blob: a6c2019ed2cbbb3f540538a25a1eaaadc9fe3da6 [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
2Copyright 2015 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
pingping-lin4ed949d2015-08-13 17:15:48 -070022class SDNIPperf:
23
24 def __init__( self ):
25 self.default = ''
26 global branchName
27
28 # This case is to setup ONOS
29 def CASE100( self, main ):
30 """
31 CASE100 is to compile ONOS and push it to the test machines
32 Startup sequence:
33 cell <name>
34 onos-verify-cell
35 git pull
36 mvn clean install
37 onos-package
38 onos-install -f
39 onos-wait-for-start
40 """
Devin Lim58046fa2017-07-05 16:55:00 -070041 try:
42 from tests.dependencies.ONOSSetup import ONOSSetup
43 main.testSetUp = ONOSSetup()
44 except ImportError:
45 main.log.error( "ONOSSetup not found. exiting the test" )
46 main.exit()
47 main.testSetUp.envSetupDescription()
48 stepResult = main.FALSE
pingping-lin4ed949d2015-08-13 17:15:48 -070049
Devin Lim58046fa2017-07-05 16:55:00 -070050 try:
51 cellName = main.params[ 'ENV' ][ 'cellName' ]
52 ONOS1Ip = main.params['CTRL']['ip1']
53 stepResult = main.testSetUp.envSetup( specificIp=ONOS1Ip )
54 except Exception as e:
55 main.testSetUp.envSetupException( e )
56 main.testSetUp.evnSetupConclusion( stepResult )
pingping-lin4ed949d2015-08-13 17:15:48 -070057
Devin Lim58046fa2017-07-05 16:55:00 -070058 case1Result = main.testSetUp.ONOSSetUp( "", newCell=False, cellname=cellName )
pingping-lin4ed949d2015-08-13 17:15:48 -070059
60 if case1Result == main.FALSE:
61 main.cleanup()
62 main.exit()
63
64 def CASE9( self, main ):
65 """
66 Test the SDN-IP Performance
67 Test whether SDN-IP can boot with 600,000 routes from an external peer.
68 Since our goal for SDN-IP is to handle 600,000 routes, in this test case
69 we statically configure an external peer Quagga with 655360 routes.
70 Thus, we pre-know the routes and intents it should be, and then boot the
71 whole system and check whether the numbers of routes and intents from
72 ONOS CLI are correct.
73 """
74 import time
75 import json
76 from operator import eq
77 from time import localtime, strftime
78
79 # We configured one external BGP peer with 655360 routes
80 routeNumberExpected = 655360
81 m2SIntentsNumberExpected = 655360
82
83 main.case("This case is to testing the performance of SDN-IP with \
84 single ONOS instance" )
85 time.sleep( 10 )
86
87 main.step( "Get devices in the network" )
Devin Lim58046fa2017-07-05 16:55:00 -070088 listResult = main.ONOScli1.devices( jsonFormat=False )
pingping-lin4ed949d2015-08-13 17:15:48 -070089 main.log.info( listResult )
90
91 main.step( "Get links in the network" )
Devin Lim58046fa2017-07-05 16:55:00 -070092 listResult = main.ONOScli1.links ( jsonFormat=False )
pingping-lin4ed949d2015-08-13 17:15:48 -070093 main.log.info( listResult )
94
95 main.log.info( "Activate sdn-ip application" )
Devin Lim58046fa2017-07-05 16:55:00 -070096 main.ONOScli1.activateApp( "org.onosproject.sdnip" )
pingping-lin4ed949d2015-08-13 17:15:48 -070097
98 main.step("Sleep 1200 seconds")
99 # wait until SDN-IP receives all routes and ONOS installs all intents
pingping-lin6f919c32015-08-25 14:04:33 -0700100 time.sleep( int(main.params[ 'timers' ][ 'SystemBoot' ]) )
pingping-lin4ed949d2015-08-13 17:15:48 -0700101
102 main.step( "Checking routes installed" )
103
104 main.log.info( "Total route number expected is:" )
105 main.log.info( routeNumberExpected )
106
Devin Lim58046fa2017-07-05 16:55:00 -0700107 routeNumberActual = main.ONOScli1.ipv4RouteNumber()
pingping-lin4ed949d2015-08-13 17:15:48 -0700108 main.log.info("Total route number actual is: ")
109 main.log.info(routeNumberActual)
110
111 utilities.assertEquals(
112 expect=routeNumberExpected, actual=routeNumberActual,
113 onpass="***Routes in SDN-IP are correct!***",
114 onfail="***Routes in SDN-IP are wrong!***" )
115
116
117 main.step( "Checking MultiPointToSinglePointIntent intents installed" )
118
119 main.log.info( "MultiPointToSinglePoint intent number expected is:" )
120 main.log.info( m2SIntentsNumberExpected )
121
Devin Lim58046fa2017-07-05 16:55:00 -0700122 m2SIntentsNumberActual = main.ONOScli1.m2SIntentInstalledNumber()
pingping-lin4ed949d2015-08-13 17:15:48 -0700123 main.log.info( "MultiPointToSinglePoint intent number actual is:" )
124 main.log.info(m2SIntentsNumberActual)
125
126 utilities.assertEquals(
127 expect=True,
128 actual=eq( m2SIntentsNumberExpected, m2SIntentsNumberActual ),
129 onpass="***MultiPointToSinglePoint intent number is correct!***",
130 onfail="***MultiPointToSinglePoint intent number is wrong!***" )