Created
April 12, 2016 06:49
-
-
Save hkumarmk/18077007aa1d07a59db29b3fe66f90fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
run=${1:-'basic_job'} | |
export AVAILABLE_TESTBEDS=testbed_sanity_nodei31.py | |
export BUILDID=25 | |
export BRANCH=R3.0 | |
export DISTRO=ubuntu-14-04 | |
export SKU=kilo | |
export JENKINS_TRIGGERED=0 | |
export LOCK_TESTBED_ON_FAILURE=0 | |
export TEST_CONTAINER_IMAGE_DIR=/cs-shared/images/contrail-test-docker-images/ | |
export TOOLS_WS=~/contrail-tools | |
cd $TOOLS_WS | |
export USE_LATEST_TEST_CODE=1 | |
export MX_GW_TEST=1 | |
#export TEST_RUN_CMD="bash -x run_tests.sh -m -U -F tor" | |
export SKIP_SANITY=0 | |
export SKIP_LOGS_COLLECTION=1 | |
export SKIP_REIMAGE=0 | |
export SKIP_BRINGUP=0 | |
export TEST_HOST_STRING="root@10.204.217.156" | |
export TEST_HOST_IP=`echo $TEST_HOST_STRING | cut -d @ -f2` | |
export TEST_HOST_USER=`echo $TEST_HOST_STRING | cut -d @ -f1` | |
export TEST_HOST_PASSWORD="${TEST_HOST_PASSWORD:-c0ntrail123}" | |
export TEST_RUN_INFRA='docker' | |
export TEST_RUN='contrail-test' | |
#export package_version= | |
if [[ $run == 'basic_job' ]]; then | |
bash -x testers/basic_job.sh | |
exit 0 | |
fi | |
TOOLS_WS=${TOOLS_WS:-$(pwd)} | |
source $TOOLS_WS/testers/utils | |
# AVAILABLE_TESTBEDS is a comma separated list of testbed filenames or paths | |
testbeds=(${AVAILABLE_TESTBEDS//,/ }) | |
echo "AVAILABLE TESTBEDS : ${testbeds[@]}" | |
# Contrail labs specific | |
get_testbed | |
create_testbed | |
reimage_and_bringup | |
# search_package will export some variables like PACKAGE_FILE which will be used to | |
#detect conainer tag to be run. | |
# TODO: Below functions can be replaced with more generic code | |
search_package | |
# End contrail lab specific | |
#copy contrail-test.sh, this should be distributed in some way and should be installed on test node | |
SCRIPT_TIMESTAMP=`date +"%Y_%m_%d_%H_%M_%S"` | |
SSHOPT="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" | |
contrail_test_script='/root/contrail-test.sh' | |
pkg_file_name=`basename $PKG_FILE` | |
PACKAGE_VERSION=`echo ${pkg_file_name} | sed 's/contrail-install-packages_\([0-9\.\-]*\).*/\1/'` | |
setup_testnode | |
sshpass -p $TEST_HOST_PASSWORD scp ${SSHOPT} ${contrail_test_script} ${TEST_HOST_STRING}:/root/contrail-test.sh | |
sanity_cmd="bash -x /root/contrail-test.sh run -n -p /root/tests/test_${SCRIPT_TIMESTAMP}/logs -t /root/tests/test_${SCRIPT_TIMESTAMP}/testbed.py contrail-test-ci-${SKU}:${PACKAGE_VERSION}" | |
sshpass -p ${TEST_HOST_PASSWORD} ssh -t -t ${SSHOPT} ${TEST_HOST_STRING} "( | |
export CT_SCRIPT_TS=${SCRIPT_TIMESTAMP}; | |
export CT_BUILD_ID=${BUILDID}; | |
export CT_PARAMS_FILE=${PARAMS_FILE}; | |
export CT_TEST_TYPE=${TEST_TYPE}; | |
export CT_EMAIL_SUBJECT_PREFIX=\"${EMAIL_SUBJECT_PREFIX}\"; | |
export CT_EMAIL_SUBJECT=\"${EMAIL_SUBJECT}\"; | |
export CT_MX_GW_TEST=${MX_GW_TEST}; | |
export CT_IMAGE_WEB_SERVER=${IMAGE_WEB_SERVER}; | |
export CT_BRANCH=$BRANCH; | |
$OTHER_OPTS | |
${sanity_cmd};)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment