Make sure only one onos-mininet operation is going at a time. This script is not mutlithread safe.

Change-Id: I066e9e6ad6405cb32c037502095a2a470eb7c9d5
diff --git a/tools/test/scenarios/net-multi-to-single-intent.xml b/tools/test/scenarios/net-multi-to-single-intent.xml
index 1d537ff..a033925 100644
--- a/tools/test/scenarios/net-multi-to-single-intent.xml
+++ b/tools/test/scenarios/net-multi-to-single-intent.xml
@@ -31,34 +31,28 @@
               exec="onos-create-intent ${OC1} back single-to-multi of:0000000000000011/1 of:0000000000000014/1 of:0000000000000002/1 of:000000000000000E/1"/>
 
         <!-- Make sure intents installed properly -->
-        <step name="M2S-Intent.Validate-Intent-forward-Installed" requires="M2S-Intent.Create-Intent-forward"
+        <step name="M2S-Intent.Validate-Intent-forward-Installed" requires="^"
               exec="onos-check-intent ${OC1} forward INSTALLED"/>
-        <step name="M2S-Intent.Validate-Intent-back1-Installed" requires="M2S-Intent.Create-Intent-back1"
+        <step name="M2S-Intent.Validate-Intent-back1-Installed" requires="^"
               exec="onos-check-intent ${OC1} back INSTALLED"/>
 
         <!-- Check the connectivity of the 11 <-> 14 intent -->
         <step name="M2S-Intent.Ping-1-forward"
-              exec="onos-mininet sendAndExpect h17 ping -c1 h20 --expect \ 0% packet loss" requires="M2S-Intent.Create-Intent-forward,
-                                                                                                     M2S-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h17 ping -c1 h20 --expect \ 0% packet loss" requires="^" />
         <step name="M2S-Intent.Ping-1-back"
-              exec="onos-mininet sendAndExpect h20 ping -c1 h17 --expect \ 0% packet loss" requires="M2S-Intent.Create-Intent-forward,
-                                                                                                     M2S-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h20 ping -c1 h17 --expect \ 0% packet loss" requires="^" />
 
         <!-- Check the connectivity of the 11 <-> 2 intent -->
         <step name="M2S-Intent.Ping-2-forward"
-              exec="onos-mininet sendAndExpect h17 ping -c1 h2 --expect \ 0% packet loss" requires="M2S-Intent.Create-Intent-forward,
-                                                                                                     M2S-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h17 ping -c1 h2 --expect \ 0% packet loss" requires="^" />
         <step name="M2S-Intent.Ping-2-back"
-              exec="onos-mininet sendAndExpect h2 ping -c1 h17 --expect \ 0% packet loss" requires="M2S-Intent.Create-Intent-forward,
-                                                                                                     M2S-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h2 ping -c1 h17 --expect \ 0% packet loss" requires="^" />
 
         <!-- Check the connectivity of the 11 <-> E intent -->
         <step name="M2S-Intent.Ping-3-forward"
-              exec="onos-mininet sendAndExpect h17 ping -c1 h14 --expect \ 0% packet loss" requires="M2S-Intent.Create-Intent-forward,
-                                                                                                     M2S-Intent.Create-Intent-back2" />
+              exec="onos-mininet sendAndExpect h17 ping -c1 h14 --expect \ 0% packet loss" requires="^" />
         <step name="M2S-Intent.Ping-3-back"
-              exec="onos-mininet sendAndExpect h14 ping -c1 h17 --expect \ 0% packet loss" requires="M2S-Intent.Create-Intent-forward,
-                                                                                                     M2S-Intent.Create-Intent-back3" />
+              exec="onos-mininet sendAndExpect h14 ping -c1 h17 --expect \ 0% packet loss" requires="^" />
 
         <!-- Clean up intents -->
         <step name="M2S-Intent.Remove-Intent-forward" requires="~M2S-Intent.Ping-3-back"
diff --git a/tools/test/scenarios/net-rest.xml b/tools/test/scenarios/net-rest.xml
index 52a0e03..95f91d1 100644
--- a/tools/test/scenarios/net-rest.xml
+++ b/tools/test/scenarios/net-rest.xml
@@ -123,7 +123,7 @@
               exec="test ${dev4outFlowPort} -ge 1 -a ${dev4outFlowPort} -le 5"/>
 
         <!-- Check that connectivity was established -->
