FIxed startup scenario and re-worked cluster restart to use shutdown and startup scenarios.

Change-Id: I0fd6d10eb4d87251a4ed19d1e103b60f63c74448
diff --git a/tools/test/bin/stw b/tools/test/bin/stw
index 677d29c..ab33823 100755
--- a/tools/test/bin/stw
+++ b/tools/test/bin/stw
@@ -32,16 +32,17 @@
     [ "$ONOS_CELL" = "borrow" ] && onos-cell $ONOS_CELL 120 >/dev/null
 
     # Iterate over all listed scenarios
+    let status=0
     for scenario in "${@:-smoke}"; do
         if [[ $scenario =~ ^[0-9]*$ ]]; then
             printf "Waiting %d seconds...\n" $scenario
             sleep $scenario
         else
             printf "Running scenario %s...\n" $scenario
-            stc $scenario
+            stc $scenario || let status=status+$?
         fi
+        [ $status -ne 0 ] && break
     done
-    status=$?
 
     printf "Finished run %d...\n" $run
     [ $status -ne 0 ] && exit $status
diff --git a/tools/test/scenarios/ha-cluster-restart.xml b/tools/test/scenarios/ha-cluster-restart.xml
index 0abadbd..8f02f63 100644
--- a/tools/test/scenarios/ha-cluster-restart.xml
+++ b/tools/test/scenarios/ha-cluster-restart.xml
@@ -17,25 +17,13 @@
 <scenario name="ha-cluster-restart"
           description="ONOS cluster restart and recovery">
     <group name="Cluster-Restart" if="${OC2}">
-        <group name="Fail">
-            <parallel var="${OC#}">
-                <step name="Node-Stop-${#}" exec="onos-service ${OC#} stop"/>
-                <step name="Wait-for-Stop-${#}" requires="~Node-Stop-${#}"
-                      exec="onos-wait-for-stop ${OC#} ${ONOS_KILL_OPTION}"/>
-            </parallel>
-        </group>
+        <import file="${ONOS_SCENARIOS}/shutdown.xml" namespace="Cluster-Fail"/>
+        <import file="${ONOS_SCENARIOS}/startup.xml" namespace="Cluster-Recover"/>
 
-        <step name="Breathe" exec="sleep 5" requires="Fail"/>
+        <step name="Breathe" exec="sleep 5" requires="Cluster-Fail.Shutdown"/>
+        <dependency name="Cluster-Recover.Startup" requires="Breathe"/>
 
-        <group name="Recover" requires="~Breathe,Fail">
-            <parallel var="${OC#}">
-                <step name="Node-Start-${#}" exec="onos-service ${OC#} start"/>
-                <step name="Wait-for-Start-${#}" requires="~Node-Start-${#}"
-                      exec="onos-wait-for-start ${OC#}"/>
-            </parallel>
-        </group>
-
-        <group name="Validate-Recovery" requires="Recover">
+        <group name="Validate-Recovery" requires="Cluster-Recover.Startup">
             <parallel var="${OC#}">
                 <step name="Check-Nodes-${#}"
                       exec="onos-check-nodes ${OC#}"/>
diff --git a/tools/test/scenarios/startup.xml b/tools/test/scenarios/startup.xml
index df53184..27c324f 100644
--- a/tools/test/scenarios/startup.xml
+++ b/tools/test/scenarios/startup.xml
@@ -19,7 +19,7 @@
             <step name="Start-Service-${#}" exec="onos-service ${OC#} start"/>
             <step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}"
                   requires="Start-Service-${#}"/>
-            <step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}"
+            <step name="Check-Logs-${#}" exec="onos-check-logs --ignore-store-exceptions ${OC#}"
                   requires="~Wait-for-Start-${#}"/>
         </parallel>
     </group>