pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1 | # from cupshelpers.config import prefix |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 2 | |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 3 | # Testing the basic functionality of SDN-IP |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 4 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 5 | |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 6 | class SdnIpTest: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 7 | |
| 8 | def __init__( self ): |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 9 | self.default = '' |
| 10 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 11 | # from cupshelpers.config import prefix |
| 12 | |
| 13 | # Testing the basic functionality of SDN-IP |
| 14 | |
| 15 | |
| 16 | class SdnIpTest: |
| 17 | |
| 18 | def __init__( self ): |
| 19 | self.default = '' |
| 20 | |
| 21 | def CASE4( self, main ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 22 | """ |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 23 | Test the SDN-IP functionality |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 24 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 30 | """ |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 31 | import time |
| 32 | import json |
| 33 | from operator import eq |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 34 | # from datetime import datetime |
pingping-lin | 01355a6 | 2014-12-02 20:58:14 -0800 | [diff] [blame] | 35 | from time import localtime, strftime |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 36 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 37 | main.case( |
| 38 | "The test case is to help to setup the TestON environment and test new drivers" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 39 | # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json" |
| 40 | SDNIPJSONFILEPATH = "/home/admin/workspace/onos/tools/package/config/sdnip.json" |
pingping-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 41 | # all expected routes for all BGP peers |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 42 | allRoutesExpected = [] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 43 | main.step( "Start to generate routes for all BGP peers" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 44 | main.log.info( "Generate prefixes for host3" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 45 | prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 ) |
| 46 | main.log.info( prefixesHost3 ) |
pingping-lin | 36fbe80 | 2014-11-25 16:01:14 -0800 | [diff] [blame] | 47 | # generate route with next hop |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 48 | 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-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 52 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 53 | main.log.info( "Generate prefixes for host4" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 54 | prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 ) |
| 55 | main.log.info( prefixesHost4 ) |
pingping-lin | 36fbe80 | 2014-11-25 16:01:14 -0800 | [diff] [blame] | 56 | # generate route with next hop |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 57 | 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-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 61 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 62 | 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-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 69 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 70 | routeIntentsExpected = routeIntentsExpectedHost3 + \ |
| 71 | routeIntentsExpectedHost4 + routeIntentsExpectedHost5 |
| 72 | |
| 73 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 74 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 75 | main.step( "Set cell for ONOS-cli environment" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 76 | main.ONOScli.setCell( cellName ) |
| 77 | verifyResult = main.ONOSbench.verifyCell() |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 78 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 79 | main.log.report( "Removing raft logs" ) |
| 80 | main.ONOSbench.onosRemoveRaftLogs() |
| 81 | main.log.report( "Uninstalling ONOS" ) |
| 82 | main.ONOSbench.onosUninstall( ONOS1Ip ) |
| 83 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 84 | main.step( "Installing ONOS package" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 85 | onos1InstallResult = main.ONOSbench.onosInstall( |
| 86 | options="-f", node=ONOS1Ip ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 87 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 88 | main.step( "Checking if ONOS is up yet" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 89 | time.sleep( 150 ) |
| 90 | onos1Isup = main.ONOSbench.isup( ONOS1Ip ) |
| 91 | if not onos1Isup: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 92 | main.log.report( "ONOS1 didn't start!" ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 93 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 94 | main.step( "Start ONOS-cli" ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 95 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 96 | main.ONOScli.startOnosCli( ONOS1Ip ) |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 97 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 98 | main.step( "Get devices in the network" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 99 | listResult = main.ONOScli.devices( jsonFormat=False ) |
| 100 | main.log.info( listResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 101 | time.sleep( 10 ) |
| 102 | main.log.info( "Installing sdn-ip feature" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 103 | main.ONOScli.featureInstall( "onos-app-sdnip" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 104 | time.sleep( 10 ) |
| 105 | main.step( "Login all BGP peers and add routes into peers" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 106 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 107 | 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-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 110 | main.QuaggaCliHost3.enterConfig( 64514 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 111 | main.log.info( "Add routes to Quagga on host3" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 112 | main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 ) |
pingping-lin | bc23094 | 2014-12-03 18:36:27 -0800 | [diff] [blame] | 113 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 114 | 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-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 117 | main.QuaggaCliHost4.enterConfig( 64516 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 118 | main.log.info( "Add routes to Quagga on host4" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 119 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 150 | time.sleep( 60 ) |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 151 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 152 | # get routes inside SDN-IP |
| 153 | getRoutesResult = main.ONOScli.routes( jsonFormat=True ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 154 | |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 155 | # parse routes from ONOS CLI |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 156 | allRoutesActual = main.QuaggaCliHost3.extractActualRoutes( |
| 157 | getRoutesResult ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 158 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 159 | allRoutesStrExpected = str( sorted( allRoutesExpected ) ) |
| 160 | allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 161 | main.step( "Check routes installed" ) |
| 162 | main.log.info( "Routes expected:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 163 | main.log.info( allRoutesStrExpected ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 164 | main.log.info( "Routes get from ONOS CLI:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 165 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 171 | main.log.report( |
| 172 | "***Routes in SDN-IP after adding routes are correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 173 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 174 | main.log.report( |
| 175 | "***Routes in SDN-IP after adding routes are wrong!***" ) |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 176 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 177 | time.sleep( 20 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 178 | getIntentsResult = main.ONOScli.intents( jsonFormat=True ) |
pingping-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 179 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 180 | main.step( "Check MultiPointToSinglePointIntent intents installed" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 181 | # routeIntentsExpected are generated when generating routes |
pingping-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 182 | # get rpoute intents from ONOS CLI |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 183 | routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents( |
| 184 | getIntentsResult ) |
| 185 | routeIntentsStrExpected = str( sorted( routeIntentsExpected ) ) |
| 186 | routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 187 | main.log.info( "MultiPointToSinglePoint intents expected:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 188 | main.log.info( routeIntentsStrExpected ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 189 | main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 190 | 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-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 196 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 197 | if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 198 | main.log.report( |
| 199 | "***MultiPointToSinglePoint Intents before deleting routes correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 200 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 201 | main.log.report( |
| 202 | "***MultiPointToSinglePoint Intents before deleting routes wrong!***" ) |
pingping-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 203 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 204 | main.step( "Check BGP PointToPointIntent intents installed" ) |
pingping-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 205 | # bgp intents expected |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 206 | bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents( |
| 207 | SDNIPJSONFILEPATH ) |
pingping-lin | 6f6332e | 2014-11-19 19:13:58 -0800 | [diff] [blame] | 208 | # get BGP intents from ONOS CLI |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 209 | bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents( |
| 210 | getIntentsResult ) |
pingping-lin | 3228e13 | 2014-11-20 17:49:02 -0800 | [diff] [blame] | 211 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 212 | bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" ) |
| 213 | bgpIntentsStrActual = str( bgpIntentsActual ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 214 | main.log.info( "PointToPointIntent intents expected:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 215 | main.log.info( bgpIntentsStrExpected ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 216 | main.log.info( "PointToPointIntent intents get from ONOS CLI:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 217 | main.log.info( bgpIntentsStrActual ) |
pingping-lin | 3228e13 | 2014-11-20 17:49:02 -0800 | [diff] [blame] | 218 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 219 | 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-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 224 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 225 | if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 226 | main.log.report( |
| 227 | "***PointToPointIntent Intents in SDN-IP are correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 228 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 229 | main.log.report( |
| 230 | "***PointToPointIntent Intents in SDN-IP are wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 231 | |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 232 | #============================= Ping Test ======================== |
| 233 | # wait until all MultiPointToSinglePoint |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 234 | time.sleep( 20 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 235 | pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh" |
| 236 | pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-before-delete-routes-" + \ |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 237 | strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt" |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 238 | pingTestResults = main.QuaggaCliHost.pingTest( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 239 | "1.168.30.100", |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 240 | pingTestScript, |
| 241 | pingTestResultsFile ) |
| 242 | main.log.info( pingTestResults ) |
| 243 | time.sleep( 20 ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 244 | |
| 245 | #============================= Deleting Routes ================== |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 246 | main.step( "Check deleting routes installed" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 247 | main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 ) |
| 248 | main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 ) |
| 249 | main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 250 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 251 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 260 | main.log.info( "allRoutes_actual = " ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 261 | main.log.info( allRoutesActual ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 262 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 263 | 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-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 266 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 267 | if( eq( allRoutesStrExpected, allRoutesStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 268 | main.log.report( "***Routes in SDN-IP after deleting correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 269 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 270 | main.log.report( "***Routes in SDN-IP after deleting wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 271 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 272 | main.step( "Check intents after deleting routes" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 273 | getIntentsResult = main.ONOScli.intents( jsonFormat=True ) |
| 274 | routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents( |
| 275 | getIntentsResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 276 | main.log.info( "main.ONOScli.intents()= " ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 277 | 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-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 281 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 282 | if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 283 | main.log.report( |
| 284 | "***MultiPointToSinglePoint Intents after deleting routes correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 285 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 286 | main.log.report( |
| 287 | "***MultiPointToSinglePoint Intents after deleting routes wrong!***" ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 288 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 289 | time.sleep( 20 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 290 | pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh" |
| 291 | pingTestResultsFile = "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-after-delete-routes-" + \ |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 292 | strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt" |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 293 | pingTestResults = main.QuaggaCliHost.pingTest( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 294 | "1.168.30.100", |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 295 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 832 | time.sleep( 30 ) |
pingping-lin | c6b86fa | 2014-12-01 16:18:10 -0800 | [diff] [blame] | 833 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 834 | # main.step( "Test whether Mininet is started" ) |
| 835 | # main.Mininet2.handle.sendline( "xterm host1" ) |
| 836 | # main.Mininet2.handle.expect( "mininet>" ) |
pingping-lin | 8b306ac | 2014-11-17 18:13:51 -0800 | [diff] [blame] | 837 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 838 | def CASE2( self, main ): |
| 839 | """ |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 840 | Test the SDN-IP functionality |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 841 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 847 | """ |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 848 | import time |
| 849 | import json |
| 850 | from operator import eq |
| 851 | from time import localtime, strftime |
| 852 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 853 | main.case( |
| 854 | "The test case is to help to setup the TestON environment and test new drivers" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 855 | SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json" |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 856 | # all expected routes for all BGP peers |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 857 | allRoutesExpected = [] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 858 | main.step( "Start to generate routes for all BGP peers" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 859 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 860 | main.log.info( "Generate prefixes for host3" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 861 | prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 ) |
| 862 | main.log.info( prefixesHost3 ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 863 | # generate route with next hop |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 864 | 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-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 868 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 869 | main.log.info( "Generate prefixes for host4" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 870 | prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 ) |
| 871 | main.log.info( prefixesHost4 ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 872 | # generate route with next hop |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 873 | 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-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 877 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 878 | routeIntentsExpected = routeIntentsExpectedHost3 + \ |
| 879 | routeIntentsExpectedHost4 |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 880 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 881 | main.log.report( "Removing raft logs" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 882 | main.ONOSbench.onosRemoveRaftLogs() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 883 | main.log.report( "Uninstalling ONOS" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 884 | main.ONOSbench.onosUninstall( ONOS1Ip ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 885 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 886 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 887 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 888 | main.step( "Set cell for ONOS-cli environment" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 889 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 895 | main.step( "Creating ONOS package" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 896 | # packageResult = main.ONOSbench.onosPackage() |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 897 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 898 | main.step( "Installing ONOS package" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 899 | # onos1InstallResult = main.ONOSbench.onosInstall( options="-f", |
| 900 | # node=ONOS1Ip ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 901 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 902 | main.step( "Checking if ONOS is up yet" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 903 | # time.sleep( 60 ) |
| 904 | onos1Isup = main.ONOSbench.isup( ONOS1Ip ) |
| 905 | if not onos1Isup: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 906 | main.log.report( "ONOS1 didn't start!" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 907 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 908 | main.step( "Start ONOS-cli" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 909 | main.ONOScli.startOnosCli( ONOS1Ip ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 910 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 911 | main.step( "Get devices in the network" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 912 | listResult = main.ONOScli.devices( jsonFormat=False ) |
| 913 | main.log.info( listResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 914 | time.sleep( 10 ) |
| 915 | main.log.info( "Installing sdn-ip feature" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 916 | main.ONOScli.featureInstall( "onos-app-sdnip" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 917 | time.sleep( 10 ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 918 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 919 | main.step( "Check BGP PointToPointIntent intents installed" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 920 | # bgp intents expected |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 921 | bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents( |
| 922 | SDNIPJSONFILEPATH ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 923 | # get BGP intents from ONOS CLI |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 924 | getIntentsResult = main.ONOScli.intents( jsonFormat=True ) |
| 925 | bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents( |
| 926 | getIntentsResult ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 927 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 928 | bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" ) |
| 929 | bgpIntentsStrActual = str( bgpIntentsActual ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 930 | main.log.info( "PointToPointIntent intents expected:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 931 | main.log.info( bgpIntentsStrExpected ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 932 | main.log.info( "PointToPointIntent intents get from ONOS CLI:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 933 | main.log.info( bgpIntentsStrActual ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 934 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 935 | 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-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 940 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 941 | if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 942 | main.log.report( |
| 943 | "***PointToPointIntent Intents in SDN-IP are correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 944 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 945 | main.log.report( |
| 946 | "***PointToPointIntent Intents in SDN-IP are wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 947 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 948 | allRoutesStrExpected = str( sorted( allRoutesExpected ) ) |
| 949 | routeIntentsStrExpected = str( sorted( routeIntentsExpected ) ) |
| 950 | pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh" |
| 951 | # roundNum = 0; |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 952 | # while( True ): |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 953 | for roundNum in range( 1, 6 ): |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 954 | # round = round + 1; |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 955 | main.log.report( "The Round " + str( roundNum ) + |
| 956 | " test starts........................................" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 957 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 958 | 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-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 962 | main.QuaggaCliHost3.enterConfig( 64514 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 963 | main.log.info( "Add routes to Quagga on host3" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 964 | main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 965 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 966 | 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-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 969 | main.QuaggaCliHost4.enterConfig( 64516 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 970 | main.log.info( "Add routes to Quagga on host4" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 971 | main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 972 | time.sleep( 60 ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 973 | |
| 974 | # get all routes inside SDN-IP |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 975 | getRoutesResult = main.ONOScli.routes( jsonFormat=True ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 976 | |
| 977 | # parse routes from ONOS CLI |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 978 | allRoutesActual = main.QuaggaCliHost3.extractActualRoutes( |
| 979 | getRoutesResult ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 980 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 981 | # allRoutesStrExpected = str( sorted( allRoutesExpected ) ) |
| 982 | allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 983 | main.step( "Check routes installed" ) |
| 984 | main.log.info( "Routes expected:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 985 | main.log.info( allRoutesStrExpected ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 986 | main.log.info( "Routes get from ONOS CLI:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 987 | 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 993 | main.log.report( |
| 994 | "***Routes in SDN-IP after adding correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 995 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 996 | main.log.report( "***Routes in SDN-IP after adding wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 997 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 998 | time.sleep( 20 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 999 | getIntentsResult = main.ONOScli.intents( jsonFormat=True ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1000 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1001 | main.step( |
| 1002 | "Check MultiPointToSinglePointIntent intents installed" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1003 | # routeIntentsExpected are generated when generating routes |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1004 | # get route intents from ONOS CLI |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1005 | routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents( |
| 1006 | getIntentsResult ) |
| 1007 | # routeIntentsStrExpected = str( sorted( routeIntentsExpected ) ) |
| 1008 | routeIntentsStrActual = str( |
| 1009 | routeIntentsActual ).replace( |
| 1010 | 'u', |
| 1011 | "" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1012 | main.log.info( "MultiPointToSinglePoint intents expected:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1013 | main.log.info( routeIntentsStrExpected ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1014 | main.log.info( |
| 1015 | "MultiPointToSinglePoint intents get from ONOS CLI:" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1016 | 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-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1022 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1023 | if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1024 | main.log.report( |
| 1025 | "***MultiPointToSinglePoint Intents after adding routes correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1026 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1027 | main.log.report( |
| 1028 | "***MultiPointToSinglePoint Intents after adding routes wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1029 | |
| 1030 | #============================= Ping Test ======================== |
| 1031 | # wait until all MultiPointToSinglePoint |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1032 | time.sleep( 20 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1033 | # 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1038 | "1.168.30.100", |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1039 | pingTestScript, |
| 1040 | pingTestResultsFile ) |
| 1041 | main.log.info( pingTestResults ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1042 | # ping test |
| 1043 | |
| 1044 | #============================= Deleting Routes ================== |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1045 | main.step( "Check deleting routes installed" ) |
| 1046 | main.log.info( "Delete routes to Quagga on host3" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1047 | main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1048 | main.log.info( "Delete routes to Quagga on host4" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1049 | main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1050 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1051 | getRoutesResult = main.ONOScli.routes( jsonFormat=True ) |
| 1052 | allRoutesActual = main.QuaggaCliHost3.extractActualRoutes( |
| 1053 | getRoutesResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1054 | main.log.info( "allRoutes_actual = " ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1055 | main.log.info( allRoutesActual ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1056 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1057 | 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-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1060 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1061 | if( eq( allRoutesStrExpected, allRoutesStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1062 | main.log.report( |
| 1063 | "***Routes in SDN-IP after deleting correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1064 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1065 | main.log.report( |
| 1066 | "***Routes in SDN-IP after deleting wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1067 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1068 | main.step( "Check intents after deleting routes" ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1069 | getIntentsResult = main.ONOScli.intents( jsonFormat=True ) |
| 1070 | routeIntentsActual = main.QuaggaCliHost3.extractActualRouteIntents( |
| 1071 | getIntentsResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1072 | main.log.info( "main.ONOScli.intents()= " ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1073 | 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-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1078 | |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1079 | if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1080 | main.log.report( |
| 1081 | "***MultiPointToSinglePoint Intents after deleting routes correct!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1082 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1083 | main.log.report( |
| 1084 | "***MultiPointToSinglePoint Intents after deleting routes wrong!***" ) |
pingping-lin | 3d87a13 | 2014-12-04 14:22:49 -0800 | [diff] [blame] | 1085 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1086 | time.sleep( 20 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1087 | # 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-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1092 | "1.168.30.100", |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1093 | pingTestScript, |
| 1094 | pingTestResultsFile ) |
| 1095 | main.log.info( pingTestResults ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1096 | time.sleep( 30 ) |
pingping-lin | c1c696e | 2015-01-27 13:46:44 -0800 | [diff] [blame^] | 1097 | |