Enable tempest test

Tempest test is not being able to be passed due to
the devstack plugin.sh script was not updated for
this purpose. This patch is to make Trio2o pass
the tempest gate test.

Change-Id: Id25e503d05b267aa46b61bba546621fba10fda3b
Signed-off-by: joehuang <joehuang@huawei.com>
This commit is contained in:
joehuang 2017-01-29 21:15:34 -05:00
parent 4e08947850
commit 815b881e9b
13 changed files with 191 additions and 219 deletions

View File

@ -15,41 +15,13 @@ RABBIT_PASSWORD=password
SERVICE_PASSWORD=password SERVICE_PASSWORD=password
SERVICE_TOKEN=password SERVICE_TOKEN=password
ADMIN_PASSWORD=password ADMIN_PASSWORD=password
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
FIXED_RANGE=10.0.0.0/24
NETWORK_GATEWAY=10.0.0.1
FIXED_NETWORK_SIZE=256
FLOATING_RANGE=10.100.100.160/24
Q_FLOATING_ALLOCATION_POOL=start=10.100.100.160,end=10.100.100.192
NEUTRON_CREATE_INITIAL_NETWORKS=False
PUBLIC_NETWORK_GATEWAY=10.100.100.3
Q_USE_SECGROUP=False
LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
# Enable Trio2o # Enable Trio2o
Q_ENABLE_TRIO2O=True TRIO2O_START_SERVICES=True
enable_plugin trio2o https://github.com/openstack/trio2o/ enable_plugin trio2o https://github.com/openstack/trio2o/
# Change the HOST_IP address to the host's IP address where # Change the HOST_IP address to the host's IP address where
# the Trio2o is running # the Trio2o is running
HOST_IP=162.3.124.203 HOST_IP=162.3.124.203
# Use Neutron instead of nova-network
disable_service n-net
enable_service q-svc
enable_service q-dhcp
enable_service q-agt
disable_service n-obj
disable_service n-cauth
disable_service n-novnc
disable_service q-l3
enable_service c-api
enable_service c-vol
enable_service c-sch
disable_service c-bak
disable_service tempest
disable_service horizon disable_service horizon

View File

@ -15,27 +15,13 @@
[[local|localrc]] [[local|localrc]]
RECLONE=no
DATABASE_PASSWORD=password DATABASE_PASSWORD=password
RABBIT_PASSWORD=password RABBIT_PASSWORD=password
SERVICE_PASSWORD=password SERVICE_PASSWORD=password
SERVICE_TOKEN=password SERVICE_TOKEN=password
ADMIN_PASSWORD=password ADMIN_PASSWORD=password
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
FIXED_RANGE=10.0.0.0/24
NETWORK_GATEWAY=10.0.0.1
FIXED_NETWORK_SIZE=256
FLOATING_RANGE=10.100.100.160/24
Q_FLOATING_ALLOCATION_POOL=start=10.100.100.160,end=10.100.100.192
PUBLIC_NETWORK_GATEWAY=10.100.100.3
Q_USE_SECGROUP=False
LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
NEUTRON_CREATE_INITIAL_NETWORKS=False NEUTRON_CREATE_INITIAL_NETWORKS=False
Q_USE_PROVIDERNET_FOR_PUBLIC=True
# the region name of this OpenStack instance, and it's also # the region name of this OpenStack instance, and it's also
# the pod name in Trio2o # the pod name in Trio2o
@ -56,21 +42,8 @@ KEYSTONE_AUTH_HOST=162.3.124.203
# Use the Glance which is located in RegionOne, where the Trio2o is # Use the Glance which is located in RegionOne, where the Trio2o is
# installed # installed
GLANCE_SERVICE_HOST=162.3.124.203 GLANCE_SERVICE_HOST=162.3.124.203
# Use Neutron instead of nova-network
disable_service n-net
enable_service q-svc
enable_service q-dhcp
enable_service q-agt
enable_service q-l3
enable_service c-api
enable_service c-vol
enable_service c-sch
disable_service n-obj
disable_service g-api disable_service g-api
disable_service g-reg disable_service g-reg
disable_service c-bak
disable_service tempest disable_service tempest
disable_service horizon disable_service horizon

