diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-08-28 17:24:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-28 17:24:04 +0000 |
commit | 57b17a2223d8751f2c5eae660b706e2fc736a47c (patch) | |
tree | 2531c3a7ea354ab9b8ddace0a411b0925842b381 /tests/ci | |
parent | 6b762e9edb2f7913348d99c1c240fe94b9f7cbf9 (diff) | |
parent | 731a5bcfacc17c9189837d2af2d5dc1f0a95ccff (diff) |
Merge "Kubernetes context adoption when run in CI"
Diffstat (limited to 'tests/ci')
-rwxr-xr-x | tests/ci/yardstick-verify | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/tests/ci/yardstick-verify b/tests/ci/yardstick-verify index 16598df7b..ca8a0b27a 100755 --- a/tests/ci/yardstick-verify +++ b/tests/ci/yardstick-verify @@ -248,6 +248,38 @@ EOF } +check_openstack(){ + # check if some necessary variables is set + if [ -z "$OS_AUTH_URL" ]; then + echo "OS_AUTH_URL is unset or empty" + exit 1 + fi + + echo "OS_AUTH_URL is $OS_AUTH_URL" + echo + + # check OpenStack services + if [[ $OS_INSECURE ]] && [[ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]]; then + SECURE="--insecure" + else + SECURE="" + fi + echo "Checking OpenStack services:" + for cmd in "openstack ${SECURE} image list" "openstack ${SECURE} server list" "openstack ${SECURE} stack list"; do + echo " checking ${cmd} ..." + if ! $cmd >/dev/null; then + echo "error: command \"$cmd\" failed" + exit 1 + fi + done + + echo + echo "Checking for External network:" + for net in $(openstack network list --external -c Name -f value); do + echo " external network: $net" + done +} + main() { GITROOT=$(cd $(dirname $0) && git rev-parse --show-toplevel) @@ -283,41 +315,15 @@ main() done echo - # check if some necessary variables is set - if [ -z "$OS_AUTH_URL" ]; then - echo "OS_AUTH_URL is unset or empty" - exit 1 - fi + trap "error_exit" EXIT SIGTERM - echo "OS_AUTH_URL is $OS_AUTH_URL" - echo + if [[ "${DEPLOY_SCENARIO:0:2}" == "os" ]];then + check_openstack - # check OpenStack services - if [[ $OS_INSECURE ]] && [[ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]]; then - SECURE="--insecure" - else - SECURE="" + source $YARDSTICK_REPO_DIR/tests/ci/clean_images.sh + source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh fi - echo "Checking OpenStack services:" - for cmd in "openstack ${SECURE} image list" "openstack ${SECURE} server list" "openstack ${SECURE} stack list"; do - echo " checking ${cmd} ..." - if ! $cmd >/dev/null; then - echo "error: command \"$cmd\" failed" - exit 1 - fi - done - - echo - echo "Checking for External network:" - for net in $(openstack network list --external -c Name -f value); do - echo " external network: $net" - done - - source $YARDSTICK_REPO_DIR/tests/ci/clean_images.sh - - trap "error_exit" EXIT SIGTERM - source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh install_storperf run_test remove_storperf |