shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 2 | # Testing the basic functionality of ONOS Next |
| 3 | # For sanity and driver functionality excercises only. |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 4 | |
| 5 | import time |
| 6 | import sys |
| 7 | import os |
| 8 | import re |
| 9 | import time |
| 10 | import json |
| 11 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 12 | time.sleep( 1 ) |
| 13 | |
| 14 | |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 15 | class MultiProd: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 16 | |
| 17 | def __init__( self ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 18 | self.default = '' |
| 19 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 20 | def CASE1( self, main ): |
| 21 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 22 | Startup sequence: |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 23 | cell <name> |
| 24 | onos-verify-cell |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 25 | onos-remove-raft-logs |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 26 | git pull |
| 27 | mvn clean install |
| 28 | onos-package |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 29 | onos-install -f |
| 30 | onos-wait-for-start |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 31 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 32 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 33 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 34 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 35 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
| 36 | ONOS1Port = main.params[ 'CTRL' ][ 'port1' ] |
| 37 | ONOS2Port = main.params[ 'CTRL' ][ 'port2' ] |
| 38 | ONOS3Port = main.params[ 'CTRL' ][ 'port3' ] |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 39 | |
| 40 | main.case( "Setting up test environment" ) |
| 41 | main.log.report( |
| 42 | "This testcase is testing setting up test environment" ) |
| 43 | main.log.report( "__________________________________" ) |
| 44 | |
| 45 | main.step( "Applying cell variable to environment" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 46 | cellResult1 = main.ONOSbench.setCell( cellName ) |
| 47 | #cellResult2 = main.ONOScli1.setCell( cellName ) |
| 48 | #cellResult3 = main.ONOScli2.setCell( cellName ) |
| 49 | #cellResult4 = main.ONOScli3.setCell( cellName ) |
| 50 | verifyResult = main.ONOSbench.verifyCell() |
| 51 | cellResult = cellResult1 |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 52 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 53 | main.step( "Removing raft logs before a clen installation of ONOS" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 54 | removeLogResult = main.ONOSbench.onosRemoveRaftLogs() |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 55 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 56 | main.step( "Git checkout and pull master and get version" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 57 | main.ONOSbench.gitCheckout( "master" ) |
| 58 | gitPullResult = main.ONOSbench.gitPull() |
| 59 | print "git_pull_result = ", gitPullResult |
| 60 | versionResult = main.ONOSbench.getVersion( report=True ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 61 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 62 | if gitPullResult == 1: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 63 | main.step( "Using mvn clean & install" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 64 | cleanInstallResult = main.ONOSbench.cleanInstall() |
| 65 | #cleanInstallResult = main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 66 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 67 | main.step( "Creating ONOS package" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 68 | packageResult = main.ONOSbench.onosPackage() |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 69 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 70 | #main.step( "Creating a cell" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 71 | # cellCreateResult = main.ONOSbench.createCellFile( ************** |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 72 | # ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 73 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 74 | main.step( "Installing ONOS package" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 75 | onos1InstallResult = main.ONOSbench.onosInstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 76 | options="-f", |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 77 | node=ONOS1Ip ) |
| 78 | onos2InstallResult = main.ONOSbench.onosInstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 79 | options="-f", |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 80 | node=ONOS2Ip ) |
| 81 | onos3InstallResult = main.ONOSbench.onosInstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 82 | options="-f", |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 83 | node=ONOS3Ip ) |
| 84 | onosInstallResult = onos1InstallResult and onos2InstallResult and onos3InstallResult |
| 85 | if onosInstallResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 86 | main.log.report( "Installing ONOS package successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 87 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 88 | main.log.report( "Installing ONOS package failed" ) |
| 89 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 90 | onos1Isup = main.ONOSbench.isup( ONOS1Ip ) |
| 91 | onos2Isup = main.ONOSbench.isup( ONOS2Ip ) |
| 92 | onos3Isup = main.ONOSbench.isup( ONOS3Ip ) |
| 93 | onosIsup = onos1Isup and onos2Isup and onos3Isup |
| 94 | if onosIsup == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 95 | main.log.report( "ONOS instances are up and ready" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 96 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 97 | main.log.report( "ONOS instances may not be up" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 98 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 99 | main.step( "Starting ONOS service" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 100 | startResult = main.TRUE |
| 101 | #startResult = main.ONOSbench.onosStart( ONOS1Ip ) |
| 102 | startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip ) |
| 103 | startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip ) |
| 104 | startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 105 | print startcli1 |
| 106 | print startcli2 |
| 107 | print startcli3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 108 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 109 | case1Result = ( packageResult and |
| 110 | cellResult and verifyResult and onosInstallResult and |
| 111 | onosIsup and startResult ) |
| 112 | utilities.assertEquals( expect=main.TRUE, actual=case1Result, |
| 113 | onpass="Test startup successful", |
| 114 | onfail="Test startup NOT successful" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 115 | |
| 116 | def CASE11( self, main ): |
| 117 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 118 | Cleanup sequence: |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 119 | onos-service <nodeIp> stop |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 120 | onos-uninstall |
| 121 | |
| 122 | TODO: Define rest of cleanup |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 123 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 124 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 125 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 126 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 127 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 128 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 129 | main.case( "Cleaning up test environment" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 130 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 131 | main.step( "Testing ONOS kill function" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 132 | killResult1 = main.ONOSbench.onosKill( ONOS1Ip ) |
| 133 | killResult2 = main.ONOSbench.onosKill( ONOS2Ip ) |
| 134 | killResult3 = main.ONOSbench.onosKill( ONOS3Ip ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 135 | |
| 136 | main.step( "Stopping ONOS service" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 137 | stopResult1 = main.ONOSbench.onosStop( ONOS1Ip ) |
| 138 | stopResult2 = main.ONOSbench.onosStop( ONOS2Ip ) |
| 139 | stopResult3 = main.ONOSbench.onosStop( ONOS3Ip ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 140 | |
| 141 | main.step( "Uninstalling ONOS service" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 142 | uninstallResult = main.ONOSbench.onosUninstall() |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 143 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 144 | def CASE3( self, main ): |
| 145 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 146 | Test 'onos' command and its functionality in driver |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 147 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 148 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 149 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 150 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 151 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 152 | main.case( "Testing 'onos' command" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 153 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 154 | main.step( "Sending command 'onos -w <onos-ip> system:name'" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 155 | cmdstr1 = "system:name" |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 156 | cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 ) |
| 157 | main.log.info( "onos command returned: " + cmdResult1 ) |
| 158 | cmdResult2 = main.ONOSbench.onosCli( ONOS2Ip, cmdstr1 ) |
| 159 | main.log.info( "onos command returned: " + cmdResult2 ) |
| 160 | cmdResult3 = main.ONOSbench.onosCli( ONOS3Ip, cmdstr1 ) |
| 161 | main.log.info( "onos command returned: " + cmdResult3 ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 162 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 163 | main.step( "Sending command 'onos -w <onos-ip> onos:topology'" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 164 | cmdstr2 = "onos:topology" |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 165 | cmdResult4 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 ) |
| 166 | main.log.info( "onos command returned: " + cmdResult4 ) |
| 167 | cmdResult5 = main.ONOSbench.onosCli( ONOS2Ip, cmdstr2 ) |
| 168 | main.log.info( "onos command returned: " + cmdResult5 ) |
| 169 | cmdResult6 = main.ONOSbench.onosCli( ONOS6Ip, cmdstr2 ) |
| 170 | main.log.info( "onos command returned: " + cmdResult6 ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 171 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 172 | def CASE4( self, main ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 173 | import re |
| 174 | import time |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 175 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 176 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 177 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
| 178 | ONOS1Port = main.params[ 'CTRL' ][ 'port1' ] |
| 179 | ONOS2Port = main.params[ 'CTRL' ][ 'port2' ] |
| 180 | ONOS3Port = main.params[ 'CTRL' ][ 'port3' ] |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 181 | |
| 182 | main.log.report( |
| 183 | "This testcase is testing the assignment of all the switches to all controllers and discovering the hosts in reactive mode" ) |
| 184 | main.log.report( "__________________________________" ) |
| 185 | main.case( "Pingall Test(No intents are added)" ) |
| 186 | main.step( "Assigning switches to controllers" ) |
| 187 | for i in range( 1, 29 ): # 1 to ( num of switches +1 ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 188 | main.Mininet1.assignSwController( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 189 | sw=str( i ), |
| 190 | count=3, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 191 | ip1=ONOS1Ip, |
| 192 | port1=ONOS1Port, |
| 193 | ip2=ONOS2Ip, |
| 194 | port2=ONOS2Port, |
| 195 | ip3=ONOS3Ip, |
| 196 | port3=ONOS3Port ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 197 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 198 | switchMastership = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 199 | for i in range( 1, 29 ): |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 200 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 201 | print( "Response is " + str( response ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 202 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 203 | switchMastership = switchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 204 | else: |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 205 | switchMastership = main.FALSE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 206 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 207 | if switchMastership == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 208 | main.log.report( "Controller assignment successfull" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 209 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 210 | main.log.report( "Controller assignment failed" ) |
| 211 | # REACTIVE FWD test |
| 212 | main.step( "Pingall" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 213 | pingResult = main.FALSE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 214 | time1 = time.time() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 215 | pingResult = main.Mininet1.pingall() |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 216 | time2 = time.time() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 217 | print "Time for pingall: %2f seconds" % ( time2 - time1 ) |
| 218 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 219 | case4Result = switchMastership and pingResult |
| 220 | if pingResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 221 | main.log.report( |
| 222 | "Pingall Test in reactive mode to discover the hosts successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 223 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 224 | main.log.report( |
| 225 | "Pingall Test in reactive mode to discover the hosts failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 226 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 227 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 228 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 229 | actual=case4Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 230 | onpass="Controller assignment and Pingall Test successful", |
| 231 | onfail="Controller assignment and Pingall Test NOT successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 232 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 233 | def CASE5( self, main ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 234 | import json |
| 235 | from subprocess import Popen, PIPE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 236 | # assumes that sts is already in you PYTHONPATH |
| 237 | from sts.topology.teston_topology import TestONTopology |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 238 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 239 | ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ] |
| 240 | ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ] |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 241 | |
| 242 | main.log.report( |
| 243 | "This testcase is testing if all ONOS nodes are in topology sync with mininet and its peer ONOS nodes" ) |
| 244 | main.log.report( "__________________________________" ) |
| 245 | main.case( |
| 246 | "Testing Mininet topology with the topology of multi instances ONOS" ) |
| 247 | main.step( "Collecting topology information from ONOS" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 248 | devices1 = main.ONOScli1.devices() |
| 249 | devices2 = main.ONOScli2.devices() |
| 250 | devices3 = main.ONOScli3.devices() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 251 | # print "devices1 = ", devices1 |
| 252 | # print "devices2 = ", devices2 |
| 253 | # print "devices3 = ", devices3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 254 | hosts1 = main.ONOScli1.hosts() |
| 255 | hosts2 = main.ONOScli2.hosts() |
| 256 | hosts3 = main.ONOScli3.hosts() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 257 | # print "hosts1 = ", hosts1 |
| 258 | # print "hosts2 = ", hosts2 |
| 259 | # print "hosts3 = ", hosts3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 260 | ports1 = main.ONOScli1.ports() |
| 261 | ports2 = main.ONOScli2.ports() |
| 262 | ports3 = main.ONOScli3.ports() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 263 | # print "ports1 = ", ports1 |
| 264 | # print "ports2 = ", ports2 |
| 265 | # print "ports3 = ", ports3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 266 | links1 = main.ONOScli1.links() |
| 267 | links2 = main.ONOScli2.links() |
| 268 | links3 = main.ONOScli3.links() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 269 | # print "links1 = ", links1 |
| 270 | # print "links2 = ", links2 |
| 271 | # print "links3 = ", links3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 272 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 273 | print "**************" |
| 274 | |
| 275 | main.step( "Start continuous pings" ) |
| 276 | main.Mininet2.pingLong( |
| 277 | src=main.params[ 'PING' ][ 'source1' ], |
| 278 | target=main.params[ 'PING' ][ 'target1' ], |
| 279 | pingTime=500 ) |
| 280 | main.Mininet2.pingLong( |
| 281 | src=main.params[ 'PING' ][ 'source2' ], |
| 282 | target=main.params[ 'PING' ][ 'target2' ], |
| 283 | pingTime=500 ) |
| 284 | main.Mininet2.pingLong( |
| 285 | src=main.params[ 'PING' ][ 'source3' ], |
| 286 | target=main.params[ 'PING' ][ 'target3' ], |
| 287 | pingTime=500 ) |
| 288 | main.Mininet2.pingLong( |
| 289 | src=main.params[ 'PING' ][ 'source4' ], |
| 290 | target=main.params[ 'PING' ][ 'target4' ], |
| 291 | pingTime=500 ) |
| 292 | main.Mininet2.pingLong( |
| 293 | src=main.params[ 'PING' ][ 'source5' ], |
| 294 | target=main.params[ 'PING' ][ 'target5' ], |
| 295 | pingTime=500 ) |
| 296 | main.Mininet2.pingLong( |
| 297 | src=main.params[ 'PING' ][ 'source6' ], |
| 298 | target=main.params[ 'PING' ][ 'target6' ], |
| 299 | pingTime=500 ) |
| 300 | main.Mininet2.pingLong( |
| 301 | src=main.params[ 'PING' ][ 'source7' ], |
| 302 | target=main.params[ 'PING' ][ 'target7' ], |
| 303 | pingTime=500 ) |
| 304 | main.Mininet2.pingLong( |
| 305 | src=main.params[ 'PING' ][ 'source8' ], |
| 306 | target=main.params[ 'PING' ][ 'target8' ], |
| 307 | pingTime=500 ) |
| 308 | main.Mininet2.pingLong( |
| 309 | src=main.params[ 'PING' ][ 'source9' ], |
| 310 | target=main.params[ 'PING' ][ 'target9' ], |
| 311 | pingTime=500 ) |
| 312 | main.Mininet2.pingLong( |
| 313 | src=main.params[ 'PING' ][ 'source10' ], |
| 314 | target=main.params[ 'PING' ][ 'target10' ], |
| 315 | pingTime=500 ) |
| 316 | |
| 317 | main.step( "Create TestONTopology object" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 318 | global ctrls |
| 319 | ctrls = [] |
| 320 | count = 1 |
| 321 | while True: |
| 322 | temp = () |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 323 | if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]: |
| 324 | temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), ) |
| 325 | temp = temp + ( "ONOS" + str( count ), ) |
| 326 | temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], ) |
| 327 | temp = temp + \ |
| 328 | ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), ) |
| 329 | ctrls.append( temp ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 330 | count = count + 1 |
| 331 | else: |
| 332 | break |
| 333 | global MNTopo |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 334 | Topo = TestONTopology( |
| 335 | main.Mininet1, |
| 336 | ctrls ) # can also add Intent API info for intent operations |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 337 | MNTopo = Topo |
| 338 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 339 | TopologyCheck = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 340 | main.step( "Compare ONOS Topology to MN Topology" ) |
| 341 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 342 | switchesResults1 = main.Mininet1.compareSwitches( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 343 | MNTopo, |
| 344 | json.loads( devices1 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 345 | print "switches_Result1 = ", switchesResults1 |
| 346 | utilities.assertEquals( expect=main.TRUE, actual=switchesResults1, |
| 347 | onpass="ONOS1 Switches view is correct", |
| 348 | onfail="ONOS1 Switches view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 349 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 350 | switchesResults2 = main.Mininet1.compareSwitches( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 351 | MNTopo, |
| 352 | json.loads( devices2 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 353 | utilities.assertEquals( expect=main.TRUE, actual=switchesResults2, |
| 354 | onpass="ONOS2 Switches view is correct", |
| 355 | onfail="ONOS2 Switches view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 356 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 357 | switchesResults3 = main.Mininet1.compareSwitches( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 358 | MNTopo, |
| 359 | json.loads( devices3 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 360 | utilities.assertEquals( expect=main.TRUE, actual=switchesResults3, |
| 361 | onpass="ONOS3 Switches view is correct", |
| 362 | onfail="ONOS3 Switches view is incorrect" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 363 | |
| 364 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 365 | portsResults1 = main.Mininet1.comparePorts( MNTopo, json.loads( ports1 ) ) |
| 366 | utilities.assertEquals( expect=main.TRUE, actual=portsResults1, |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 367 | onpass="ONOS1 Ports view is correct", |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 368 | onfail="ONOS1 Ports view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 369 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 370 | portsResults2 = main.Mininet1.comparePorts( MNTopo, json.loads( ports2 ) ) |
| 371 | utilities.assertEquals( expect=main.TRUE, actual=portsResults2, |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 372 | onpass="ONOS2 Ports view is correct", |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 373 | onfail="ONOS2 Ports view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 374 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 375 | portsResults3 = main.Mininet1.comparePorts( MNTopo, json.loads( ports3 ) ) |
| 376 | utilities.assertEquals( expect=main.TRUE, actual=portsResults3, |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 377 | onpass="ONOS3 Ports view is correct", |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 378 | onfail="ONOS3 Ports view is incorrect" ) |
| 379 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 380 | linksResults1 = main.Mininet1.compareLinks( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 381 | MNTopo, |
| 382 | json.loads( links1 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 383 | utilities.assertEquals( expect=main.TRUE, actual=linksResults1, |
| 384 | onpass="ONOS1 Links view is correct", |
| 385 | onfail="ONOS1 Links view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 386 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 387 | linksResults2 = main.Mininet1.compareLinks( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 388 | MNTopo, |
| 389 | json.loads( links2 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 390 | utilities.assertEquals( expect=main.TRUE, actual=linksResults2, |
| 391 | onpass="ONOS2 Links view is correct", |
| 392 | onfail="ONOS2 Links view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 393 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 394 | linksResults3 = main.Mininet1.compareLinks( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 395 | MNTopo, |
| 396 | json.loads( links3 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 397 | utilities.assertEquals( expect=main.TRUE, actual=linksResults3, |
| 398 | onpass="ONOS2 Links view is correct", |
| 399 | onfail="ONOS2 Links view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 400 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 401 | #topoResult = switchesResults1 and switchesResults2 and switchesResults3\ |
| 402 | # and portsResults1 and portsResults2 and portsResults3\ |
| 403 | # and linksResults1 and linksResults2 and linksResults3 |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 404 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 405 | topoResult = switchesResults1 and switchesResults2 and switchesResults3\ |
| 406 | and linksResults1 and linksResults2 and linksResults3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 407 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 408 | if topoResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 409 | main.log.report( |
| 410 | "Topology Check Test with mininet and ONOS instances successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 411 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 412 | main.log.report( |
| 413 | "Topology Check Test with mininet and ONOS instances failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 414 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 415 | utilities.assertEquals( expect=main.TRUE, actual=topoResult, |
| 416 | onpass="Topology Check Test successful", |
| 417 | onfail="Topology Check Test NOT successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 418 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 419 | def CASE10( self ): |
| 420 | main.log.report( |
| 421 | "This testcase uninstalls the reactive forwarding app" ) |
| 422 | main.log.report( "__________________________________" ) |
| 423 | main.case( "Uninstalling reactive forwarding app" ) |
| 424 | # Unistall onos-app-fwd app to disable reactive forwarding |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 425 | appUninstallResult1 = main.ONOScli1.featureUninstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 426 | "onos-app-fwd" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 427 | appUninstallResult2 = main.ONOScli2.featureUninstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 428 | "onos-app-fwd" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 429 | appUninstallResult3 = main.ONOScli3.featureUninstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 430 | "onos-app-fwd" ) |
| 431 | main.log.info( "onos-app-fwd uninstalled" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 432 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 433 | # After reactive forwarding is disabled, the reactive flows on switches timeout in 10-15s |
| 434 | # So sleep for 15s |
| 435 | time.sleep( 15 ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 436 | |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 437 | hosts = main.ONOScli1.hosts() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 438 | main.log.info( hosts ) |
| 439 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 440 | case10Result = appUninstallResult1 and appUninstallResult2 and appUninstallResult3 |
| 441 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 442 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 443 | actual=case10Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 444 | onpass="Reactive forwarding app uninstallation successful", |
| 445 | onfail="Reactive forwarding app uninstallation failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 446 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 447 | def CASE6( self ): |
| 448 | main.log.report( |
| 449 | "This testcase is testing the addition of host intents and then doing pingall" ) |
| 450 | main.log.report( "__________________________________" ) |
| 451 | main.case( "Obtaining hostsfor adding host intents" ) |
| 452 | main.step( "Get hosts" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 453 | hosts = main.ONOScli1.hosts() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 454 | main.log.info( hosts ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 455 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 456 | main.step( "Get all devices id" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 457 | devicesIdList = main.ONOScli1.getAllDevicesId() |
| 458 | main.log.info( devicesIdList ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 459 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 460 | # ONOS displays the hosts in hex format unlike mininet which does in decimal format |
| 461 | # So take care while adding intents |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 462 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 463 | """ |
| 464 | main.step( "Add host intents for mn hosts(h8-h18,h9-h19,h10-h20,h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 465 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:08/-1", "00:00:00:00:00:12/-1" ) |
| 466 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:09/-1", "00:00:00:00:00:13/-1" ) |
| 467 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0A/-1", "00:00:00:00:00:14/-1" ) |
| 468 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0B/-1", "00:00:00:00:00:15/-1" ) |
| 469 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0C/-1", "00:00:00:00:00:16/-1" ) |
| 470 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0D/-1", "00:00:00:00:00:17/-1" ) |
| 471 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0E/-1", "00:00:00:00:00:18/-1" ) |
| 472 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0F/-1", "00:00:00:00:00:19/-1" ) |
| 473 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:10/-1", "00:00:00:00:00:1A/-1" ) |
| 474 | hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:11/-1", "00:00:00:00:00:1B/-1" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 475 | """ |
| 476 | for i in range( 8, 18 ): |
| 477 | main.log.info( |
| 478 | "Adding host intent between h" + str( i ) + " and h" + str( i + 10 ) ) |
| 479 | host1 = "00:00:00:00:00:" + \ |
| 480 | str( hex( i )[ 2: ] ).zfill( 2 ).upper() |
| 481 | host2 = "00:00:00:00:00:" + \ |
| 482 | str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper() |
| 483 | # NOTE: get host can return None |
| 484 | # TODO: handle this |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 485 | host1Id = main.ONOScli1.getHost( host1 )[ 'id' ] |
| 486 | host2Id = main.ONOScli1.getHost( host2 )[ 'id' ] |
| 487 | tmpResult = main.ONOScli1.addHostIntent( host1Id, host2Id ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 488 | |
| 489 | flowHandle = main.ONOScli1.flows() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 490 | # print "flowHandle = ", flowHandle |
| 491 | main.log.info( "flows:" + flowHandle ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 492 | |
| 493 | count = 1 |
| 494 | i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 495 | PingResult = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 496 | while i < 18: |
| 497 | main.log.info( |
| 498 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 499 | ping = main.Mininet1.pingHost( |
| 500 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 501 | if ping == main.FALSE and count < 5: |
| 502 | count += 1 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 503 | #i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 504 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 505 | main.log.report( "Ping between h" + |
| 506 | str( i ) + |
| 507 | " and h" + |
| 508 | str( i + |
| 509 | 10 ) + |
| 510 | " failed. Making attempt number " + |
| 511 | str( count ) + |
| 512 | " in 2 seconds" ) |
| 513 | time.sleep( 2 ) |
| 514 | elif ping == main.FALSE: |
| 515 | main.log.report( "All ping attempts between h" + |
| 516 | str( i ) + |
| 517 | " and h" + |
| 518 | str( i + |
| 519 | 10 ) + |
| 520 | "have failed" ) |
| 521 | i = 19 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 522 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 523 | elif ping == main.TRUE: |
| 524 | main.log.info( "Ping test between h" + |
| 525 | str( i ) + |
| 526 | " and h" + |
| 527 | str( i + |
| 528 | 10 ) + |
| 529 | "passed!" ) |
| 530 | i += 1 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 531 | PingResult = main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 532 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 533 | main.log.info( "Unknown error" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 534 | PingResult = main.ERROR |
| 535 | if PingResult == main.FALSE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 536 | main.log.report( |
| 537 | "Host intents have not ben installed correctly. Cleaning up" ) |
| 538 | # main.cleanup() |
| 539 | # main.exit() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 540 | if PingResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 541 | main.log.report( "Host intents have been installed correctly" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 542 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 543 | case6Result = PingResult |
| 544 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 545 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 546 | actual=case6Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 547 | onpass="Host intent addition and Pingall Test successful", |
| 548 | onfail="Host intent addition and Pingall Test NOT successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 549 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 550 | def CASE7( self, main ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 551 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 552 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 553 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 554 | linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 555 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 556 | main.log.report( |
| 557 | "This testscase is killing a link to ensure that link discovery is consistent" ) |
| 558 | main.log.report( "__________________________________" ) |
| 559 | main.case( |
| 560 | "Killing a link to Ensure that Link Discovery is Working Properly" ) |
| 561 | main.step( "Start continuous pings" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 562 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 563 | main.Mininet2.pingLong( |
| 564 | src=main.params[ 'PING' ][ 'source1' ], |
| 565 | target=main.params[ 'PING' ][ 'target1' ], |
| 566 | pingTime=500 ) |
| 567 | main.Mininet2.pingLong( |
| 568 | src=main.params[ 'PING' ][ 'source2' ], |
| 569 | target=main.params[ 'PING' ][ 'target2' ], |
| 570 | pingTime=500 ) |
| 571 | main.Mininet2.pingLong( |
| 572 | src=main.params[ 'PING' ][ 'source3' ], |
| 573 | target=main.params[ 'PING' ][ 'target3' ], |
| 574 | pingTime=500 ) |
| 575 | main.Mininet2.pingLong( |
| 576 | src=main.params[ 'PING' ][ 'source4' ], |
| 577 | target=main.params[ 'PING' ][ 'target4' ], |
| 578 | pingTime=500 ) |
| 579 | main.Mininet2.pingLong( |
| 580 | src=main.params[ 'PING' ][ 'source5' ], |
| 581 | target=main.params[ 'PING' ][ 'target5' ], |
| 582 | pingTime=500 ) |
| 583 | main.Mininet2.pingLong( |
| 584 | src=main.params[ 'PING' ][ 'source6' ], |
| 585 | target=main.params[ 'PING' ][ 'target6' ], |
| 586 | pingTime=500 ) |
| 587 | main.Mininet2.pingLong( |
| 588 | src=main.params[ 'PING' ][ 'source7' ], |
| 589 | target=main.params[ 'PING' ][ 'target7' ], |
| 590 | pingTime=500 ) |
| 591 | main.Mininet2.pingLong( |
| 592 | src=main.params[ 'PING' ][ 'source8' ], |
| 593 | target=main.params[ 'PING' ][ 'target8' ], |
| 594 | pingTime=500 ) |
| 595 | main.Mininet2.pingLong( |
| 596 | src=main.params[ 'PING' ][ 'source9' ], |
| 597 | target=main.params[ 'PING' ][ 'target9' ], |
| 598 | pingTime=500 ) |
| 599 | main.Mininet2.pingLong( |
| 600 | src=main.params[ 'PING' ][ 'source10' ], |
| 601 | target=main.params[ 'PING' ][ 'target10' ], |
| 602 | pingTime=500 ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 603 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 604 | main.step( "Determine the current number of switches and links" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 605 | topologyOutput = main.ONOScli1.topology() |
| 606 | topologyResult = main.ONOSbench.getTopology( topologyOutput ) |
| 607 | activeSwitches = topologyResult[ 'devices' ] |
| 608 | links = topologyResult[ 'links' ] |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 609 | print "activeSwitches = ", type( activeSwitches ) |
| 610 | print "links = ", type( links ) |
| 611 | main.log.info( |
| 612 | "Currently there are %s switches and %s links" % |
| 613 | ( str( activeSwitches ), str( links ) ) ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 614 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 615 | main.step( "Kill Link between s3 and s28" ) |
| 616 | main.Mininet1.link( END1="s3", END2="s28", OPTION="down" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 617 | time.sleep( linkSleep ) |
| 618 | topologyOutput = main.ONOScli2.topology() |
| 619 | LinkDown = main.ONOSbench.checkStatus( |
| 620 | topologyOutput, activeSwitches, str( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 621 | int( links ) - 2 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 622 | if LinkDown == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 623 | main.log.report( "Link Down discovered properly" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 624 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 625 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 626 | actual=LinkDown, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 627 | onpass="Link Down discovered properly", |
| 628 | onfail="Link down was not discovered in " + |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 629 | str( linkSleep ) + |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 630 | " seconds" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 631 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 632 | main.step( "Bring link between s3 and s28 back up" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 633 | LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" ) |
| 634 | time.sleep( linkSleep ) |
| 635 | topologyOutput = main.ONOScli2.topology() |
| 636 | LinkUp = main.ONOSbench.checkStatus( |
| 637 | topologyOutput, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 638 | activeSwitches, |
| 639 | str( links ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 640 | if LinkUp == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 641 | main.log.report( "Link up discovered properly" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 642 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 643 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 644 | actual=LinkUp, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 645 | onpass="Link up discovered properly", |
| 646 | onfail="Link up was not discovered in " + |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 647 | str( linkSleep ) + |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 648 | " seconds" ) |
| 649 | |
| 650 | main.step( "Compare ONOS Topology to MN Topology" ) |
| 651 | main.case( |
| 652 | "Testing Mininet topology with the topology of multi instances ONOS" ) |
| 653 | main.step( "Collecting topology information from ONOS" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 654 | devices1 = main.ONOScli1.devices() |
| 655 | devices2 = main.ONOScli2.devices() |
| 656 | devices3 = main.ONOScli3.devices() |
| 657 | print "devices1 = ", devices1 |
| 658 | print "devices2 = ", devices2 |
| 659 | print "devices3 = ", devices3 |
| 660 | hosts1 = main.ONOScli1.hosts() |
| 661 | hosts2 = main.ONOScli2.hosts() |
| 662 | hosts3 = main.ONOScli3.hosts() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 663 | # print "hosts1 = ", hosts1 |
| 664 | # print "hosts2 = ", hosts2 |
| 665 | # print "hosts3 = ", hosts3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 666 | ports1 = main.ONOScli1.ports() |
| 667 | ports2 = main.ONOScli2.ports() |
| 668 | ports3 = main.ONOScli3.ports() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 669 | # print "ports1 = ", ports1 |
| 670 | # print "ports2 = ", ports2 |
| 671 | # print "ports3 = ", ports3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 672 | links1 = main.ONOScli1.links() |
| 673 | links2 = main.ONOScli2.links() |
| 674 | links3 = main.ONOScli3.links() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 675 | # print "links1 = ", links1 |
| 676 | # print "links2 = ", links2 |
| 677 | # print "links3 = ", links3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 678 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 679 | print "**************" |
| 680 | |
| 681 | main.step( "Start continuous pings" ) |
| 682 | main.Mininet2.pingLong( |
| 683 | src=main.params[ 'PING' ][ 'source1' ], |
| 684 | target=main.params[ 'PING' ][ 'target1' ], |
| 685 | pingTime=500 ) |
| 686 | main.Mininet2.pingLong( |
| 687 | src=main.params[ 'PING' ][ 'source2' ], |
| 688 | target=main.params[ 'PING' ][ 'target2' ], |
| 689 | pingTime=500 ) |
| 690 | main.Mininet2.pingLong( |
| 691 | src=main.params[ 'PING' ][ 'source3' ], |
| 692 | target=main.params[ 'PING' ][ 'target3' ], |
| 693 | pingTime=500 ) |
| 694 | main.Mininet2.pingLong( |
| 695 | src=main.params[ 'PING' ][ 'source4' ], |
| 696 | target=main.params[ 'PING' ][ 'target4' ], |
| 697 | pingTime=500 ) |
| 698 | main.Mininet2.pingLong( |
| 699 | src=main.params[ 'PING' ][ 'source5' ], |
| 700 | target=main.params[ 'PING' ][ 'target5' ], |
| 701 | pingTime=500 ) |
| 702 | main.Mininet2.pingLong( |
| 703 | src=main.params[ 'PING' ][ 'source6' ], |
| 704 | target=main.params[ 'PING' ][ 'target6' ], |
| 705 | pingTime=500 ) |
| 706 | main.Mininet2.pingLong( |
| 707 | src=main.params[ 'PING' ][ 'source7' ], |
| 708 | target=main.params[ 'PING' ][ 'target7' ], |
| 709 | pingTime=500 ) |
| 710 | main.Mininet2.pingLong( |
| 711 | src=main.params[ 'PING' ][ 'source8' ], |
| 712 | target=main.params[ 'PING' ][ 'target8' ], |
| 713 | pingTime=500 ) |
| 714 | main.Mininet2.pingLong( |
| 715 | src=main.params[ 'PING' ][ 'source9' ], |
| 716 | target=main.params[ 'PING' ][ 'target9' ], |
| 717 | pingTime=500 ) |
| 718 | main.Mininet2.pingLong( |
| 719 | src=main.params[ 'PING' ][ 'source10' ], |
| 720 | target=main.params[ 'PING' ][ 'target10' ], |
| 721 | pingTime=500 ) |
| 722 | |
| 723 | main.step( "Create TestONTopology object" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 724 | global ctrls |
| 725 | ctrls = [] |
| 726 | count = 1 |
| 727 | while True: |
| 728 | temp = () |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 729 | if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]: |
| 730 | temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), ) |
| 731 | temp = temp + ( "ONOS" + str( count ), ) |
| 732 | temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], ) |
| 733 | temp = temp + \ |
| 734 | ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), ) |
| 735 | ctrls.append( temp ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 736 | count = count + 1 |
| 737 | else: |
| 738 | break |
| 739 | global MNTopo |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 740 | Topo = TestONTopology( |
| 741 | main.Mininet1, |
| 742 | ctrls ) # can also add Intent API info for intent operations |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 743 | MNTopo = Topo |
| 744 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 745 | TopologyCheck = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 746 | main.step( "Compare ONOS Topology to MN Topology" ) |
| 747 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 748 | switchesResults1 = main.Mininet1.compareSwitches( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 749 | MNTopo, |
| 750 | json.loads( devices1 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 751 | print "switches_Result1 = ", switchesResults1 |
| 752 | utilities.assertEquals( expect=main.TRUE, actual=switchesResults1, |
| 753 | onpass="ONOS1 Switches view is correct", |
| 754 | onfail="ONOS1 Switches view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 755 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 756 | switchesResults2 = main.Mininet1.compareSwitches( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 757 | MNTopo, |
| 758 | json.loads( devices2 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 759 | utilities.assertEquals( expect=main.TRUE, actual=switchesResults2, |
| 760 | onpass="ONOS2 Switches view is correct", |
| 761 | onfail="ONOS2 Switches view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 762 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 763 | switchesResults3 = main.Mininet1.compareSwitches( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 764 | MNTopo, |
| 765 | json.loads( devices3 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 766 | utilities.assertEquals( expect=main.TRUE, actual=switchesResults3, |
| 767 | onpass="ONOS3 Switches view is correct", |
| 768 | onfail="ONOS3 Switches view is incorrect" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 769 | |
| 770 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 771 | portsResults1 = main.Mininet1.comparePorts( MNTopo, json.loads( ports1 ) ) |
| 772 | utilities.assertEquals( expect=main.TRUE, actual=portsResults1, |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 773 | onpass="ONOS1 Ports view is correct", |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 774 | onfail="ONOS1 Ports view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 775 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 776 | portsResults2 = main.Mininet1.comparePorts( MNTopo, json.loads( ports2 ) ) |
| 777 | utilities.assertEquals( expect=main.TRUE, actual=portsResults2, |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 778 | onpass="ONOS2 Ports view is correct", |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 779 | onfail="ONOS2 Ports view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 780 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 781 | portsResults3 = main.Mininet1.comparePorts( MNTopo, json.loads( ports3 ) ) |
| 782 | utilities.assertEquals( expect=main.TRUE, actual=portsResults3, |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 783 | onpass="ONOS3 Ports view is correct", |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 784 | onfail="ONOS3 Ports view is incorrect" ) |
| 785 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 786 | linksResults1 = main.Mininet1.compareLinks( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 787 | MNTopo, |
| 788 | json.loads( links1 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 789 | utilities.assertEquals( expect=main.TRUE, actual=linksResults1, |
| 790 | onpass="ONOS1 Links view is correct", |
| 791 | onfail="ONOS1 Links view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 792 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 793 | linksResults2 = main.Mininet1.compareLinks( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 794 | MNTopo, |
| 795 | json.loads( links2 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 796 | utilities.assertEquals( expect=main.TRUE, actual=linksResults2, |
| 797 | onpass="ONOS2 Links view is correct", |
| 798 | onfail="ONOS2 Links view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 799 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 800 | linksResults3 = main.Mininet1.compareLinks( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 801 | MNTopo, |
| 802 | json.loads( links3 ) ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 803 | utilities.assertEquals( expect=main.TRUE, actual=linksResults3, |
| 804 | onpass="ONOS2 Links view is correct", |
| 805 | onfail="ONOS2 Links view is incorrect" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 806 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 807 | #topoResult = switchesResults1 and switchesResults2 and switchesResults3\ |
| 808 | # and portsResults1 and portsResults2 and portsResults3\ |
| 809 | # and linksResults1 and linksResults2 and linksResults3 |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 810 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 811 | topoResult = switchesResults1 and switchesResults2 and switchesResults3\ |
| 812 | and linksResults1 and linksResults2 and linksResults3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 813 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 814 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 815 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 816 | actual=topoResult and LinkUp and LinkDown, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 817 | onpass="Topology Check Test successful", |
| 818 | onfail="Topology Check Test NOT successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 819 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 820 | def CASE8( self ): |
| 821 | """ |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 822 | Intent removal |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 823 | """ |
| 824 | main.log.report( |
| 825 | "This testcase removes host any previously added intents" ) |
| 826 | main.log.report( "__________________________________" ) |
| 827 | main.log.info( "Removing any previously installed intents" ) |
| 828 | main.case( "Removing intents" ) |
| 829 | main.step( "Obtain the intent id's" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 830 | intentResult = main.ONOScli1.intents( jsonFormat=False ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 831 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 832 | intentLinewise = intentResult.split( "\n" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 833 | intentList = [] |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 834 | for line in intentLinewise: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 835 | if line.startswith( "id=" ): |
| 836 | intentList.append( line ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 837 | |
| 838 | intentids = [] |
| 839 | for line in intentList: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 840 | intentids.append( line.split( "," )[ 0 ].split( "=" )[ 1 ] ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 841 | for id in intentids: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 842 | main.log.info( "id = " + id ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 843 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 844 | main.step( |
| 845 | "Iterate through the intentids list and remove each intent" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 846 | for id in intentids: |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 847 | main.ONOScli1.removeIntent( intentId=id ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 848 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 849 | intentResult = main.ONOScli1.intents( jsonFormat=False ) |
| 850 | main.log.info( "intent_result = " + intentResult ) |
| 851 | case8Result = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 852 | |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 853 | i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 854 | PingResult = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 855 | while i < 18: |
| 856 | main.log.info( |
| 857 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 858 | ping = main.Mininet1.pingHost( |
| 859 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 860 | if ping == main.TRUE: |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 861 | i = 19 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 862 | PingResult = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 863 | elif ping == main.FALSE: |
| 864 | i += 1 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 865 | PingResult = main.FALSE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 866 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 867 | main.log.info( "Unknown error" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 868 | PingResult = main.ERROR |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 869 | |
| 870 | # Note: If the ping result failed, that means the intents have been |
| 871 | # withdrawn correctly. |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 872 | if PingResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 873 | main.log.report( "Host intents have not been withdrawn correctly" ) |
| 874 | # main.cleanup() |
| 875 | # main.exit() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 876 | if PingResult == main.FALSE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 877 | main.log.report( "Host intents have been withdrawn correctly" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 878 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 879 | case8Result = case8Result and PingResult |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 880 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 881 | if case8Result == main.FALSE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 882 | main.log.report( "Intent removal successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 883 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 884 | main.log.report( "Intent removal failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 885 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 886 | utilities.assertEquals( expect=main.FALSE, actual=case8Result, |
| 887 | onpass="Intent removal test failed", |
| 888 | onfail="Intent removal test successful" ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 889 | |
| 890 | def CASE9( self ): |
| 891 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 892 | This test case adds point intents. Make sure you run test case 8 which is host intent removal before executing this test case. |
| 893 | Else the host intent's flows will persist on switches and the pings would work even if there is some issue with the point intent's flows |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 894 | """ |
| 895 | main.log.report( |
| 896 | "This testcase adds point intents and then does pingall" ) |
| 897 | main.log.report( "__________________________________" ) |
| 898 | main.log.info( "Adding point intents" ) |
| 899 | main.case( |
| 900 | "Adding bidirectional point for mn hosts(h8-h18,h9-h19,h10-h20,h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" ) |
| 901 | main.step( |
| 902 | "Add point-to-point intents for mininet hosts h8 and h18 or ONOS hosts h8 and h12" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 903 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 904 | "of:0000000000003008/1", |
| 905 | "of:0000000000006018/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 906 | if ptpIntentResult == main.TRUE: |
| 907 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 908 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 909 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 910 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 911 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 912 | "of:0000000000006018/1", |
| 913 | "of:0000000000003008/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 914 | if ptpIntentResult == main.TRUE: |
| 915 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 916 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 917 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 918 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 919 | main.step( |
| 920 | "Add point-to-point intents for mininet hosts h9 and h19 or ONOS hosts h9 and h13" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 921 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 922 | "of:0000000000003009/1", |
| 923 | "of:0000000000006019/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 924 | if ptpIntentResult == main.TRUE: |
| 925 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 926 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 927 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 928 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 929 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 930 | "of:0000000000006019/1", |
| 931 | "of:0000000000003009/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 932 | if ptpIntentResult == main.TRUE: |
| 933 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 934 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 935 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 936 | |
| 937 | main.step( |
| 938 | "Add point-to-point intents for mininet hosts h10 and h20 or ONOS hosts hA and h14" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 939 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 940 | "of:0000000000003010/1", |
| 941 | "of:0000000000006020/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 942 | if ptpIntentResult == main.TRUE: |
| 943 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 944 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 945 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 946 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 947 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 948 | "of:0000000000006020/1", |
| 949 | "of:0000000000003010/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 950 | if ptpIntentResult == main.TRUE: |
| 951 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 952 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 953 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 954 | |
| 955 | main.step( |
| 956 | "Add point-to-point intents for mininet hosts h11 and h21 or ONOS hosts hB and h15" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 957 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 958 | "of:0000000000003011/1", |
| 959 | "of:0000000000006021/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 960 | if ptpIntentResult == main.TRUE: |
| 961 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 962 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 963 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 964 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 965 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 966 | "of:0000000000006021/1", |
| 967 | "of:0000000000003011/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 968 | if ptpIntentResult == main.TRUE: |
| 969 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 970 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 971 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 972 | |
| 973 | main.step( |
| 974 | "Add point-to-point intents for mininet hosts h12 and h22 or ONOS hosts hC and h16" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 975 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 976 | "of:0000000000003012/1", |
| 977 | "of:0000000000006022/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 978 | if ptpIntentResult == main.TRUE: |
| 979 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 980 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 981 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 982 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 983 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 984 | "of:0000000000006022/1", |
| 985 | "of:0000000000003012/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 986 | if ptpIntentResult == main.TRUE: |
| 987 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 988 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 989 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 990 | |
| 991 | main.step( |
| 992 | "Add point-to-point intents for mininet hosts h13 and h23 or ONOS hosts hD and h17" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 993 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 994 | "of:0000000000003013/1", |
| 995 | "of:0000000000006023/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 996 | if ptpIntentResult == main.TRUE: |
| 997 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 998 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 999 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1000 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1001 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1002 | "of:0000000000006023/1", |
| 1003 | "of:0000000000003013/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1004 | if ptpIntentResult == main.TRUE: |
| 1005 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1006 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1007 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1008 | |
| 1009 | main.step( |
| 1010 | "Add point-to-point intents for mininet hosts h14 and h24 or ONOS hosts hE and h18" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1011 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1012 | "of:0000000000003014/1", |
| 1013 | "of:0000000000006024/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1014 | if ptpIntentResult == main.TRUE: |
| 1015 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1016 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1017 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1018 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1019 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1020 | "of:0000000000006024/1", |
| 1021 | "of:0000000000003014/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1022 | if ptpIntentResult == main.TRUE: |
| 1023 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1024 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1025 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1026 | |
| 1027 | main.step( |
| 1028 | "Add point-to-point intents for mininet hosts h15 and h25 or ONOS hosts hF and h19" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1029 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1030 | "of:0000000000003015/1", |
| 1031 | "of:0000000000006025/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1032 | if ptpIntentResult == main.TRUE: |
| 1033 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1034 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1035 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1036 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1037 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1038 | "of:0000000000006025/1", |
| 1039 | "of:0000000000003015/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1040 | if ptpIntentResult == main.TRUE: |
| 1041 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1042 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1043 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1044 | |
| 1045 | main.step( |
| 1046 | "Add point-to-point intents for mininet hosts h16 and h26 or ONOS hosts h10 and h1A" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1047 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1048 | "of:0000000000003016/1", |
| 1049 | "of:0000000000006026/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1050 | if ptpIntentResult == main.TRUE: |
| 1051 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1052 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1053 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1054 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1055 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1056 | "of:0000000000006026/1", |
| 1057 | "of:0000000000003016/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1058 | if ptpIntentResult == main.TRUE: |
| 1059 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1060 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1061 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1062 | |
| 1063 | main.step( |
| 1064 | "Add point-to-point intents for mininet hosts h17 and h27 or ONOS hosts h11 and h1B" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1065 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1066 | "of:0000000000003017/1", |
| 1067 | "of:0000000000006027/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1068 | if ptpIntentResult == main.TRUE: |
| 1069 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1070 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1071 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1072 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1073 | ptpIntentResult = main.ONOScli1.addPointIntent( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1074 | "of:0000000000006027/1", |
| 1075 | "of:0000000000003017/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1076 | if ptpIntentResult == main.TRUE: |
| 1077 | getIntentResult = main.ONOScli1.intents() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1078 | main.log.info( "Point to point intent install successful" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1079 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1080 | |
| 1081 | print( |
| 1082 | "_______________________________________________________________________________________" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1083 | |
| 1084 | flowHandle = main.ONOScli1.flows() |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1085 | # print "flowHandle = ", flowHandle |
| 1086 | main.log.info( "flows :" + flowHandle ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1087 | |
| 1088 | count = 1 |
| 1089 | i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1090 | PingResult = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1091 | while i < 18: |
| 1092 | main.log.info( |
| 1093 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 1094 | ping = main.Mininet1.pingHost( |
| 1095 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 1096 | if ping == main.FALSE and count < 5: |
| 1097 | count += 1 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1098 | #i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1099 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1100 | main.log.report( "Ping between h" + |
| 1101 | str( i ) + |
| 1102 | " and h" + |
| 1103 | str( i + |
| 1104 | 10 ) + |
| 1105 | " failed. Making attempt number " + |
| 1106 | str( count ) + |
| 1107 | " in 2 seconds" ) |
| 1108 | time.sleep( 2 ) |
| 1109 | elif ping == main.FALSE: |
| 1110 | main.log.report( "All ping attempts between h" + |
| 1111 | str( i ) + |
| 1112 | " and h" + |
| 1113 | str( i + |
| 1114 | 10 ) + |
| 1115 | "have failed" ) |
| 1116 | i = 19 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1117 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1118 | elif ping == main.TRUE: |
| 1119 | main.log.info( "Ping test between h" + |
| 1120 | str( i ) + |
| 1121 | " and h" + |
| 1122 | str( i + |
| 1123 | 10 ) + |
| 1124 | "passed!" ) |
| 1125 | i += 1 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1126 | PingResult = main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1127 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1128 | main.log.info( "Unknown error" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1129 | PingResult = main.ERROR |
| 1130 | if PingResult == main.FALSE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1131 | main.log.report( |
| 1132 | "Ping all test after Point intents addition failed. Cleaning up" ) |
| 1133 | # main.cleanup() |
| 1134 | # main.exit() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1135 | if PingResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1136 | main.log.report( |
| 1137 | "Ping all test after Point intents addition successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1138 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1139 | case8Result = PingResult |
| 1140 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1141 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1142 | actual=case8Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1143 | onpass="Ping all test after Point intents addition successful", |
| 1144 | onfail="Ping all test after Point intents addition failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1145 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1146 | def CASE31( self ): |
| 1147 | """ |
| 1148 | This test case adds point intent related to SDN-IP matching on ICMP ( ethertype=IPV4, ipProto=1 ) |
| 1149 | """ |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1150 | import json |
| 1151 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1152 | main.log.report( |
| 1153 | "This test case adds point intent related to SDN-IP matching on ICMP" ) |
| 1154 | main.case( |
| 1155 | "Adding bidirectional point intent related to SDN-IP matching on ICMP" ) |
| 1156 | main.step( "Adding bidirectional point intent" ) |
| 1157 | # add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32 |
| 1158 | # --ethType=IPV4 --ipProto=1 of:0000000000003008/1 |
| 1159 | # of:0000000000006018/1 |
| 1160 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1161 | hostsJson = json.loads( main.ONOScli1.hosts() ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1162 | for i in range( 8, 11 ): |
| 1163 | main.log.info( |
| 1164 | "Adding point intent between h" + str( i ) + " and h" + str( i + 10 ) ) |
| 1165 | host1 = "00:00:00:00:00:" + \ |
| 1166 | str( hex( i )[ 2: ] ).zfill( 2 ).upper() |
| 1167 | host2 = "00:00:00:00:00:" + \ |
| 1168 | str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1169 | host1Id = main.ONOScli1.getHost( host1 )[ 'id' ] |
| 1170 | host2Id = main.ONOScli1.getHost( host2 )[ 'id' ] |
| 1171 | for host in hostsJson: |
| 1172 | if host[ 'id' ] == host1Id: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1173 | ip1 = host[ 'ips' ][ 0 ] |
| 1174 | ip1 = str( ip1 + "/32" ) |
| 1175 | device1 = host[ 'location' ][ 'device' ] |
| 1176 | device1 = str( device1 + "/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1177 | elif host[ 'id' ] == host2Id: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1178 | ip2 = str( host[ 'ips' ][ 0 ] ) + "/32" |
| 1179 | device2 = host[ 'location' ][ "device" ] |
| 1180 | device2 = str( device2 + "/1" ) |
| 1181 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1182 | pIntentResult1 = main.ONOScli1.addPointIntent( |
| 1183 | ingressDevice=device1, |
| 1184 | egressDevice=device2, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1185 | ipSrc=ip1, |
| 1186 | ipDst=ip2, |
| 1187 | ethType=main.params[ 'SDNIP' ][ 'ethType' ], |
| 1188 | ipProto=main.params[ 'SDNIP' ][ 'icmpProto' ] ) |
| 1189 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1190 | getIntentResult = main.ONOScli1.intents( jsonFormat=False ) |
| 1191 | main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1192 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1193 | pIntentResult2 = main.ONOScli1.addPointIntent( |
| 1194 | ingressDevice=device2, |
| 1195 | egressDevice=device1, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1196 | ipSrc=ip2, |
| 1197 | ipDst=ip1, |
| 1198 | ethType=main.params[ 'SDNIP' ][ 'ethType' ], |
| 1199 | ipProto=main.params[ 'SDNIP' ][ 'icmpProto' ] ) |
| 1200 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1201 | getIntentResult = main.ONOScli1.intents( jsonFormat=False ) |
| 1202 | main.log.info( getIntentResult ) |
| 1203 | if ( pIntentResult1 and pIntentResult2 ) == main.TRUE: |
| 1204 | #getIntentResult = main.ONOScli1.intents() |
| 1205 | # main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1206 | main.log.info( |
| 1207 | "Point intent related to SDN-IP matching on ICMP install successful" ) |
| 1208 | |
| 1209 | time.sleep( 15 ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1210 | getIntentResult = main.ONOScli1.intents( jsonFormat=False ) |
| 1211 | main.log.info( "intents = " + getIntentResult ) |
| 1212 | getFlowsResult = main.ONOScli1.flows() |
| 1213 | main.log.info( "flows = " + getFlowsResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1214 | |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1215 | count = 1 |
| 1216 | i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1217 | PingResult = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1218 | while i < 11: |
| 1219 | main.log.info( |
| 1220 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 1221 | ping = main.Mininet1.pingHost( |
| 1222 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 1223 | if ping == main.FALSE and count < 3: |
| 1224 | count += 1 |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1225 | #i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1226 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1227 | main.log.report( "Ping between h" + |
| 1228 | str( i ) + |
| 1229 | " and h" + |
| 1230 | str( i + |
| 1231 | 10 ) + |
| 1232 | " failed. Making attempt number " + |
| 1233 | str( count ) + |
| 1234 | " in 2 seconds" ) |
| 1235 | time.sleep( 2 ) |
| 1236 | elif ping == main.FALSE: |
| 1237 | main.log.report( "All ping attempts between h" + |
| 1238 | str( i ) + |
| 1239 | " and h" + |
| 1240 | str( i + |
| 1241 | 10 ) + |
| 1242 | "have failed" ) |
| 1243 | i = 19 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1244 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1245 | elif ping == main.TRUE: |
| 1246 | main.log.info( "Ping test between h" + |
| 1247 | str( i ) + |
| 1248 | " and h" + |
| 1249 | str( i + |
| 1250 | 10 ) + |
| 1251 | "passed!" ) |
| 1252 | i += 1 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1253 | PingResult = main.TRUE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1254 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1255 | main.log.info( "Unknown error" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1256 | PingResult = main.ERROR |
| 1257 | if PingResult == main.FALSE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1258 | main.log.report( |
| 1259 | "Ping test after Point intents related to SDN-IP matching on ICMP failed." ) |
| 1260 | # main.cleanup() |
| 1261 | # main.exit() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1262 | if PingResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1263 | main.log.report( |
| 1264 | "Ping all test after Point intents related to SDN-IP matching on ICMP successful" ) |
| 1265 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1266 | case31Result = PingResult and pIntentResult1 and pIntentResult2 |
| 1267 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1268 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1269 | actual=case31Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1270 | onpass="Point intent related to SDN-IP matching on ICMP and ping test successful", |
| 1271 | onfail="Point intent related to SDN-IP matching on ICMP and ping test failed" ) |
| 1272 | |
| 1273 | def CASE32( self ): |
| 1274 | """ |
| 1275 | This test case adds point intent related to SDN-IP matching on TCP ( ethertype=IPV4, ipProto=6, DefaultPort for iperf=5001 ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1276 | Note: Although BGP port is 179, we are using 5001 because iperf is used for verifying and iperf's default port is 5001 |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1277 | """ |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1278 | import json |
| 1279 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1280 | main.log.report( |
| 1281 | "This test case adds point intent related to SDN-IP matching on TCP" ) |
| 1282 | main.case( |
| 1283 | "Adding bidirectional point intent related to SDN-IP matching on TCP" ) |
| 1284 | main.step( "Adding bidirectional point intent" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1285 | """ |
| 1286 | add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32 --ethType=IPV4 --ipProto=6 --tcpDst=5001 of:0000000000003008/1 of:0000000000006018/1 |
| 1287 | |
| 1288 | add-point-intent --ipSrc=10.0.0.18/32 --ipDst=10.0.0.8/32 --ethType=IPV4 --ipProto=6 --tcpDst=5001 of:0000000000006018/1 of:0000000000003008/1 |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1289 | |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1290 | add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32 --ethType=IPV4 --ipProto=6 --tcpSrc=5001 of:0000000000003008/1 of:0000000000006018/1 |
| 1291 | |
| 1292 | add-point-intent --ipSrc=10.0.0.18/32 --ipDst=10.0.0.8/32 --ethType=IPV4 --ipProto=6 --tcpSrc=5001 of:0000000000006018/1 of:0000000000003008/1 |
| 1293 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1294 | """ |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1295 | hostsJson = json.loads( main.ONOScli1.hosts() ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1296 | for i in range( 8, 9 ): |
| 1297 | main.log.info( |
| 1298 | "Adding point intent between h" + str( i ) + " and h" + str( i + 10 ) ) |
| 1299 | host1 = "00:00:00:00:00:" + \ |
| 1300 | str( hex( i )[ 2: ] ).zfill( 2 ).upper() |
| 1301 | host2 = "00:00:00:00:00:" + \ |
| 1302 | str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1303 | host1Id = main.ONOScli1.getHost( host1 )[ 'id' ] |
| 1304 | host2Id = main.ONOScli1.getHost( host2 )[ 'id' ] |
| 1305 | for host in hostsJson: |
| 1306 | if host[ 'id' ] == host1Id: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1307 | ip1 = host[ 'ips' ][ 0 ] |
| 1308 | ip1 = str( ip1 + "/32" ) |
| 1309 | device1 = host[ 'location' ][ 'device' ] |
| 1310 | device1 = str( device1 + "/1" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1311 | elif host[ 'id' ] == host2Id: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1312 | ip2 = str( host[ 'ips' ][ 0 ] ) + "/32" |
| 1313 | device2 = host[ 'location' ][ "device" ] |
| 1314 | device2 = str( device2 + "/1" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1315 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1316 | pIntentResult1 = main.ONOScli1.addPointIntent( |
| 1317 | ingressDevice=device1, |
| 1318 | egressDevice=device2, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1319 | ipSrc=ip1, |
| 1320 | ipDst=ip2, |
| 1321 | ethType=main.params[ 'SDNIP' ][ 'ethType' ], |
| 1322 | ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ], |
| 1323 | tcpDst=main.params[ 'SDNIP' ][ 'dstPort' ] ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1324 | pIntentResult2 = main.ONOScli1.addPointIntent( |
| 1325 | ingressDevice=device2, |
| 1326 | egressDevice=device1, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1327 | ipSrc=ip2, |
| 1328 | ipDst=ip1, |
| 1329 | ethType=main.params[ 'SDNIP' ][ 'ethType' ], |
| 1330 | ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ], |
| 1331 | tcpDst=main.params[ 'SDNIP' ][ 'dstPort' ] ) |
| 1332 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1333 | pIntentResult3 = main.ONOScli1.addPointIntent( |
| 1334 | ingressDevice=device1, |
| 1335 | egressDevice=device2, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1336 | ipSrc=ip1, |
| 1337 | ipDst=ip2, |
| 1338 | ethType=main.params[ 'SDNIP' ][ 'ethType' ], |
| 1339 | ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ], |
| 1340 | tcpSrc=main.params[ 'SDNIP' ][ 'srcPort' ] ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1341 | pIntentResult4 = main.ONOScli1.addPointIntent( |
| 1342 | ingressDevice=device2, |
| 1343 | egressDevice=device1, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1344 | ipSrc=ip2, |
| 1345 | ipDst=ip1, |
| 1346 | ethType=main.params[ 'SDNIP' ][ 'ethType' ], |
| 1347 | ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ], |
| 1348 | tcpSrc=main.params[ 'SDNIP' ][ 'srcPort' ] ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1349 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1350 | pIntentResult = pIntentResult1 and pIntentResult2 and pIntentResult3 and pIntentResult4 |
| 1351 | if pIntentResult == main.TRUE: |
| 1352 | getIntentResult = main.ONOScli1.intents( jsonFormat=False ) |
| 1353 | main.log.info( getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1354 | main.log.info( |
| 1355 | "Point intent related to SDN-IP matching on TCP install successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1356 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1357 | iperfResult = main.Mininet1.iperf( 'h8', 'h18' ) |
| 1358 | if iperfResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1359 | main.log.report( "iperf test successful" ) |
| 1360 | else: |
| 1361 | main.log.report( "iperf test failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1362 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1363 | case32Result = pIntentResult and iperfResult |
| 1364 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1365 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1366 | actual=case32Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1367 | onpass="Ping all test after Point intents addition related to SDN-IP on TCP match successful", |
| 1368 | onfail="Ping all test after Point intents addition related to SDN-IP on TCP match failed" ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1369 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1370 | def CASE33( self ): |
| 1371 | """ |
| 1372 | This test case adds multipoint to singlepoint intent related to SDN-IP matching on destination ip and the action is to rewrite the mac address |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1373 | Here the mac address to be rewritten is the mac address of the egress device |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1374 | """ |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1375 | import json |
| 1376 | import time |
| 1377 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1378 | main.log.report( |
| 1379 | "This test case adds multipoint to singlepoint intent related to SDN-IP matching on destination ip and rewrite mac address action" ) |
| 1380 | main.case( |
| 1381 | "Adding multipoint to singlepoint intent related to SDN-IP matching on destination ip" ) |
| 1382 | main.step( "Adding bidirectional multipoint to singlepoint intent" ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1383 | """ |
| 1384 | add-multi-to-single-intent --ipDst=10.0.3.0/24 --setEthDst=00:00:00:00:00:12 of:0000000000003008/1 0000000000003009/1 of:0000000000006018/1 |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1385 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1386 | add-multi-to-single-intent --ipDst=10.0.1.0/24 --setEthDst=00:00:00:00:00:08 of:0000000000006018/1 0000000000003009/1 of:0000000000003008/1 |
| 1387 | """ |
| 1388 | main.case( |
| 1389 | "Installing multipoint to single point intent with rewrite mac address" ) |
| 1390 | main.step( "Uninstalling proxy arp app" ) |
| 1391 | # Unistall onos-app-proxyarp app to disable reactive forwarding |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1392 | appUninstallResult1 = main.ONOScli1.featureUninstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1393 | "onos-app-proxyarp" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1394 | appUninstallResult2 = main.ONOScli2.featureUninstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1395 | "onos-app-proxyarp" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1396 | appUninstallResult3 = main.ONOScli3.featureUninstall( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1397 | "onos-app-proxyarp" ) |
| 1398 | main.log.info( "onos-app-proxyarp uninstalled" ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1399 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1400 | main.step( "Changing ipaddress of hosts h8,h9 and h18" ) |
| 1401 | main.Mininet1.changeIP( |
| 1402 | host='h8', |
| 1403 | intf='h8-eth0', |
| 1404 | newIP='10.0.1.1', |
| 1405 | newNetmask='255.255.255.0' ) |
| 1406 | main.Mininet1.changeIP( |
| 1407 | host='h9', |
| 1408 | intf='h9-eth0', |
| 1409 | newIP='10.0.2.1', |
| 1410 | newNetmask='255.255.255.0' ) |
| 1411 | main.Mininet1.changeIP( |
| 1412 | host='h10', |
| 1413 | intf='h10-eth0', |
| 1414 | newIP='10.0.3.1', |
| 1415 | newNetmask='255.255.255.0' ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1416 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1417 | main.step( "Changing default gateway of hosts h8,h9 and h18" ) |
| 1418 | main.Mininet1.changeDefaultGateway( host='h8', newGW='10.0.1.254' ) |
| 1419 | main.Mininet1.changeDefaultGateway( host='h9', newGW='10.0.2.254' ) |
| 1420 | main.Mininet1.changeDefaultGateway( host='h10', newGW='10.0.3.254' ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1421 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1422 | main.step( |
| 1423 | "Assigning random mac address to the default gateways since proxyarp app is uninstalled" ) |
| 1424 | main.Mininet1.addStaticMACAddress( |
| 1425 | host='h8', |
| 1426 | GW='10.0.1.254', |
| 1427 | macaddr='00:00:00:00:11:11' ) |
| 1428 | main.Mininet1.addStaticMACAddress( |
| 1429 | host='h9', |
| 1430 | GW='10.0.2.254', |
| 1431 | macaddr='00:00:00:00:22:22' ) |
| 1432 | main.Mininet1.addStaticMACAddress( |
| 1433 | host='h10', |
| 1434 | GW='10.0.3.254', |
| 1435 | macaddr='00:00:00:00:33:33' ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1436 | |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1437 | main.step( "Verify static gateway and MAC address assignment" ) |
| 1438 | main.Mininet1.verifyStaticGWandMAC( host='h8' ) |
| 1439 | main.Mininet1.verifyStaticGWandMAC( host='h9' ) |
| 1440 | main.Mininet1.verifyStaticGWandMAC( host='h10' ) |
| 1441 | |
| 1442 | main.step( "Adding multipoint to singlepoint intent" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1443 | pIntentResult1 = main.ONOScli1.addMultipointToSinglepointIntent( |
| 1444 | ingressDevice1=main.params[ 'MULTIPOINT_INTENT' ][ 'device1' ], |
| 1445 | ingressDevice2=main.params[ 'MULTIPOINT_INTENT' ][ 'device2' ], |
| 1446 | egressDevice=main.params[ 'MULTIPOINT_INTENT' ][ 'device3' ], |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1447 | ipDst=main.params[ 'MULTIPOINT_INTENT' ][ 'ip1' ], |
| 1448 | setEthDst=main.params[ 'MULTIPOINT_INTENT' ][ 'mac1' ] ) |
| 1449 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1450 | pIntentResult2 = main.ONOScli1.addMultipointToSinglepointIntent( |
| 1451 | ingressDevice1=main.params[ 'MULTIPOINT_INTENT' ][ 'device3' ], |
| 1452 | ingressDevice2=main.params[ 'MULTIPOINT_INTENT' ][ 'device2' ], |
| 1453 | egressDevice=main.params[ 'MULTIPOINT_INTENT' ][ 'device1' ], |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1454 | ipDst=main.params[ 'MULTIPOINT_INTENT' ][ 'ip2' ], |
| 1455 | setEthDst=main.params[ 'MULTIPOINT_INTENT' ][ 'mac2' ] ) |
| 1456 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1457 | getIntentResult = main.ONOScli1.intents( jsonFormat=False ) |
| 1458 | main.log.info( "intents = " + getIntentResult ) |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1459 | |
| 1460 | time.sleep( 10 ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1461 | getFlowsResult = main.ONOScli1.flows( jsonFormat=False ) |
| 1462 | main.log.info( "flows = " + getFlowsResult ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1463 | |
| 1464 | count = 1 |
| 1465 | i = 8 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1466 | PingResult = main.TRUE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1467 | |
| 1468 | main.log.info( "\n\nh" + str( i ) + " is Pinging h" + str( i + 2 ) ) |
| 1469 | ping = main.Mininet1.pingHost( |
| 1470 | src="h" + str( i ), target="h" + str( i + 2 ) ) |
| 1471 | if ping == main.FALSE and count < 3: |
| 1472 | count += 1 |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1473 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1474 | main.log.report( "Ping between h" + |
| 1475 | str( i ) + |
| 1476 | " and h" + |
| 1477 | str( i + |
| 1478 | 2 ) + |
| 1479 | " failed. Making attempt number " + |
| 1480 | str( count ) + |
| 1481 | " in 2 seconds" ) |
| 1482 | time.sleep( 2 ) |
| 1483 | elif ping == main.FALSE: |
| 1484 | main.log.report( "All ping attempts between h" + |
| 1485 | str( i ) + |
| 1486 | " and h" + |
| 1487 | str( i + |
| 1488 | 10 ) + |
| 1489 | "have failed" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1490 | PingResult = main.FALSE |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1491 | elif ping == main.TRUE: |
| 1492 | main.log.info( "Ping test between h" + |
| 1493 | str( i ) + |
| 1494 | " and h" + |
| 1495 | str( i + |
| 1496 | 2 ) + |
| 1497 | "passed!" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1498 | PingResult = main.TRUE |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1499 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1500 | main.log.info( "Unknown error" ) |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1501 | PingResult = main.ERROR |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1502 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1503 | if PingResult == main.FALSE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1504 | main.log.report( "Ping test failed." ) |
| 1505 | # main.cleanup() |
| 1506 | # main.exit() |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1507 | if PingResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1508 | main.log.report( "Ping all successful" ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1509 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1510 | pIntentResult = pIntentResult1 and pIntentResult2 |
| 1511 | if pIntentResult == main.TRUE: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1512 | main.log.info( |
| 1513 | "Multi point intent with rewrite mac address installation successful" ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 1514 | else: |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1515 | main.log.info( |
| 1516 | "Multi point intent with rewrite mac address installation failed" ) |
| 1517 | |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1518 | case33Result = pIntentResult and PingResult |
| 1519 | utilities.assertEquals( |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1520 | expect=main.TRUE, |
shahshreya | f307635 | 2015-01-23 13:52:01 -0800 | [diff] [blame] | 1521 | actual=case33Result, |
kelvin-onlab | eaa2eb3 | 2015-01-16 15:58:18 -0800 | [diff] [blame] | 1522 | onpass="Ping all test after multipoint to single point intent addition with rewrite mac address successful", |
| 1523 | onfail="Ping all test after multipoint to single point intent addition with rewrite mac address failed" ) |