View File

@ -40,7 +40,6 @@ function create_nova_apigw_accounts {
if [[ "$ENABLED_SERVICES" =~ "t-ngw" ]]; then if [[ "$ENABLED_SERVICES" =~ "t-ngw" ]]; then
create_service_user "nova_apigw" create_service_user "nova_apigw"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
local trio2o_nova_apigw=$(get_or_create_service "nova" \ local trio2o_nova_apigw=$(get_or_create_service "nova" \
"compute" "Nova Compute Service") "compute" "Nova Compute Service")
@ -52,7 +51,6 @@ function create_nova_apigw_accounts {
"$SERVICE_PROTOCOL://$TRIO2O_NOVA_APIGW_HOST:$TRIO2O_NOVA_APIGW_PORT/v2.1/"'$(tenant_id)s' \ "$SERVICE_PROTOCOL://$TRIO2O_NOVA_APIGW_HOST:$TRIO2O_NOVA_APIGW_PORT/v2.1/"'$(tenant_id)s' \
"$SERVICE_PROTOCOL://$TRIO2O_NOVA_APIGW_HOST:$TRIO2O_NOVA_APIGW_PORT/v2.1/"'$(tenant_id)s' "$SERVICE_PROTOCOL://$TRIO2O_NOVA_APIGW_HOST:$TRIO2O_NOVA_APIGW_PORT/v2.1/"'$(tenant_id)s'
fi fi
fi
} }
# create_cinder_apigw_accounts() - Set up common required cinder_apigw # create_cinder_apigw_accounts() - Set up common required cinder_apigw
@ -66,7 +64,6 @@ function create_cinder_apigw_accounts {
if [[ "$ENABLED_SERVICES" =~ "t-cgw" ]]; then if [[ "$ENABLED_SERVICES" =~ "t-cgw" ]]; then
create_service_user "cinder_apigw" create_service_user "cinder_apigw"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
local trio2o_cinder_apigw=$(get_or_create_service "cinder" \ local trio2o_cinder_apigw=$(get_or_create_service "cinder" \
"volumev2" "Cinder Volume Service") "volumev2" "Cinder Volume Service")
@ -78,7 +75,6 @@ function create_cinder_apigw_accounts {
"$SERVICE_PROTOCOL://$TRIO2O_CINDER_APIGW_HOST:$TRIO2O_CINDER_APIGW_PORT/v2/"'$(tenant_id)s' \ "$SERVICE_PROTOCOL://$TRIO2O_CINDER_APIGW_HOST:$TRIO2O_CINDER_APIGW_PORT/v2/"'$(tenant_id)s' \
"$SERVICE_PROTOCOL://$TRIO2O_CINDER_APIGW_HOST:$TRIO2O_CINDER_APIGW_PORT/v2/"'$(tenant_id)s' "$SERVICE_PROTOCOL://$TRIO2O_CINDER_APIGW_HOST:$TRIO2O_CINDER_APIGW_PORT/v2/"'$(tenant_id)s'
fi fi
fi
} }
@ -210,6 +206,34 @@ function configure_trio2o_xjob {
fi fi
} }
function reconfigure_nova {
# Nova services are running, but we need to re-configure them to
# move them to bottom region
iniset $NOVA_CONF neutron region_name $POD_REGION_NAME
iniset $NOVA_CONF neutron url "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT"
iniset $NOVA_CONF cinder os_region_name $POD_REGION_NAME
iniset $NOVA_CONF DEFAULT vif_plugging_is_fatal False
iniset $NOVA_CONF DEFAULT vif_plugging_timeout 60
get_or_create_endpoint "compute" \
"$POD_REGION_NAME" \
"$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2.1/"'$(tenant_id)s' \
"$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2.1/"'$(tenant_id)s' \
"$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2.1/"'$(tenant_id)s'
stop_process n-api
stop_process n-cpu
# remove previous failure flag file since we are going to restart service
rm -f "$SERVICE_DIR/$SCREEN_NAME"/n-api.failure
rm -f "$SERVICE_DIR/$SCREEN_NAME"/n-cpu.failure
sleep 20
run_process n-api "$NOVA_BIN_DIR/nova-api"
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF" $LIBVIRT_GROUP
}
function move_neutron_server { function move_neutron_server {
local region_name=$1 local region_name=$1
@ -231,14 +255,16 @@ function move_neutron_server {
run_process q-svc "$NEUTRON_BIN_DIR/neutron-server --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE" run_process q-svc "$NEUTRON_BIN_DIR/neutron-server --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
} }
if [[ "$Q_ENABLE_TRIO2O" == "True" ]]; then if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
echo summary "Trio2o pre-install" echo summary "Trio2o pre-install"
elif [[ "$1" == "stack" && "$2" == "install" ]]; then elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Trio2o" echo_summary "Installing Trio2o"
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Trio2o" echo_summary "Configuring Trio2o"
export NEUTRON_CREATE_INITIAL_NETWORKS=False export NEUTRON_CREATE_INITIAL_NETWORKS=False
export DEFAULT_INSTANCE_TYPE=m1.tiny
sudo install -d -o $STACK_USER -m 755 $TRIO2O_CONF_DIR sudo install -d -o $STACK_USER -m 755 $TRIO2O_CONF_DIR
enable_service t-api t-job t-ngw t-cgw enable_service t-api t-job t-ngw t-cgw
@ -255,7 +281,7 @@ if [[ "$Q_ENABLE_TRIO2O" == "True" ]]; then
recreate_database trio2o recreate_database trio2o
python "$TRIO2O_DIR/cmd/manage.py" "$TRIO2O_API_CONF" python "$TRIO2O_DIR/cmd/manage.py" "$TRIO2O_API_CONF"
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing Trio2o Service" echo_summary "Initializing Trio2o Service"
if is_service_enabled t-api; then if is_service_enabled t-api; then
@ -271,30 +297,8 @@ if [[ "$Q_ENABLE_TRIO2O" == "True" ]]; then
run_process t-ngw "python $TRIO2O_NOVA_APIGW --config-file $TRIO2O_NOVA_APIGW_CONF" run_process t-ngw "python $TRIO2O_NOVA_APIGW --config-file $TRIO2O_NOVA_APIGW_CONF"
# Nova services are running, but we need to re-configure them to reconfigure_nova
# move them to bottom region
iniset $NOVA_CONF neutron region_name $POD_REGION_NAME
iniset $NOVA_CONF neutron url "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT"
iniset $NOVA_CONF cinder os_region_name $POD_REGION_NAME
get_or_create_endpoint "compute" \
"$POD_REGION_NAME" \
"$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2.1/"'$(tenant_id)s' \
"$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2.1/"'$(tenant_id)s' \
"$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2.1/"'$(tenant_id)s'
stop_process n-api
stop_process n-cpu
# remove previous failure flag file since we are going to restart service
rm -f "$SERVICE_DIR/$SCREEN_NAME"/n-api.failure
rm -f "$SERVICE_DIR/$SCREEN_NAME"/n-cpu.failure
sleep 20
run_process n-api "$NOVA_BIN_DIR/nova-api"
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF" $LIBVIRT_GROUP
fi
if is_service_enabled q-svc; then
move_neutron_server $POD_REGION_NAME
fi fi
if is_service_enabled t-cgw; then if is_service_enabled t-cgw; then
@ -314,9 +318,9 @@ if [[ "$Q_ENABLE_TRIO2O" == "True" ]]; then
run_process t-job "python $TRIO2O_XJOB --config-file $TRIO2O_XJOB_CONF" run_process t-job "python $TRIO2O_XJOB --config-file $TRIO2O_XJOB_CONF"
fi fi
fi fi
if [[ "$1" == "unstack" ]]; then if [[ "$1" == "unstack" ]]; then
if is_service_enabled t-api; then if is_service_enabled t-api; then
stop_process t-api stop_process t-api
@ -333,5 +337,4 @@ if [[ "$Q_ENABLE_TRIO2O" == "True" ]]; then
if is_service_enabled t-job; then if is_service_enabled t-job; then
stop_process t-job stop_process t-job
fi fi
fi
fi fi

View File

@ -7,6 +7,7 @@ TRIO2O_BRANCH=${TRIO2O_BRANCH:-master}
POD_REGION_NAME=${POD_REGION_NAME:-Pod1} POD_REGION_NAME=${POD_REGION_NAME:-Pod1}
TRIO2O_CONF_DIR=${TRIO2O_CONF_DIR:-/etc/trio2o} TRIO2O_CONF_DIR=${TRIO2O_CONF_DIR:-/etc/trio2o}
TRIO2O_STATE_PATH=${TRIO2O_STATE_PATH:-/var/lib/trio2o} TRIO2O_STATE_PATH=${TRIO2O_STATE_PATH:-/var/lib/trio2o}
TRIO2O_START_SERVICES=${TRIO2O_START_SERVICES:-True}
# trio2o rest admin api # trio2o rest admin api
TRIO2O_API=$TRIO2O_DIR/cmd/api.py TRIO2O_API=$TRIO2O_DIR/cmd/api.py
@ -14,7 +15,7 @@ TRIO2O_API_CONF=$TRIO2O_CONF_DIR/api.conf
TRIO2O_API_LISTEN_ADDRESS=${TRIO2O_API_LISTEN_ADDRESS:-0.0.0.0} TRIO2O_API_LISTEN_ADDRESS=${TRIO2O_API_LISTEN_ADDRESS:-0.0.0.0}
TRIO2O_API_HOST=${TRIO2O_API_HOST:-$SERVICE_HOST} TRIO2O_API_HOST=${TRIO2O_API_HOST:-$SERVICE_HOST}
TRIO2O_API_PORT=${TRIO2O_API_PORT:-19999} TRIO2O_API_PORT=${TRIO2O_API_PORT:-19996}
TRIO2O_API_PROTOCOL=${TRIO2O_API_PROTOCOL:-$SERVICE_PROTOCOL} TRIO2O_API_PROTOCOL=${TRIO2O_API_PROTOCOL:-$SERVICE_PROTOCOL}
# trio2o nova_apigw # trio2o nova_apigw

View File

@ -25,8 +25,8 @@ the OpenStack Identity service. They also require a base service url that can
be got from the OpenStack Trio2o endpoint. This will be the root url that be got from the OpenStack Trio2o endpoint. This will be the root url that
every call below will be added to build a full path. every call below will be added to build a full path.
For instance, if the Trio2o service url is http://127.0.0.1:19999/v1.0 then For instance, if the Trio2o service url is http://127.0.0.1:19996/v1.0 then
the full API call for /pods is http://127.0.0.1:19999/v1.0/pods. the full API call for /pods is http://127.0.0.1:19996/v1.0/pods.
As such, for the rest of this document we will leave out the root url where As such, for the rest of this document we will leave out the root url where
GET /pods really means GET {trio2o_service_url}/pods. GET /pods really means GET {trio2o_service_url}/pods.

View File

@ -72,20 +72,20 @@ installing DevStack in virtual machine.
availability zone and OpenStack instances, the "$token" is obtained in the availability zone and OpenStack instances, the "$token" is obtained in the
step 7:: step 7::
curl -X POST http://127.0.0.1:19999/v1.0/pods -H "Content-Type: application/json" \ curl -X POST http://127.0.0.1:19996/v1.0/pods -H "Content-Type: application/json" \
-H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "RegionOne"}}' -H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "RegionOne"}}'
curl -X POST http://127.0.0.1:19999/v1.0/pods -H "Content-Type: application/json" \ curl -X POST http://127.0.0.1:19996/v1.0/pods -H "Content-Type: application/json" \
-H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "Pod1", "az_name": "az1"}}' -H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "Pod1", "az_name": "az1"}}'
Pay attention to "pod_name" parameter we specify when creating pod. Pod name Pay attention to "pod_name" parameter we specify when creating pod. Pod name
should exactly match the region name registered in Keystone. In the above should exactly match the region name registered in Keystone. In the above
commands, we create pods named "RegionOne" and "Pod1". commands, we create pods named "RegionOne" and "Pod1".
- 10 Create necessary resources in local Neutron server:: - 10 Create necessary resources in Neutron server::
neutron --os-region-name=Pod1 net-create net1 neutron --os-region-name=RegionOne net-create net1
neutron --os-region-name=Pod1 subnet-create net1 10.0.0.0/24 neutron --os-region-name=RegionOne subnet-create net1 10.0.0.0/24
Please note that the net1 ID will be used in later step to boot VM. Please note that the net1 ID will be used in later step to boot VM.
@ -101,8 +101,9 @@ installing DevStack in virtual machine.
- 13 Verify the VM is connected to the net1:: - 13 Verify the VM is connected to the net1::
neutron --os-region-name=Pod1 port-list
nova --os-region-name=RegionOne list nova --os-region-name=RegionOne list
nova --os-region-name=Pod1 list
neutron --os-region-name=RegionOne port-list
- 14 Create, list, show and delete volume:: - 14 Create, list, show and delete volume::
@ -223,7 +224,7 @@ Add another pod to Trio2o with DevStack
availability zone and OpenStack instances, the "$token" is obtained in the availability zone and OpenStack instances, the "$token" is obtained in the
step 11:: step 11::
curl -X POST http://127.0.0.1:19999/v1.0/pods -H "Content-Type: application/json" \ curl -X POST http://127.0.0.1:19996/v1.0/pods -H "Content-Type: application/json" \
-H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "Pod2", "az_name": "az2"}}' -H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "Pod2", "az_name": "az2"}}'
Pay attention to "pod_name" parameter we specify when creating pod. Pod name Pay attention to "pod_name" parameter we specify when creating pod. Pod name

View File

@ -11,14 +11,12 @@ Routes!=2.0,!=2.3.0,>=1.12.3;python_version!='2.7' # MIT
debtcollector>=1.2.0 # Apache-2.0 debtcollector>=1.2.0 # Apache-2.0
eventlet!=0.18.3,>=0.18.2 # MIT eventlet!=0.18.3,>=0.18.2 # MIT
pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD
greenlet>=0.3.2 # MIT
httplib2>=0.7.5 # MIT
requests!=2.12.2,>=2.10.0 # Apache-2.0 requests!=2.12.2,>=2.10.0 # Apache-2.0
Jinja2>=2.8 # BSD License (3 clause) Jinja2!=2.9.0,!=2.9.1,!=2.9.2,!=2.9.3,!=2.9.4,>=2.8 # BSD License (3 clause)
keystonemiddleware>=4.12.0 # Apache-2.0 keystonemiddleware>=4.12.0 # Apache-2.0
netaddr!=0.7.16,>=0.7.13 # BSD netaddr!=0.7.16,>=0.7.13 # BSD
netifaces>=0.10.4 # MIT netifaces>=0.10.4 # MIT
neutron-lib>=1.0.0 # Apache-2.0 neutron-lib>=1.1.0 # Apache-2.0
retrying!=1.3.0,>=1.2.3 # Apache-2.0 retrying!=1.3.0,>=1.2.3 # Apache-2.0
SQLAlchemy<1.1.0,>=1.0.10 # MIT SQLAlchemy<1.1.0,>=1.0.10 # MIT
WebOb>=1.6.0 # MIT WebOb>=1.6.0 # MIT
@ -26,14 +24,14 @@ python-cinderclient!=1.7.0,!=1.7.1,>=1.6.0 # Apache-2.0
python-glanceclient>=2.5.0 # Apache-2.0 python-glanceclient>=2.5.0 # Apache-2.0
python-keystoneclient>=3.8.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0
python-neutronclient>=5.1.0 # Apache-2.0 python-neutronclient>=5.1.0 # Apache-2.0
python-novaclient!=2.33.0,>=2.29.0 # Apache-2.0 python-novaclient!=7.0.0,>=6.0.0 # Apache-2.0
alembic>=0.8.4 # MIT alembic>=0.8.10 # MIT
six>=1.9.0 # MIT six>=1.9.0 # MIT
stevedore>=1.17.1 # Apache-2.0 stevedore>=1.17.1 # Apache-2.0
oslo.concurrency>=3.8.0 # Apache-2.0 oslo.concurrency>=3.8.0 # Apache-2.0
oslo.config!=3.18.0,>=3.14.0 # Apache-2.0 oslo.config!=3.18.0,>=3.14.0 # Apache-2.0
oslo.context>=2.9.0 # Apache-2.0 oslo.context>=2.9.0 # Apache-2.0
oslo.db!=4.13.1,!=4.13.2,>=4.11.0 # Apache-2.0 oslo.db>=4.15.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0 oslo.i18n>=2.1.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0 oslo.log>=3.11.0 # Apache-2.0
oslo.messaging>=5.14.0 # Apache-2.0 oslo.messaging>=5.14.0 # Apache-2.0
@ -45,4 +43,3 @@ oslo.service>=1.10.0 # Apache-2.0
oslo.utils>=3.18.0 # Apache-2.0 oslo.utils>=3.18.0 # Apache-2.0
oslo.versionedobjects>=1.17.0 # Apache-2.0 oslo.versionedobjects>=1.17.0 # Apache-2.0
sqlalchemy-migrate>=0.9.6 # Apache-2.0 sqlalchemy-migrate>=0.9.6 # Apache-2.0
kombu!=4.0.0,!=4.0.1,!=4.0.2,>=3.0.25 # BSD

View File

@ -3,23 +3,20 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.2 hacking<0.11,>=0.10.2
cliff>=2.3.0 # Apache-2.0
coverage>=4.0 # Apache-2.0 coverage>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0 # BSD mock>=2.0 # BSD
python-subunit>=0.0.18 # Apache-2.0/BSD python-subunit>=0.0.18 # Apache-2.0/BSD
requests-mock>=1.1 # Apache-2.0 requests-mock>=1.1 # Apache-2.0
docutils!=0.13.1,>=0.11 # OSI-Approved Open Source, Public Domain
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
oslosphinx>=4.7.0 # Apache-2.0 oslosphinx>=4.7.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=1.4.0 # MIT testtools>=1.4.0 # MIT
testresources>=0.2.4 # Apache-2.0/BSD testresources>=0.2.4 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
WebTest>=2.0 # MIT
oslotest>=1.10.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0
os-testr>=0.8.0 # Apache-2.0 os-testr>=0.8.0 # Apache-2.0
tempest-lib>=0.14.0 # Apache-2.0 tempest-lib>=0.14.0 # Apache-2.0
ddt>=1.0.1 # MIT ddt>=1.0.1 # MIT
pylint==1.4.5 # GPLv2 reno>=1.8.0 # Apache-2.0
docutils>=0.11,!=0.13.1 # OSI-Approved Open Source, Public Domain

