ONOS-2184 -  virtual network Intents for vnet STC.

Change-Id: Ic6b15ba20b45cae36ec873808641f7a1b9c9aa8c
diff --git a/tools/test/scenarios/net-setup-vnets.xml b/tools/test/scenarios/net-setup-vnets.xml
index 9393cdb..bd58036 100644
--- a/tools/test/scenarios/net-setup-vnets.xml
+++ b/tools/test/scenarios/net-setup-vnets.xml
@@ -16,10 +16,10 @@
 <scenario name="net-setup-vnets" description="Network (vnets) setup steps">
     <group name="Net-Setup-Vnets">
 
-        <step name="Get-TenantId" requires="^" unless="${tenantId}"
+        <step name="Get-TenantId" unless="${tenantId}"
               exec="echo @stc tenantId=TestTenant"/>
 
-        <step name="Create-Tenant" requires="^"
+        <step name="Create-Tenant" requires="~Get-TenantId"
               exec="onos ${OCI} vnet-add-tenant ${tenantId}"/>
 
         <step name="Query-Tenant" requires="^"
@@ -46,8 +46,17 @@
         <step name="Create-Bidirectional-Link" requires="^"
               exec="onos -f ${OCI} vnet-create-link --bidirectional ${networkId} device2 2 device1 1"/>
 
-        <step name="Check-intents-installed" requires="^"
-              exec="onos-check-intent ${OCI} networkId=${networkId} INSTALLED 2"/>
+        <step name="Create-Intent-1" requires="^"
+              exec="onos -f ${OCI} add-vnet-intent --key 21 --encapsulation VLAN ${networkId} device2/2 device1/1"/>
+
+        <step name="Check-intents-installed-1" requires="^"
+              exec="onos-check-intent ${OCI} 21 INSTALLED 1"/>
+
+        <step name="Create-Intent-2" requires="^"
+              exec="onos -f ${OCI} add-vnet-intent --key 12 --encapsulation VLAN ${networkId} device1/1 device2/2"/>
+
+        <step name="Check-intents-installed-2" requires="^"
+              exec="onos-check-intent ${OCI} 12 INSTALLED 1"/>
 
         <step name="Ping-hosts-1" requires="^"
               exec="onos-mininet sendAndExpect h4 ping -c1 h9 --expect \ 0% packet loss"/>
diff --git a/tools/test/scenarios/net-teardown-vnets.xml b/tools/test/scenarios/net-teardown-vnets.xml
index 7c3571f..fe19c33 100644
--- a/tools/test/scenarios/net-teardown-vnets.xml
+++ b/tools/test/scenarios/net-teardown-vnets.xml
@@ -19,15 +19,24 @@
         <step name="Check-NetworkId-Variable-Exists"
               exec="test '${networkId}' != ''"/>
 
+        <step name="Remove-Intent-1" requires="^"
+              exec="onos -f ${OCI} remove-vnet-intent -p ${networkId} org.onosproject.cli 21"/>
+
+        <step name="Check-intents-removed-1" requires="^"
+              exec="onos-check-intent ${OCI} 21 WITHDRAWN 1"/>
+
+        <step name="Remove-Intent-2" requires="^"
+              exec="onos -f ${OCI} remove-vnet-intent -p ${networkId} org.onosproject.cli 12"/>
+
+        <step name="Check-intents-removed-2" requires="^"
+              exec="onos-check-intent ${OCI} 12 WITHDRAWN 1"/>
+
         <step name="Check-Vnet-Link" requires="^"
               exec="onos ${OCI} vnet-links ${networkId}"/>
 
         <step name="Remove-Bidirectional-Link" requires="^"
               exec="onos -f ${OCI} vnet-remove-link --bidirectional ${networkId} device2 2 device1 1"/>
 
-        <step name="Check-intents-removed" requires="^"
-              exec="onos-check-intent ${OCI} networkId=${networkId} IGNORE_STATE 0"/>
-
         <step name="Ping-hosts-2" requires="^"
               exec="onos-mininet sendAndExpect h4 ping -c1 h9 --expect \ 100% packet loss"/>
 
diff --git a/tools/test/scenarios/vnets.xml b/tools/test/scenarios/vnets.xml
index d879f73..57ec4ef 100644
--- a/tools/test/scenarios/vnets.xml
+++ b/tools/test/scenarios/vnets.xml
@@ -17,8 +17,11 @@
 
     <import file="${ONOS_SCENARIOS}/net-setup.xml"/>
 
+    <import file="${ONOS_SCENARIOS}/net-reactive-fwd.xml"/>
+    <dependency name="Net-Reactive-Fwd" requires="Net-Setup"/>
+
     <import file="${ONOS_SCENARIOS}/net-setup-vnets.xml"/>
-    <dependency name="Net-Setup-Vnets" requires="Net-Setup"/>
+    <dependency name="Net-Setup-Vnets" requires="Net-Reactive-Fwd"/>
 
     <import file="${ONOS_SCENARIOS}/net-teardown-vnets.xml"/>
     <dependency name="Net-Teardown-Vnets" requires="Net-Setup-Vnets"/>