diff options
author | Tim Rozet <trozet@redhat.com> | 2016-07-15 22:56:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-07-15 22:56:48 +0000 |
commit | 6ee3eda280fca9c701056a8d4c5d9cf79fc1cfb7 (patch) | |
tree | f93c2b60efd23b5c1f11896cbbf9363fc78638a0 | |
parent | 88d5b2462933cce79cb059c81e007ec83ee2cd9e (diff) | |
parent | c1b82d85dcf815764cb4247bedfee4ca491e2d57 (diff) |
Merge "Scripts for running smoke tests on the undercloud VM. Tested against Apex Brahmaputra as I have had many issues getting a Colorado environment up and running."
-rwxr-xr-x | ci/run_smoke_tests.sh | 5 | ||||
-rw-r--r-- | lib/utility-functions.sh | 13 | ||||
-rwxr-xr-x | tests/smoke_tests/execute_smoke_tests.sh | 6 | ||||
-rw-r--r-- | tests/smoke_tests/execute_tests.yml | 9 | ||||
-rw-r--r-- | tests/smoke_tests/prepare_undercloud.yml | 16 | ||||
-rw-r--r-- | tests/smoke_tests/smoke_tests.yml | 3 |
6 files changed, 48 insertions, 4 deletions
diff --git a/ci/run_smoke_tests.sh b/ci/run_smoke_tests.sh new file mode 100755 index 00000000..b0599527 --- /dev/null +++ b/ci/run_smoke_tests.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source ../lib/utility-functions.sh + +ansible-playbook -i "$(get_undercloud_ip)," ../tests/smoke_tests/smoke_tests.yml diff --git a/lib/utility-functions.sh b/lib/utility-functions.sh index 93050701..f73a2d85 100644 --- a/lib/utility-functions.sh +++ b/lib/utility-functions.sh @@ -15,14 +15,19 @@ function undercloud_connect { fi if [ -z "$2" ]; then - ssh ${SSH_OPTIONS[@]} ${user}@$(arp -a | grep $(virsh domiflist undercloud | grep default |\ - awk '{print $5}') | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") + ssh ${SSH_OPTIONS[@]} ${user}@$(get_undercloud_ip) else - ssh ${SSH_OPTIONS[@]} -T ${user}@$(arp -a | grep $(virsh domiflist undercloud | grep default \ - | awk '{print $5}') | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") "$2" + ssh ${SSH_OPTIONS[@]} -T ${user}@$(get_undercloud_ip) "$2" fi } +##outputs the Undercloud's IP address +##params: none +function get_undercloud_ip { + echo $(arp -a | grep $(virsh domiflist undercloud | grep default |\ + awk '{print $5}') | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") +} + ##connects to overcloud nodes ##params: node to login to, command to execute on overcloud (optional) function overcloud_connect { diff --git a/tests/smoke_tests/execute_smoke_tests.sh b/tests/smoke_tests/execute_smoke_tests.sh new file mode 100755 index 00000000..245ccc53 --- /dev/null +++ b/tests/smoke_tests/execute_smoke_tests.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +cd ~/provisioning/python +export PYTHONPATH=$PYTHONPATH:$(pwd) + +python unit_test_suite.py ~stack/overcloudrc
\ No newline at end of file diff --git a/tests/smoke_tests/execute_tests.yml b/tests/smoke_tests/execute_tests.yml new file mode 100644 index 00000000..e2326560 --- /dev/null +++ b/tests/smoke_tests/execute_tests.yml @@ -0,0 +1,9 @@ +--- +- hosts: all + sudo: yes + + tasks: + - name: Copy execute_smoke_tests.sh + copy: src=execute_smoke_tests.sh dest=~/execute_smoke_tests.sh mode=0755 + - name: Execute Tests + command: sh ~/execute_smoke_tests.sh | tee ~/unit_tests.out
\ No newline at end of file diff --git a/tests/smoke_tests/prepare_undercloud.yml b/tests/smoke_tests/prepare_undercloud.yml new file mode 100644 index 00000000..8f0cb709 --- /dev/null +++ b/tests/smoke_tests/prepare_undercloud.yml @@ -0,0 +1,16 @@ +--- +- hosts: all + sudo: yes + + tasks: + - yum: name=libffi + - yum: name=libffi-devel + - pip: name=python-keystoneclient + - pip: name=python-glanceclient + - pip: name=python-neutronclient + - pip: name=python-novaclient + - pip: name=scp + - pip: name=PyYAML + - pip: name=ansible==2.1.0 + + - git: repo=https://nougat.cablelabs.com/SNAPS/provisioning.git dest=~/provisioning diff --git a/tests/smoke_tests/smoke_tests.yml b/tests/smoke_tests/smoke_tests.yml new file mode 100644 index 00000000..b67c194f --- /dev/null +++ b/tests/smoke_tests/smoke_tests.yml @@ -0,0 +1,3 @@ +--- +- include: prepare_undercloud.yml +- include: execute_tests.yml
\ No newline at end of file |