22
tox.ini
View File

@ -1,12 +1,12 @@
[tox] [tox]
minversion = 1.6 minversion = 1.6
envlist = py34,py27,pypy,pep8 envlist = py35,py27,pypy,pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
sitepackages = True sitepackages = True
usedevelop = True usedevelop = True
install_command = pip install -U --force-reinstall {opts} {packages} install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning PYTHONWARNINGS=default::DeprecationWarning
@ -16,30 +16,42 @@ deps =
commands = python setup.py testr --slowest --testr-args='{posargs}' commands = python setup.py testr --slowest --testr-args='{posargs}'
whitelist_externals = rm whitelist_externals = rm
[testenv:releasenotes]
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8] [testenv:pep8]
deps =
-r{toxinidir}/test-requirements.txt
commands = flake8 commands = flake8
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}' commands =
python setup.py testr --coverage --testr-args='{posargs}'
coverage report
[testenv:genconfig] [testenv:genconfig]
deps =
-r{toxinidir}/test-requirements.txt
commands = oslo-config-generator --config-file=etc/api-cfg-gen.conf commands = oslo-config-generator --config-file=etc/api-cfg-gen.conf
oslo-config-generator --config-file=etc/nova_apigw-cfg-gen.conf oslo-config-generator --config-file=etc/nova_apigw-cfg-gen.conf
oslo-config-generator --config-file=etc/cinder_apigw-cfg-gen.conf oslo-config-generator --config-file=etc/cinder_apigw-cfg-gen.conf
oslo-config-generator --config-file=etc/xjob-cfg-gen.conf oslo-config-generator --config-file=etc/xjob-cfg-gen.conf
[testenv:docs] [testenv:docs]
deps =
-r{toxinidir}/test-requirements.txt
commands = python setup.py build_sphinx commands = python setup.py build_sphinx
[testenv:debug] [testenv:debug]
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[flake8] [flake8]
show-source = True show-source = True
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = trio2o.common.i18n

