blob: c79a44697c0214d40704e212adf9ae2387c03a9d [file] [log] [blame]
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -08001"""
2Copyright 2017 Open Networking Foundation ( ONF )
3
4Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
5the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
6or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
7
8 TestON is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 2 of the License, or
11 ( at your option ) any later version.
12
13 TestON is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with TestON. If not, see <http://www.gnu.org/licenses/>.
20"""
21
22from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
23
24class SRRoutingTest ():
25
26 topo = {}
27
28 def __init__( self ):
29 self.default = ''
30
31 @staticmethod
Andreas Pantelopoulosb7904ce2018-02-07 16:24:49 -080032 def runTest( main, test_idx, onosNodes, dhcp, routers, ipv4, ipv6, description):
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -080033
34 skipPackage = False
35 init = False
36 if not hasattr( main, 'apps' ):
37 init = True
38 run.initTest( main )
39
40 # Skip onos packaging if the cluster size stays the same
41 if not init and onosNodes == main.Cluster.numCtrls:
42 skipPackage = True
43
44 main.case('%s, ONOS instance%s' %
45 (description, onosNodes))
46
47 main.cfgName = 'COMCAST_CONFIG_ipv4=%d_ipv6=%d_dhcp=%d_routers=%d' % \
48 (ipv4, ipv6, dhcp, routers)
49 main.configPath = main.path + "/dependencies/"
50 main.resultFileName = 'CASE%02d' % test_idx
51 main.Cluster.setRunningNode(onosNodes)
52
53 run.installOnos(main, skipPackage=skipPackage, cliSleep=5,
54 parallel=False)
55
56 if hasattr(main, 'Mininet1'):
57 # Run the test with Mininet
58 mininet_args = ' --dhcp=%s --routers=%s --ipv6=%s --ipv4=%s' % (dhcp, routers, ipv6, ipv4)
59 run.startMininet(main, 'comcast_fabric.py', args=mininet_args)
60 else:
61 # Run the test with physical devices
62 # TODO: connect TestON to the physical network
63 pass
64
65 # ping hosts
Andreas Pantelopoulosb7904ce2018-02-07 16:24:49 -080066 main.Network.pingAll()
Andreas Pantelopoulos90f0b102018-02-01 13:21:45 -080067
68 if hasattr(main, 'Mininet1'):
69 run.cleanup(main)
70 else:
71 # TODO: disconnect TestON from the physical network
72 pass