|
| 1 | +- hosts: all |
| 2 | + become: yes |
| 3 | + roles: |
| 4 | + - clone-devstack-gate-to-workspace |
| 5 | + - role: create-devstack-local-conf |
| 6 | + enable_services: |
| 7 | + - 'lbaas' |
| 8 | + - install-devstack |
| 9 | + tasks: |
| 10 | + - shell: |
| 11 | + cmd: | |
| 12 | + set -e |
| 13 | + set -o pipefail |
| 14 | + set -x |
| 15 | +
|
| 16 | + # Prep the testing environment by creating the required testing resources and environment variables |
| 17 | + pushd /opt/stack/new/devstack |
| 18 | + source openrc admin admin |
| 19 | + openstack flavor create m1.acctest --id 99 --ram 512 --disk 5 --vcpu 1 --ephemeral 10 |
| 20 | + openstack flavor create m1.resize --id 98 --ram 512 --disk 6 --vcpu 1 --ephemeral 10 |
| 21 | + _NETWORK_ID=$(openstack network show private -c id -f value) |
| 22 | + _EXTGW_ID=$(openstack network show public -c id -f value) |
| 23 | + _IMAGE=$(openstack image list | grep -i cirros | head -n 1) |
| 24 | + _IMAGE_ID=$(echo $_IMAGE | awk -F\| '{print $2}' | tr -d ' ') |
| 25 | + _IMAGE_NAME=$(echo $_IMAGE | awk -F\| '{print $3}' | tr -d ' ') |
| 26 | + echo export OS_IMAGE_NAME="$_IMAGE_NAME" >> openrc |
| 27 | + echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc |
| 28 | + echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc |
| 29 | + echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc |
| 30 | + echo export OS_POOL_NAME="public" >> openrc |
| 31 | + echo export OS_FLAVOR_ID=99 >> openrc |
| 32 | + echo export OS_FLAVOR_ID_RESIZE=98 >> openrc |
| 33 | + echo export OS_SHARE_NETWORK_ID=foobar >> openrc |
| 34 | + source openrc demo demo |
| 35 | + popd |
| 36 | +
|
| 37 | + # Run acc test |
| 38 | + if [[ ! -d $GOPATH/src/github.com/terraform-providers/terraform-provider-openstack/ && -d $GOPATH/src/github.com/theopenlab/terraform-provider-openstack ]]; then |
| 39 | + echo "Warning: this is a temporary workaround because this job is not triggered from official git repo." |
| 40 | + mkdir -p $GOPATH/src/github.com/terraform-providers/ |
| 41 | + cp -r $GOPATH/src/github.com/theopenlab/terraform-provider-openstack $GOPATH/src/github.com/terraform-providers/ |
| 42 | + cd $GOPATH/src/github.com/terraform-providers/terraform-provider-openstack |
| 43 | + fi |
| 44 | +
|
| 45 | + # Run the LB test 100 testcases at a time |
| 46 | + export OS_LB_ENVIRONMENT=1 # for LBaaS tests |
| 47 | + testcases=`go test ./openstack/ -v -list 'Acc'` |
| 48 | + testcases=`echo "$testcases" | sed '$d' | grep LB` |
| 49 | + echo "$testcases" | xargs -t -n100 sh -c 'TF_LOG=DEBUG TF_ACC=1 go test ./openstack -v -timeout 120m -run $(echo "$@" | tr " " "|")' argv0 2>&1 | tee $TEST_RESULTS_TXT |
| 50 | + executable: /bin/bash |
| 51 | + chdir: '{{ zuul.project.src_dir }}' |
| 52 | + environment: '{{ golang_env }}' |
0 commit comments