View File

@ -24,7 +24,7 @@ from trio2o.common import restapp
common_opts = [ common_opts = [
cfg.IPOpt('bind_host', default='0.0.0.0', cfg.IPOpt('bind_host', default='0.0.0.0',
help=_("The host IP to bind to")), help=_("The host IP to bind to")),
cfg.PortOpt('bind_port', default=19999, cfg.PortOpt('bind_port', default=19996,
help=_("The port to bind to")), help=_("The port to bind to")),
cfg.IntOpt('api_workers', default=1, cfg.IntOpt('api_workers', default=1,
help=_("number of api workers")), help=_("number of api workers")),

View File

@ -215,12 +215,14 @@ class NovaResourceHandle(ResourceHandle):
'server_volume': ACTION} 'server_volume': ACTION}
def _get_client(self, cxt): def _get_client(self, cxt):
url = self.endpoint_url.replace('$(tenant_id)s', cxt.tenant)
cli = n_client.Client(api_versions.APIVersion(cxt.nova_micro_version), cli = n_client.Client(api_versions.APIVersion(cxt.nova_micro_version),
auth_token=cxt.auth_token, auth_token=cxt.auth_token,
auth_url=self.auth_url, auth_url=self.auth_url,
project_name=cxt.tenant_name,
project_domain_name=cxt.project_domain,
endpoint_override=url,
timeout=cfg.CONF.client.nova_timeout) timeout=cfg.CONF.client.nova_timeout)
cli.set_management_url(
self.endpoint_url.replace('$(tenant_id)s', cxt.tenant))
return cli return cli
def _adapt_resource(self, resource): def _adapt_resource(self, resource):

