forked from theopenlab/spark
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support separate FWaaS tests for terraform-openstack-provider
Add job defination and Ansible script to deploy FWaaS service, and run related terraform-openstack-provider acceptance FW tests. Fixes: theopenlab#35 Part of https://github.com/orgs/theopenlab/projects/1#card-6800912
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
playbooks/terraform-provider-openstack-acceptance-test-fwaas/run.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
- hosts: all | ||
become: yes | ||
roles: | ||
- clone-devstack-gate-to-workspace | ||
- role: create-devstack-local-conf | ||
enable_services: | ||
- 'fwaas' | ||
- install-devstack | ||
tasks: | ||
- shell: | ||
cmd: | | ||
set -e | ||
set -o pipefail | ||
set -x | ||
# Prep the testing environment by creating the required testing resources and environment variables | ||
pushd /opt/stack/new/devstack | ||
source openrc admin admin | ||
openstack flavor create m1.acctest --id 99 --ram 512 --disk 5 --vcpu 1 --ephemeral 10 | ||
openstack flavor create m1.resize --id 98 --ram 512 --disk 6 --vcpu 1 --ephemeral 10 | ||
_NETWORK_ID=$(openstack network show private -c id -f value) | ||
_EXTGW_ID=$(openstack network show public -c id -f value) | ||
_IMAGE=$(openstack image list | grep -i cirros | head -n 1) | ||
_IMAGE_ID=$(echo $_IMAGE | awk -F\| '{print $2}' | tr -d ' ') | ||
_IMAGE_NAME=$(echo $_IMAGE | awk -F\| '{print $3}' | tr -d ' ') | ||
echo export OS_IMAGE_NAME="$_IMAGE_NAME" >> openrc | ||
echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc | ||
echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc | ||
echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc | ||
echo export OS_POOL_NAME="public" >> openrc | ||
echo export OS_FLAVOR_ID=99 >> openrc | ||
echo export OS_FLAVOR_ID_RESIZE=98 >> openrc | ||
echo export OS_SHARE_NETWORK_ID=foobar >> openrc | ||
source openrc demo demo | ||
popd | ||
# Run acc test | ||
if [[ ! -d $GOPATH/src/github.com/terraform-providers/terraform-provider-openstack/ && -d $GOPATH/src/github.com/theopenlab/terraform-provider-openstack ]]; then | ||
echo "Warning: this is a temporary workaround because this job is not triggered from official git repo." | ||
mkdir -p $GOPATH/src/github.com/terraform-providers/ | ||
cp -r $GOPATH/src/github.com/theopenlab/terraform-provider-openstack $GOPATH/src/github.com/terraform-providers/ | ||
cd $GOPATH/src/github.com/terraform-providers/terraform-provider-openstack | ||
fi | ||
# Run the FWaaS test 100 testcases at a time | ||
export OS_FW_ENVIRONMENT=1 # for FWaaS tests | ||
testcases=`go test ./openstack/ -v -list 'Acc'` | ||
testcases=`echo "$testcases" | sed '$d' | grep FW` | ||
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 | ||
executable: /bin/bash | ||
chdir: '{{ zuul.project.src_dir }}' | ||
environment: '{{ golang_env }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters