blob: 7957776751a502fdd7e749abc29baafe0425e6ba [file] [log] [blame]
pingping-lin3d87a132014-12-04 14:22:49 -08001# from cupshelpers.config import prefix
pingping-lin8b306ac2014-11-17 18:13:51 -08002
pingping-linc6b86fa2014-12-01 16:18:10 -08003# Testing the basic functionality of SDN-IP
pingping-lin8b306ac2014-11-17 18:13:51 -08004
kelvin-onlab8a832582015-01-16 17:06:11 -08005
pingping-lin8b306ac2014-11-17 18:13:51 -08006class SdnIpTest:
kelvin-onlab8a832582015-01-16 17:06:11 -08007
8 def __init__( self ):
pingping-lin8b306ac2014-11-17 18:13:51 -08009 self.default = ''
10
pingping-linc1c696e2015-01-27 13:46:44 -080011# from cupshelpers.config import prefix
12
13# Testing the basic functionality of SDN-IP
14
15
16class SdnIpTest:
17
18 def __init__( self ):
19 self.default = ''
20
21 def CASE4( self, main ):
kelvin-onlab8a832582015-01-16 17:06:11 -080022 """
pingping-lin8b306ac2014-11-17 18:13:51 -080023 Test the SDN-IP functionality
pingping-linc1c696e2015-01-27 13:46:44 -080024 allRoutesExpected: all expected routes for all BGP peers
25 routeIntentsExpected: all expected MultiPointToSinglePointIntent intents
26 bgpIntentsExpected: expected PointToPointIntent intents
27 allRoutesActual: all routes from ONOS LCI
28 routeIntentsActual: actual MultiPointToSinglePointIntent intents from ONOS CLI
29 bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
kelvin-onlab8a832582015-01-16 17:06:11 -080030 """
pingping-lin8b306ac2014-11-17 18:13:51 -080031 import time
32 import json
33 from operator import eq
pingping-linc6b86fa2014-12-01 16:18:10 -080034 # from datetime import datetime
pingping-lin01355a62014-12-02 20:58:14 -080035 from time import localtime, strftime
pingping-linc6b86fa2014-12-01 16:18:10 -080036
kelvin-onlab8a832582015-01-16 17:06:11 -080037 main.case(
38 "The test case is to help to setup the TestON environment and test new drivers" )
pingping-linc1c696e2015-01-27 13:46:44 -080039 # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
40 SDNIPJSONFILEPATH = "/home/admin/workspace/onos/tools/package/config/sdnip.json"
pingping-lin6f6332e2014-11-19 19:13:58 -080041 # all expected routes for all BGP peers
pingping-linc1c696e2015-01-27 13:46:44 -080042 allRoutesExpected = []
kelvin-onlab8a832582015-01-16 17:06:11 -080043 main.step( "Start to generate routes for all BGP peers" )
kelvin-onlab8a832582015-01-16 17:06:11 -080044 main.log.info( "Generate prefixes for host3" )
pingping-linc1c696e2015-01-27 13:46:44 -080045 prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
46 main.log.info( prefixesHost3 )
pingping-lin36fbe802014-11-25 16:01:14 -080047 # generate route with next hop
pingping-linc1c696e2015-01-27 13:46:44 -080048 for prefix in prefixesHost3:
49 allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
50 routeIntentsExpectedHost3 = main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
51 prefixesHost3, "192.168.20.1", "00:00:00:00:02:02", SDNIPJSONFILEPATH )
pingping-lin6f6332e2014-11-19 19:13:58 -080052
kelvin-onlab8a832582015-01-16 17:06:11 -080053 main.log.info( "Generate prefixes for host4" )
pingping-linc1c696e2015-01-27 13:46:44 -080054 prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
55 main.log.info( prefixesHost4 )
pingping-lin36fbe802014-11-25 16:01:14 -080056 # generate route with next hop
pingping-linc1c696e2015-01-27 13:46:44 -080057 for prefix in prefixesHost4:
58 allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
59 routeIntentsExpectedHost4 = main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
60 prefixesHost4, "192.168.30.1", "00:00:00:00:03:01", SDNIPJSONFILEPATH )
pingping-lin6f6332e2014-11-19 19:13:58 -080061
pingping-linc1c696e2015-01-27 13:46:44 -080062 main.log.info( "Generate prefixes for host5" )
63 prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
64 main.log.info( prefixesHost5 )
65 for prefix in prefixesHost5:
66 allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
67 routeIntentsExpectedHost5 = main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
68 prefixesHost5, "192.168.60.1", "00:00:00:00:06:02", SDNIPJSONFILEPATH )
pingping-lin8b306ac2014-11-17 18:13:51 -080069
pingping-linc1c696e2015-01-27 13:46:44 -080070 routeIntentsExpected = routeIntentsExpectedHost3 + \
71 routeIntentsExpectedHost4 + routeIntentsExpectedHost5
72
73 cellName = main.params[ 'ENV' ][ 'cellName' ]
74 ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
kelvin-onlab8a832582015-01-16 17:06:11 -080075 main.step( "Set cell for ONOS-cli environment" )
pingping-linc1c696e2015-01-27 13:46:44 -080076 main.ONOScli.setCell( cellName )
77 verifyResult = main.ONOSbench.verifyCell()
pingping-lin8b306ac2014-11-17 18:13:51 -080078
pingping-linc1c696e2015-01-27 13:46:44 -080079 main.log.report( "Removing raft logs" )
80 main.ONOSbench.onosRemoveRaftLogs()
81 main.log.report( "Uninstalling ONOS" )
82 main.ONOSbench.onosUninstall( ONOS1Ip )
83
kelvin-onlab8a832582015-01-16 17:06:11 -080084 main.step( "Installing ONOS package" )
pingping-linc1c696e2015-01-27 13:46:44 -080085 onos1InstallResult = main.ONOSbench.onosInstall(
86 options="-f", node=ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -080087
kelvin-onlab8a832582015-01-16 17:06:11 -080088 main.step( "Checking if ONOS is up yet" )
pingping-linc1c696e2015-01-27 13:46:44 -080089 time.sleep( 150 )
90 onos1Isup = main.ONOSbench.isup( ONOS1Ip )
91 if not onos1Isup:
kelvin-onlab8a832582015-01-16 17:06:11 -080092 main.log.report( "ONOS1 didn't start!" )
pingping-linc6b86fa2014-12-01 16:18:10 -080093
kelvin-onlab8a832582015-01-16 17:06:11 -080094 main.step( "Start ONOS-cli" )
pingping-linc6b86fa2014-12-01 16:18:10 -080095
pingping-linc1c696e2015-01-27 13:46:44 -080096 main.ONOScli.startOnosCli( ONOS1Ip )
pingping-lin8b306ac2014-11-17 18:13:51 -080097
kelvin-onlab8a832582015-01-16 17:06:11 -080098 main.step( "Get devices in the network" )
pingping-linc1c696e2015-01-27 13:46:44 -080099 listResult = main.ONOScli.devices( jsonFormat=False )
100 main.log.info( listResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800101 time.sleep( 10 )
102 main.log.info( "Installing sdn-ip feature" )
pingping-linc1c696e2015-01-27 13:46:44 -0800103 main.ONOScli.featureInstall( "onos-app-sdnip" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800104 time.sleep( 10 )
105 main.step( "Login all BGP peers and add routes into peers" )
pingping-linc1c696e2015-01-27 13:46:44 -0800106
kelvin-onlab8a832582015-01-16 17:06:11 -0800107 main.log.info( "Login Quagga CLI on host3" )
108 main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
109 main.log.info( "Enter configuration model of Quagga CLI on host3" )
pingping-linc1c696e2015-01-27 13:46:44 -0800110 main.QuaggaCliHost3.enterConfig( 64514 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800111 main.log.info( "Add routes to Quagga on host3" )
pingping-linc1c696e2015-01-27 13:46:44 -0800112 main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
pingping-linbc230942014-12-03 18:36:27 -0800113
kelvin-onlab8a832582015-01-16 17:06:11 -0800114 main.log.info( "Login Quagga CLI on host4" )
115 main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
116 main.log.info( "Enter configuration model of Quagga CLI on host4" )
pingping-linc1c696e2015-01-27 13:46:44 -0800117 main.QuaggaCliHost4.enterConfig( 64516 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800118 main.log.info( "Add routes to Quagga on host4" )
pingping-linc1c696e2015-01-27 13:46:44 -0800119 main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
120
121 main.log.info( "Login Quagga CLI on host5" )
122 main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
123 main.log.info( "Enter configuration model of Quagga CLI on host5" )
124 main.QuaggaCliHost5.enterConfig( 64521 )
125 main.log.info( "Add routes to Quagga on host5" )
126 main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
127
128 for i in range( 101, 201 ):
129 prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
130 main.log.info( prefixesHostX )
131 for prefix in prefixesHostX:
132 allRoutesExpected.append(
133 prefix + "/" + "192.168.40." + str( i - 100 ) )
134
135 routeIntentsExpectedHostX = main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
136 prefixesHostX, "192.168.40." + str( i - 100 ), "00:00:%02d:00:00:90" %
137 ( i - 101 ), SDNIPJSONFILEPATH )
138 routeIntentsExpected = routeIntentsExpected + \
139 routeIntentsExpectedHostX
140
141 main.log.info( "Login Quagga CLI on host" + str( i ) )
142 QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
143 QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
144 main.log.info(
145 "Enter configuration model of Quagga CLI on host" + str( i ) )
146 QuaggaCliHostX.enterConfig( 65000 + i - 100 )
147 main.log.info( "Add routes to Quagga on host" + str( i ) )
148 QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
149
kelvin-onlab8a832582015-01-16 17:06:11 -0800150 time.sleep( 60 )
pingping-lin8b306ac2014-11-17 18:13:51 -0800151
pingping-linc1c696e2015-01-27 13:46:44 -0800152 # get routes inside SDN-IP
153 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
pingping-linc6b86fa2014-12-01 16:18:10 -0800154
pingping-lin8b306ac2014-11-17 18:13:51 -0800155 # parse routes from ONOS CLI
pingping-linc1c696e2015-01-27 13:46:44 -0800156 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
157 getRoutesResult )
pingping-linc6b86fa2014-12-01 16:18:10 -0800158
pingping-linc1c696e2015-01-27 13:46:44 -0800159 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
160 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800161 main.step( "Check routes installed" )
162 main.log.info( "Routes expected:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800163 main.log.info( allRoutesStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800164 main.log.info( "Routes get from ONOS CLI:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800165 main.log.info( allRoutesStrActual )
166 utilities.assertEquals(
167 expect=allRoutesStrExpected, actual=allRoutesStrActual,
168 onpass="***Routes in SDN-IP are correct!***",
169 onfail="***Routes in SDN-IP are wrong!***" )
170 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800171 main.log.report(
172 "***Routes in SDN-IP after adding routes are correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800173 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800174 main.log.report(
175 "***Routes in SDN-IP after adding routes are wrong!***" )
pingping-lin8b306ac2014-11-17 18:13:51 -0800176
kelvin-onlab8a832582015-01-16 17:06:11 -0800177 time.sleep( 20 )
pingping-linc1c696e2015-01-27 13:46:44 -0800178 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin6f6332e2014-11-19 19:13:58 -0800179
kelvin-onlab8a832582015-01-16 17:06:11 -0800180 main.step( "Check MultiPointToSinglePointIntent intents installed" )
pingping-linc1c696e2015-01-27 13:46:44 -0800181 # routeIntentsExpected are generated when generating routes
pingping-lin6f6332e2014-11-19 19:13:58 -0800182 # get rpoute intents from ONOS CLI
pingping-linc1c696e2015-01-27 13:46:44 -0800183 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
184 getIntentsResult )
185 routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
186 routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800187 main.log.info( "MultiPointToSinglePoint intents expected:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800188 main.log.info( routeIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800189 main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800190 main.log.info( routeIntentsStrActual )
191 utilities.assertEquals(
192 expect=True, actual=eq(
193 routeIntentsStrExpected, routeIntentsStrActual ),
194 onpass="***MultiPointToSinglePoint Intents in SDN-IP are correct!***",
195 onfail="***MultiPointToSinglePoint Intents in SDN-IP are wrong!***" )
pingping-lin6f6332e2014-11-19 19:13:58 -0800196
pingping-linc1c696e2015-01-27 13:46:44 -0800197 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800198 main.log.report(
199 "***MultiPointToSinglePoint Intents before deleting routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800200 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800201 main.log.report(
202 "***MultiPointToSinglePoint Intents before deleting routes wrong!***" )
pingping-lin6f6332e2014-11-19 19:13:58 -0800203
kelvin-onlab8a832582015-01-16 17:06:11 -0800204 main.step( "Check BGP PointToPointIntent intents installed" )
pingping-lin6f6332e2014-11-19 19:13:58 -0800205 # bgp intents expected
pingping-linc1c696e2015-01-27 13:46:44 -0800206 bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
207 SDNIPJSONFILEPATH )
pingping-lin6f6332e2014-11-19 19:13:58 -0800208 # get BGP intents from ONOS CLI
pingping-linc1c696e2015-01-27 13:46:44 -0800209 bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
210 getIntentsResult )
pingping-lin3228e132014-11-20 17:49:02 -0800211
pingping-linc1c696e2015-01-27 13:46:44 -0800212 bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
213 bgpIntentsStrActual = str( bgpIntentsActual )
kelvin-onlab8a832582015-01-16 17:06:11 -0800214 main.log.info( "PointToPointIntent intents expected:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800215 main.log.info( bgpIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800216 main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800217 main.log.info( bgpIntentsStrActual )
pingping-lin3228e132014-11-20 17:49:02 -0800218
pingping-linc1c696e2015-01-27 13:46:44 -0800219 utilities.assertEquals(
220 expect=True, actual=eq(
221 bgpIntentsStrExpected, bgpIntentsStrActual ),
222 onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
223 onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin8b306ac2014-11-17 18:13:51 -0800224
pingping-linc1c696e2015-01-27 13:46:44 -0800225 if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800226 main.log.report(
227 "***PointToPointIntent Intents in SDN-IP are correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800228 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800229 main.log.report(
230 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800231
pingping-linc6b86fa2014-12-01 16:18:10 -0800232 #============================= Ping Test ========================
233 # wait until all MultiPointToSinglePoint
kelvin-onlab8a832582015-01-16 17:06:11 -0800234 time.sleep( 20 )
pingping-linc1c696e2015-01-27 13:46:44 -0800235 pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
236 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-before-delete-routes-" + \
kelvin-onlab8a832582015-01-16 17:06:11 -0800237 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
pingping-linc1c696e2015-01-27 13:46:44 -0800238 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -0800239 "1.168.30.100",
pingping-linc1c696e2015-01-27 13:46:44 -0800240 pingTestScript,
241 pingTestResultsFile )
242 main.log.info( pingTestResults )
243 time.sleep( 20 )
pingping-linc6b86fa2014-12-01 16:18:10 -0800244
245 #============================= Deleting Routes ==================
kelvin-onlab8a832582015-01-16 17:06:11 -0800246 main.step( "Check deleting routes installed" )
pingping-linc1c696e2015-01-27 13:46:44 -0800247 main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
248 main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
249 main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
pingping-linc6b86fa2014-12-01 16:18:10 -0800250
pingping-linc1c696e2015-01-27 13:46:44 -0800251 for i in range( 101, 201 ):
252 prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
253 main.log.info( prefixesHostX )
254 QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
255 QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
256
257 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
258 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
259 getRoutesResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800260 main.log.info( "allRoutes_actual = " )
pingping-linc1c696e2015-01-27 13:46:44 -0800261 main.log.info( allRoutesActual )
pingping-linc6b86fa2014-12-01 16:18:10 -0800262
pingping-linc1c696e2015-01-27 13:46:44 -0800263 utilities.assertEquals( expect="[]", actual=str( allRoutesActual ),
264 onpass="***Route number in SDN-IP is 0, correct!***",
265 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
pingping-linc6b86fa2014-12-01 16:18:10 -0800266
pingping-linc1c696e2015-01-27 13:46:44 -0800267 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800268 main.log.report( "***Routes in SDN-IP after deleting correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800269 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800270 main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800271
kelvin-onlab8a832582015-01-16 17:06:11 -0800272 main.step( "Check intents after deleting routes" )
pingping-linc1c696e2015-01-27 13:46:44 -0800273 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
274 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
275 getIntentsResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800276 main.log.info( "main.ONOScli.intents()= " )
pingping-linc1c696e2015-01-27 13:46:44 -0800277 main.log.info( routeIntentsActual )
278 utilities.assertEquals( expect="[]", actual=str( routeIntentsActual ),
279 onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, correct!***",
280 onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, wrong!***" )
pingping-linc6b86fa2014-12-01 16:18:10 -0800281
pingping-linc1c696e2015-01-27 13:46:44 -0800282 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800283 main.log.report(
284 "***MultiPointToSinglePoint Intents after deleting routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800285 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800286 main.log.report(
287 "***MultiPointToSinglePoint Intents after deleting routes wrong!***" )
pingping-linc6b86fa2014-12-01 16:18:10 -0800288
kelvin-onlab8a832582015-01-16 17:06:11 -0800289 time.sleep( 20 )
pingping-linc1c696e2015-01-27 13:46:44 -0800290 pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
291 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-after-delete-routes-" + \
kelvin-onlab8a832582015-01-16 17:06:11 -0800292 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
pingping-linc1c696e2015-01-27 13:46:44 -0800293 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -0800294 "1.168.30.100",
pingping-linc1c696e2015-01-27 13:46:44 -0800295 pingTestScript,
296 pingTestResultsFile )
297 main.log.info( pingTestResults )
298 time.sleep( 100 )
299
300 # main.step( "Test whether Mininet is started" )
301 # main.Mininet2.handle.sendline( "xterm host1" )
302 # main.Mininet2.handle.expect( "mininet>" )
303
304 def CASE3( self, main ):
305 """
306 Test the SDN-IP functionality
307 allRoutesExpected: all expected routes for all BGP peers
308 routeIntentsExpected: all expected MultiPointToSinglePointIntent intents
309 bgpIntentsExpected: expected PointToPointIntent intents
310 allRoutesActual: all routes from ONOS LCI
311 routeIntentsActual: actual MultiPointToSinglePointIntent intents from ONOS CLI
312 bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
313 """
314 import time
315 import json
316 from operator import eq
317 # from datetime import datetime
318 from time import localtime, strftime
319
320 main.case(
321 "The test case is to help to setup the TestON environment and test new drivers" )
322 # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
323 SDNIPJSONFILEPATH = "/home/admin/workspace/onos/tools/package/config/sdnip.json"
324 # all expected routes for all BGP peers
325 allRoutesExpected = []
326 main.step( "Start to generate routes for all BGP peers" )
327 main.log.info( "Generate prefixes for host3" )
328 prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
329 main.log.info( prefixesHost3 )
330 # generate route with next hop
331 for prefix in prefixesHost3:
332 allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
333 routeIntentsExpectedHost3 = main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
334 prefixesHost3, "192.168.20.1", "00:00:00:00:02:02", SDNIPJSONFILEPATH )
335
336 main.log.info( "Generate prefixes for host4" )
337 prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
338 main.log.info( prefixesHost4 )
339 # generate route with next hop
340 for prefix in prefixesHost4:
341 allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
342 routeIntentsExpectedHost4 = main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
343 prefixesHost4, "192.168.30.1", "00:00:00:00:03:01", SDNIPJSONFILEPATH )
344
345 routeIntentsExpected = routeIntentsExpectedHost3 + \
346 routeIntentsExpectedHost4
347
348 #
349 # main.log.info( "Generate prefixes for 100 guaggas" )
350 # for i in range( 101, 105 ):
351 # prefixesHostX=main.QuaggaCliHost.generatePrefixes( str( i ),10 )
352 # main.log.info( prefixesHostX )
353 # for prefix in prefixesHostX:
354 # allRoutesExpected.append( prefix + "/" + "192.168.40."+ str( i-100 ) )
355 # routeIntentsExpectedHostX = main.QuaggaCliHost.generateExpectedOnePeerRouteIntents( prefixesHostX, "192.168.40."+str( i ), "00:00:"+str( i-101 )+":00:00:90", SDNIPJSONFILEPATH )
356 # routeIntentsExpected = routeIntentsExpected + routeIntentsExpectedHostX
357 #
358
359 cellName = main.params[ 'ENV' ][ 'cellName' ]
360 ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
361 main.step( "Set cell for ONOS-cli environment" )
362 main.ONOScli.setCell( cellName )
363 verifyResult = main.ONOSbench.verifyCell()
364
365 main.log.report( "Removing raft logs" )
366 main.ONOSbench.onosRemoveRaftLogs()
367 main.log.report( "Uninstalling ONOS" )
368 main.ONOSbench.onosUninstall( ONOS1Ip )
369
370 main.step( "Installing ONOS package" )
371 onos1InstallResult = main.ONOSbench.onosInstall(
372 options="-f", node=ONOS1Ip )
373
374 main.step( "Checking if ONOS is up yet" )
375 time.sleep( 60 )
376 onos1Isup = main.ONOSbench.isup( ONOS1Ip )
377 if not onos1Isup:
378 main.log.report( "ONOS1 didn't start!" )
379
380 main.step( "Start ONOS-cli" )
381
382 main.ONOScli.startOnosCli( ONOS1Ip )
383
384 main.step( "Get devices in the network" )
385 listResult = main.ONOScli.devices( jsonFormat=False )
386 main.log.info( listResult )
387 time.sleep( 10 )
388 main.log.info( "Installing sdn-ip feature" )
389 main.ONOScli.featureInstall( "onos-app-sdnip" )
390 time.sleep( 10 )
391 main.step( "Login all BGP peers and add routes into peers" )
392
393 main.log.info( "Login Quagga CLI on host3" )
394 main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
395 main.log.info( "Enter configuration model of Quagga CLI on host3" )
396 main.QuaggaCliHost3.enterConfig( 64514 )
397 main.log.info( "Add routes to Quagga on host3" )
398 main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
399
400 main.log.info( "Login Quagga CLI on host4" )
401 main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
402 main.log.info( "Enter configuration model of Quagga CLI on host4" )
403 main.QuaggaCliHost4.enterConfig( 64516 )
404 main.log.info( "Add routes to Quagga on host4" )
405 main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
406
407 for i in range( 101, 201 ):
408 prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
409 main.log.info( prefixesHostX )
410 for prefix in prefixesHostX:
411 allRoutesExpected.append(
412 prefix + "/" + "192.168.40." + str( i - 100 ) )
413
414 routeIntentsExpectedHostX = main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
415 prefixesHostX, "192.168.40." + str( i - 100 ), "00:00:%02d:00:00:90" %
416 ( i - 101 ), SDNIPJSONFILEPATH )
417 routeIntentsExpected = routeIntentsExpected + \
418 routeIntentsExpectedHostX
419
420 main.log.info( "Login Quagga CLI on host" + str( i ) )
421 QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
422 QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
423 main.log.info(
424 "Enter configuration model of Quagga CLI on host" + str( i ) )
425 QuaggaCliHostX.enterConfig( 65000 + i - 100 )
426 main.log.info( "Add routes to Quagga on host" + str( i ) )
427 QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
428
429 time.sleep( 60 )
430
431 # get routes inside SDN-IP
432 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
433
434 # parse routes from ONOS CLI
435 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
436 getRoutesResult )
437
438 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
439 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
440 main.step( "Check routes installed" )
441 main.log.info( "Routes expected:" )
442 main.log.info( allRoutesStrExpected )
443 main.log.info( "Routes get from ONOS CLI:" )
444 main.log.info( allRoutesStrActual )
445 utilities.assertEquals(
446 expect=allRoutesStrExpected, actual=allRoutesStrActual,
447 onpass="***Routes in SDN-IP are correct!***",
448 onfail="***Routes in SDN-IP are wrong!***" )
449 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
450 main.log.report(
451 "***Routes in SDN-IP after adding routes are correct!***" )
452 else:
453 main.log.report(
454 "***Routes in SDN-IP after adding routes are wrong!***" )
455
456 time.sleep( 20 )
457 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
458
459 main.step( "Check MultiPointToSinglePointIntent intents installed" )
460 # routeIntentsExpected are generated when generating routes
461 # get rpoute intents from ONOS CLI
462 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
463 getIntentsResult )
464 routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
465 routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
466 main.log.info( "MultiPointToSinglePoint intents expected:" )
467 main.log.info( routeIntentsStrExpected )
468 main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
469 main.log.info( routeIntentsStrActual )
470 utilities.assertEquals(
471 expect=True, actual=eq(
472 routeIntentsStrExpected, routeIntentsStrActual ),
473 onpass="***MultiPointToSinglePoint Intents in SDN-IP are correct!***",
474 onfail="***MultiPointToSinglePoint Intents in SDN-IP are wrong!***" )
475
476 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
477 main.log.report(
478 "***MultiPointToSinglePoint Intents before deleting routes correct!***" )
479 else:
480 main.log.report(
481 "***MultiPointToSinglePoint Intents before deleting routes wrong!***" )
482
483 main.step( "Check BGP PointToPointIntent intents installed" )
484 # bgp intents expected
485 bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
486 SDNIPJSONFILEPATH )
487 # get BGP intents from ONOS CLI
488 bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
489 getIntentsResult )
490
491 bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
492 bgpIntentsStrActual = str( bgpIntentsActual )
493 main.log.info( "PointToPointIntent intents expected:" )
494 main.log.info( bgpIntentsStrExpected )
495 main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
496 main.log.info( bgpIntentsStrActual )
497
498 utilities.assertEquals(
499 expect=True, actual=eq(
500 bgpIntentsStrExpected, bgpIntentsStrActual ),
501 onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
502 onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
503
504 if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
505 main.log.report(
506 "***PointToPointIntent Intents in SDN-IP are correct!***" )
507 else:
508 main.log.report(
509 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
510
511 #============================= Ping Test ========================
512 # wait until all MultiPointToSinglePoint
513 time.sleep( 20 )
514 pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
515 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE3-ping-results-before-delete-routes-" + \
516 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
517 pingTestResults = main.QuaggaCliHost.pingTest(
518 "1.168.30.100",
519 pingTestScript,
520 pingTestResultsFile )
521 main.log.info( pingTestResults )
522 time.sleep( 20 )
523
524 #============================= Deleting Routes ==================
525 main.step( "Check deleting routes installed" )
526 main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
527 main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
528 for i in range( 101, 201 ):
529 prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
530 main.log.info( prefixesHostX )
531 QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
532 QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
533
534 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
535 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
536 getRoutesResult )
537 main.log.info( "allRoutes_actual = " )
538 main.log.info( allRoutesActual )
539
540 utilities.assertEquals( expect="[]", actual=str( allRoutesActual ),
541 onpass="***Route number in SDN-IP is 0, correct!***",
542 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
543
544 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
545 main.log.report( "***Routes in SDN-IP after deleting correct!***" )
546 else:
547 main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
548
549 main.step( "Check intents after deleting routes" )
550 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
551 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
552 getIntentsResult )
553 main.log.info( "main.ONOScli.intents()= " )
554 main.log.info( routeIntentsActual )
555 utilities.assertEquals( expect="[]", actual=str( routeIntentsActual ),
556 onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, correct!***",
557 onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, wrong!***" )
558
559 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
560 main.log.report(
561 "***MultiPointToSinglePoint Intents after deleting routes correct!***" )
562 else:
563 main.log.report(
564 "***MultiPointToSinglePoint Intents after deleting routes wrong!***" )
565
566 time.sleep( 20 )
567 pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
568 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE3-ping-results-after-delete-routes-" + \
569 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
570 pingTestResults = main.QuaggaCliHost.pingTest(
571 "1.168.30.100",
572 pingTestScript,
573 pingTestResultsFile )
574 main.log.info( pingTestResults )
575 time.sleep( 100 )
576
577 # main.step( "Test whether Mininet is started" )
578 # main.Mininet2.handle.sendline( "xterm host1" )
579 # main.Mininet2.handle.expect( "mininet>" )
580
581 def CASE1( self, main ):
582 """
583 Test the SDN-IP functionality
584 allRoutesExpected: all expected routes for all BGP peers
585 routeIntentsExpected: all expected MultiPointToSinglePointIntent intents
586 bgpIntentsExpected: expected PointToPointIntent intents
587 allRoutesActual: all routes from ONOS LCI
588 routeIntentsActual: actual MultiPointToSinglePointIntent intents from ONOS CLI
589 bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
590 """
591 import time
592 import json
593 from operator import eq
594 # from datetime import datetime
595 from time import localtime, strftime
596
597 main.case(
598 "The test case is to help to setup the TestON environment and test new drivers" )
599 SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
600 # all expected routes for all BGP peers
601 allRoutesExpected = []
602 main.step( "Start to generate routes for all BGP peers" )
603 # bgpPeerHosts = []
604 # for i in range( 3, 5 ):
605 # bgpPeerHosts.append( "host" + str( i ) )
606 # main.log.info( "BGP Peer Hosts are:" + bgpPeerHosts )
607
608 # for i in range( 3, 5 ):
609 # QuaggaCliHost = "QuaggaCliHost" + str( i )
610 # prefixes = main.QuaggaCliHost.generatePrefixes( 3, 10 )
611
612 # main.log.info( prefixes )
613 # allRoutesExpected.append( prefixes )
614 main.log.info( "Generate prefixes for host3" )
615 prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
616 main.log.info( prefixesHost3 )
617 # generate route with next hop
618 for prefix in prefixesHost3:
619 allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
620 routeIntentsExpectedHost3 = main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
621 prefixesHost3, "192.168.20.1", "00:00:00:00:02:02", SDNIPJSONFILEPATH )
622
623 main.log.info( "Generate prefixes for host4" )
624 prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
625 main.log.info( prefixesHost4 )
626 # generate route with next hop
627 for prefix in prefixesHost4:
628 allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
629 routeIntentsExpectedHost4 = main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
630 prefixesHost4, "192.168.30.1", "00:00:00:00:03:01", SDNIPJSONFILEPATH )
631
632 routeIntentsExpected = routeIntentsExpectedHost3 + \
633 routeIntentsExpectedHost4
634
635 cellName = main.params[ 'ENV' ][ 'cellName' ]
636 ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
637 main.step( "Set cell for ONOS-cli environment" )
638 main.ONOScli.setCell( cellName )
639 verifyResult = main.ONOSbench.verifyCell()
640 main.log.report( "Removing raft logs" )
641 main.ONOSbench.onosRemoveRaftLogs()
642 main.log.report( "Uninstalling ONOS" )
643 main.ONOSbench.onosUninstall( ONOS1Ip )
644 main.step( "Creating ONOS package" )
645 packageResult = main.ONOSbench.onosPackage()
646
647 main.step( "Starting ONOS service" )
648 # TODO: start ONOS from Mininet Script
649 # startResult = main.ONOSbench.onosStart( "127.0.0.1" )
650 main.step( "Installing ONOS package" )
651 onos1InstallResult = main.ONOSbench.onosInstall(
652 options="-f", node=ONOS1Ip )
653
654 main.step( "Checking if ONOS is up yet" )
655 time.sleep( 60 )
656 onos1Isup = main.ONOSbench.isup( ONOS1Ip )
657 if not onos1Isup:
658 main.log.report( "ONOS1 didn't start!" )
659
660 main.step( "Start ONOS-cli" )
661 # TODO: change the hardcode in startOnosCli method in ONOS CLI driver
662
663 main.ONOScli.startOnosCli( ONOS1Ip )
664
665 main.step( "Get devices in the network" )
666 listResult = main.ONOScli.devices( jsonFormat=False )
667 main.log.info( listResult )
668 time.sleep( 10 )
669 main.log.info( "Installing sdn-ip feature" )
670 main.ONOScli.featureInstall( "onos-app-sdnip" )
671 time.sleep( 10 )
672 main.step( "Login all BGP peers and add routes into peers" )
673 main.log.info( "Login Quagga CLI on host3" )
674 main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
675 main.log.info( "Enter configuration model of Quagga CLI on host3" )
676 main.QuaggaCliHost3.enterConfig( 64514 )
677 main.log.info( "Add routes to Quagga on host3" )
678 main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
679
680 main.log.info( "Login Quagga CLI on host4" )
681 main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
682 main.log.info( "Enter configuration model of Quagga CLI on host4" )
683 main.QuaggaCliHost4.enterConfig( 64516 )
684 main.log.info( "Add routes to Quagga on host4" )
685 main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
686 time.sleep( 60 )
687
688 # get all routes inside SDN-IP
689 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
690
691 # parse routes from ONOS CLI
692 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
693 getRoutesResult )
694
695 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
696 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
697 main.step( "Check routes installed" )
698 main.log.info( "Routes expected:" )
699 main.log.info( allRoutesStrExpected )
700 main.log.info( "Routes get from ONOS CLI:" )
701 main.log.info( allRoutesStrActual )
702 utilities.assertEquals(
703 expect=allRoutesStrExpected, actual=allRoutesStrActual,
704 onpass="***Routes in SDN-IP are correct!***",
705 onfail="***Routes in SDN-IP are wrong!***" )
706 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
707 main.log.report(
708 "***Routes in SDN-IP after adding routes are correct!***" )
709 else:
710 main.log.report(
711 "***Routes in SDN-IP after adding routes are wrong!***" )
712
713 time.sleep( 20 )
714 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
715
716 main.step( "Check MultiPointToSinglePointIntent intents installed" )
717 # routeIntentsExpected are generated when generating routes
718 # get rpoute intents from ONOS CLI
719 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
720 getIntentsResult )
721 routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
722 routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
723 main.log.info( "MultiPointToSinglePoint intents expected:" )
724 main.log.info( routeIntentsStrExpected )
725 main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
726 main.log.info( routeIntentsStrActual )
727 utilities.assertEquals(
728 expect=True, actual=eq(
729 routeIntentsStrExpected, routeIntentsStrActual ),
730 onpass="***MultiPointToSinglePoint Intents in SDN-IP are correct!***",
731 onfail="***MultiPointToSinglePoint Intents in SDN-IP are wrong!***" )
732
733 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
734 main.log.report(
735 "***MultiPointToSinglePoint Intents before deleting routes correct!***" )
736 else:
737 main.log.report(
738 "***MultiPointToSinglePoint Intents before deleting routes wrong!***" )
739
740 main.step( "Check BGP PointToPointIntent intents installed" )
741 # bgp intents expected
742 bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
743 SDNIPJSONFILEPATH )
744 # get BGP intents from ONOS CLI
745 bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
746 getIntentsResult )
747
748 bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
749 bgpIntentsStrActual = str( bgpIntentsActual )
750 main.log.info( "PointToPointIntent intents expected:" )
751 main.log.info( bgpIntentsStrExpected )
752 main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
753 main.log.info( bgpIntentsStrActual )
754
755 utilities.assertEquals(
756 expect=True, actual=eq(
757 bgpIntentsStrExpected, bgpIntentsStrActual ),
758 onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
759 onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
760
761 if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
762 main.log.report(
763 "***PointToPointIntent Intents in SDN-IP are correct!***" )
764 else:
765 main.log.report(
766 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
767
768 #============================= Ping Test ========================
769 # wait until all MultiPointToSinglePoint
770 time.sleep( 20 )
771 pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
772 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-before-delete-routes-" + \
773 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
774 pingTestResults = main.QuaggaCliHost.pingTest(
775 "1.168.30.100",
776 pingTestScript,
777 pingTestResultsFile )
778 main.log.info( pingTestResults )
779
780 # ping test
781
782 #============================= Deleting Routes ==================
783 main.step( "Check deleting routes installed" )
784 main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
785 main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
786
787 # main.log.info( "main.ONOScli.get_routes_num() = " )
788 # main.log.info( main.ONOScli.getRoutesNum() )
789 # utilities.assertEquals( expect="Total SDN-IP routes = 1", actual=
790 # main.ONOScli.getRoutesNum(),
791 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
792 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
793 getRoutesResult )
794 main.log.info( "allRoutes_actual = " )
795 main.log.info( allRoutesActual )
796
797 utilities.assertEquals( expect="[]", actual=str( allRoutesActual ),
798 onpass="***Route number in SDN-IP is 0, correct!***",
799 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
800
801 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
802 main.log.report( "***Routes in SDN-IP after deleting correct!***" )
803 else:
804 main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
805
806 main.step( "Check intents after deleting routes" )
807 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
808 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
809 getIntentsResult )
810 main.log.info( "main.ONOScli.intents()= " )
811 main.log.info( routeIntentsActual )
812 utilities.assertEquals( expect="[]", actual=str( routeIntentsActual ),
813 onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, correct!***",
814 onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, wrong!***" )
815
816 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
817 main.log.report(
818 "***MultiPointToSinglePoint Intents after deleting routes correct!***" )
819 else:
820 main.log.report(
821 "***MultiPointToSinglePoint Intents after deleting routes wrong!***" )
822
823 time.sleep( 20 )
824 pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
825 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-after-delete-routes-" + \
826 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
827 pingTestResults = main.QuaggaCliHost.pingTest(
828 "1.168.30.100",
829 pingTestScript,
830 pingTestResultsFile )
831 main.log.info( pingTestResults )
kelvin-onlab8a832582015-01-16 17:06:11 -0800832 time.sleep( 30 )
pingping-linc6b86fa2014-12-01 16:18:10 -0800833
kelvin-onlab8a832582015-01-16 17:06:11 -0800834 # main.step( "Test whether Mininet is started" )
835 # main.Mininet2.handle.sendline( "xterm host1" )
836 # main.Mininet2.handle.expect( "mininet>" )
pingping-lin8b306ac2014-11-17 18:13:51 -0800837
kelvin-onlab8a832582015-01-16 17:06:11 -0800838 def CASE2( self, main ):
839 """
pingping-lin3d87a132014-12-04 14:22:49 -0800840 Test the SDN-IP functionality
pingping-linc1c696e2015-01-27 13:46:44 -0800841 allRoutesExpected: all expected routes for all BGP peers
842 routeIntentsExpected: all expected MultiPointToSinglePointIntent intents
843 bgpIntentsExpected: expected PointToPointIntent intents
844 allRoutesActual: all routes from ONOS LCI
845 routeIntentsActual: actual MultiPointToSinglePointIntent intents from ONOS CLI
846 bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
kelvin-onlab8a832582015-01-16 17:06:11 -0800847 """
pingping-lin3d87a132014-12-04 14:22:49 -0800848 import time
849 import json
850 from operator import eq
851 from time import localtime, strftime
852
kelvin-onlab8a832582015-01-16 17:06:11 -0800853 main.case(
854 "The test case is to help to setup the TestON environment and test new drivers" )
pingping-linc1c696e2015-01-27 13:46:44 -0800855 SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
pingping-lin3d87a132014-12-04 14:22:49 -0800856 # all expected routes for all BGP peers
pingping-linc1c696e2015-01-27 13:46:44 -0800857 allRoutesExpected = []
kelvin-onlab8a832582015-01-16 17:06:11 -0800858 main.step( "Start to generate routes for all BGP peers" )
pingping-lin3d87a132014-12-04 14:22:49 -0800859
kelvin-onlab8a832582015-01-16 17:06:11 -0800860 main.log.info( "Generate prefixes for host3" )
pingping-linc1c696e2015-01-27 13:46:44 -0800861 prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
862 main.log.info( prefixesHost3 )
pingping-lin3d87a132014-12-04 14:22:49 -0800863 # generate route with next hop
pingping-linc1c696e2015-01-27 13:46:44 -0800864 for prefix in prefixesHost3:
865 allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
866 routeIntentsExpectedHost3 = main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
867 prefixesHost3, "192.168.20.1", "00:00:00:00:02:02", SDNIPJSONFILEPATH )
pingping-lin3d87a132014-12-04 14:22:49 -0800868
kelvin-onlab8a832582015-01-16 17:06:11 -0800869 main.log.info( "Generate prefixes for host4" )
pingping-linc1c696e2015-01-27 13:46:44 -0800870 prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
871 main.log.info( prefixesHost4 )
pingping-lin3d87a132014-12-04 14:22:49 -0800872 # generate route with next hop
pingping-linc1c696e2015-01-27 13:46:44 -0800873 for prefix in prefixesHost4:
874 allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
875 routeIntentsExpectedHost4 = main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
876 prefixesHost4, "192.168.30.1", "00:00:00:00:03:01", SDNIPJSONFILEPATH )
pingping-lin3d87a132014-12-04 14:22:49 -0800877
pingping-linc1c696e2015-01-27 13:46:44 -0800878 routeIntentsExpected = routeIntentsExpectedHost3 + \
879 routeIntentsExpectedHost4
pingping-lin3d87a132014-12-04 14:22:49 -0800880
kelvin-onlab8a832582015-01-16 17:06:11 -0800881 main.log.report( "Removing raft logs" )
pingping-linc1c696e2015-01-27 13:46:44 -0800882 main.ONOSbench.onosRemoveRaftLogs()
kelvin-onlab8a832582015-01-16 17:06:11 -0800883 main.log.report( "Uninstalling ONOS" )
pingping-linc1c696e2015-01-27 13:46:44 -0800884 main.ONOSbench.onosUninstall( ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -0800885
pingping-linc1c696e2015-01-27 13:46:44 -0800886 cellName = main.params[ 'ENV' ][ 'cellName' ]
887 ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
kelvin-onlab8a832582015-01-16 17:06:11 -0800888 main.step( "Set cell for ONOS-cli environment" )
pingping-linc1c696e2015-01-27 13:46:44 -0800889 main.ONOScli.setCell( cellName )
890 verifyResult = main.ONOSbench.verifyCell()
891 # main.log.report( "Removing raft logs" )
892 # main.ONOSbench.onosRemoveRaftLogs()
893 # main.log.report( "Uninstalling ONOS" )
894 # main.ONOSbench.onosUninstall( ONOS1Ip )
kelvin-onlab8a832582015-01-16 17:06:11 -0800895 main.step( "Creating ONOS package" )
pingping-linc1c696e2015-01-27 13:46:44 -0800896 # packageResult = main.ONOSbench.onosPackage()
pingping-lin3d87a132014-12-04 14:22:49 -0800897
kelvin-onlab8a832582015-01-16 17:06:11 -0800898 main.step( "Installing ONOS package" )
pingping-linc1c696e2015-01-27 13:46:44 -0800899 # onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
900 # node=ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -0800901
kelvin-onlab8a832582015-01-16 17:06:11 -0800902 main.step( "Checking if ONOS is up yet" )
pingping-linc1c696e2015-01-27 13:46:44 -0800903 # time.sleep( 60 )
904 onos1Isup = main.ONOSbench.isup( ONOS1Ip )
905 if not onos1Isup:
kelvin-onlab8a832582015-01-16 17:06:11 -0800906 main.log.report( "ONOS1 didn't start!" )
pingping-lin3d87a132014-12-04 14:22:49 -0800907
kelvin-onlab8a832582015-01-16 17:06:11 -0800908 main.step( "Start ONOS-cli" )
pingping-linc1c696e2015-01-27 13:46:44 -0800909 main.ONOScli.startOnosCli( ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -0800910
kelvin-onlab8a832582015-01-16 17:06:11 -0800911 main.step( "Get devices in the network" )
pingping-linc1c696e2015-01-27 13:46:44 -0800912 listResult = main.ONOScli.devices( jsonFormat=False )
913 main.log.info( listResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800914 time.sleep( 10 )
915 main.log.info( "Installing sdn-ip feature" )
pingping-linc1c696e2015-01-27 13:46:44 -0800916 main.ONOScli.featureInstall( "onos-app-sdnip" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800917 time.sleep( 10 )
pingping-lin3d87a132014-12-04 14:22:49 -0800918
kelvin-onlab8a832582015-01-16 17:06:11 -0800919 main.step( "Check BGP PointToPointIntent intents installed" )
pingping-lin3d87a132014-12-04 14:22:49 -0800920 # bgp intents expected
pingping-linc1c696e2015-01-27 13:46:44 -0800921 bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
922 SDNIPJSONFILEPATH )
pingping-lin3d87a132014-12-04 14:22:49 -0800923 # get BGP intents from ONOS CLI
pingping-linc1c696e2015-01-27 13:46:44 -0800924 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
925 bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
926 getIntentsResult )
pingping-lin3d87a132014-12-04 14:22:49 -0800927
pingping-linc1c696e2015-01-27 13:46:44 -0800928 bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
929 bgpIntentsStrActual = str( bgpIntentsActual )
kelvin-onlab8a832582015-01-16 17:06:11 -0800930 main.log.info( "PointToPointIntent intents expected:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800931 main.log.info( bgpIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800932 main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800933 main.log.info( bgpIntentsStrActual )
pingping-lin3d87a132014-12-04 14:22:49 -0800934
pingping-linc1c696e2015-01-27 13:46:44 -0800935 utilities.assertEquals(
936 expect=True, actual=eq(
937 bgpIntentsStrExpected, bgpIntentsStrActual ),
938 onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
939 onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800940
pingping-linc1c696e2015-01-27 13:46:44 -0800941 if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800942 main.log.report(
943 "***PointToPointIntent Intents in SDN-IP are correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800944 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800945 main.log.report(
946 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800947
pingping-linc1c696e2015-01-27 13:46:44 -0800948 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
949 routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
950 pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
951 # roundNum = 0;
kelvin-onlab8a832582015-01-16 17:06:11 -0800952 # while( True ):
pingping-linc1c696e2015-01-27 13:46:44 -0800953 for roundNum in range( 1, 6 ):
pingping-lin3d87a132014-12-04 14:22:49 -0800954 # round = round + 1;
pingping-linc1c696e2015-01-27 13:46:44 -0800955 main.log.report( "The Round " + str( roundNum ) +
956 " test starts........................................" )
pingping-lin3d87a132014-12-04 14:22:49 -0800957
kelvin-onlab8a832582015-01-16 17:06:11 -0800958 main.step( "Login all BGP peers and add routes into peers" )
959 main.log.info( "Login Quagga CLI on host3" )
960 main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
961 main.log.info( "Enter configuration model of Quagga CLI on host3" )
pingping-linc1c696e2015-01-27 13:46:44 -0800962 main.QuaggaCliHost3.enterConfig( 64514 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800963 main.log.info( "Add routes to Quagga on host3" )
pingping-linc1c696e2015-01-27 13:46:44 -0800964 main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
pingping-lin3d87a132014-12-04 14:22:49 -0800965
kelvin-onlab8a832582015-01-16 17:06:11 -0800966 main.log.info( "Login Quagga CLI on host4" )
967 main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
968 main.log.info( "Enter configuration model of Quagga CLI on host4" )
pingping-linc1c696e2015-01-27 13:46:44 -0800969 main.QuaggaCliHost4.enterConfig( 64516 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800970 main.log.info( "Add routes to Quagga on host4" )
pingping-linc1c696e2015-01-27 13:46:44 -0800971 main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800972 time.sleep( 60 )
pingping-lin3d87a132014-12-04 14:22:49 -0800973
974 # get all routes inside SDN-IP
pingping-linc1c696e2015-01-27 13:46:44 -0800975 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
pingping-lin3d87a132014-12-04 14:22:49 -0800976
977 # parse routes from ONOS CLI
pingping-linc1c696e2015-01-27 13:46:44 -0800978 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
979 getRoutesResult )
pingping-lin3d87a132014-12-04 14:22:49 -0800980
pingping-linc1c696e2015-01-27 13:46:44 -0800981 # allRoutesStrExpected = str( sorted( allRoutesExpected ) )
982 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800983 main.step( "Check routes installed" )
984 main.log.info( "Routes expected:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800985 main.log.info( allRoutesStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800986 main.log.info( "Routes get from ONOS CLI:" )
pingping-linc1c696e2015-01-27 13:46:44 -0800987 main.log.info( allRoutesStrActual )
988 utilities.assertEquals(
989 expect=allRoutesStrExpected, actual=allRoutesStrActual,
990 onpass="***Routes in SDN-IP are correct!***",
991 onfail="***Routes in SDN-IP are wrong!***" )
992 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800993 main.log.report(
994 "***Routes in SDN-IP after adding correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800995 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800996 main.log.report( "***Routes in SDN-IP after adding wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800997
kelvin-onlab8a832582015-01-16 17:06:11 -0800998 time.sleep( 20 )
pingping-linc1c696e2015-01-27 13:46:44 -0800999 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin3d87a132014-12-04 14:22:49 -08001000
kelvin-onlab8a832582015-01-16 17:06:11 -08001001 main.step(
1002 "Check MultiPointToSinglePointIntent intents installed" )
pingping-linc1c696e2015-01-27 13:46:44 -08001003 # routeIntentsExpected are generated when generating routes
pingping-lin3d87a132014-12-04 14:22:49 -08001004 # get route intents from ONOS CLI
pingping-linc1c696e2015-01-27 13:46:44 -08001005 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
1006 getIntentsResult )
1007 # routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
1008 routeIntentsStrActual = str(
1009 routeIntentsActual ).replace(
1010 'u',
1011 "" )
kelvin-onlab8a832582015-01-16 17:06:11 -08001012 main.log.info( "MultiPointToSinglePoint intents expected:" )
pingping-linc1c696e2015-01-27 13:46:44 -08001013 main.log.info( routeIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -08001014 main.log.info(
1015 "MultiPointToSinglePoint intents get from ONOS CLI:" )
pingping-linc1c696e2015-01-27 13:46:44 -08001016 main.log.info( routeIntentsStrActual )
1017 utilities.assertEquals(
1018 expect=True, actual=eq(
1019 routeIntentsStrExpected, routeIntentsStrActual ),
1020 onpass="***MultiPointToSinglePoint Intents in SDN-IP are correct!***",
1021 onfail="***MultiPointToSinglePoint Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001022
pingping-linc1c696e2015-01-27 13:46:44 -08001023 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -08001024 main.log.report(
1025 "***MultiPointToSinglePoint Intents after adding routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001026 else:
kelvin-onlab8a832582015-01-16 17:06:11 -08001027 main.log.report(
1028 "***MultiPointToSinglePoint Intents after adding routes wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001029
1030 #============================= Ping Test ========================
1031 # wait until all MultiPointToSinglePoint
kelvin-onlab8a832582015-01-16 17:06:11 -08001032 time.sleep( 20 )
pingping-linc1c696e2015-01-27 13:46:44 -08001033 # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
1034 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" + str(
1035 roundNum ) + "-ping-results-before-delete-routes-" + strftime( "%Y-%m-%d_%H:%M:%S",
1036 localtime() ) + ".txt"
1037 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -08001038 "1.168.30.100",
pingping-linc1c696e2015-01-27 13:46:44 -08001039 pingTestScript,
1040 pingTestResultsFile )
1041 main.log.info( pingTestResults )
pingping-lin3d87a132014-12-04 14:22:49 -08001042 # ping test
1043
1044 #============================= Deleting Routes ==================
kelvin-onlab8a832582015-01-16 17:06:11 -08001045 main.step( "Check deleting routes installed" )
1046 main.log.info( "Delete routes to Quagga on host3" )
pingping-linc1c696e2015-01-27 13:46:44 -08001047 main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
kelvin-onlab8a832582015-01-16 17:06:11 -08001048 main.log.info( "Delete routes to Quagga on host4" )
pingping-linc1c696e2015-01-27 13:46:44 -08001049 main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
pingping-lin3d87a132014-12-04 14:22:49 -08001050
pingping-linc1c696e2015-01-27 13:46:44 -08001051 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
1052 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
1053 getRoutesResult )
kelvin-onlab8a832582015-01-16 17:06:11 -08001054 main.log.info( "allRoutes_actual = " )
pingping-linc1c696e2015-01-27 13:46:44 -08001055 main.log.info( allRoutesActual )
pingping-lin3d87a132014-12-04 14:22:49 -08001056
pingping-linc1c696e2015-01-27 13:46:44 -08001057 utilities.assertEquals( expect="[]", actual=str( allRoutesActual ),
1058 onpass="***Route number in SDN-IP is 0, correct!***",
1059 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001060
pingping-linc1c696e2015-01-27 13:46:44 -08001061 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -08001062 main.log.report(
1063 "***Routes in SDN-IP after deleting correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001064 else:
kelvin-onlab8a832582015-01-16 17:06:11 -08001065 main.log.report(
1066 "***Routes in SDN-IP after deleting wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001067
kelvin-onlab8a832582015-01-16 17:06:11 -08001068 main.step( "Check intents after deleting routes" )
pingping-linc1c696e2015-01-27 13:46:44 -08001069 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
1070 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
1071 getIntentsResult )
kelvin-onlab8a832582015-01-16 17:06:11 -08001072 main.log.info( "main.ONOScli.intents()= " )
pingping-linc1c696e2015-01-27 13:46:44 -08001073 main.log.info( routeIntentsActual )
1074 utilities.assertEquals(
1075 expect="[]", actual=str( routeIntentsActual ),
1076 onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, correct!***",
1077 onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001078
pingping-linc1c696e2015-01-27 13:46:44 -08001079 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -08001080 main.log.report(
1081 "***MultiPointToSinglePoint Intents after deleting routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001082 else:
kelvin-onlab8a832582015-01-16 17:06:11 -08001083 main.log.report(
1084 "***MultiPointToSinglePoint Intents after deleting routes wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -08001085
kelvin-onlab8a832582015-01-16 17:06:11 -08001086 time.sleep( 20 )
pingping-linc1c696e2015-01-27 13:46:44 -08001087 # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
1088 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" + str(
1089 roundNum ) + "-ping-results-after-delete-routes-" + strftime( "%Y-%m-%d_%H:%M:%S",
1090 localtime() ) + ".txt"
1091 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -08001092 "1.168.30.100",
pingping-linc1c696e2015-01-27 13:46:44 -08001093 pingTestScript,
1094 pingTestResultsFile )
1095 main.log.info( pingTestResults )
kelvin-onlab8a832582015-01-16 17:06:11 -08001096 time.sleep( 30 )
pingping-linc1c696e2015-01-27 13:46:44 -08001097