3 if [ ${CONTROLLERSCOPE} == 'all' ]; then
4 ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
7 ACTUALFEATURES="${CONTROLLERFEATURES}"
10 if [ -f ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} ]; then
11 echo "scriptplan exists!!!"
12 echo "Changing the scriptplan path..."
13 cat ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > scriptplan.txt
15 for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' scriptplan.txt ); do
16 echo "Executing ${line}..."
21 cat > ${WORKSPACE}/controller-script.sh <<EOF
23 echo "Changing to /tmp"
26 echo "Downloading the distribution..."
27 wget --no-verbose '${ACTUALBUNDLEURL}'
29 echo "Extracting the new controller..."
32 echo "Configuring the startup features..."
33 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
34 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
35 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}
38 echo "Configuring the log..."
39 LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
40 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/g' \${LOGCONF}
43 echo "Configure max memory..."
44 MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
45 sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF}
48 echo "Starting controller..."
49 /tmp/${BUNDLEFOLDER}/bin/start
51 echo "Waiting for controller to come up..."
54 RESP="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null )"
56 if [[ \$RESP == *"200"* ]]; then
59 elif (( "\$COUNT" > "600" )); then
60 echo Timeout Controller DOWN
61 echo "Dumping Karaf log..."
62 cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
65 COUNT=\$(( \${COUNT} + 5 ))
67 echo waiting \$COUNT secs...
71 echo "Cool down for 1 min :)..."
74 echo "Checking OSGi bundles..."
75 sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
79 scp ${WORKSPACE}/controller-script.sh ${CONTROLLER0}:/tmp
80 ssh ${CONTROLLER0} 'bash /tmp/controller-script.sh'
82 echo "Changing the testplan path..."
83 cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt
86 SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' )
88 echo "Starting Robot test suites ${SUITES} ..."
89 pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \
90 -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${CONTROLLER0} -v CONTROLLER_USER:${USER} \
91 -v MININET:${MININET0} -v MININET1:${MININET1} -v MININET2:${MININET2} -v MININET_USER:${USER} \
92 -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
94 echo "Fetching Karaf log"
95 scp ${CONTROLLER0}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log .
97 # vim: ts=4 sw=4 sts=4 et ft=sh :