+#@IgnoreInspection BashAddShebang
+# Activate robotframework virtualenv
+# ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh
+# script.
+source ${ROBOT_VENV}/bin/activate
+
echo "#################################################"
echo "## Configure Cluster and Start ##"
echo "#################################################"
# Run script plan in case it exists
if [ -f ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} ]; then
echo "scriptplan exists!!!"
- echo "Changing the scriptplan path..."
+ 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
cd /tmp
echo "Downloading the distribution from ${ACTUALBUNDLEURL}"
-wget --no-verbose '${ACTUALBUNDLEURL}'
+wget --progress=dot:mega '${ACTUALBUNDLEURL}'
echo "Extracting the new controller..."
unzip -q ${BUNDLE}
echo "Configuring the startup features..."
FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
+CUSTOMPROP=/tmp/${BUNDLEFOLDER}/etc/custom.properties
sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
-sed -ie "s%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features,mvn:org.opendaylight.integration/features-integration-test/${BUNDLEVERSION}/xml/features%g" \${FEATURESCONF}
+sed -ie "s%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features,mvn:org.opendaylight.integration/features-integration-test/${BUNDLEVERSION}/xml/features,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.0.0/xml/features%g" \${FEATURESCONF}
cat \${FEATURESCONF}
echo "Configuring the log..."
LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' \${LOGCONF}
# FIXME: Make log size limit configurable from build parameter.
-sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF}
+sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=30GB/g' \${LOGCONF}
cat \${LOGCONF}
+if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
+ echo "Enable the l3.fwd in custom.properties.."
+ echo "ovsdb.l3.fwd.enabled=yes" >> \${CUSTOMPROP}
+ cat \${CUSTOMPROP}
+fi
+
echo "Configure java home and max memory..."
MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' \${MEMCONF}
echo "Dump module-shards.conf"
cat ${MODULESHARDSCONF}
+EOF
+
+# Create the startup script to be run on controllers.
+cat > ${WORKSPACE}/startup-script.sh <<EOF
+
+echo "Redirecting karaf console output to karaf_console.log"
+export KARAF_REDIRECT="/tmp/${BUNDLEFOLDER}/data/log/karaf_console.log"
+
echo "Starting controller..."
/tmp/${BUNDLEFOLDER}/bin/start
ssh ${!CONTROLLERIP} "bash /tmp/configuration-script.sh ${i}"
done
+# Run config plan in case it exists
+configplan_filepath="${WORKSPACE}/test/csit/configplans/${STREAMTESTPLAN}"
+if [ ! -f "${configplan_filepath}" ]; then
+ configplan_filepath="${WORKSPACE}/test/csit/configplans/${TESTPLAN}"
+fi
+
+if [ -f ${configplan_filepath} ]; then
+ echo "configplan exists!!!"
+ echo "Reading the configplan:"
+ cat ${configplan_filepath} | sed "s:integration:${WORKSPACE}:" > 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
+
# vim: ts=4 sw=4 sts=4 et ft=sh :