1 # Activate robotframework virtualenv
2 # ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh
4 source ${ROBOT_VENV}/bin/activate
6 echo "#################################################"
7 echo "## Verify Cluster is UP ##"
8 echo "#################################################"
10 cat > ${WORKSPACE}/verify-cluster-is-up.sh <<EOF
12 CONTROLLERID="member-\$1"
13 ODL_SYSTEM_IP_PATH=\$2
15 echo "Waiting for controller to come up..."
18 RESP="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null )"
20 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)"
22 if ([[ \$RESP == *"200"* ]] && [[ \$SHARD == *'"status":200'* ]]); then
25 elif (( "\$COUNT" > "600" )); then
26 echo Timeout Controller DOWN
27 echo "Dumping Karaf log..."
28 cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
31 COUNT=\$(( \${COUNT} + 5 ))
33 echo waiting \$COUNT secs...
37 echo "Checking OSGi bundles..."
38 sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
42 ODL_SYSTEM_IPS=(${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP})
43 for i in "${!ODL_SYSTEM_IPS[@]}"
45 echo "Verifying member-$((i+1)) with IP address ${ODL_SYSTEM_IPS[$i]} is UP"
46 scp ${WORKSPACE}/verify-cluster-is-up.sh ${ODL_SYSTEM_IPS[$i]}:/tmp
47 ssh ${ODL_SYSTEM_IPS[$i]} "bash /tmp/verify-cluster-is-up.sh $((i+1)) ${ODL_SYSTEM_IPS[$i]}"
50 echo "Cool down for 1 min :)..."
53 echo "Changing the testplan path..."
54 cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt
57 SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' )
59 echo "Starting Robot test suites ${SUITES} ..."
60 pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \
61 -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} \
62 -v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} -v ODL_SYSTEM_2_IP:${ODL_SYSTEM_2_IP} \
63 -v ODL_SYSTEM_3_IP:${ODL_SYSTEM_3_IP} -v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} \
64 -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} \
65 -v TOOLS_SYSTEM_USER:${USER} \
66 -v MININET:${TOOLS_SYSTEM_IP} -v MININET1:${TOOLS_SYSTEM_2_IP} -v MININET2:${TOOLS_SYSTEM_3_IP} -v MININET_USER:${USER} \
67 -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
69 echo "Fetching Karaf log"
70 scp $ODL_SYSTEM_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller0-karaf.log
71 scp $ODL_SYSTEM_2_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller1-karaf.log
72 scp $ODL_SYSTEM_3_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller2-karaf.log
74 # vim: ts=4 sw=4 sts=4 et ft=sh :