Merge "[ONOS-7671] Fixing Mininet starting up failure on SCPFhostLat test"
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.py b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.py
index 144b4cf..866b273 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.py
@@ -307,7 +307,10 @@
         main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
         setupTest( main, test_idx=202, onosNodes=3 )
         verifyMcastRoutes( main )
-        verifySwitchDown( main, "leaf2", 10, { "ipv4": False, "ipv6": False }, [ "h4v4" ] )
+        verifySwitchDown( main, "leaf2", 10,
+                          { "ipv4": False, "ipv6": False },
+                          [ "h4v4" ],
+                          { "h4v4": ["of:0000000000000002/10", "of:0000000000000003/10"] } )
         verifyMcastRemoval( main, removeDHT1=False )
         lib.cleanup( main, copyKarafLog=False )
 
@@ -327,7 +330,9 @@
         main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
         setupTest( main, test_idx=203, onosNodes=3 )
         verifyMcastRoutes( main )
-        verifySwitchDown( main, "leaf5", 10, hostsToDiscover=[ "h10v4" ] )
+        verifySwitchDown( main, "leaf5", 10,
+                          hostsToDiscover=[ "h10v4" ],
+                          hostLocations={ "h10v4": ["of:0000000000000004/11", "of:0000000000000005/10"] } )
         verifyMcastRemoval( main, removeDHT1=False )
         lib.cleanup( main, copyKarafLog=False )
 
@@ -347,7 +352,11 @@
         main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
         setupTest( main, test_idx=204, onosNodes=3 )
         verifyMcastRoutes( main )
-        verifySwitchDown( main, "leaf4", 10, { "ipv4": [ True, False, True ], "ipv6": True }, [ "h8v4", "h10v4" ] )
+        verifySwitchDown( main, "leaf4", 10,
+                          { "ipv4": [ True, False, True ], "ipv6": True },
+                          [ "h8v4", "h10v4" ],
+                          { "h8v4": ["of:0000000000000004/9"],
+                            "h10v4": ["of:0000000000000004/11", "of:0000000000000005/10"] } )
         verifyMcastRemoval( main, removeDHT1=False )
         lib.cleanup( main, copyKarafLog=False )
 
@@ -367,7 +376,13 @@
         main.mcastRoutes = { "ipv4": { "src": [ 0 ], "dst": [ 0, 1, 2 ] }, "ipv6": { "src": [ 0 ], "dst": [ 0 ] } }
         setupTest( main, test_idx=205, onosNodes=3 )
         verifyMcastRoutes( main )
-        verifySwitchDown( main, [ "leaf1", "leaf3", "leaf4", "leaf5" ], 32, { "ipv4": [ True, False, False ], "ipv6": False }, [ "h4v4", "h8v4", "h10v4", "h1v6"] )
+        verifySwitchDown( main, [ "leaf1", "leaf3", "leaf4", "leaf5" ], 32,
+                          { "ipv4": [ True, False, False ], "ipv6": False },
+                          [ "h4v4", "h8v4", "h10v4", "h1v6"],
+                          { "h4v4": ["of:0000000000000002/10", "of:0000000000000003/10"],
+                            "h8v4": ["of:0000000000000004/9"],
+                            "h10v4": ["of:0000000000000004/11", "of:0000000000000005/10"],
+                            "h1v6": ["of:0000000000000001/3"] } )
         verifyMcastRemoval( main, removeDHT1=False )
         lib.cleanup( main, copyKarafLog=False )
 
@@ -417,7 +432,9 @@
         # Verify killing one link of dual-homed host h10
         verifyPortDown( main, "of:0000000000000004", 11, hostsToDiscover=[ "h10v4" ], hostLocations={ "h10v4": ["of:0000000000000004/11", "of:0000000000000005/10"] } )
         verifyPortDown( main, "of:0000000000000005", 10, hostsToDiscover=[ "h10v4" ], hostLocations={ "h10v4": ["of:0000000000000004/11", "of:0000000000000005/10"] } )
-        verifySwitchDown( main, "leaf3", 10, hostsToDiscover=[ "h4v4" ] )
+        verifySwitchDown( main, "leaf3", 10,
+                          hostsToDiscover=[ "h4v4" ],
+                          hostLocations={ "h4v4": ["of:0000000000000002/10", "of:0000000000000003/10"] } )
         verifyMcastRemoval( main, removeDHT1=False )
         lib.cleanup( main, copyKarafLog=False )
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py
index f598f96..be8e4c9 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py
@@ -42,6 +42,7 @@
     time.sleep( float( main.params[ "timers" ][ "loadNetcfgSleep" ] ) )
     main.cfgName = "common"
     lib.loadMulticastConfig( main )
+    lib.loadHost( main )
 
     if hasattr( main, "Mininet1" ):
         # Run the test with Mininet
@@ -56,6 +57,9 @@
 
     # Create scapy components
     lib.startScapyHosts( main )
+    # Verify host IP assignment
+    lib.verifyOnosHostIp( main )
+    lib.verifyNetworkHostIp( main )
 
 def verifyMcastRoutes( main ):
     """
@@ -180,7 +184,7 @@
     # Recover the switch(es)
     lib.recoverSwitch( main, switchName, int( main.params[ "TOPO" ][ "switchNum" ] ), int( main.params[ "TOPO" ][ "linkNum" ] ), True if hostsToDiscover else False, hostsToDiscover )
     for host, loc in hostLocations.items():
-        lib.verifyHostLocation( host, loc, retry=5 )
+        lib.verifyHostLocation( main, host, loc, retry=5 )
     for routeName in expectList.keys():
         lib.verifyMulticastTraffic( main, routeName, True )
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/host/common.host b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/host/common.host
new file mode 100644
index 0000000..c0dd913
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/host/common.host
@@ -0,0 +1,20 @@
+{
+    "onos":
+    {
+        "00:AA:00:00:00:02/None": "10.2.0.1",
+        "00:AA:00:00:00:03/None": "10.2.30.1",
+        "00:AA:00:00:00:06/None": "10.3.0.1",
+        "00:AA:00:00:00:08/40": "10.3.30.1",
+        "00:BB:00:00:00:01/None": "1000::3fe",
+        "00:BB:00:00:00:02/None": "1002::3fe"
+    },
+    "network":
+    {
+        "h3v4": "10.2.0.1",
+        "h4v4": "10.2.30.1",
+        "h8v4": "10.3.0.1",
+        "h10v4": "10.3.30.1",
+        "h1v6": "1000::3fe",
+        "h3v6": "1002::3fe"
+    }
+}