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
29 echo "Listing all open ports on controller system"
33 COUNT=\$(( \${COUNT} + 5 ))
35 echo waiting \$COUNT secs...
39 echo "Checking OSGi bundles..."
40 sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
42 echo "Listing all open ports on controller system"
45 # checking for any bind exceptions in log which could indicate a port conflict
46 if grep --quiet 'BindException: Address already in use' /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then
47 echo BindException found: Possible port conflict
48 echo "Dumping Karaf log..."
49 cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log
55 ODL_SYSTEM_IPS=(${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP})
56 for i in "${!ODL_SYSTEM_IPS[@]}"
58 echo "Verifying member-$((i+1)) with IP address ${ODL_SYSTEM_IPS[$i]} is UP"
59 scp ${WORKSPACE}/verify-cluster-is-up.sh ${ODL_SYSTEM_IPS[$i]}:/tmp
60 ssh ${ODL_SYSTEM_IPS[$i]} "bash /tmp/verify-cluster-is-up.sh $((i+1)) ${ODL_SYSTEM_IPS[$i]}"
63 echo "Cool down for 1 min :)..."
66 echo "Changing the testplan path..."
67 cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt
70 SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' )
72 echo "Starting Robot test suites ${SUITES} ..."
73 pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \
74 -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} \
75 -v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} -v ODL_SYSTEM_2_IP:${ODL_SYSTEM_2_IP} \
76 -v ODL_SYSTEM_3_IP:${ODL_SYSTEM_3_IP} -v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} \
77 -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} \
78 -v TOOLS_SYSTEM_USER:${USER} \
79 -v MININET:${TOOLS_SYSTEM_IP} -v MININET1:${TOOLS_SYSTEM_2_IP} -v MININET2:${TOOLS_SYSTEM_3_IP} -v MININET_USER:${USER} \
80 -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
82 echo "Fetching Karaf log"
83 scp $ODL_SYSTEM_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller0-karaf.log
84 scp $ODL_SYSTEM_2_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller1-karaf.log
85 scp $ODL_SYSTEM_3_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller2-karaf.log
87 # vim: ts=4 sw=4 sts=4 et ft=sh :