diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-08-28 09:55:05 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-08-28 09:55:05 +0000 |
commit | 731a5bcfacc17c9189837d2af2d5dc1f0a95ccff (patch) | |
tree | b51f0537dffb2009813b42d5afccc4af235c1355 /tests | |
parent | 952ccb549c08b620a35f20ae809e0cea88ae4d99 (diff) |
Kubernetes context adoption when run in CI
JIRA: YARDSTICK-801
We need kubernetes test case run in CI.
We have one scenario k8-nosdb-lb-noha for kubernetes.
But for now, we need to do some adoption in CI script.
Also I move check OS_AUTH_URL in heat.py.
Change-Id: Iff86caf77fd74e70469ad2dc43f2238097ce0001
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'tests')
-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 |