summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-22 11:20:18 +0000
committerGerrit Code Review <review@openstack.org>2016-11-22 11:20:18 +0000
commit0019b1dac8f4889ee434002052bfb766de040f46 (patch)
treef6c5c34bfff76a253c344a13f6e00048a59a0caf
parentc5df4cc9ae6adce1d40241c1603269f5a80a73f9 (diff)
parentcdbe75160ffcda150da761428e0d9b119d1150f7 (diff)
Merge "Test run issue is fixed"
-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