diff --git a/mininet/test/test_nets.py b/mininet/test/test_nets.py index 87dca058044b8d6c8ff1e6f9b6d6041f7e816c28..215b1867c5f4cca418dd566aae97d922497a01e7 100755 --- a/mininet/test/test_nets.py +++ b/mininet/test/test_nets.py @@ -7,7 +7,7 @@ from time import sleep import unittest -from mininet.mininet import init, TreeNet, pingTest, DATAPATHS +from mininet.mininet import init, TreeNet, LinearNet, pingTest, DATAPATHS class testMinimal(unittest.TestCase): '''For each datapath type, test ping with a minimal topology. @@ -16,7 +16,7 @@ class testMinimal(unittest.TestCase): ''' def testMinimal(self): - '''Ping test with user-space datapath on minimal topology''' + '''Ping test with both datapaths on minimal topology''' init() for datapath in DATAPATHS: k = datapath == 'kernel' @@ -29,7 +29,7 @@ class testTree(unittest.TestCase): '''For each datapath type, test all-pairs ping with TreeNet.''' def testTree16(self): - '''Ping test with user-space datapath on minimal topology''' + '''Ping test with both datapaths on 16-host topology''' init() for datapath in DATAPATHS: k = datapath == 'kernel' @@ -38,5 +38,18 @@ def testTree16(self): self.assertEqual(dropped, 0) +class testLinear(unittest.TestCase): + '''For each datapath type, test all-pairs ping with LinearNet.''' + + def testLinear10(self): + '''Ping test with both datapaths on 10-switch topology''' + init() + for datapath in DATAPATHS: + k = datapath == 'kernel' + network = network = LinearNet(10, kernel=k) + dropped = network.run(pingTest) + self.assertEqual(dropped, 0) + + if __name__ == '__main__': unittest.main() \ No newline at end of file