X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-controller-run-test.sh;h=20a536a4553ec25d2813478b3963123fe5e31bf6;hb=dab749f0e527e85d11cf90079fd7eaa1b08e39d9;hp=021161e61d6a10646aaf01618dba9d0eae810bc1;hpb=211eaee50a24c864af8d355417a1897dc7fc56db;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-deploy-controller-run-test.sh b/jjb/integration/integration-deploy-controller-run-test.sh old mode 100644 new mode 100755 index 021161e61..20a536a45 --- a/jjb/integration/integration-deploy-controller-run-test.sh +++ b/jjb/integration/integration-deploy-controller-run-test.sh @@ -6,273 +6,32 @@ source ${ROBOT_VENV}/bin/activate source /tmp/common-functions.sh ${BUNDLEFOLDER} -if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then - echo "Configure cluster" - AKKACONF=/tmp/${BUNDLEFOLDER}/configuration/initial/akka.conf - MODULESCONF=/tmp/${BUNDLEFOLDER}/configuration/initial/modules.conf - MODULESHARDSCONF=/tmp/${BUNDLEFOLDER}/configuration/initial/module-shards.conf -fi - -if [ ${CONTROLLERSCOPE} == 'all' ]; then - ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}" - export CONTROLLERMEM="3072m" -else - ACTUALFEATURES="odl-infrautils-ready,${CONTROLLERFEATURES}" -fi - -# Some versions of jenkins job builder result in feature list containing spaces -# and ending in newline. Remove all that. -ACTUALFEATURES=`echo "${ACTUALFEATURES}" | tr -d '\n \r'` -echo "ACTUALFEATURES: ${ACTUALFEATURES}" - -# In the case that we want to install features via karaf shell, a space separated list of -# ACTUALFEATURES IS NEEDED -SPACE_SEPARATED_FEATURES=$(echo "${ACTUALFEATURES}" | tr ',' ' ') -echo "SPACE_SEPARATED_FEATURES: ${SPACE_SEPARATED_FEATURES}" - -if [ -f "${WORKSPACE}/test/csit/scriptplans/${TESTPLAN}" ]; then - echo "scriptplan exists!!!" - echo "Changing the scriptplan path..." - cat ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > scriptplan.txt - cat scriptplan.txt - for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' scriptplan.txt ); do - echo "Executing ${line}..." - # shellcheck source=${line} disable=SC1091 - source ${line} - done -fi +echo "#################################################" +echo "## Configure Cluster and Start ##" +echo "#################################################" -cat > ${WORKSPACE}/configuration-script.sh <> ${CUSTOMPROP} -fi -cat ${CUSTOMPROP} +create_startup_script -configure_karaf_log "${KARAF_VERSION}" "${CONTROLLERDEBUGMAP}" +create_post_startup_script -set_java_vars "${JAVA_HOME}" "${CONTROLLERMEM}" "${MEMCONF}" +copy_and_run_configuration_script -echo "Listing all open ports on controller system..." -netstat -pnatu +run_plan "config" -if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then +copy_and_run_startup_script - # Copy shard file if exists - if [ -f /tmp/custom_shard_config.txt ]; then - echo "Custom shard config exists!!!" - echo "Copying the shard config..." - cp /tmp/custom_shard_config.txt /tmp/${BUNDLEFOLDER}/bin/ - fi +copy_and_run_post_startup_script - echo "Configuring cluster" - /tmp/${BUNDLEFOLDER}/bin/configure_cluster.sh \$1 \$2 - - echo "Dump akka.conf" - cat ${AKKACONF} - - echo "Dump modules.conf" - cat ${MODULESCONF} - - echo "Dump module-shards.conf" - cat ${MODULESHARDSCONF} -fi - -EOF -# cat > ${WORKSPACE}/configuration-script.sh < ${WORKSPACE}/startup-script.sh < ${WORKSPACE}/startup-script.sh < ${WORKSPACE}/post-startup-script.sh < ${WORKSPACE}/post-startup-script.sh < configplan.txt - cat configplan.txt - for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' configplan.txt ); do - echo "Executing ${line}..." - # shellcheck source=${line} disable=SC1091 - source ${line} - done -fi - -# Copy over the startup script to controller and execute it. -for i in `seq 1 ${NUM_ODL_SYSTEM}` -do - CONTROLLERIP=ODL_SYSTEM_${i}_IP - echo "Execute the startup script on controller ${!CONTROLLERIP}" - scp ${WORKSPACE}/startup-script.sh ${!CONTROLLERIP}:/tmp - ssh ${!CONTROLLERIP} "bash /tmp/startup-script.sh" -done - -seed_index=1 -for i in `seq 1 ${NUM_ODL_SYSTEM}` -do - CONTROLLERIP=ODL_SYSTEM_${i}_IP - echo "Execute the post startup script on controller ${!CONTROLLERIP}" - scp ${WORKSPACE}/post-startup-script.sh ${!CONTROLLERIP}:/tmp - ssh ${!CONTROLLERIP} "bash /tmp/post-startup-script.sh $(( seed_index++ ))" - if [ $(( $i % (${NUM_ODL_SYSTEM} / ${NUM_OPENSTACK_SITES}) )) == 0 ]; then - seed_index=1 - fi -done - -echo "Generating controller variables..." -for i in `seq 1 ${NUM_ODL_SYSTEM}` -do - CONTROLLERIP=ODL_SYSTEM_${i}_IP - odl_variables=${odl_variables}" -v ${CONTROLLERIP}:${!CONTROLLERIP}" - echo "Lets's take the karaf thread dump" - ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_before.log - pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_before.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') - echo "karaf main: org.apache.karaf.main.Main, pid:${pid}" - ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_before.log || true -done +create_controller_variables if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then echo "Exiting without running tests to deploy openstack for testing" @@ -337,6 +96,7 @@ pybot -N ${TESTPLAN} \ -v ODL_SYSTEM_1_IP:${ODL_SYSTEM_IP} \ -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \ -v ODL_SYSTEM_USER:${USER} \ + -v SUITES:"${SUITES}" \ -v TOOLS_SYSTEM_1_IP:${TOOLS_SYSTEM_IP} \ -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} \ -v TOOLS_SYSTEM_3_IP:${TOOLS_SYSTEM_3_IP} \ @@ -360,7 +120,7 @@ do ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_after.log pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_after.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') echo "karaf main: org.apache.karaf.main.Main, pid:${pid}" - ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_after.log || true + ssh ${!CONTROLLERIP} "${JAVA_HOME}/bin/jstack -l ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_after.log || true echo "Killing ODL" set +e # We do not want to create red dot just because something went wrong while fetching logs. ssh "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'