blob: 772dad8eb8f2e7edc9592dd2edab9962d7405208 [file] [log] [blame]
pingping-lin4ed949d2015-08-13 17:15:48 -07001class SDNIPperf:
2
3 def __init__( self ):
4 self.default = ''
5 global branchName
6
7 # This case is to setup ONOS
8 def CASE100( self, main ):
9 """
10 CASE100 is to compile ONOS and push it to the test machines
11 Startup sequence:
12 cell <name>
13 onos-verify-cell
14 git pull
15 mvn clean install
16 onos-package
17 onos-install -f
18 onos-wait-for-start
19 """
Devin Lim58046fa2017-07-05 16:55:00 -070020 try:
21 from tests.dependencies.ONOSSetup import ONOSSetup
22 main.testSetUp = ONOSSetup()
23 except ImportError:
24 main.log.error( "ONOSSetup not found. exiting the test" )
25 main.exit()
26 main.testSetUp.envSetupDescription()
27 stepResult = main.FALSE
pingping-lin4ed949d2015-08-13 17:15:48 -070028
Devin Lim58046fa2017-07-05 16:55:00 -070029 try:
30 cellName = main.params[ 'ENV' ][ 'cellName' ]
31 ONOS1Ip = main.params['CTRL']['ip1']
32 stepResult = main.testSetUp.envSetup( specificIp=ONOS1Ip )
33 except Exception as e:
34 main.testSetUp.envSetupException( e )
35 main.testSetUp.evnSetupConclusion( stepResult )
pingping-lin4ed949d2015-08-13 17:15:48 -070036
Devin Lim58046fa2017-07-05 16:55:00 -070037 case1Result = main.testSetUp.ONOSSetUp( "", newCell=False, cellname=cellName )
pingping-lin4ed949d2015-08-13 17:15:48 -070038
39 if case1Result == main.FALSE:
40 main.cleanup()
41 main.exit()
42
43 def CASE9( self, main ):
44 """
45 Test the SDN-IP Performance
46 Test whether SDN-IP can boot with 600,000 routes from an external peer.
47 Since our goal for SDN-IP is to handle 600,000 routes, in this test case
48 we statically configure an external peer Quagga with 655360 routes.
49 Thus, we pre-know the routes and intents it should be, and then boot the
50 whole system and check whether the numbers of routes and intents from
51 ONOS CLI are correct.
52 """
53 import time
54 import json
55 from operator import eq
56 from time import localtime, strftime
57
58 # We configured one external BGP peer with 655360 routes
59 routeNumberExpected = 655360
60 m2SIntentsNumberExpected = 655360
61
62 main.case("This case is to testing the performance of SDN-IP with \
63 single ONOS instance" )
64 time.sleep( 10 )
65
66 main.step( "Get devices in the network" )
Devin Lim58046fa2017-07-05 16:55:00 -070067 listResult = main.ONOScli1.devices( jsonFormat=False )
pingping-lin4ed949d2015-08-13 17:15:48 -070068 main.log.info( listResult )
69
70 main.step( "Get links in the network" )
Devin Lim58046fa2017-07-05 16:55:00 -070071 listResult = main.ONOScli1.links ( jsonFormat=False )
pingping-lin4ed949d2015-08-13 17:15:48 -070072 main.log.info( listResult )
73
74 main.log.info( "Activate sdn-ip application" )
Devin Lim58046fa2017-07-05 16:55:00 -070075 main.ONOScli1.activateApp( "org.onosproject.sdnip" )
pingping-lin4ed949d2015-08-13 17:15:48 -070076
77 main.step("Sleep 1200 seconds")
78 # wait until SDN-IP receives all routes and ONOS installs all intents
pingping-lin6f919c32015-08-25 14:04:33 -070079 time.sleep( int(main.params[ 'timers' ][ 'SystemBoot' ]) )
pingping-lin4ed949d2015-08-13 17:15:48 -070080
81 main.step( "Checking routes installed" )
82
83 main.log.info( "Total route number expected is:" )
84 main.log.info( routeNumberExpected )
85
Devin Lim58046fa2017-07-05 16:55:00 -070086 routeNumberActual = main.ONOScli1.ipv4RouteNumber()
pingping-lin4ed949d2015-08-13 17:15:48 -070087 main.log.info("Total route number actual is: ")
88 main.log.info(routeNumberActual)
89
90 utilities.assertEquals(
91 expect=routeNumberExpected, actual=routeNumberActual,
92 onpass="***Routes in SDN-IP are correct!***",
93 onfail="***Routes in SDN-IP are wrong!***" )
94
95
96 main.step( "Checking MultiPointToSinglePointIntent intents installed" )
97
98 main.log.info( "MultiPointToSinglePoint intent number expected is:" )
99 main.log.info( m2SIntentsNumberExpected )
100
Devin Lim58046fa2017-07-05 16:55:00 -0700101 m2SIntentsNumberActual = main.ONOScli1.m2SIntentInstalledNumber()
pingping-lin4ed949d2015-08-13 17:15:48 -0700102 main.log.info( "MultiPointToSinglePoint intent number actual is:" )
103 main.log.info(m2SIntentsNumberActual)
104
105 utilities.assertEquals(
106 expect=True,
107 actual=eq( m2SIntentsNumberExpected, m2SIntentsNumberActual ),
108 onpass="***MultiPointToSinglePoint intent number is correct!***",
109 onfail="***MultiPointToSinglePoint intent number is wrong!***" )