X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-configure-clustering.sh;h=42f73e40a3c6ada706b24cc1c74a79b1c1f81b10;hb=995edd3864f792c93980549fdd6e402d36d88fd5;hp=ecc941a5b16ca3eff5d4e84687e4e9a3268f164e;hpb=39a0450315a14058a0c8fd7eb8c53fad2637249f;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-configure-clustering.sh b/jjb/integration/integration-configure-clustering.sh index ecc941a5b..42f73e40a 100644 --- a/jjb/integration/integration-configure-clustering.sh +++ b/jjb/integration/integration-configure-clustering.sh @@ -1,165 +1,33 @@ +#!/bin/bash #@IgnoreInspection BashAddShebang # Activate robotframework virtualenv # ${ROBOT_VENV} comes from the integration-install-robotframework.sh # script. -# shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091 -source ${ROBOT_VENV}/bin/activate -source /tmp/common-functions.sh ${BUNDLEFOLDER} +# shellcheck disable=SC1090,SC1091 +. "${ROBOT_VENV}/bin/activate" +source /tmp/common-functions.sh "${BUNDLEFOLDER}" echo "#################################################" echo "## Configure Cluster and Start ##" echo "#################################################" -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'` +get_features -# Utility function for joining strings. -function join { - delim=' ' - final=$1; shift +# shellcheck disable=SC2034 +nodes_list=$(get_nodes_list) - for str in "$@" ; do - final=${final}${delim}${str} - done +run_plan "script" - echo ${final} -} +add_jvm_support -# Create the string for nodes -for i in `seq 1 ${NUM_ODL_SYSTEM}` ; do - CONTROLLERIP=ODL_SYSTEM_${i}_IP - nodes[$i]=${!CONTROLLERIP} -done +create_configuration_script -nodes_list=$(join "${nodes[@]}") +create_startup_script -echo ${nodes_list} +copy_and_run_configuration_script -# Run script plan in case it exists -if [ -f ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} ]; then - echo "scriptplan exists!!!" - echo "Reading the scriptplan:" - 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}..." - source ${line} - done -fi +run_plan "config" -# Create the configuration script to be run on controllers. -cat > ${WORKSPACE}/configuration-script.sh <> ${CUSTOMPROP} - cat ${CUSTOMPROP} -fi - -configure_karaf_log "${KARAF_VERSION}" "${CONTROLLERDEBUGMAP}" - -set_java_vars "${JAVA_HOME}" - -# 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 - -echo "Configuring cluster" -/tmp/${BUNDLEFOLDER}/bin/configure_cluster.sh \$1 ${nodes_list} - -echo "Dump akka.conf" -cat ${AKKACONF} - -echo "Dump modules.conf" -cat ${MODULESCONF} - -echo "Dump module-shards.conf" -cat ${MODULESHARDSCONF} - -EOF - -# Create the startup script to be run on controllers. -cat > ${WORKSPACE}/startup-script.sh < configplan.txt - cat configplan.txt - for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' configplan.txt ); do - echo "Executing ${line}..." - source ${line} - done -fi - -# Copy over the startup script to each controller and execute it. -for i in `seq 1 ${NUM_ODL_SYSTEM}` -do - CONTROLLERIP=ODL_SYSTEM_${i}_IP - echo "Starting member-${i} with IP address ${!CONTROLLERIP}" - scp ${WORKSPACE}/startup-script.sh ${!CONTROLLERIP}:/tmp/ - ssh ${!CONTROLLERIP} "bash /tmp/startup-script.sh" -done +copy_and_run_startup_script # vim: ts=4 sw=4 sts=4 et ft=sh :