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-host-intent.xml b/tools/test/scenarios/net-host-intent.xml
index 88b79bf..fbf8c4a 100644
--- a/tools/test/scenarios/net-host-intent.xml
+++ b/tools/test/scenarios/net-host-intent.xml
@@ -16,36 +16,44 @@
 <scenario name="net-host-intent" description="Network host intent connectivity test">
     <!-- TODO: parametrize this via recipes -->
     <group name="Host-Intent-Connectivity">
-        <step name="Uninstall-Reactive-Forwarding"
+        <step name="Host-Intent.Uninstall-Reactive-Forwarding"
               exec="onos ${OC1} app deactivate org.onosproject.fwd org.onosproject.ifwd"/>
+        <step name="Host-Intent.Check-Apps" requires="^"
+              exec="onos-check-apps ${OC1} fwd,ifwd excludes"/>
 
-        <step name="Find-Host-1" requires="^"
-              exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect ."/>
-        <step name="Find-Host-2" requires="^"
-              exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect ."/>
+        <step name="Host-Intent.Find-Host-1" requires="^"
+              exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect ."/>
+        <step name="Host-Intent.Find-Host-2" requires="^"
+              exec="onos-mininet sendAndExpect h4 ping -c1 -w1 h1 --expect ."/>
 
-        <step name="Create-Intent" requires="^"
-              exec="onos-create-intent ${OC1} hostToHost host 00:00:00:00:00:01/-1 00:00:00:00:00:04/-1"/>
-        <step name="Validate-Intent-Installed" exec="onos-check-intent ${OC1} ${hostToHostId} INSTALLED"
-              requires="Create-Intent" />
+        <step name="Host-Intent.Create-Intent" requires="^"
+              exec="onos-create-intent ${OC1} h2h host 00:00:00:00:00:01/-1 00:00:00:00:00:04/-1"/>
+        <step name="Host-Intent.Validate-Intent-Installed" requires="Host-Intent.Create-Intent"
+              exec="onos-check-intent ${OC1} h2h INSTALLED"/>
 
         <import file="${ONOS_SCENARIOS}/net-link-down-up.xml" namespace="Host-Intent"/>
-        <dependency name="Host-Intent.Net-Link-Down-Up" requires="Validate-Intent-Installed"/>
+        <dependency name="Host-Intent.Net-Link-Down-Up"
+                    requires="Host-Intent.Validate-Intent-Installed"/>
 
-        <step name="Validate-Intent-Installed-Still" exec="onos-check-intent ${OC1} ${hostToHostId} INSTALLED"
-              requires="Host-Intent.Link-1-Down" />
+        <step name="Host-Intent.Validate-Intent-Installed-Still" requires="Host-Intent.Link-1-Down"
+              exec="onos-check-intent ${OC1} h2h INSTALLED"/>
 
-        <step name="Validate-Intent-Failed" exec="onos-check-intent ${OC1} ${hostToHostId} FAILED"
-              requires="Host-Intent.Link-2-Down" />
+        <dependency name="Host-Intent.Link-2-Down"
+                    requires="~Host-Intent.Validate-Intent-Installed-Still" />
 
-        <step name="Validate-Intent-Installed-Again" exec="onos-check-intent ${OC1} ${hostToHostId} INSTALLED"
-              requires="Host-Intent.Link-1-Up" />
-        <dependency name="Host-Intent.Ping-4" requires="Validate-Intent-Installed-Again" />
+        <step name="Host-Intent.Validate-Intent-Failed" requires="Host-Intent.Link-2-Down"
+              exec="onos-check-intent ${OC1} h2h FAILED"/>
 
-        <step name="Remove-Intent" requires="~Host-Intent.Net-Link-Down-Up"
-              exec="onos ${OC1} remove-intent -p"/>
-        
+        <dependency name="Host-Intent.Link-1-Up"
+                    requires="~Host-Intent.Validate-Intent-Failed" />
 
+        <step name="Host-Intent.Validate-Intent-Installed-Again" requires="Host-Intent.Link-1-Up"
+              exec="onos-check-intent ${OC1} h2h INSTALLED"/>
 
+        <dependency name="Host-Intent.Ping-4"
+                    requires="~Host-Intent.Validate-Intent-Installed-Again" />
+
+        <step name="Host-Intent.Remove-Intent" requires="~Host-Intent.Net-Link-Down-Up"
+              exec="onos ${OC1} remove-intent -p org.onosproject.cli h2h"/>
     </group>
 </scenario>