summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Khozinov <rkhozinov@mirantis.com>2016-11-18 19:26:55 +0300
committerRuslan Khozinov <rkhozinov@mirantis.com>2016-11-22 08:45:39 +0000
commitcdbe75160ffcda150da761428e0d9b119d1150f7 (patch)
treeb683b489beb6064b10ae3a1b9cc71135df97f965
parent5dc4aa95623f58bbe8237ac373db4d26b3c45560 (diff)
Test run issue is fixed
We've faced with the WORKSPACE env var reusing. WORKSPACE env should be different for fuel-qa submoule and nsx-t repo. Closes-Bug: #1642991 Change-Id: Id0b77b8f187d4c29cd486ccda5d5e6a5dc84980a
Notes
Notes (review): Code-Review+1: Fuel TPI CI <pi-ci@mirantis.com> Code-Review+2: Igor Zinovik <izinovik@mirantis.com> Workflow+1: Igor Zinovik <izinovik@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 22 Nov 2016 11:20:18 +0000 Reviewed-on: https://review.openstack.org/399677 Project: openstack/fuel-plugin-nsx-t Branch: refs/heads/master
-rwxr-xr-xplugin_test/utils/jenkins/system_tests.sh47
1 files changed, 18 insertions, 29 deletions
diff --git a/plugin_test/utils/jenkins/system_tests.sh b/plugin_test/utils/jenkins/system_tests.sh
index 9074b60..8c79ac5 100755
--- a/plugin_test/utils/jenkins/system_tests.sh
+++ b/plugin_test/utils/jenkins/system_tests.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 2PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
3 3
4INVALIDOPTS_ERR=100 4INVALIDOPTS_ERR=100
@@ -407,11 +407,7 @@ RunTest() {
407 407
408 # run python virtualenv 408 # run python virtualenv
409 if [ "${VENV}" = "yes" ]; then 409 if [ "${VENV}" = "yes" ]; then
410 if [ "${DRY_RUN}" = "yes" ]; then 410 . $VENV_PATH/bin/activate
411 echo . $VENV_PATH/bin/activate
412 else
413 . $VENV_PATH/bin/activate
414 fi
415 fi 411 fi
416 412
417 if [ "${ENV_NAME}" = "" ]; then 413 if [ "${ENV_NAME}" = "" ]; then
@@ -431,14 +427,9 @@ RunTest() {
431 export ISO_PATH 427 export ISO_PATH
432 428
433 if [ "${KEEP_BEFORE}" != "yes" ]; then 429 if [ "${KEEP_BEFORE}" != "yes" ]; then
434 # remove previous environment
435 if [ "${DRY_RUN}" = "yes" ]; then
436 echo dos.py erase "${ENV_NAME}"
437 else
438 if dos.py list | grep -q "^${ENV_NAME}\$" ; then 430 if dos.py list | grep -q "^${ENV_NAME}\$" ; then
439 dos.py erase "${ENV_NAME}" 431 dos.py erase "${ENV_NAME}"
440 fi 432 fi
441 fi
442 fi 433 fi
443 434
444 # gather additional option for this nose test run 435 # gather additional option for this nose test run
@@ -455,16 +446,15 @@ RunTest() {
455 446
456 clean_old_bridges 447 clean_old_bridges
457 448
458 # run python test set to create environments, deploy and test product 449 export PLUGIN_WORKSPACE="${WORKSPACE/\/fuel-qa}/plugin_test"
459 if [ "${DRY_RUN}" = "yes" ]; then 450 export WORKSPACE="${PLUGIN_WORKSPACE}/fuel-qa"
460 echo export PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${WORKSPACE}" 451 export PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${WORKSPACE}:${PLUGIN_WORKSPACE}"
461 echo python plugin_test/run_tests.py -q --nologcapture --with-xunit ${OPTS}
462 else
463 export PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${WORKSPACE}"
464 echo ${PYTHONPATH}
465 python plugin_test/run_tests.py -q --nologcapture --with-xunit ${OPTS} &
466 452
467 fi 453 [[ "${DEBUG}" == "true" ]] && echo "PYTHONPATH:${PYTHONPATH} PATH${PATH}"
454 [[ "${DEBUG}" == "true" ]] && echo "PLUGIN_WORKSPACE:${PLUGIN_WORKSPACE}"
455 [[ "${DEBUG}" == "true" ]] && echo "WORKSPACE:${WORKSPACE}"
456
457 python $PLUGIN_WORKSPACE/run_tests.py -q --nologcapture --with-xunit ${OPTS} &
468 458
469 SYSTEST_PID=$! 459 SYSTEST_PID=$!
470 460
@@ -474,7 +464,7 @@ RunTest() {
474 exit 1 464 exit 1
475 fi 465 fi
476 466
477 while [ "$(virsh net-list | grep -c $ENV_NAME)" -ne 5 ];do sleep 10 467 while [ "$(virsh net-list | grep -c $ENV_NAME)" -ne 5 ]; do sleep 10
478 if ! ps -p $SYSTEST_PID > /dev/null 468 if ! ps -p $SYSTEST_PID > /dev/null
479 then 469 then
480 echo System tests exited prematurely, aborting 470 echo System tests exited prematurely, aborting
@@ -578,17 +568,16 @@ clean_iptables() {
578} 568}
579 569
580revert_ws() { 570revert_ws() {
581 for i in $1 571 cmd="vmrun -T ws-shared -h https://localhost:443/sdk -u $WORKSTATION_USERNAME -p $WORKSTATION_PASSWORD"
582 do 572 for i in $1; do
583 vmrun -T ws-shared -h https://localhost:443/sdk -u $WORKSTATION_USERNAME -p $WORKSTATION_PASSWORD listRegisteredVM | grep -q $i || { echo "VM $i does not exist"; continue; } 573 $cmd listRegisteredVM | grep -q $i || { echo "VM $i does not exist"; continue; }
584 echo vmrun: reverting $i to $WORKSTATION_SNAPSHOT 574 echo vmrun: reverting $i to $WORKSTATION_SNAPSHOT
585 vmrun -T ws-shared -h https://localhost:443/sdk -u $WORKSTATION_USERNAME -p $WORKSTATION_PASSWORD revertToSnapshot "[standard] $i/$i.vmx" $WORKSTATION_SNAPSHOT || { echo "Error: revert of $i failed"; return 1; } 575 $cmd revertToSnapshot "[standard] $i/$i.vmx" $WORKSTATION_SNAPSHOT || { echo "Error: revert of $i failed"; return 1; }
586 done 576 done
587 577
588 for i in $1 578 for i in $1; do
589 do
590 echo vmrun: starting $i 579 echo vmrun: starting $i
591 vmrun -T ws-shared -h https://localhost:443/sdk -u $WORKSTATION_USERNAME -p $WORKSTATION_PASSWORD start "[standard] $i/$i.vmx" || { echo "Error: $i failed to start"; return 1; } 580 $cmd start "[standard] $i/$i.vmx" || { echo "Error: $i failed to start"; return 1; }
592 done 581 done
593} 582}
594 583