blob: 53560f35683d39c7255664929ea4b7156a389025 [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
kelvin-onlab8a832582015-01-16 17:06:11 -080011 def CASE1( self, main ):
12 """
pingping-lin8b306ac2014-11-17 18:13:51 -080013 Test the SDN-IP functionality
kelvin-onlab7bbb5612015-01-26 10:54:50 -080014 allRoutesExpected: all expected routes for all BGP peers
15 routeIntentsExpected: all expected
16 MultiPointToSinglePointIntent intents
17 bgpIntentsExpected: expected PointToPointIntent intents
18 allRoutesActual: all routes from ONOS LCI
19 routeIntentsActual: actual MultiPointToSinglePointIntent
20 intents from ONOS CLI
21 bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
kelvin-onlab8a832582015-01-16 17:06:11 -080022 """
pingping-lin8b306ac2014-11-17 18:13:51 -080023 import time
24 import json
25 from operator import eq
pingping-linc6b86fa2014-12-01 16:18:10 -080026 # from datetime import datetime
pingping-lin01355a62014-12-02 20:58:14 -080027 from time import localtime, strftime
pingping-linc6b86fa2014-12-01 16:18:10 -080028
kelvin-onlab8a832582015-01-16 17:06:11 -080029 main.case(
kelvin-onlab7bbb5612015-01-26 10:54:50 -080030 "The test case is to help to setup the TestON " +
31 "environment and test new drivers" )
32 SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
pingping-lin6f6332e2014-11-19 19:13:58 -080033 # all expected routes for all BGP peers
kelvin-onlab7bbb5612015-01-26 10:54:50 -080034 allRoutesExpected = []
kelvin-onlab8a832582015-01-16 17:06:11 -080035 main.step( "Start to generate routes for all BGP peers" )
pingping-linc6b86fa2014-12-01 16:18:10 -080036 # bgpPeerHosts = []
kelvin-onlab8a832582015-01-16 17:06:11 -080037 # for i in range( 3, 5 ):
38 # bgpPeerHosts.append( "host" + str( i ) )
39 # main.log.info( "BGP Peer Hosts are:" + bgpPeerHosts )
pingping-lin6f6332e2014-11-19 19:13:58 -080040
kelvin-onlab8a832582015-01-16 17:06:11 -080041 # for i in range( 3, 5 ):
42 # QuaggaCliHost = "QuaggaCliHost" + str( i )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080043 # prefixes = main.QuaggaCliHost.generatePrefixes( 3, 10 )
pingping-lin6f6332e2014-11-19 19:13:58 -080044
kelvin-onlab8a832582015-01-16 17:06:11 -080045 # main.log.info( prefixes )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080046 # allRoutesExpected.append( prefixes )
kelvin-onlab8a832582015-01-16 17:06:11 -080047 main.log.info( "Generate prefixes for host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080048 prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
49 main.log.info( prefixesHost3 )
pingping-lin36fbe802014-11-25 16:01:14 -080050 # generate route with next hop
kelvin-onlab7bbb5612015-01-26 10:54:50 -080051 for prefix in prefixesHost3:
52 allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
53 routeIntentsExpectedHost3 = main.QuaggaCliHost3.\
54 generateExpectedOnePeerRouteIntents( prefixesHost3,
55 "192.168.20.1",
56 "00:00:00:00:02:02",
57 SDNIPJSONFILEPATH )
pingping-lin6f6332e2014-11-19 19:13:58 -080058
kelvin-onlab8a832582015-01-16 17:06:11 -080059 main.log.info( "Generate prefixes for host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080060 prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
61 main.log.info( prefixesHost4 )
pingping-lin36fbe802014-11-25 16:01:14 -080062 # generate route with next hop
kelvin-onlab7bbb5612015-01-26 10:54:50 -080063 for prefix in prefixesHost4:
64 allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
65 routeIntentsExpectedHost4 = main.QuaggaCliHost4.\
66 generateExpectedOnePeerRouteIntents( prefixesHost4,
67 "192.168.30.1",
68 "00:00:00:00:03:01",
69 SDNIPJSONFILEPATH )
pingping-lin6f6332e2014-11-19 19:13:58 -080070
kelvin-onlab7bbb5612015-01-26 10:54:50 -080071 routeIntentsExpected = routeIntentsExpectedHost3 + \
72 routeIntentsExpectedHost4
pingping-lin8b306ac2014-11-17 18:13:51 -080073
kelvin-onlab7bbb5612015-01-26 10:54:50 -080074 cellName = main.params[ 'ENV' ][ 'cellName' ]
75 ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
kelvin-onlab8a832582015-01-16 17:06:11 -080076 main.step( "Set cell for ONOS-cli environment" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080077 main.ONOScli.setCell( cellName )
78 verifyResult = main.ONOSbench.verifyCell()
kelvin-onlab8a832582015-01-16 17:06:11 -080079 main.log.report( "Removing raft logs" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080080 main.ONOSbench.onosRemoveRaftLogs()
kelvin-onlab8a832582015-01-16 17:06:11 -080081 main.log.report( "Uninstalling ONOS" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080082 main.ONOSbench.onosUninstall( ONOS1Ip )
kelvin-onlab8a832582015-01-16 17:06:11 -080083 main.step( "Creating ONOS package" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080084 packageResult = main.ONOSbench.onosPackage()
pingping-lin8b306ac2014-11-17 18:13:51 -080085
kelvin-onlab8a832582015-01-16 17:06:11 -080086 main.step( "Starting ONOS service" )
pingping-lin8b306ac2014-11-17 18:13:51 -080087 # TODO: start ONOS from Mininet Script
kelvin-onlab7bbb5612015-01-26 10:54:50 -080088 # startResult = main.ONOSbench.onosStart( "127.0.0.1" )
kelvin-onlab8a832582015-01-16 17:06:11 -080089 main.step( "Installing ONOS package" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080090 onos1InstallResult = main.ONOSbench.onosInstall(
kelvin-onlab8a832582015-01-16 17:06:11 -080091 options="-f",
kelvin-onlab7bbb5612015-01-26 10:54:50 -080092 node=ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -080093
kelvin-onlab8a832582015-01-16 17:06:11 -080094 main.step( "Checking if ONOS is up yet" )
95 time.sleep( 60 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -080096 onos1Isup = main.ONOSbench.isup( ONOS1Ip )
97 if not onos1Isup:
kelvin-onlab8a832582015-01-16 17:06:11 -080098 main.log.report( "ONOS1 didn't start!" )
pingping-linc6b86fa2014-12-01 16:18:10 -080099
kelvin-onlab8a832582015-01-16 17:06:11 -0800100 main.step( "Start ONOS-cli" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800101 # TODO: change the hardcode in startOnosCli method in ONOS CLI driver
pingping-linc6b86fa2014-12-01 16:18:10 -0800102
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800103 main.ONOScli.startOnosCli( ONOS1Ip )
pingping-lin8b306ac2014-11-17 18:13:51 -0800104
kelvin-onlab8a832582015-01-16 17:06:11 -0800105 main.step( "Get devices in the network" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800106 listResult = main.ONOScli.devices( jsonFormat=False )
107 main.log.info( listResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800108 time.sleep( 10 )
109 main.log.info( "Installing sdn-ip feature" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800110 main.ONOScli.featureInstall( "onos-app-sdnip" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800111 time.sleep( 10 )
112 main.step( "Login all BGP peers and add routes into peers" )
113 main.log.info( "Login Quagga CLI on host3" )
114 main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
115 main.log.info( "Enter configuration model of Quagga CLI on host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800116 main.QuaggaCliHost3.enterConfig( 64514 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800117 main.log.info( "Add routes to Quagga on host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800118 main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
pingping-linbc230942014-12-03 18:36:27 -0800119
kelvin-onlab8a832582015-01-16 17:06:11 -0800120 main.log.info( "Login Quagga CLI on host4" )
121 main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
122 main.log.info( "Enter configuration model of Quagga CLI on host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800123 main.QuaggaCliHost4.enterConfig( 64516 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800124 main.log.info( "Add routes to Quagga on host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800125 main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800126 time.sleep( 60 )
pingping-lin8b306ac2014-11-17 18:13:51 -0800127
pingping-linc6b86fa2014-12-01 16:18:10 -0800128 # get all routes inside SDN-IP
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800129 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
pingping-linc6b86fa2014-12-01 16:18:10 -0800130
pingping-lin8b306ac2014-11-17 18:13:51 -0800131 # parse routes from ONOS CLI
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800132 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
133 getRoutesResult )
pingping-linc6b86fa2014-12-01 16:18:10 -0800134
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800135 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
136 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800137 main.step( "Check routes installed" )
138 main.log.info( "Routes expected:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800139 main.log.info( allRoutesStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800140 main.log.info( "Routes get from ONOS CLI:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800141 main.log.info( allRoutesStrActual )
142 utilities.assertEquals(
143 expect=allRoutesStrExpected,
144 actual=allRoutesStrActual,
kelvin-onlab8a832582015-01-16 17:06:11 -0800145 onpass="***Routes in SDN-IP are correct!***",
146 onfail="***Routes in SDN-IP are wrong!***" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800147 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800148 main.log.report(
149 "***Routes in SDN-IP after adding routes are correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800150 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800151 main.log.report(
152 "***Routes in SDN-IP after adding routes are wrong!***" )
pingping-lin8b306ac2014-11-17 18:13:51 -0800153
kelvin-onlab8a832582015-01-16 17:06:11 -0800154 time.sleep( 20 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800155 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin6f6332e2014-11-19 19:13:58 -0800156
kelvin-onlab8a832582015-01-16 17:06:11 -0800157 main.step( "Check MultiPointToSinglePointIntent intents installed" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800158 # routeIntentsExpected are generated when generating routes
pingping-lin6f6332e2014-11-19 19:13:58 -0800159 # get rpoute intents from ONOS CLI
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800160 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
161 getIntentsResult )
162 routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
163 routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800164 main.log.info( "MultiPointToSinglePoint intents expected:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800165 main.log.info( routeIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800166 main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800167 main.log.info( routeIntentsStrActual )
168 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800169 expect=True,
170 actual=eq(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800171 routeIntentsStrExpected,
172 routeIntentsStrActual ),
173 onpass= "***MultiPointToSinglePoint " +
174 "Intents in SDN-IP are correct!***",
175 onfail= "***MultiPointToSinglePoint Intents" +
176 " in SDN-IP are wrong!***" )
pingping-lin6f6332e2014-11-19 19:13:58 -0800177
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800178 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800179 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800180 "***MultiPointToSinglePoint Intents " +
181 "before deleting routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800182 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800183 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800184 "***MultiPointToSinglePoint Intents" +
185 "before deleting routes wrong!***" )
pingping-lin6f6332e2014-11-19 19:13:58 -0800186
kelvin-onlab8a832582015-01-16 17:06:11 -0800187 main.step( "Check BGP PointToPointIntent intents installed" )
pingping-lin6f6332e2014-11-19 19:13:58 -0800188 # bgp intents expected
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800189 bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
190 SDNIPJSONFILEPATH )
pingping-lin6f6332e2014-11-19 19:13:58 -0800191 # get BGP intents from ONOS CLI
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800192 bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
193 getIntentsResult )
pingping-lin3228e132014-11-20 17:49:02 -0800194
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800195 bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
196 bgpIntentsStrActual = str( bgpIntentsActual )
kelvin-onlab8a832582015-01-16 17:06:11 -0800197 main.log.info( "PointToPointIntent intents expected:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800198 main.log.info( bgpIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800199 main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800200 main.log.info( bgpIntentsStrActual )
pingping-lin3228e132014-11-20 17:49:02 -0800201
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800202 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800203 expect=True,
204 actual=eq(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800205 bgpIntentsStrExpected,
206 bgpIntentsStrActual ),
kelvin-onlab8a832582015-01-16 17:06:11 -0800207 onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
208 onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin8b306ac2014-11-17 18:13:51 -0800209
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800210 if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800211 main.log.report(
212 "***PointToPointIntent Intents in SDN-IP are correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800213 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800214 main.log.report(
215 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800216
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800217 # ============================= Ping Test ========================
pingping-linc6b86fa2014-12-01 16:18:10 -0800218 # wait until all MultiPointToSinglePoint
kelvin-onlab8a832582015-01-16 17:06:11 -0800219 time.sleep( 20 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800220 pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
221 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/" +\
222 "CASE1-ping-results-before-delete-routes-" + \
223 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
224 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -0800225 "1.168.30.100",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800226 pingTestScript,
227 pingTestResultsFile )
228 main.log.info( pingTestResults )
pingping-linc6b86fa2014-12-01 16:18:10 -0800229
230 # ping test
231
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800232 # ============================= Deleting Routes ==================
kelvin-onlab8a832582015-01-16 17:06:11 -0800233 main.step( "Check deleting routes installed" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800234 main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
235 main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
pingping-linc6b86fa2014-12-01 16:18:10 -0800236
kelvin-onlab8a832582015-01-16 17:06:11 -0800237 # main.log.info( "main.ONOScli.get_routes_num() = " )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800238 # main.log.info( main.ONOScli.getRoutesNum() )
239 # utilities.assertEquals( expect="Total SDN-IP routes = 1", actual=
240 # main.ONOScli.getRoutesNum(),
241 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
242 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
243 getRoutesResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800244 main.log.info( "allRoutes_actual = " )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800245 main.log.info( allRoutesActual )
pingping-linc6b86fa2014-12-01 16:18:10 -0800246
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800247 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800248 expect="[]",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800249 actual=str( allRoutesActual ),
kelvin-onlab8a832582015-01-16 17:06:11 -0800250 onpass="***Route number in SDN-IP is 0, correct!***",
251 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
pingping-linc6b86fa2014-12-01 16:18:10 -0800252
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800253 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800254 main.log.report( "***Routes in SDN-IP after deleting correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800255 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800256 main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800257
kelvin-onlab8a832582015-01-16 17:06:11 -0800258 main.step( "Check intents after deleting routes" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800259 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
260 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
261 getIntentsResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800262 main.log.info( "main.ONOScli.intents()= " )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800263 main.log.info( routeIntentsActual )
264 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800265 expect="[]",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800266 actual=str( routeIntentsActual ),
267 onpass="***MultiPointToSinglePoint Intents" +
268 " number in SDN-IP is 0, correct!***",
269 onfail="***MultiPointToSinglePoint Intents " +
270 "number in SDN-IP is 0, wrong!***" )
pingping-linc6b86fa2014-12-01 16:18:10 -0800271
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800272 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800273 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800274 "***MultiPointToSinglePoint Intents" +
275 " after deleting routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800276 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800277 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800278 "***MultiPointToSinglePoint Intents " +
279 "after deleting routes wrong!***" )
pingping-linc6b86fa2014-12-01 16:18:10 -0800280
kelvin-onlab8a832582015-01-16 17:06:11 -0800281 time.sleep( 20 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800282 pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
283 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/" +\
284 "CASE1-ping-results-after-delete-routes-" +\
285 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) +\
286 ".txt"
287 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -0800288 "1.168.30.100",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800289 pingTestScript,
290 pingTestResultsFile )
291 main.log.info( pingTestResults )
kelvin-onlab8a832582015-01-16 17:06:11 -0800292 time.sleep( 30 )
pingping-linc6b86fa2014-12-01 16:18:10 -0800293
kelvin-onlab8a832582015-01-16 17:06:11 -0800294 # main.step( "Test whether Mininet is started" )
295 # main.Mininet2.handle.sendline( "xterm host1" )
296 # main.Mininet2.handle.expect( "mininet>" )
pingping-lin8b306ac2014-11-17 18:13:51 -0800297
kelvin-onlab8a832582015-01-16 17:06:11 -0800298 def CASE2( self, main ):
299 """
pingping-lin3d87a132014-12-04 14:22:49 -0800300 Test the SDN-IP functionality
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800301 allRoutesExpected: all expected routes for all BGP peers
302 routeIntentsExpected: all expected MultiPointToSinglePointIntent
303 intents
304 bgpIntentsExpected: expected PointToPointIntent intents
305 allRoutesActual: all routes from ONOS LCI
306 routeIntentsActual: actual MultiPointToSinglePointIntent intents from
307 ONOS CLI
308 bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
kelvin-onlab8a832582015-01-16 17:06:11 -0800309 """
pingping-lin3d87a132014-12-04 14:22:49 -0800310 import time
311 import json
312 from operator import eq
313 from time import localtime, strftime
314
kelvin-onlab8a832582015-01-16 17:06:11 -0800315 main.case(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800316 "The test case is to help to setup the " +
317 "TestON environment and test new drivers" )
318 SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
pingping-lin3d87a132014-12-04 14:22:49 -0800319 # all expected routes for all BGP peers
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800320 allRoutesExpected = []
kelvin-onlab8a832582015-01-16 17:06:11 -0800321 main.step( "Start to generate routes for all BGP peers" )
pingping-lin3d87a132014-12-04 14:22:49 -0800322
kelvin-onlab8a832582015-01-16 17:06:11 -0800323 main.log.info( "Generate prefixes for host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800324 prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
325 main.log.info( prefixesHost3 )
pingping-lin3d87a132014-12-04 14:22:49 -0800326 # generate route with next hop
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800327 for prefix in prefixesHost3:
328 allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
329 routeIntentsExpectedHost3 = main.QuaggaCliHost3.\
330 generateExpectedOnePeerRouteIntents( prefixesHost3,
331 "192.168.20.1",
332 "00:00:00:00:02:02",
333 SDNIPJSONFILEPATH )
pingping-lin3d87a132014-12-04 14:22:49 -0800334
kelvin-onlab8a832582015-01-16 17:06:11 -0800335 main.log.info( "Generate prefixes for host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800336 prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
337 main.log.info( prefixesHost4 )
pingping-lin3d87a132014-12-04 14:22:49 -0800338 # generate route with next hop
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800339 for prefix in prefixesHost4:
340 allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
341 routeIntentsExpectedHost4 = main.QuaggaCliHost4.\
342 generateExpectedOnePeerRouteIntents( prefixesHost4,
343 "192.168.30.1",
344 "00:00:00:00:03:01",
345 SDNIPJSONFILEPATH )
pingping-lin3d87a132014-12-04 14:22:49 -0800346
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800347 routeIntentsExpected = routeIntentsExpectedHost3 + \
348 routeIntentsExpectedHost4
pingping-lin3d87a132014-12-04 14:22:49 -0800349
kelvin-onlab8a832582015-01-16 17:06:11 -0800350 main.log.report( "Removing raft logs" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800351 main.ONOSbench.onosRemoveRaftLogs()
kelvin-onlab8a832582015-01-16 17:06:11 -0800352 main.log.report( "Uninstalling ONOS" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800353 main.ONOSbench.onosUninstall( ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -0800354
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800355 cellName = main.params[ 'ENV' ][ 'cellName' ]
356 ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
kelvin-onlab8a832582015-01-16 17:06:11 -0800357 main.step( "Set cell for ONOS-cli environment" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800358 main.ONOScli.setCell( cellName )
359 verifyResult = main.ONOSbench.verifyCell()
360 # main.log.report( "Removing raft logs" )
361 # main.ONOSbench.onosRemoveRaftLogs()
362 # main.log.report( "Uninstalling ONOS" )
363 # main.ONOSbench.onosUninstall( ONOS1Ip )
kelvin-onlab8a832582015-01-16 17:06:11 -0800364 main.step( "Creating ONOS package" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800365 packageResult = main.ONOSbench.onosPackage()
pingping-lin3d87a132014-12-04 14:22:49 -0800366
kelvin-onlab8a832582015-01-16 17:06:11 -0800367 main.step( "Installing ONOS package" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800368 onos1InstallResult = main.ONOSbench.onosInstall(
kelvin-onlab8a832582015-01-16 17:06:11 -0800369 options="-f",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800370 node=ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -0800371
kelvin-onlab8a832582015-01-16 17:06:11 -0800372 main.step( "Checking if ONOS is up yet" )
373 time.sleep( 60 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800374 onos1Isup = main.ONOSbench.isup( ONOS1Ip )
375 if not onos1Isup:
kelvin-onlab8a832582015-01-16 17:06:11 -0800376 main.log.report( "ONOS1 didn't start!" )
pingping-lin3d87a132014-12-04 14:22:49 -0800377
kelvin-onlab8a832582015-01-16 17:06:11 -0800378 main.step( "Start ONOS-cli" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800379 main.ONOScli.startOnosCli( ONOS1Ip )
pingping-lin3d87a132014-12-04 14:22:49 -0800380
kelvin-onlab8a832582015-01-16 17:06:11 -0800381 main.step( "Get devices in the network" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800382 listResult = main.ONOScli.devices( jsonFormat=False )
383 main.log.info( listResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800384 time.sleep( 10 )
385 main.log.info( "Installing sdn-ip feature" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800386 main.ONOScli.featureInstall( "onos-app-sdnip" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800387 time.sleep( 10 )
pingping-lin3d87a132014-12-04 14:22:49 -0800388
kelvin-onlab8a832582015-01-16 17:06:11 -0800389 main.step( "Check BGP PointToPointIntent intents installed" )
pingping-lin3d87a132014-12-04 14:22:49 -0800390 # bgp intents expected
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800391 bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
392 SDNIPJSONFILEPATH )
pingping-lin3d87a132014-12-04 14:22:49 -0800393 # get BGP intents from ONOS CLI
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800394 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
395 bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
396 getIntentsResult )
pingping-lin3d87a132014-12-04 14:22:49 -0800397
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800398 bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
399 bgpIntentsStrActual = str( bgpIntentsActual )
kelvin-onlab8a832582015-01-16 17:06:11 -0800400 main.log.info( "PointToPointIntent intents expected:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800401 main.log.info( bgpIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800402 main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800403 main.log.info( bgpIntentsStrActual )
pingping-lin3d87a132014-12-04 14:22:49 -0800404
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800405 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800406 expect=True,
407 actual=eq(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800408 bgpIntentsStrExpected,
409 bgpIntentsStrActual ),
kelvin-onlab8a832582015-01-16 17:06:11 -0800410 onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
411 onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800412
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800413 if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800414 main.log.report(
415 "***PointToPointIntent Intents in SDN-IP are correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800416 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800417 main.log.report(
418 "***PointToPointIntent Intents in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800419
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800420 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
421 routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
422 pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
423 # roundNum = 0;
kelvin-onlab8a832582015-01-16 17:06:11 -0800424 # while( True ):
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800425 for roundNum in range( 1, 6 ):
pingping-lin3d87a132014-12-04 14:22:49 -0800426 # round = round + 1;
kelvin-onlab8a832582015-01-16 17:06:11 -0800427 main.log.report(
428 "The Round " +
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800429 str( roundNum ) +
kelvin-onlab8a832582015-01-16 17:06:11 -0800430 " test starts........................................" )
pingping-lin3d87a132014-12-04 14:22:49 -0800431
kelvin-onlab8a832582015-01-16 17:06:11 -0800432 main.step( "Login all BGP peers and add routes into peers" )
433 main.log.info( "Login Quagga CLI on host3" )
434 main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
435 main.log.info( "Enter configuration model of Quagga CLI on host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800436 main.QuaggaCliHost3.enterConfig( 64514 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800437 main.log.info( "Add routes to Quagga on host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800438 main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
pingping-lin3d87a132014-12-04 14:22:49 -0800439
kelvin-onlab8a832582015-01-16 17:06:11 -0800440 main.log.info( "Login Quagga CLI on host4" )
441 main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
442 main.log.info( "Enter configuration model of Quagga CLI on host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800443 main.QuaggaCliHost4.enterConfig( 64516 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800444 main.log.info( "Add routes to Quagga on host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800445 main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800446 time.sleep( 60 )
pingping-lin3d87a132014-12-04 14:22:49 -0800447
448 # get all routes inside SDN-IP
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800449 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
pingping-lin3d87a132014-12-04 14:22:49 -0800450
451 # parse routes from ONOS CLI
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800452 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
453 getRoutesResult )
pingping-lin3d87a132014-12-04 14:22:49 -0800454
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800455 # allRoutesStrExpected = str( sorted( allRoutesExpected ) )
456 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800457 main.step( "Check routes installed" )
458 main.log.info( "Routes expected:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800459 main.log.info( allRoutesStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800460 main.log.info( "Routes get from ONOS CLI:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800461 main.log.info( allRoutesStrActual )
462 utilities.assertEquals(
463 expect=allRoutesStrExpected,
464 actual=allRoutesStrActual,
kelvin-onlab8a832582015-01-16 17:06:11 -0800465 onpass="***Routes in SDN-IP are correct!***",
466 onfail="***Routes in SDN-IP are wrong!***" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800467 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800468 main.log.report(
469 "***Routes in SDN-IP after adding correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800470 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800471 main.log.report( "***Routes in SDN-IP after adding wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800472
kelvin-onlab8a832582015-01-16 17:06:11 -0800473 time.sleep( 20 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800474 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin3d87a132014-12-04 14:22:49 -0800475
kelvin-onlab8a832582015-01-16 17:06:11 -0800476 main.step(
477 "Check MultiPointToSinglePointIntent intents installed" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800478 # routeIntentsExpected are generated when generating routes
pingping-lin3d87a132014-12-04 14:22:49 -0800479 # get route intents from ONOS CLI
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800480 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
481 getIntentsResult )
482 # routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
483 routeIntentsStrActual = str(
484 routeIntentsActual ).replace( 'u', "" )
kelvin-onlab8a832582015-01-16 17:06:11 -0800485 main.log.info( "MultiPointToSinglePoint intents expected:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800486 main.log.info( routeIntentsStrExpected )
kelvin-onlab8a832582015-01-16 17:06:11 -0800487 main.log.info(
488 "MultiPointToSinglePoint intents get from ONOS CLI:" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800489 main.log.info( routeIntentsStrActual )
490 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800491 expect=True,
492 actual=eq(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800493 routeIntentsStrExpected,
494 routeIntentsStrActual ),
495 onpass= "***MultiPointToSinglePoint " +
496 "Intents in SDN-IP are correct!***",
497 onfail= "***MultiPointToSinglePoint Intents " +
498 "in SDN-IP are wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800499
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800500 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800501 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800502 "***MultiPointToSinglePoint Intents" +
503 " after adding routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800504 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800505 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800506 "***MultiPointToSinglePoint Intents" +
507 " after adding routes wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800508
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800509 # ============================= Ping Test ========================
pingping-lin3d87a132014-12-04 14:22:49 -0800510 # wait until all MultiPointToSinglePoint
kelvin-onlab8a832582015-01-16 17:06:11 -0800511 time.sleep( 20 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800512 # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
513 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" + \
514 str( roundNum ) + "-ping-results-before-delete-routes-" +\
515 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
516 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -0800517 "1.168.30.100",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800518 pingTestScript,
519 pingTestResultsFile )
520 main.log.info( pingTestResults )
pingping-lin3d87a132014-12-04 14:22:49 -0800521 # ping test
522
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800523 # ============================= Deleting Routes ==================
kelvin-onlab8a832582015-01-16 17:06:11 -0800524 main.step( "Check deleting routes installed" )
525 main.log.info( "Delete routes to Quagga on host3" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800526 main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
kelvin-onlab8a832582015-01-16 17:06:11 -0800527 main.log.info( "Delete routes to Quagga on host4" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800528 main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
pingping-lin3d87a132014-12-04 14:22:49 -0800529
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800530 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
531 allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
532 getRoutesResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800533 main.log.info( "allRoutes_actual = " )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800534 main.log.info( allRoutesActual )
pingping-lin3d87a132014-12-04 14:22:49 -0800535
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800536 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800537 expect="[]",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800538 actual=str( allRoutesActual ),
kelvin-onlab8a832582015-01-16 17:06:11 -0800539 onpass="***Route number in SDN-IP is 0, correct!***",
540 onfail="***Routes number in SDN-IP is not 0, wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800541
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800542 if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800543 main.log.report(
544 "***Routes in SDN-IP after deleting correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800545 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800546 main.log.report(
547 "***Routes in SDN-IP after deleting wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800548
kelvin-onlab8a832582015-01-16 17:06:11 -0800549 main.step( "Check intents after deleting routes" )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800550 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
551 routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents(
552 getIntentsResult )
kelvin-onlab8a832582015-01-16 17:06:11 -0800553 main.log.info( "main.ONOScli.intents()= " )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800554 main.log.info( routeIntentsActual )
555 utilities.assertEquals(
kelvin-onlab8a832582015-01-16 17:06:11 -0800556 expect="[]",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800557 actual=str( routeIntentsActual ),
558 onpass="***MultiPointToSinglePoint Intents " +
559 "number in SDN-IP is 0, correct!***",
560 onfail="***MultiPointToSinglePoint Intents " +
561 "number in SDN-IP is 0, wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800562
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800563 if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
kelvin-onlab8a832582015-01-16 17:06:11 -0800564 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800565 "***MultiPointToSinglePoint Intents " +
566 "after deleting routes correct!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800567 else:
kelvin-onlab8a832582015-01-16 17:06:11 -0800568 main.log.report(
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800569 "***MultiPointToSinglePoint Intents " +
570 "after deleting routes wrong!***" )
pingping-lin3d87a132014-12-04 14:22:49 -0800571
kelvin-onlab8a832582015-01-16 17:06:11 -0800572 time.sleep( 20 )
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800573 # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
574 pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" + \
575 str( roundNum ) + "-ping-results-after-delete-routes-" +\
576 strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
577 pingTestResults = main.QuaggaCliHost.pingTest(
kelvin-onlab8a832582015-01-16 17:06:11 -0800578 "1.168.30.100",
kelvin-onlab7bbb5612015-01-26 10:54:50 -0800579 pingTestScript,
580 pingTestResultsFile )
581 main.log.info( pingTestResults )
kelvin-onlab8a832582015-01-16 17:06:11 -0800582 time.sleep( 30 )