Added tests for static route testing.
Change-Id: I087012ff439db50c28a68a3b71092cafeae88339
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index aa9d1a4..7c51b0a 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -250,6 +250,18 @@
else:
main.log.error( "Configuration failed!" )
main.cleanAndExit()
+
+ @staticmethod
+ def addStaticOnosRoute( main, subnet, intf):
+ """
+ Adds an ONOS static route with the use route-add command.
+ """
+ main.step("Add static route for subnet {0} towards router interface {1}".format(subnet, intf))
+ routeResult = main.Cluster.active( 0 ).addStaticRoute(subnet, intf)
+
+ utilities.assert_equals( expect=True, actual=( not routeResult ),
+ onpass="route-add command succeeded",
+ onfail="route-add command failed")
@staticmethod
def checkFlows( main, minFlowCount, tag="", dumpflows=True, sleep=10 ):
@@ -776,3 +788,4 @@
utilities.assert_equals( expect=main.TRUE, actual=ipResult,
onpass="Verify ONOS host IP succeded",
onfail="Verify ONOS host IP failed" )
+
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py b/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py
index 568760b..08ccd1a 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py
@@ -300,7 +300,9 @@
'r1-eth1': {'ipAddrs': ['10.0.5.1/24', '2000::501/120'], 'mac': '00:88:00:00:00:11'},
'r1-eth2': {'ipAddrs': ['10.0.99.1/16']},
'r1-eth3': {'ipAddrs': ['2000::9901/120']},
- 'r1-eth4': {'ipAddrs': ['2000::7701/120']}}
+ 'r1-eth4': {'ipAddrs': ['2000::7701/120']},
+ 'r1-eth5': {'ipAddrs': ['10.0.88.1/24']},
+ 'r1-eth6': {'ipAddrs': ['2000::8701/120']}}
r1 = self.addHost('r1', cls=BgpRouter,
interfaces=intfs,
quaggaConfFile='./bgpdr1.conf')
@@ -319,6 +321,16 @@
rh11v6 = self.addHost('rh11v6', cls=RoutedHost, ips=['2000::7702/120'], gateway='2000::7701')
self.addLink(r1, rh11v6)
+ # Add an external ipv4 hosts that is not configured in the bgp conf
+ # files
+ rh5v4 = self.addHost('rh5v4', cls=RoutedHost, ips=['10.0.88.2/24'], gateway='10.0.88.1')
+ self.addLink(r1, rh5v4)
+
+ # Add an external ipv6 hosts that is not configured in the bgp conf
+ # files
+ rh5v6 = self.addHost('rh5v6', cls=RoutedHost, ips=['2000::8702/120'], gateway='2000::8701')
+ self.addLink(r1, rh5v6)
+
# External Quagga r2
intfs = {'r2-eth0': {'ipAddrs': ['10.0.6.1/24', '2000::601/120'], 'mac': '00:88:00:00:00:02'},
'r2-eth1': {'ipAddrs': ['10.0.7.1/24', '2000::701/120'], 'mac': '00:88:00:00:00:22'},