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