X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Fci%2Fyardstick-verify;h=34423ff2f8b5a09a44af63459dbf53e467f26553;hb=7411096e94f7e30f03c73cc0b8d66dbd076fc37e;hp=2986c9f2f5fe863965d2ba08a28a3fd325147e89;hpb=8fc6288589a060ac6c420ccd2d824ebe329e56d3;p=yardstick.git diff --git a/tests/ci/yardstick-verify b/tests/ci/yardstick-verify index 2986c9f2f..34423ff2f 100755 --- a/tests/ci/yardstick-verify +++ b/tests/ci/yardstick-verify @@ -87,7 +87,9 @@ error_exit() exitcode=$rc fi - cleanup + if [[ "${DEPLOY_SCENARIO:0:2}" == 'os' ]];then + source "${YARDSTICK_REPO_DIR}/tests/ci/clean_images.sh" + fi echo "Exiting with RC=$exitcode" @@ -97,26 +99,14 @@ error_exit() set -o errexit set -o pipefail -install_yardstick() -{ - echo - echo "========== Installing yardstick ==========" - - # uninstall previous version - pip uninstall -y yardstick || true - - # Install yardstick - pip install . -} - install_storperf() { - # Install Storper on huawei-pod1 - if [ "$NODE_NAME" == "huawei-pod1" ]; then + # Install Storper on huawei-pod1 and huawei-pod2 + if [ "$NODE_NAME" == "huawei-pod1" -o "$NODE_NAME" == "huawei-pod2" ]; then echo echo "========== Installing storperf ==========" - if ! yardstick -d plugin install plugin/CI/storperf.yaml; then + if ! yardstick -d plugin install ${YARDSTICK_REPO_DIR}/plugin/CI/storperf.yaml; then echo "Install storperf plugin FAILED"; exit 1 fi @@ -126,12 +116,12 @@ install_storperf() remove_storperf() { - # remove Storper from huawei-pod1 - if [ "$NODE_NAME" == "huawei-pod1" ]; then + # remove Storper from huawei-pod1 and huawei-pod2 + if [ "$NODE_NAME" == "huawei-pod1" -o "$NODE_NAME" == "huawei-pod2" ]; then echo echo "========== Removing storperf ==========" - if ! yardstick -d plugin remove plugin/CI/storperf.yaml; then + if ! yardstick -d plugin remove ${YARDSTICK_REPO_DIR}/plugin/CI/storperf.yaml; then echo "Remove storperf plugin FAILED"; exit 1 fi @@ -219,10 +209,10 @@ EOF - local scenario_status="SUCCESS" + local scenario_status="PASS" if [ $failed -gt 0 ]; then - scenario_status="FAILED" + scenario_status="FAIL" fi report "${scenario_status}" "${start_date}" "${stop_date}" @@ -260,6 +250,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) @@ -295,39 +317,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 - - echo "OS_AUTH_URL is $OS_AUTH_URL" - echo - - # check OpenStack services - echo "Checking OpenStack services:" - for cmd in "openstack image list" "openstack server list" "openstack 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 - - # install yardstick - install_yardstick + trap "error_exit" EXIT SIGTERM - source $YARDSTICK_REPO_DIR/tests/ci/clean_images.sh + if [[ "${DEPLOY_SCENARIO:0:2}" == "os" ]];then + check_openstack - trap "error_exit" EXIT SIGTERM + source $YARDSTICK_REPO_DIR/tests/ci/clean_images.sh + source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh + fi - source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh install_storperf run_test remove_storperf