View File

@ -25,16 +25,19 @@ export TEMPEST_CONF=$TEMPEST_DIR/etc/tempest.conf
# use admin role to create Trio2o top Pod and Pod1 # use admin role to create Trio2o top Pod and Pod1
source $DEVSTACK_DIR/openrc admin admin source $DEVSTACK_DIR/openrc admin admin
token=$(openstack token issue | awk 'NR==5 {print $4}') # unset OS_REGION_NAME
echo $token
curl -X POST http://127.0.0.1:19999/v1.0/pods \ # mytoken=$(openstack --os-region-name=RegionOne token issue -f value -c id)
-H "Content-Type: application/json" \ mytoken=$(openstack token issue -f value -c id)
-H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "RegionOne"}}' echo $mytoken
curl -X POST http://127.0.0.1:19999/v1.0/pods \ curl -X POST http://127.0.0.1:19996/v1.0/pods \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "X-Auth-Token: $token" \ -H "X-Auth-Token: $mytoken" -d '{"pod": {"pod_name": "RegionOne"}}'
curl -X POST http://127.0.0.1:19996/v1.0/pods \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $mytoken" \
-d '{"pod": {"pod_name": "Pod1", "az_name": "az1"}}' -d '{"pod": {"pod_name": "Pod1", "az_name": "az1"}}'
# the usage of "nova flavor-create": # the usage of "nova flavor-create":
@ -43,8 +46,10 @@ curl -X POST http://127.0.0.1:19999/v1.0/pods \
# <name> <id> <ram> <disk> <vcpus> # <name> <id> <ram> <disk> <vcpus>
# the following command is to create a flavor wih name='test', # the following command is to create a flavor wih name='test',
# id=1, ram=1024MB, disk=10GB, vcpu=1 # id=1, ram=1024MB, disk=10GB, vcpu=1
# nova --os-region-name=RegionOne flavor-create test 1 1024 10 1
# image_id=$(glance --os-region-name=RegionOne image-list | awk 'NR==4 {print $2}')
nova flavor-create test 1 1024 10 1 nova flavor-create test 1 1024 10 1
image_id=$(openstack image list | awk 'NR==4 {print $2}') image_id=$(glance image-list | awk 'NR==4 {print $2}')
# preparation for the tests # preparation for the tests
cd $TEMPEST_DIR cd $TEMPEST_DIR
@ -65,8 +70,10 @@ source $DEVSTACK_DIR/functions
iniset $TEMPEST_CONF auth admin_username ${ADMIN_USERNAME:-"admin"} iniset $TEMPEST_CONF auth admin_username ${ADMIN_USERNAME:-"admin"}
iniset $TEMPEST_CONF auth admin_project_name admin iniset $TEMPEST_CONF auth admin_project_name admin
iniset $TEMPEST_CONF auth admin_password $OS_PASSWORD iniset $TEMPEST_CONF auth admin_password $OS_PASSWORD
iniset $TEMPEST_CONF identity uri $OS_AUTH_URL iniset $TEMPEST_CONF identity auth_version v2
iniset $TEMPEST_CONF identity-feature-enabled api_v3 false iniset $TEMPEST_CONF identity uri_v3 http://$SERVICE_HOST/identity/v3
iniset $TEMPEST_CONF identity uri http://$SERVICE_HOST:5000/v2.0/
iniset $TEMPEST_CONF identity-feature-enabled api_v2 True
iniset $TEMPEST_CONF compute region RegionOne iniset $TEMPEST_CONF compute region RegionOne
iniset $TEMPEST_CONF compute image_ref $image_id iniset $TEMPEST_CONF compute image_ref $image_id

