Added check for cyclic dependencies.

Changes intent test scenarios to use the key and added dependencies to make them more robust; h2h still fails intermittently due to a bug.

Increased parallelism of the smoke test scenario.

Change-Id: Ib7fed38d17d1b25c5dd854ef1cd4dc777002c5fc
diff --git a/tools/test/scenarios/net-point-intent.xml b/tools/test/scenarios/net-point-intent.xml
index 125f491..acb8212 100644
--- a/tools/test/scenarios/net-point-intent.xml
+++ b/tools/test/scenarios/net-point-intent.xml
@@ -13,44 +13,65 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
-<scenario name="net-point-intent" description="Network point to point intent connectivity test">
+<scenario name="net-point-intent"
+          description="Network point to point intent connectivity test">
     <!-- TODO: parametrize this via recipes -->
-    <group name="Point-To-Point-Intent-Connectivity">
-        <step name="P2P-Uninstall-Reactive-Forwarding"
+    <group name="P2P-Intent-Connectivity">
+        <step name="P2P-Intent.Uninstall-Reactive-Forwarding"
               exec="onos ${OC1} app deactivate org.onosproject.fwd org.onosproject.ifwd"/>
+        <step name="P2P-Intent.Check-Apps" requires="^"
+              exec="onos-check-apps ${OC1} fwd,ifwd excludes"/>
 
-        <step name="P2P-Find-Host-1" requires="^"
-              exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect ."/>
-        <step name="P2PFind-Host-2" requires="^"
-              exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect ."/>
+        <step name="P2P-Intent.Find-Host-1" requires="^"
+              exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect ."/>
+        <step name="P2P-Intent.Find-Host-2" requires="^"
+              exec="onos-mininet sendAndExpect h4 ping -c1 -w1 h1 --expect ."/>
 
-        <step name="P2P-Create-Intent-1-To-4" requires="^"
-              exec="onos-create-intent ${OC1} oneToFour point of:0000000000000001/1 of:0000000000000004/1"/>
-        <step name="P2P-Create-Intent-4-To-1" requires="^"
-              exec="onos-create-intent ${OC1} fourToOne point of:0000000000000004/1 of:0000000000000001/1"/>
+        <step name="P2P-Intent.Create-Intent-XY" requires="^"
+              exec="onos-create-intent ${OC1} xy point of:0000000000000001/1 of:0000000000000004/1"/>
+        <step name="P2P-Intent.Create-Intent-YX" requires="^"
+              exec="onos-create-intent ${OC1} yx point of:0000000000000004/1 of:0000000000000001/1"/>
 
-        <step name="P2P-Validate-Point-Intents-Installed1" exec="onos-check-intent ${OC1} ${fourToOneId} INSTALLED"
-              requires="^" />
-        <step name="P2P-Validate-Point-Intents-Installed2" exec="onos-check-intent ${OC1} ${oneToFourId} INSTALLED"
-              requires="^" />
+        <step name="P2P-Intent.Validate-Intent-XY-Installed" requires="^"
+              exec="onos-check-intent ${OC1} yx INSTALLED"/>
+        <step name="P2P-Intent.Validate-Intent-YX-Installed" requires="^"
+              exec="onos-check-intent ${OC1} xy INSTALLED"/>
 
-        <import file="${ONOS_SCENARIOS}/net-link-down-up.xml" namespace="Point-To-Point-Intent"/>
-        <dependency name="Point-To-Point-Intent.Net-Link-Down-Up" requires="P2P-Validate-Point-Intents-Installed2"/>
-        <step name="P2P-Validate-Intent-Installed-Still" exec="onos-check-intent ${OC1} ${fourToOneId} INSTALLED"
-              requires="Point-To-Point-Intent.Link-1-Down" />
+        <import file="${ONOS_SCENARIOS}/net-link-down-up.xml" namespace="P2P-Intent"/>
+        <dependency name="P2P-Intent.Net-Link-Down-Up"
+                    requires="P2P-Intent.Validate-Intent-XY-Installed,
+                              P2P-Intent.Validate-Intent-YX-Installed"/>
 
-        <step name="P2P-Validate-Intent-Failed" exec="onos-check-intent ${OC1} ${fourToOneId} FAILED"
-              requires="Point-To-Point-Intent.Link-2-Down" />
-        <step name="P2P-Validate-Intent-Failed2" exec="onos-check-intent ${OC1} ${oneToFourId} FAILED"
-              requires="Point-To-Point-Intent.Link-2-Down" />
+        <step name="P2P-Intent.Validate-Intent-XY-Installed-Still" requires="P2P-Intent.Link-1-Down"
+              exec="onos-check-intent ${OC1} xy INSTALLED"/>
+        <step name="P2P-Intent.Validate-Intent-YX-Installed-Still" requires="P2P-Intent.Link-1-Down"
+              exec="onos-check-intent ${OC1} yx INSTALLED"/>
 
-        <step name="P2P-Validate-Intent-Installed-Again" exec="onos-check-intent ${OC1} ${fourToOneId} INSTALLED"
-              requires="Point-To-Point-Intent.Link-1-Up" />
-        <dependency name="Point-To-Point-Intent.Ping-4" requires="P2P-Validate-Intent-Installed-Again" />
+        <dependency name="P2P-Intent.Link-2-Down"
+                    requires="~P2P-Intent.Validate-Intent-XY-Installed-Still,
+                              ~P2P-Intent.Validate-Intent-YX-Installed-Still"/>
 
-        <step name="P2P-Remove-Intent-4-to-1" requires="~Point-To-Point-Intent.Net-Link-Down-Up"
-              exec="onos ${OC1} remove-intent -p org.onosproject.cli ${fourToOneId}"/>
-        <step name="P2P-Remove-Intent-1-to-4" requires="^"
-              exec="onos ${OC1} remove-intent -p org.onosproject.cli ${oneToFourId}"/>
+        <step name="P2P-Intent.Validate-Intent-XY-Failed" requires="P2P-Intent.Link-2-Down"
+              exec="onos-check-intent ${OC1} xy FAILED"/>
+        <step name="P2P-Intent.Validate-Intent-YX-Failed" requires="P2P-Intent.Link-2-Down"
+              exec="onos-check-intent ${OC1} yx FAILED"/>
+
+        <dependency name="P2P-Intent.Link-1-Up"
+                    requires="~P2P-Intent.Validate-Intent-XY-Failed,
+                              ~P2P-Intent.Validate-Intent-YX-Failed" />
+
+        <step name="P2P-Intent.Validate-Intent-XY-Installed-Again" requires="P2P-Intent.Link-1-Up"
+              exec="onos-check-intent ${OC1} xy INSTALLED"/>
+        <step name="P2P-Intent.Validate-Intent-YX-Installed-Again" requires="P2P-Intent.Link-1-Up"
+              exec="onos-check-intent ${OC1} yx INSTALLED"/>
+
+        <dependency name="P2P-Intent.Ping-4"
+                    requires="~P2P-Intent.Validate-Intent-XY-Installed-Again,
+                              ~P2P-Intent.Validate-Intent-YX-Installed-Again"/>
+
+        <step name="P2P-Intent.Remove-Intent-XY" requires="~P2P-Intent.Net-Link-Down-Up"
+              exec="onos ${OC1} remove-intent -p org.onosproject.cli xy"/>
+        <step name="P2P-Intent.Remove-Intent-YX" requires="~P2P-Intent.Net-Link-Down-Up"
+              exec="onos ${OC1} remove-intent -p org.onosproject.cli yx"/>
     </group>
 </scenario>