Enable some additional functional testing

alt_demo user, non-ascii resource names

Change-Id: I4872d194963c790549c4bd6f03aceec1cb2e25a4
This commit is contained in:
Adam Harwell 2019-10-02 09:57:19 -07:00
parent a7b9786f4a
commit 4bda141c47
2 changed files with 35 additions and 16 deletions

View File

@ -12,7 +12,10 @@
# under the License. # under the License.
# Be strict (but not too much: '-u' doesn't always play nice with devstack) # Be strict (but not too much: '-u' doesn't always play nice with devstack)
set -eo pipefail set -xeo pipefail
# Set this so -x doesn't spam warnings
RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
readonly PROGDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" readonly PROGDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@ -153,8 +156,9 @@ if [[ ! "$(openstack flavor list)" =~ 'm1.nano' ]]; then
openstack flavor create --id 42 --ram 64 --disk 1 --vcpus 1 m1.nano openstack flavor create --id 42 --ram 64 --disk 1 --vcpus 1 m1.nano
fi fi
# Allow demo/invisible_to_admin to access the load-balancer service # Allow additional test user/projects access the load-balancer service
openstack role add --user demo --project invisible_to_admin load-balancer_member openstack role add --user demo --project invisible_to_admin load-balancer_member
openstack role add --user alt_demo --project alt_demo load-balancer_member
######################## ########################
### Populate ### Populate
@ -170,8 +174,8 @@ pid+=($!)
(source $DEVSTACK_DIR/openrc demo invisible_to_admin && ${PROGDIR}/populate.sh) & (source $DEVSTACK_DIR/openrc demo invisible_to_admin && ${PROGDIR}/populate.sh) &
pid+=($!) pid+=($!)
#(source $DEVSTACK_DIR/openrc alt_demo alt_demo && ${PROGDIR}/populate.sh) & (source $DEVSTACK_DIR/openrc alt_demo alt_demo && ${PROGDIR}/populate.sh) &
#pid+=($!) pid+=($!)
for i in ${!pid[@]}; do for i in ${!pid[@]}; do
wait ${pid[i]} wait ${pid[i]}
@ -215,18 +219,30 @@ tox -e run -- \
--os-cacert /opt/stack/data/ca-bundle.pem \ --os-cacert /opt/stack/data/ca-bundle.pem \
--os-identity-api-version 3 \ --os-identity-api-version 3 \
--os-region-name $OS_REGION_NAME \ --os-region-name $OS_REGION_NAME \
--os-username demo --os-project-name invisible_to_admin \ --os-username demo \
--os-project-name invisible_to_admin \
--os-password $invisible_to_admin_demo_pass \ --os-password $invisible_to_admin_demo_pass \
--os-domain-id=$OS_PROJECT_DOMAIN_ID \ --os-domain-id $OS_PROJECT_DOMAIN_ID \
--purge-own-project --verbose --purge-own-project \
--verbose
#source $DEVSTACK_DIR/openrc alt_demo alt_demo source $DEVSTACK_DIR/openrc alt_demo alt_demo
#assert_compute && assert_network && assert_volume assert_compute && assert_network && assert_volume
source $DEVSTACK_DIR/openrc admin admin source $DEVSTACK_DIR/openrc admin admin
#openstack project set --disable alt_demo openstack project set --disable alt_demo
#tox -e run -- --os-auth-url http://localhost/identity --os-username admin --os-project-name admin --os-password $admin_admin_pass --purge-project alt_demo --verbose tox -e run -- \
#openstack project set --enable alt_demo --os-auth-url http://localhost/identity \
--os-cacert /opt/stack/data/ca-bundle.pem \
--os-identity-api-version 3 \
--os-region-name $OS_REGION_NAME \
--os-username admin \
--os-project-name admin \
--os-password $admin_admin_pass \
--os-domain-id $OS_PROJECT_DOMAIN_ID \
--purge-project alt_demo \
--verbose
openstack project set --enable alt_demo

View File

@ -16,7 +16,10 @@
# ospurge. # ospurge.
# Be strict but don't exit automatically on error (exit_on_failure handles that) # Be strict but don't exit automatically on error (exit_on_failure handles that)
set -uo pipefail set -xuo pipefail
# Set this so -x doesn't spam warnings
RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
function exit_on_failure { function exit_on_failure {
RET_CODE=$? RET_CODE=$?
@ -75,8 +78,8 @@ function wait_for_lb_active {
# Some random UUID # Some random UUID
# Commented to workaround a nova #1730756 with non-ASCII VM name: # Commented to workaround a nova #1730756 with non-ASCII VM name:
# https://bugs.launchpad.net/nova/+bug/1730756 # https://bugs.launchpad.net/nova/+bug/1730756
#UUID="♫$(cat /proc/sys/kernel/random/uuid)✓" ASCII_UUID="$(cat /proc/sys/kernel/random/uuid)"
UUID="$(cat /proc/sys/kernel/random/uuid)" UUID="${ASCII_UUID}"
# Name of external network # Name of external network
EXTNET_NAME=${EXTNET_NAME:-public} EXTNET_NAME=${EXTNET_NAME:-public}
# Name of flavor used to spawn a VM # Name of flavor used to spawn a VM
@ -84,7 +87,7 @@ FLAVOR=${FLAVOR:-m1.nano}
# Image used for the VM # Image used for the VM
VMIMG_NAME=${VMIMG_NAME:-cirros-0.4.0-x86_64-disk} VMIMG_NAME=${VMIMG_NAME:-cirros-0.4.0-x86_64-disk}
# Zone name used for the Designate Zone # Zone name used for the Designate Zone
ZONE_NAME="${UUID//-/}.com." ZONE_NAME="${ASCII_UUID//-/}.com."
# LoadBalancer name used for the Octavia LoadBalancer # LoadBalancer name used for the Octavia LoadBalancer
LB_NAME="lb-${UUID//-/}" LB_NAME="lb-${UUID//-/}"
LB_LISTENER_NAME="listener-${UUID//-/}" LB_LISTENER_NAME="listener-${UUID//-/}"