[ONOS-7736] Host movement tests for dual-homed hosts
Change-Id: I8f0be6af4a5c8f1e8e2562a6fbc061b7d6f35439
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 6c44c63..1838fc3 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -1277,7 +1277,7 @@
if ip == ipAddr:
vlan = hostName.split( "/" )[ -1 ]
del main.expectedHosts[ "onos" ][ hostName ]
- main.expectedHosts[ "onos" ][ "{}/{}".format( macAddr, vlan ) ] = ip
+ main.expectedHosts[ "onos" ][ "{}/{}".format( macAddr.upper(), vlan ) ] = ip
break
@staticmethod
@@ -1298,25 +1298,27 @@
macAddr: if specified, change MAC address of the host to the specified MAC address.
prefixLen: prefix length
cfg: port configurations as JSON string
- ipv6: Use True to move IPv6 host (IPv6 is not supported now.)
+ ipv6: Use True to move IPv6 host
"""
- # TODO: support IPv6 hosts and vlan-tagged hosts.
+ # TODO: support vlan-tagged hosts.
if not hasattr( main, 'Mininet1' ):
main.log.warn( "moveDualHomedHost is supposed to be used only in Mininet." )
return
+ main.step( "Moving host {} from {} and {} to {} and {}".format( hostName, srcSw, srcPairSw,
+ dstSw, dstPairSw ) )
if ipv6:
- main.log.warn( "Moving IPv6 host is not implemented yet." )
- return
-
- main.Mininet1.moveDualHomedHost( hostName, srcSw, srcPairSw, dstSw, dstPairSw,
- macAddr=macAddr, prefixLen=prefixLen )
-
- main.Mininet1.changeDefaultGateway( hostName, gw )
-
+ main.Mininet1.moveDualHomedHostv6( hostName, srcSw, srcPairSw, dstSw, dstPairSw,
+ macAddr=macAddr, prefixLen=prefixLen )
+ else:
+ main.Mininet1.moveDualHomedHost( hostName, srcSw, srcPairSw, dstSw, dstPairSw,
+ macAddr=macAddr, prefixLen=prefixLen )
+ main.Mininet1.changeDefaultGateway( hostName, gw )
if cfg:
main.Cluster.active( 0 ).REST.setNetCfg( json.loads( cfg ),
subjectClass="ports" )
+ # Wait for the host to get RA for setting up default gateway
+ time.sleep( 5 )
main.Mininet1.discoverHosts( [ hostName, ] )
@@ -1328,4 +1330,4 @@
if ip == ipAddr:
vlan = hostName.split( "/" )[ -1 ]
del main.expectedHosts[ "onos" ][ hostName ]
- main.expectedHosts[ "onos" ][ "{}/{}".format( macAddr, vlan ) ] = ip
+ main.expectedHosts[ "onos" ][ "{}/{}".format( macAddr.upper(), vlan ) ] = ip