1 # Activate robotframework virtualenv
2 source $WORKSPACE/venv-robotframework/bin/activate
4 echo "#################################################"
5 echo "## Verify Cluster is UP ##"
6 echo "#################################################"
8 cat > ${WORKSPACE}/verify-cluster-is-up.sh <<EOF
10 CONTROLLERID="member-\$1"
11 ODL_SYSTEM_IP_PATH=\$2
13 echo "Waiting for controller to come up..."
16 RESP="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null )"
18 SHARD="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/jolokia/read/org.opendaylight.controller:Category=Shards,name=\$CONTROLLERID-shard-inventory-config,type=DistributedConfigDatastore)"
20 if ([[ \$RESP == *"200"* ]] && [[ \$SHARD == *'"status":200'* ]]); then
23 elif (( "\$COUNT" > "600" )); then
24 echo Timeout Controller DOWN
25 echo "Dumping Karaf log..."
26 cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
29 COUNT=\$(( \${COUNT} + 5 ))
31 echo waiting \$COUNT secs...
35 echo "Checking OSGi bundles..."
36 sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
40 ODL_SYSTEM_IPS=(${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP})
41 for i in "${!ODL_SYSTEM_IPS[@]}"
43 echo "Verifying member-$((i+1)) with IP address ${ODL_SYSTEM_IPS[$i]} is UP"
44 scp ${WORKSPACE}/verify-cluster-is-up.sh ${ODL_SYSTEM_IPS[$i]}:/tmp
45 ssh ${ODL_SYSTEM_IPS[$i]} "bash /tmp/verify-cluster-is-up.sh $((i+1)) ${ODL_SYSTEM_IPS[$i]}"
48 echo "Cool down for 1 min :)..."
51 echo "Changing the testplan path..."
52 cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt
55 SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' )
57 echo "Starting Robot test suites ${SUITES} ..."
58 pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \
59 -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} \
60 -v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} -v ODL_SYSTEM_2_IP:${ODL_SYSTEM_2_IP} \
61 -v ODL_SYSTEM_3_IP:${ODL_SYSTEM_3_IP} -v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} \
62 -v TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_IP} -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} -v TOOLS_SYSTEM_3_IP:${TOOLS_SYSTEM_3_IP} \
63 -v TOOLS_SYSTEM_USER:${USER} \
64 -v MININET:${TOOLS_SYSTEM_IP} -v MININET1:${TOOLS_SYSTEM_2_IP} -v MININET2:${TOOLS_SYSTEM_3_IP} -v MININET_USER:${USER} \
65 -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
67 echo "Fetching Karaf log"
68 scp $ODL_SYSTEM_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller0-karaf.log
69 scp $ODL_SYSTEM_2_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller1-karaf.log
70 scp $ODL_SYSTEM_3_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller2-karaf.log
72 # vim: ts=4 sw=4 sts=4 et ft=sh :