-        <step name="Net-REST.Ping-XY" requires="Net-REST.Create-Intent-XY,Net-REST.Create-Intent-YX"
+        <step name="Net-REST.Ping-XY" requires="^"
               exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/>
         <step name="Net-REST.Ping-YX" requires="^"
               exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 0% packet loss"/>
diff --git a/tools/test/scenarios/net-single-to-multi-intent.xml b/tools/test/scenarios/net-single-to-multi-intent.xml
index 4b7ddc4..00c2594 100644
--- a/tools/test/scenarios/net-single-to-multi-intent.xml
+++ b/tools/test/scenarios/net-single-to-multi-intent.xml
@@ -35,38 +35,32 @@
               exec="onos-create-intent ${OC1} back3 point of:000000000000000E/1 of:0000000000000011/1"/>
 
         <!-- Make sure intents installed properly -->
-        <step name="S2M-Intent.Validate-Intent-forward-Installed" requires="S2M-Intent.Create-Intent-forward"
+        <step name="S2M-Intent.Validate-Intent-forward-Installed" requires="^"
               exec="onos-check-intent ${OC1} forward INSTALLED"/>
-        <step name="S2M-Intent.Validate-Intent-back1-Installed" requires="S2M-Intent.Create-Intent-back1"
+        <step name="S2M-Intent.Validate-Intent-back1-Installed" requires="^"
               exec="onos-check-intent ${OC1} back1 INSTALLED"/>
-        <step name="S2M-Intent.Validate-Intent-back2-Installed" requires="S2M-Intent.Create-Intent-back2"
+        <step name="S2M-Intent.Validate-Intent-back2-Installed" requires="^"
               exec="onos-check-intent ${OC1} back2 INSTALLED"/>
-        <step name="S2M-Intent.Validate-Intent-back3-Installed" requires="S2M-Intent.Create-Intent-back3"
+        <step name="S2M-Intent.Validate-Intent-back3-Installed" requires="^"
               exec="onos-check-intent ${OC1} back3 INSTALLED"/>
 
         <!-- Check the connectivity of the 11 <-> 14 intent -->
         <step name="S2M-Intent.Ping-1-forward"
-              exec="onos-mininet sendAndExpect h17 ping -c1 h20 --expect \ 0% packet loss" requires="S2M-Intent.Create-Intent-forward,
-                                                                                                     S2M-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h17 ping -c1 h20 --expect \ 0% packet loss" requires="^" />
         <step name="S2M-Intent.Ping-1-back"
-              exec="onos-mininet sendAndExpect h20 ping -c1 h17 --expect \ 0% packet loss" requires="S2M-Intent.Create-Intent-forward,
-                                                                                                     S2M-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h20 ping -c1 h17 --expect \ 0% packet loss" requires="^" />
 
         <!-- Check the connectivity of the 11 <-> 2 intent -->
         <step name="S2M-Intent.Ping-2-forward"
-              exec="onos-mininet sendAndExpect h17 ping -c1 h2 --expect \ 0% packet loss" requires="S2M-Intent.Create-Intent-forward,
-                                                                                                     S2M-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h17 ping -c1 h2 --expect \ 0% packet loss" requires="^" />
         <step name="S2M-Intent.Ping-2-back"
-              exec="onos-mininet sendAndExpect h2 ping -c1 h17 --expect \ 0% packet loss" requires="S2M-Intent.Create-Intent-forward,
-                                                                                                     S2M-Intent.Create-Intent-back1" />
+              exec="onos-mininet sendAndExpect h2 ping -c1 h17 --expect \ 0% packet loss" requires="^" />
 
         <!-- Check the connectivity of the 11 <-> E intent -->
         <step name="S2M-Intent.Ping-3-forward"
-              exec="onos-mininet sendAndExpect h17 ping -c1 h14 --expect \ 0% packet loss" requires="S2M-Intent.Create-Intent-forward,
-                                                                                                     S2M-Intent.Create-Intent-back2" />
+              exec="onos-mininet sendAndExpect h17 ping -c1 h14 --expect \ 0% packet loss" requires="^" />
         <step name="S2M-Intent.Ping-3-back"
-              exec="onos-mininet sendAndExpect h14 ping -c1 h17 --expect \ 0% packet loss" requires="S2M-Intent.Create-Intent-forward,
-                                                                                                     S2M-Intent.Create-Intent-back3" />
+              exec="onos-mininet sendAndExpect h14 ping -c1 h17 --expect \ 0% packet loss" requires="^" />
 
         <!-- Clean up intents -->
         <step name="S2M-Intent.Remove-Intent-forward" requires="~S2M-Intent.Ping-3-back"