kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 1 | |
| 2 | # Testing the basic functionality of ONOS Next |
| 3 | # For sanity and driver functionality excercises only. |
| 4 | |
| 5 | import time |
| 6 | import json |
| 7 | |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 8 | class FuncIntent: |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 9 | |
| 10 | def __init__( self ): |
| 11 | self.default = '' |
| 12 | |
| 13 | def CASE10( self, main ): |
| 14 | import time |
| 15 | import os |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 16 | import imp |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 17 | """ |
| 18 | Startup sequence: |
| 19 | cell <name> |
| 20 | onos-verify-cell |
| 21 | onos-remove-raft-log |
| 22 | git pull |
| 23 | mvn clean install |
| 24 | onos-package |
| 25 | onos-install -f |
| 26 | onos-wait-for-start |
| 27 | """ |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 28 | global init |
cameron@onlab.us | 59d29d9 | 2015-05-11 14:31:54 -0700 | [diff] [blame] | 29 | global globalONOSip |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 30 | try: |
| 31 | if type(init) is not bool: |
| 32 | init = False |
| 33 | except NameError: |
| 34 | init = False |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 35 | |
| 36 | main.wrapper = imp.load_source( 'FuncIntentFunction', |
| 37 | '/home/admin/ONLabTest/TestON/tests/' + |
| 38 | 'FuncIntent/Dependency/' + |
| 39 | 'FuncIntentFunction.py' ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 40 | #Local variables |
| 41 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 42 | apps = main.params[ 'ENV' ][ 'cellApps' ] |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 43 | gitBranch = main.params[ 'GIT' ][ 'branch' ] |
cameron@onlab.us | 59d29d9 | 2015-05-11 14:31:54 -0700 | [diff] [blame] | 44 | benchIp = os.environ[ 'OCN' ] |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 45 | benchUser = main.params[ 'BENCH' ][ 'user' ] |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 46 | topology = main.params[ 'MININET' ][ 'topo' ] |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 47 | main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] ) |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 48 | main.numLinks = int( main.params[ 'MININET' ][ 'links' ] ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 49 | main.numCtrls = main.params[ 'CTRL' ][ 'num' ] |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 50 | main.ONOSport = [] |
| 51 | main.hostsData = {} |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 52 | PULLCODE = False |
| 53 | if main.params[ 'GIT' ][ 'pull' ] == 'True': |
| 54 | PULLCODE = True |
| 55 | main.case( "Setting up test environment" ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 56 | main.CLIs = [] |
| 57 | for i in range( 1, int( main.numCtrls ) + 1 ): |
| 58 | main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) ) |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 59 | main.ONOSport.append( main.params[ 'CTRL' ][ 'port' + str( i ) ] ) |
cameron@onlab.us | 7fd2a52 | 2015-05-14 11:20:33 -0700 | [diff] [blame] | 60 | |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 61 | # -- INIT SECTION, ONLY RUNS ONCE -- # |
| 62 | if init == False: |
| 63 | init = True |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 64 | |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 65 | main.scale = ( main.params[ 'SCALE' ] ).split( "," ) |
| 66 | main.numCtrls = int( main.scale[ 0 ] ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 67 | |
| 68 | if PULLCODE: |
| 69 | main.step( "Git checkout and pull " + gitBranch ) |
| 70 | main.ONOSbench.gitCheckout( gitBranch ) |
| 71 | gitPullResult = main.ONOSbench.gitPull() |
| 72 | if gitPullResult == main.ERROR: |
| 73 | main.log.error( "Error pulling git branch" ) |
| 74 | main.step( "Using mvn clean & install" ) |
| 75 | cleanInstallResult = main.ONOSbench.cleanInstall() |
| 76 | stepResult = cleanInstallResult |
| 77 | utilities.assert_equals( expect=main.TRUE, |
| 78 | actual=stepResult, |
| 79 | onpass="Successfully compiled " + |
| 80 | "latest ONOS", |
| 81 | onfail="Failed to compile " + |
| 82 | "latest ONOS" ) |
| 83 | else: |
| 84 | main.log.warn( "Did not pull new code so skipping mvn " + |
| 85 | "clean install" ) |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 86 | |
cameron@onlab.us | 033cc0f | 2015-05-15 15:27:43 -0700 | [diff] [blame] | 87 | globalONOSip = main.ONOSbench.getOnosIps() |
kelvin-onlab | 0a28a74 | 2015-05-18 16:03:13 -0700 | [diff] [blame] | 88 | |
cameron@onlab.us | 033cc0f | 2015-05-15 15:27:43 -0700 | [diff] [blame] | 89 | maxNodes = ( len(globalONOSip) - 2 ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 90 | |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 91 | main.numCtrls = int( main.scale[ 0 ] ) |
| 92 | main.scale.remove( main.scale[ 0 ] ) |
cameron@onlab.us | 59d29d9 | 2015-05-11 14:31:54 -0700 | [diff] [blame] | 93 | |
cameron@onlab.us | 033cc0f | 2015-05-15 15:27:43 -0700 | [diff] [blame] | 94 | main.ONOSip = [] |
kelvin-onlab | 0a28a74 | 2015-05-18 16:03:13 -0700 | [diff] [blame] | 95 | for i in range( maxNodes ): |
cameron@onlab.us | 59d29d9 | 2015-05-11 14:31:54 -0700 | [diff] [blame] | 96 | main.ONOSip.append( globalONOSip[i] ) |
| 97 | |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 98 | #kill off all onos processes |
| 99 | main.log.info( "Safety check, killing all ONOS processes" + |
| 100 | " before initiating enviornment setup" ) |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 101 | for i in range(maxNodes): |
| 102 | main.ONOSbench.onosDie( globalONOSip[ i ] ) |
| 103 | |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 104 | print "NODE COUNT = ", main.numCtrls |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 105 | main.log.info( "Creating cell file" ) |
| 106 | cellIp = [] |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 107 | for i in range( main.numCtrls ): |
| 108 | cellIp.append( str( main.ONOSip[ i ] ) ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 109 | print cellIp |
| 110 | main.ONOSbench.createCellFile( benchIp, cellName, "", |
| 111 | str( apps ), *cellIp ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 112 | |
| 113 | main.step( "Apply cell to environment" ) |
| 114 | cellResult = main.ONOSbench.setCell( cellName ) |
| 115 | verifyResult = main.ONOSbench.verifyCell() |
| 116 | stepResult = cellResult and verifyResult |
| 117 | utilities.assert_equals( expect=main.TRUE, |
| 118 | actual=stepResult, |
| 119 | onpass="Successfully applied cell to " + \ |
| 120 | "environment", |
| 121 | onfail="Failed to apply cell to environment " ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 122 | |
| 123 | main.step( "Creating ONOS package" ) |
| 124 | packageResult = main.ONOSbench.onosPackage() |
| 125 | stepResult = packageResult |
| 126 | utilities.assert_equals( expect=main.TRUE, |
| 127 | actual=stepResult, |
| 128 | onpass="Successfully created ONOS package", |
| 129 | onfail="Failed to create ONOS package" ) |
| 130 | |
| 131 | main.step( "Uninstalling ONOS package" ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 132 | onosUninstallResult = main.TRUE |
cameron@onlab.us | 033cc0f | 2015-05-15 15:27:43 -0700 | [diff] [blame] | 133 | for i in range( main.numCtrls ): |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 134 | onosUninstallResult = onosUninstallResult and \ |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 135 | main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 136 | stepResult = onosUninstallResult |
| 137 | utilities.assert_equals( expect=main.TRUE, |
| 138 | actual=stepResult, |
| 139 | onpass="Successfully uninstalled ONOS package", |
| 140 | onfail="Failed to uninstall ONOS package" ) |
| 141 | time.sleep( 5 ) |
| 142 | main.step( "Installing ONOS package" ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 143 | onosInstallResult = main.TRUE |
cameron@onlab.us | 033cc0f | 2015-05-15 15:27:43 -0700 | [diff] [blame] | 144 | for i in range( main.numCtrls ): |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 145 | onosInstallResult = onosInstallResult and \ |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 146 | main.ONOSbench.onosInstall( node=main.ONOSip[ i ] ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 147 | stepResult = onosInstallResult |
| 148 | utilities.assert_equals( expect=main.TRUE, |
| 149 | actual=stepResult, |
| 150 | onpass="Successfully installed ONOS package", |
| 151 | onfail="Failed to install ONOS package" ) |
| 152 | |
cameron@onlab.us | 59d29d9 | 2015-05-11 14:31:54 -0700 | [diff] [blame] | 153 | time.sleep( 20 ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 154 | main.step( "Starting ONOS service" ) |
| 155 | stopResult = main.TRUE |
| 156 | startResult = main.TRUE |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 157 | onosIsUp = main.TRUE |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 158 | for i in range( main.numCtrls ): |
| 159 | onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 160 | if onosIsUp == main.TRUE: |
| 161 | main.log.report( "ONOS instance is up and ready" ) |
| 162 | else: |
| 163 | main.log.report( "ONOS instance may not be up, stop and " + |
| 164 | "start ONOS again " ) |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 165 | for i in range( main.numCtrls ): |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 166 | stopResult = stopResult and \ |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 167 | main.ONOSbench.onosStop( main.ONOSip[ i ] ) |
| 168 | for i in range( main.numCtrls ): |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 169 | startResult = startResult and \ |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 170 | main.ONOSbench.onosStart( main.ONOSip[ i ] ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 171 | stepResult = onosIsUp and stopResult and startResult |
| 172 | utilities.assert_equals( expect=main.TRUE, |
| 173 | actual=stepResult, |
| 174 | onpass="ONOS service is ready", |
| 175 | onfail="ONOS service did not start properly" ) |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 176 | |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 177 | main.step( "Start ONOS cli" ) |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 178 | cliResult = main.TRUE |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 179 | for i in range( main.numCtrls ): |
| 180 | cliResult = cliResult and \ |
| 181 | main.CLIs[i].startOnosCli( main.ONOSip[ i ] ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 182 | stepResult = cliResult |
| 183 | utilities.assert_equals( expect=main.TRUE, |
| 184 | actual=stepResult, |
| 185 | onpass="Successfully start ONOS cli", |
| 186 | onfail="Failed to start ONOS cli" ) |
| 187 | |
kelvin-onlab | 0a28a74 | 2015-05-18 16:03:13 -0700 | [diff] [blame] | 188 | def CASE9( self, main ): |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 189 | ''' |
| 190 | Report errors/warnings/exceptions |
| 191 | ''' |
| 192 | main.log.info( "Error report: \n" ) |
| 193 | main.ONOSbench.logReport( globalONOSip[0], |
| 194 | [ "INFO", "FOLLOWER", "WARN", "flow", "ERROR" , "Except" ], |
| 195 | "s" ) |
| 196 | #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 197 | |
| 198 | def CASE11( self, main ): |
| 199 | """ |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 200 | Start mininet |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 201 | """ |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 202 | main.log.report( "Start Mininet topology" ) |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 203 | main.log.case( "Start Mininet topology" ) |
| 204 | |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 205 | main.step( "Starting Mininet Topology" ) |
| 206 | topoResult = main.Mininet1.startNet( topoFile=topology ) |
| 207 | stepResult = topoResult |
| 208 | utilities.assert_equals( expect=main.TRUE, |
| 209 | actual=stepResult, |
| 210 | onpass="Successfully loaded topology", |
| 211 | onfail="Failed to load topology" ) |
| 212 | # Exit if topology did not load properly |
| 213 | if not topoResult: |
| 214 | main.cleanup() |
| 215 | main.exit() |
| 216 | |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 217 | def CASE12( self, main ): |
| 218 | """ |
| 219 | Assign mastership to controllers |
| 220 | """ |
| 221 | import re |
| 222 | |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 223 | main.case( "Assign switches to controllers" ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 224 | main.step( "Assigning switches to controllers" ) |
| 225 | assignResult = main.TRUE |
kelvin-onlab | 5cbf999 | 2015-05-05 14:34:07 -0700 | [diff] [blame] | 226 | for i in range( 1, ( main.numSwitch + 1 ) ): |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 227 | main.Mininet1.assignSwController( sw=str( i ), |
| 228 | count=1, |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 229 | ip1=main.ONOSip[ 0 ], |
| 230 | port1=main.ONOSport[ 0 ] ) |
kelvin-onlab | 5cbf999 | 2015-05-05 14:34:07 -0700 | [diff] [blame] | 231 | for i in range( 1, ( main.numSwitch + 1 ) ): |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 232 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
| 233 | print( "Response is " + str( response ) ) |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 234 | if re.search( "tcp:" + main.ONOSip[ 0 ], response ): |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 235 | assignResult = assignResult and main.TRUE |
| 236 | else: |
| 237 | assignResult = main.FALSE |
| 238 | stepResult = assignResult |
| 239 | utilities.assert_equals( expect=main.TRUE, |
| 240 | actual=stepResult, |
| 241 | onpass="Successfully assigned switches" + |
| 242 | "to controller", |
| 243 | onfail="Failed to assign switches to " + |
| 244 | "controller" ) |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 245 | def CASE13( self, main ): |
| 246 | """ |
| 247 | Discover all hosts and store its data to a dictionary |
| 248 | """ |
| 249 | main.case( "Discover all hosts" ) |
| 250 | |
| 251 | stepResult = main.TRUE |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 252 | main.step( "Discover all hosts using pingall " ) |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 253 | stepResult = main.wrapper.getHostsData( main ) |
kelvin-onlab | 0890001 | 2015-05-20 14:30:44 -0700 | [diff] [blame] | 254 | utilities.assert_equals( expect=main.TRUE, |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 255 | actual=stepResult, |
| 256 | onpass="Successfully discovered hosts", |
| 257 | onfail="Failed to discover hosts" ) |
kelvin-onlab | 4ff9cc1 | 2015-05-05 11:14:42 -0700 | [diff] [blame] | 258 | |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 259 | def CASE1001( self, main ): |
kelvin-onlab | 7c577e8 | 2015-05-07 10:45:16 -0700 | [diff] [blame] | 260 | """ |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 261 | Add host intents between 2 host: |
| 262 | - Discover hosts |
| 263 | - Add host intents |
| 264 | - Check intents |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 265 | - Verify flows |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 266 | - Ping hosts |
| 267 | - Reroute |
| 268 | - Link down |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 269 | - Verify flows |
| 270 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 271 | - Ping hosts |
| 272 | - Link up |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 273 | - Verify flows |
| 274 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 275 | - Ping hosts |
| 276 | - Remove intents |
kelvin-onlab | 7c577e8 | 2015-05-07 10:45:16 -0700 | [diff] [blame] | 277 | """ |
| 278 | import time |
| 279 | import json |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 280 | import re |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 281 | |
| 282 | # Assert variables - These variable's name|format must be followed |
| 283 | # if you want to use the wrapper function |
| 284 | assert main, "There is no main" |
| 285 | assert main.CLIs, "There is no main.CLIs" |
| 286 | assert main.Mininet1, "Mininet handle should be named Mininet1" |
| 287 | assert main.numSwitch, "Placed the total number of switch topology in \ |
| 288 | main.numSwitch" |
| 289 | |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 290 | main.case( "Add host intents between 2 host" ) |
kelvin-onlab | 05cf773 | 2015-05-08 14:25:46 -0700 | [diff] [blame] | 291 | |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 292 | stepResult = main.TRUE |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 293 | main.step( "IPV4: Add host intents between h1 and h9" ) |
| 294 | stepResult = main.wrapper.hostIntent( main, |
| 295 | name='IPV4', |
| 296 | host1='h1', |
| 297 | host2='h9', |
| 298 | host1Id='00:00:00:00:00:01/-1', |
| 299 | host2Id='00:00:00:00:00:09/-1', |
| 300 | sw1='s5', |
| 301 | sw2='s2', |
| 302 | expectedLink=18 ) |
kelvin-onlab | 7c577e8 | 2015-05-07 10:45:16 -0700 | [diff] [blame] | 303 | |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 304 | utilities.assert_equals( expect=main.TRUE, |
| 305 | actual=stepResult, |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 306 | onpass="IPV4: Add host intent successful", |
| 307 | onfail="IPV4: Add host intent failed" ) |
| 308 | stepResult = main.TRUE |
| 309 | |
kelvin-onlab | 381b34c | 2015-05-21 09:21:06 -0700 | [diff] [blame] | 310 | main.step( "DUALSTACK1: Add host intents between h3 and h11" ) |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 311 | stepResult = main.wrapper.hostIntent( main, |
| 312 | name='DUALSTACK', |
| 313 | host1='h3', |
| 314 | host2='h11', |
| 315 | host1Id='00:00:00:00:00:03/-1', |
kelvin-onlab | 132bd5b | 2015-05-18 18:15:26 -0700 | [diff] [blame] | 316 | host2Id='00:00:00:00:00:0B/-1', |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 317 | sw1='s5', |
| 318 | sw2='s2', |
| 319 | expectedLink=18 ) |
| 320 | |
| 321 | utilities.assert_equals( expect=main.TRUE, |
| 322 | actual=stepResult, |
kelvin-onlab | 381b34c | 2015-05-21 09:21:06 -0700 | [diff] [blame] | 323 | onpass="DUALSTACK1: Add host intent" + |
| 324 | " successful", |
| 325 | onfail="DUALSTACK1: Add host intent failed" ) |
| 326 | |
| 327 | stepResult = main.TRUE |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 328 | main.step( "DUALSTACK2: Add host intents between h1 and h11" ) |
kelvin-onlab | 381b34c | 2015-05-21 09:21:06 -0700 | [diff] [blame] | 329 | stepResult = main.wrapper.hostIntent( main, |
| 330 | name='DUALSTACK2', |
| 331 | host1='h1', |
| 332 | host2='h11', |
| 333 | sw1='s5', |
| 334 | sw2='s2', |
| 335 | expectedLink=18 ) |
| 336 | |
| 337 | utilities.assert_equals( expect=main.TRUE, |
| 338 | actual=stepResult, |
| 339 | onpass="DUALSTACK2: Add host intent" + |
| 340 | " successful", |
| 341 | onfail="DUALSTACK2: Add host intent failed" ) |
kelvin-onlab | 7c577e8 | 2015-05-07 10:45:16 -0700 | [diff] [blame] | 342 | |
kaouthera | 6f37d85 | 2015-05-27 13:52:08 -0700 | [diff] [blame] | 343 | stepResult = main.TRUE |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 344 | main.step( "1HOP: Add host intents between h1 and h3" ) |
| 345 | stepResult = main.wrapper.hostIntent( main, |
| 346 | name='1HOP', |
| 347 | host1='h1', |
| 348 | host2='h3' ) |
| 349 | |
| 350 | utilities.assert_equals( expect=main.TRUE, |
| 351 | actual=stepResult, |
| 352 | onpass="1HOP: Add host intent" + |
| 353 | " successful", |
| 354 | onfail="1HOP: Add host intent failed" ) |
| 355 | |
kaouthera | 6f37d85 | 2015-05-27 13:52:08 -0700 | [diff] [blame] | 356 | main.step( "VLAN1: Add vlan host intents between h4 and h12" ) |
| 357 | stepResult = main.wrapper.hostIntent( main, |
| 358 | name='VLAN1', |
| 359 | host1='h4', |
| 360 | host2='h12', |
| 361 | host1Id='00:00:00:00:00:04/100', |
| 362 | host2Id='00:00:00:00:00:0C/100', |
| 363 | sw1='s5', |
| 364 | sw2='s2', |
| 365 | expectedLink=18 ) |
| 366 | |
| 367 | utilities.assert_equals( expect=main.TRUE, |
| 368 | actual=stepResult, |
| 369 | onpass="VLAN1: Add vlan host intent successful", |
| 370 | onfail="VLAN1: Add vlan host intent failed" ) |
| 371 | stepResult = main.TRUE |
| 372 | main.step( "VLAN2: Add inter vlan host intents between h13 and h20" ) |
| 373 | stepResult = main.wrapper.hostIntent( main, |
| 374 | name='VLAN2', |
| 375 | host1='h13', |
| 376 | host2='h20', |
| 377 | host1Id='', |
| 378 | host2Id='', |
| 379 | sw1='s5', |
| 380 | sw2='s2', |
| 381 | expectedLink=18 ) |
| 382 | |
| 383 | utilities.assert_equals( expect=main.FALSE, |
| 384 | actual=stepResult, |
| 385 | onpass="VLAN2: Add inter vlan host intent successful", |
| 386 | onfail="VLAN2: Add inter vlan host intent failed" ) |
| 387 | |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 388 | def CASE1002( self, main ): |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 389 | """ |
| 390 | Add point intents between 2 hosts: |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 391 | - Get device ids | ports |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 392 | - Add point intents |
| 393 | - Check intents |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 394 | - Verify flows |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 395 | - Ping hosts |
| 396 | - Reroute |
| 397 | - Link down |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 398 | - Verify flows |
| 399 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 400 | - Ping hosts |
| 401 | - Link up |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 402 | - Verify flows |
| 403 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 404 | - Ping hosts |
| 405 | - Remove intents |
| 406 | """ |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 407 | import time |
| 408 | import json |
| 409 | import re |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 410 | |
| 411 | # Assert variables - These variable's name|format must be followed |
| 412 | # if you want to use the wrapper function |
| 413 | assert main, "There is no main" |
| 414 | assert main.CLIs, "There is no main.CLIs" |
| 415 | assert main.Mininet1, "Mininet handle should be named Mininet1" |
| 416 | assert main.numSwitch, "Placed the total number of switch topology in \ |
| 417 | main.numSwitch" |
| 418 | |
kelvin-onlab | b223560 | 2015-05-13 17:51:06 -0700 | [diff] [blame] | 419 | main.case( "Add point intents between 2 devices" ) |
| 420 | |
| 421 | stepResult = main.TRUE |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 422 | # No option point intents |
| 423 | main.step( "NOOPTION: Add point intents between h1 and h9" ) |
| 424 | stepResult = main.wrapper.pointIntent( |
| 425 | main, |
| 426 | name="NOOPTION", |
| 427 | host1="h1", |
| 428 | host2="h9", |
| 429 | deviceId1="of:0000000000000005/1", |
| 430 | deviceId2="of:0000000000000006/1", |
| 431 | sw1="s5", |
| 432 | sw2="s2", |
| 433 | expectedLink=18 ) |
| 434 | |
| 435 | stepResult = main.TRUE |
| 436 | main.step( "NOOPTION: Add point intents between h1 and h9" ) |
| 437 | utilities.assert_equals( expect=main.TRUE, |
| 438 | actual=stepResult, |
| 439 | onpass="NOOPTION: Add point intent successful", |
| 440 | onfail="NOOPTION: Add point intent failed" ) |
| 441 | |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 442 | stepResult = main.wrapper.pointIntent( |
| 443 | main, |
| 444 | name="IPV4", |
| 445 | host1="h1", |
| 446 | host2="h9", |
| 447 | deviceId1="of:0000000000000005/1", |
| 448 | deviceId2="of:0000000000000006/1", |
| 449 | port1="", |
| 450 | port2="", |
| 451 | ethType="IPV4", |
| 452 | mac1="00:00:00:00:00:01", |
| 453 | mac2="00:00:00:00:00:09", |
| 454 | bandwidth="", |
| 455 | lambdaAlloc=False, |
| 456 | ipProto="", |
| 457 | ip1="", |
| 458 | ip2="", |
| 459 | tcp1="", |
| 460 | tcp2="", |
| 461 | sw1="s5", |
| 462 | sw2="s2", |
| 463 | expectedLink=18 ) |
| 464 | |
kelvin-onlab | b223560 | 2015-05-13 17:51:06 -0700 | [diff] [blame] | 465 | utilities.assert_equals( expect=main.TRUE, |
| 466 | actual=stepResult, |
kelvin-onlab | 2ccad6e | 2015-05-18 10:36:54 -0700 | [diff] [blame] | 467 | onpass="IPV4: Add point intent successful", |
| 468 | onfail="IPV4: Add point intent failed" ) |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 469 | |
kelvin-onlab | 381b34c | 2015-05-21 09:21:06 -0700 | [diff] [blame] | 470 | stepResult = main.TRUE |
| 471 | main.step( "DUALSTACK1: Add point intents between h1 and h9" ) |
| 472 | stepResult = main.wrapper.pointIntent( |
| 473 | main, |
| 474 | name="DUALSTACK1", |
| 475 | host1="h3", |
| 476 | host2="h11", |
| 477 | deviceId1="of:0000000000000005", |
| 478 | deviceId2="of:0000000000000006", |
| 479 | port1="3", |
| 480 | port2="3", |
| 481 | ethType="IPV4", |
| 482 | mac1="00:00:00:00:00:03", |
| 483 | mac2="00:00:00:00:00:0B", |
| 484 | bandwidth="", |
| 485 | lambdaAlloc=False, |
| 486 | ipProto="", |
| 487 | ip1="", |
| 488 | ip2="", |
| 489 | tcp1="", |
| 490 | tcp2="", |
| 491 | sw1="s5", |
| 492 | sw2="s2", |
| 493 | expectedLink=18 ) |
| 494 | |
| 495 | utilities.assert_equals( expect=main.TRUE, |
| 496 | actual=stepResult, |
| 497 | onpass="DUALSTACK1: Add point intent" + |
| 498 | " successful", |
kaouthera | 426d0ab | 2015-05-28 17:41:10 -0700 | [diff] [blame] | 499 | onfail="DUALSTACK1: Add point intent failed" ) |
| 500 | stepResult = main.TRUE |
| 501 | main.step( "VLAN: Add point intents between h5 and h21" ) |
| 502 | stepResult = main.wrapper.pointIntent( |
| 503 | main, |
| 504 | name="VLAN", |
| 505 | host1="h5", |
| 506 | host2="h21", |
| 507 | deviceId1="of:0000000000000005/5", |
| 508 | deviceId2="of:0000000000000007/5", |
| 509 | port1="", |
| 510 | port2="", |
| 511 | ethType="IPV4", |
| 512 | mac1="00:00:00:00:00:05", |
| 513 | mac2="00:00:00:00:00:15", |
| 514 | bandwidth="", |
| 515 | lambdaAlloc=False, |
| 516 | ipProto="", |
| 517 | ip1="", |
| 518 | ip2="", |
| 519 | tcp1="", |
| 520 | tcp2="", |
| 521 | sw1="s5", |
| 522 | sw2="s2", |
| 523 | expectedLink=18 ) |
| 524 | |
| 525 | utilities.assert_equals( expect=main.TRUE, |
| 526 | actual=stepResult, |
| 527 | onpass="VLAN: Add point intent successful", |
| 528 | onfail="VLAN: Add point intent failed" ) |
kelvin-onlab | c751ab4 | 2015-05-21 14:09:39 -0700 | [diff] [blame] | 529 | |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 530 | stepResult = main.TRUE |
| 531 | main.step( "1HOP: Add point intents between h1 and h3" ) |
| 532 | stepResult = main.wrapper.hostIntent( main, |
| 533 | name='1HOP', |
| 534 | host1='h1', |
| 535 | host2='h3' ) |
| 536 | |
| 537 | utilities.assert_equals( expect=main.TRUE, |
| 538 | actual=stepResult, |
| 539 | onpass="1HOP: Add point intent" + |
| 540 | " successful", |
| 541 | onfail="1HOP: Add point intent failed" ) |
| 542 | |
kelvin-onlab | f70fd54 | 2015-05-07 18:41:40 -0700 | [diff] [blame] | 543 | def CASE1003( self, main ): |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 544 | """ |
| 545 | Add single point to multi point intents |
| 546 | - Get device ids |
| 547 | - Add single point to multi point intents |
| 548 | - Check intents |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 549 | - Verify flows |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 550 | - Ping hosts |
| 551 | - Reroute |
| 552 | - Link down |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 553 | - Verify flows |
| 554 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 555 | - Ping hosts |
| 556 | - Link up |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 557 | - Verify flows |
| 558 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 559 | - Ping hosts |
| 560 | - Remove intents |
| 561 | """ |
kelvin-onlab | f0594d7 | 2015-05-19 17:25:12 -0700 | [diff] [blame] | 562 | assert main, "There is no main" |
| 563 | assert main.CLIs, "There is no main.CLIs" |
| 564 | assert main.Mininet1, "Mininet handle should be named Mininet1" |
| 565 | assert main.numSwitch, "Placed the total number of switch topology in \ |
| 566 | main.numSwitch" |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 567 | |
kelvin-onlab | f0594d7 | 2015-05-19 17:25:12 -0700 | [diff] [blame] | 568 | main.case( "Add single point to multi point intents between devices" ) |
| 569 | |
| 570 | stepResult = main.TRUE |
kelvin-onlab | f0594d7 | 2015-05-19 17:25:12 -0700 | [diff] [blame] | 571 | hostNames = [ 'h8', 'h16', 'h24' ] |
| 572 | devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8', \ |
| 573 | 'of:0000000000000007/8' ] |
| 574 | macs = [ '00:00:00:00:00:08', '00:00:00:00:00:10', '00:00:00:00:00:18' ] |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 575 | |
| 576 | main.step( "NOOPTION: Add single point to multi point intents" ) |
| 577 | stepResult = main.wrapper.singleToMultiIntent( |
| 578 | main, |
| 579 | name="NOOPTION", |
| 580 | hostNames=hostNames, |
| 581 | devices=devices, |
| 582 | sw1="s5", |
| 583 | sw2="s2", |
| 584 | expectedLink=18 ) |
| 585 | |
| 586 | utilities.assert_equals( expect=main.TRUE, |
| 587 | actual=stepResult, |
| 588 | onpass="NOOPTION: Successfully added single " |
| 589 | + " point to multi point intents", |
| 590 | onfail="NOOPTION: Failed to add single point" + |
| 591 | " to multi point intents" ) |
| 592 | |
| 593 | |
| 594 | |
| 595 | main.step( "IPV4: Add single point to multi point intents" ) |
kelvin-onlab | f0594d7 | 2015-05-19 17:25:12 -0700 | [diff] [blame] | 596 | stepResult = main.wrapper.singleToMultiIntent( |
| 597 | main, |
kelvin-onlab | 0890001 | 2015-05-20 14:30:44 -0700 | [diff] [blame] | 598 | name="IPV4", |
kelvin-onlab | f0594d7 | 2015-05-19 17:25:12 -0700 | [diff] [blame] | 599 | hostNames=hostNames, |
| 600 | devices=devices, |
| 601 | ports=None, |
| 602 | ethType="IPV4", |
| 603 | macs=macs, |
| 604 | bandwidth="", |
| 605 | lambdaAlloc=False, |
| 606 | ipProto="", |
| 607 | ipAddresses="", |
| 608 | tcp="", |
kelvin-onlab | 0890001 | 2015-05-20 14:30:44 -0700 | [diff] [blame] | 609 | sw1="s5", |
| 610 | sw2="s2", |
| 611 | expectedLink=18 ) |
kelvin-onlab | f0594d7 | 2015-05-19 17:25:12 -0700 | [diff] [blame] | 612 | |
| 613 | utilities.assert_equals( expect=main.TRUE, |
| 614 | actual=stepResult, |
| 615 | onpass="IPV4: Successfully added single point" |
| 616 | + " to multi point intents", |
| 617 | onfail="IPV4: Failed to add single point" + |
| 618 | " to multi point intents" ) |
kelvin-onlab | 0890001 | 2015-05-20 14:30:44 -0700 | [diff] [blame] | 619 | |
| 620 | main.step( "IPV4_2: Add single point to multi point intents" ) |
| 621 | hostNames = [ 'h8', 'h16', 'h24' ] |
kelvin-onlab | 0890001 | 2015-05-20 14:30:44 -0700 | [diff] [blame] | 622 | stepResult = main.wrapper.singleToMultiIntent( |
| 623 | main, |
| 624 | name="IPV4", |
| 625 | hostNames=hostNames, |
| 626 | ethType="IPV4", |
| 627 | lambdaAlloc=False ) |
| 628 | |
| 629 | utilities.assert_equals( expect=main.TRUE, |
| 630 | actual=stepResult, |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 631 | onpass="IPV4_2: Successfully added single " |
| 632 | + " point to multi point intents", |
kelvin-onlab | 0890001 | 2015-05-20 14:30:44 -0700 | [diff] [blame] | 633 | onfail="IPV4_2: Failed to add single point" + |
| 634 | " to multi point intents" ) |
kaouthera | 426d0ab | 2015-05-28 17:41:10 -0700 | [diff] [blame] | 635 | stepResult = main.TRUE |
| 636 | main.step( "VLAN: Add single point to multi point intents" ) |
| 637 | hostNames = [ 'h4', 'h12', 'h20' ] |
| 638 | devices = [ 'of:0000000000000005/4', 'of:0000000000000006/4', \ |
| 639 | 'of:0000000000000007/4' ] |
| 640 | macs = [ '00:00:00:00:00:04', '00:00:00:00:00:0C', '00:00:00:00:00:14' ] |
| 641 | stepResult = main.wrapper.singleToMultiIntent( |
| 642 | main, |
| 643 | name="VLAN", |
| 644 | hostNames=hostNames, |
| 645 | devices=devices, |
| 646 | ports=None, |
| 647 | ethType="IPV4", |
| 648 | macs=macs, |
| 649 | bandwidth="", |
| 650 | lambdaAlloc=False, |
| 651 | ipProto="", |
| 652 | ipAddresses="", |
| 653 | tcp="", |
| 654 | sw1="s5", |
| 655 | sw2="s2", |
| 656 | expectedLink=18 ) |
| 657 | |
| 658 | utilities.assert_equals( expect=main.TRUE, |
| 659 | actual=stepResult, |
| 660 | onpass="VLAN: Successfully added single point" |
| 661 | + " to multi point intents", |
| 662 | onfail="VLAN: Failed to add single point" + |
| 663 | " to multi point intents" ) |
| 664 | |
| 665 | def CASE1004( self, main ): |
| 666 | """ |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 667 | Add multi point to single point intents |
| 668 | - Get device ids |
| 669 | - Add multi point to single point intents |
| 670 | - Check intents |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 671 | - Verify flows |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 672 | - Ping hosts |
| 673 | - Reroute |
| 674 | - Link down |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 675 | - Verify flows |
| 676 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 677 | - Ping hosts |
| 678 | - Link up |
kelvin-onlab | e5239e5 | 2015-05-13 14:46:45 -0700 | [diff] [blame] | 679 | - Verify flows |
| 680 | - Check topology |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 681 | - Ping hosts |
kaouthera | 426d0ab | 2015-05-28 17:41:10 -0700 | [diff] [blame] | 682 | - Remove intents |
kelvin-onlab | 65782a8 | 2015-05-07 14:12:13 -0700 | [diff] [blame] | 683 | """ |
kelvin-onlab | c751ab4 | 2015-05-21 14:09:39 -0700 | [diff] [blame] | 684 | assert main, "There is no main" |
| 685 | assert main.CLIs, "There is no main.CLIs" |
| 686 | assert main.Mininet1, "Mininet handle should be named Mininet1" |
| 687 | assert main.numSwitch, "Placed the total number of switch topology in \ |
| 688 | main.numSwitch" |
| 689 | |
| 690 | main.case( "Add multi point to single point intents between devices" ) |
| 691 | |
| 692 | stepResult = main.TRUE |
kelvin-onlab | c751ab4 | 2015-05-21 14:09:39 -0700 | [diff] [blame] | 693 | hostNames = [ 'h8', 'h16', 'h24' ] |
| 694 | devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8', \ |
| 695 | 'of:0000000000000007/8' ] |
| 696 | macs = [ '00:00:00:00:00:08', '00:00:00:00:00:10', '00:00:00:00:00:18' ] |
kelvin-onlab | f2ec6e0 | 2015-05-27 14:15:28 -0700 | [diff] [blame] | 697 | |
| 698 | main.step( "NOOPTION: Add multi point to single point intents" ) |
| 699 | stepResult = main.wrapper.multiToSingleIntent( |
| 700 | main, |
| 701 | name="NOOPTION", |
| 702 | hostNames=hostNames, |
| 703 | devices=devices, |
| 704 | sw1="s5", |
| 705 | sw2="s2", |
| 706 | expectedLink=18 ) |
| 707 | |
| 708 | utilities.assert_equals( expect=main.TRUE, |
| 709 | actual=stepResult, |
| 710 | onpass="NOOPTION: Successfully added multi " |
| 711 | + " point to single point intents", |
| 712 | onfail="NOOPTION: Failed to add multi point" + |
| 713 | " to single point intents" ) |
| 714 | |
| 715 | |
| 716 | main.step( "IPV4: Add multi point to single point intents" ) |
kelvin-onlab | c751ab4 | 2015-05-21 14:09:39 -0700 | [diff] [blame] | 717 | stepResult = main.wrapper.multiToSingleIntent( |
| 718 | main, |
| 719 | name="IPV4", |
| 720 | hostNames=hostNames, |
| 721 | devices=devices, |
| 722 | ports=None, |
| 723 | ethType="IPV4", |
| 724 | macs=macs, |
| 725 | bandwidth="", |
| 726 | lambdaAlloc=False, |
| 727 | ipProto="", |
| 728 | ipAddresses="", |
| 729 | tcp="", |
| 730 | sw1="s5", |
| 731 | sw2="s2", |
| 732 | expectedLink=18 ) |
| 733 | |
| 734 | utilities.assert_equals( expect=main.TRUE, |
| 735 | actual=stepResult, |
| 736 | onpass="IPV4: Successfully added multi point" |
| 737 | + " to single point intents", |
| 738 | onfail="IPV4: Failed to add multi point" + |
| 739 | " to single point intents" ) |
| 740 | |
| 741 | main.step( "IPV4_2: Add multi point to single point intents" ) |
| 742 | hostNames = [ 'h8', 'h16', 'h24' ] |
| 743 | stepResult = main.wrapper.multiToSingleIntent( |
| 744 | main, |
| 745 | name="IPV4", |
| 746 | hostNames=hostNames, |
| 747 | ethType="IPV4", |
| 748 | lambdaAlloc=False ) |
| 749 | |
| 750 | utilities.assert_equals( expect=main.TRUE, |
| 751 | actual=stepResult, |
| 752 | onpass="IPV4_2: Successfully added multi point" |
| 753 | + " to single point intents", |
| 754 | onfail="IPV4_2: Failed to add multi point" + |
| 755 | " to single point intents" ) |
kaouthera | 426d0ab | 2015-05-28 17:41:10 -0700 | [diff] [blame] | 756 | |
| 757 | stepResult = main.TRUE |
| 758 | main.step( "VLAN: Add multi point to single point intents" ) |
| 759 | hostNames = [ 'h5', 'h13', 'h21' ] |
| 760 | devices = [ 'of:0000000000000005/5', 'of:0000000000000006/5', \ |
| 761 | 'of:0000000000000007/5' ] |
| 762 | macs = [ '00:00:00:00:00:05', '00:00:00:00:00:0D', '00:00:00:00:00:15' ] |
| 763 | stepResult = main.wrapper.multiToSingleIntent( |
| 764 | main, |
| 765 | name="VLAN", |
| 766 | hostNames=hostNames, |
| 767 | devices=devices, |
| 768 | ports=None, |
| 769 | ethType="IPV4", |
| 770 | macs=macs, |
| 771 | bandwidth="", |
| 772 | lambdaAlloc=False, |
| 773 | ipProto="", |
| 774 | ipAddresses="", |
| 775 | tcp="", |
| 776 | sw1="s5", |
| 777 | sw2="s2", |
| 778 | expectedLink=18 ) |
| 779 | |
| 780 | utilities.assert_equals( expect=main.TRUE, |
| 781 | actual=stepResult, |
| 782 | onpass="VLAN: Successfully added multi point" |
| 783 | + " to single point intents", |
| 784 | onfail="VLAN: Failed to add multi point" + |
| 785 | " to single point intents" ) |