View File

@ -227,8 +227,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
api_version=api_versions.APIVersion( api_version=api_versions.APIVersion(
constants.NOVA_APIGW_MIN_VERSION), constants.NOVA_APIGW_MIN_VERSION),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None)
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)
@ -241,8 +242,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
mock_client.assert_called_with( mock_client.assert_called_with(
api_version=api_versions.APIVersion(self.vaild_version.split()[1]), api_version=api_versions.APIVersion(self.vaild_version.split()[1]),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None)
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)
@ -255,8 +257,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
mock_client.assert_called_with( mock_client.assert_called_with(
api_version=api_versions.APIVersion(self.vaild_leagcy_version), api_version=api_versions.APIVersion(self.vaild_leagcy_version),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None)
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)
@ -270,8 +273,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
api_version=api_versions.APIVersion( api_version=api_versions.APIVersion(
constants.NOVA_APIGW_MAX_VERSION), constants.NOVA_APIGW_MAX_VERSION),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None)
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)
@ -284,8 +288,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
mock_client.assert_called_with( mock_client.assert_called_with(
api_version=api_versions.APIVersion(self.min_version), api_version=api_versions.APIVersion(self.min_version),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None)
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)
@ -298,8 +303,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
mock_client.assert_called_with( mock_client.assert_called_with(
api_version=api_versions.APIVersion(self.max_version.split()[1]), api_version=api_versions.APIVersion(self.max_version.split()[1]),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None, )
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)
@ -413,8 +419,9 @@ class MicroversionsTest(MicroVersionFunctionTest):
mock_client.assert_called_with( mock_client.assert_called_with(
api_version=api_versions.APIVersion(self.vaild_version.split()[1]), api_version=api_versions.APIVersion(self.vaild_version.split()[1]),
auth_token=None, auth_url='auth_url', auth_token=None, auth_url='auth_url',
direct_use=False, project_id=None, direct_use=False, project_name=None,
timeout=60, username=None, api_key=None) endpoint_override='endpoint_url', project_domain_name=None,
timeout=60, username=None)
@mock.patch.object(server.ServerController, '_get_client', @mock.patch.object(server.ServerController, '_get_client',
new=get_trio2o_client) new=get_trio2o_client)