Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 1 | """ |
| 2 | Copyright 2015 Open Networking Foundation (ONF) |
| 3 | |
| 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | |
| 8 | TestON is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | TestON is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 20 | """ |
| 21 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 22 | # Testing the basic intent functionality of ONOS |
| 23 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 24 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 25 | class FUNCintent: |
| 26 | |
| 27 | def __init__( self ): |
| 28 | self.default = '' |
| 29 | |
| 30 | def CASE1( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 31 | import imp |
Jon Hall | f632d20 | 2015-07-30 15:45:11 -0700 | [diff] [blame] | 32 | import re |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 33 | """ |
| 34 | - Construct tests variables |
| 35 | - GIT ( optional ) |
| 36 | - Checkout ONOS master branch |
| 37 | - Pull latest ONOS code |
| 38 | - Building ONOS ( optional ) |
| 39 | - Install ONOS package |
| 40 | - Build ONOS package |
| 41 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 42 | |
| 43 | try: |
| 44 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 45 | main.testSetUp = ONOSSetup() |
| 46 | except ImportError: |
| 47 | main.log.error( "ONOSSetup not found. exiting the test" ) |
| 48 | main.exit() |
| 49 | main.testSetUp.envSetupDescription() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 50 | stepResult = main.FALSE |
| 51 | |
| 52 | # Test variables |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 53 | try: |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 54 | main.apps = main.params[ 'ENV' ][ 'cellApps' ] |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 55 | main.dependencyPath = main.testOnDirectory + \ |
| 56 | main.params[ 'DEPENDENCY' ][ 'path' ] |
| 57 | main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ] |
| 58 | main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 59 | |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 60 | wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ] |
| 61 | wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ] |
| 62 | wrapperFile3 = main.params[ 'DEPENDENCY' ][ 'wrapper3' ] |
| 63 | main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] ) |
| 64 | main.checkIntentSleep = int( main.params[ 'SLEEP' ][ 'checkintent' ] ) |
acsmars | cfa5227 | 2015-08-06 15:21:45 -0700 | [diff] [blame] | 65 | main.removeIntentSleep = int( main.params[ 'SLEEP' ][ 'removeintent' ] ) |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 66 | main.rerouteSleep = int( main.params[ 'SLEEP' ][ 'reroute' ] ) |
| 67 | main.fwdSleep = int( main.params[ 'SLEEP' ][ 'fwd' ] ) |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 68 | main.checkConnectionSleep = int( main.params[ 'SLEEP' ][ 'checkConnection' ] ) |
| 69 | main.checkFlowCountSleep = int( main.params[ 'SLEEP' ][ 'checkFlowCount' ] ) |
| 70 | main.checkIntentHostSleep = int( main.params[ 'SLEEP' ][ 'checkIntentHost' ] ) |
| 71 | main.checkIntentPointSleep = int( main.params[ 'SLEEP' ][ 'checkIntentPoint' ] ) |
acsmars | 59a4c55 | 2015-09-10 18:11:19 -0700 | [diff] [blame] | 72 | main.checkTopoAttempts = int( main.params[ 'SLEEP' ][ 'topoAttempts' ] ) |
Jeremy Songster | 306ed7a | 2016-07-19 10:59:07 -0700 | [diff] [blame] | 73 | main.flowDurationSleep = int( main.params[ 'SLEEP' ][ 'flowDuration' ] ) |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 74 | main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] ) |
| 75 | main.numLinks = int( main.params[ 'MININET' ][ 'links' ] ) |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 76 | main.hostsData = {} |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 77 | main.scapyHostNames = main.params[ 'SCAPY' ][ 'HOSTNAMES' ].split( ',' ) |
| 78 | main.scapyHosts = [] # List of scapy hosts for iterating |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 79 | main.assertReturnString = '' # Assembled assert return string |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 80 | main.cycle = 0 # How many times FUNCintent has run through its tests |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 81 | |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 82 | # -- INIT SECTION, ONLY RUNS ONCE -- # |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 83 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 84 | main.intents = imp.load_source( wrapperFile2, |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 85 | main.dependencyPath + |
| 86 | wrapperFile2 + |
| 87 | ".py" ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 88 | |
kelvin-onlab | d9e23de | 2015-08-06 10:34:44 -0700 | [diff] [blame] | 89 | copyResult1 = main.ONOSbench.scp( main.Mininet1, |
| 90 | main.dependencyPath + |
| 91 | main.topology, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 92 | main.Mininet1.home + "custom/", |
kelvin-onlab | d9e23de | 2015-08-06 10:34:44 -0700 | [diff] [blame] | 93 | direction="to" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 94 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 95 | stepResult = main.testSetUp.envSetup() |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 96 | except Exception as e: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 97 | main.testSetUp.envSetupException( e ) |
| 98 | main.testSetUp.evnSetupConclusion( stepResult ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 99 | |
| 100 | def CASE2( self, main ): |
| 101 | """ |
| 102 | - Set up cell |
| 103 | - Create cell file |
| 104 | - Set cell file |
| 105 | - Verify cell file |
| 106 | - Kill ONOS process |
| 107 | - Uninstall ONOS cluster |
| 108 | - Verify ONOS start up |
| 109 | - Install ONOS cluster |
| 110 | - Connect to cli |
| 111 | """ |
Jeremy Songster | 17147f2 | 2016-05-31 18:30:52 -0700 | [diff] [blame] | 112 | |
Jeremy | cd87222 | 2016-03-29 10:08:34 -0700 | [diff] [blame] | 113 | main.flowCompiler = "Flow Rules" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 114 | main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True ) |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 115 | main.intents.report( main ) |
kelvin-onlab | 016dce2 | 2015-08-10 09:54:11 -0700 | [diff] [blame] | 116 | |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 117 | def CASE8( self, main ): |
| 118 | """ |
acsmars | 59a4c55 | 2015-09-10 18:11:19 -0700 | [diff] [blame] | 119 | Compare ONOS Topology to Mininet Topology |
Jon Hall | a3e0243 | 2015-07-24 15:55:42 -0700 | [diff] [blame] | 120 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 121 | import time |
| 122 | try: |
| 123 | from tests.dependencies.topology import Topology |
| 124 | except ImportError: |
| 125 | main.log.error( "Topology not found exiting the test" ) |
| 126 | main.exit() |
| 127 | try: |
| 128 | main.topoRelated |
| 129 | except ( NameError, AttributeError ): |
| 130 | main.topoRelated = Topology() |
| 131 | main.topoRelated.compareTopos( main.Mininet1, main.checkTopoAttempts ) |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 132 | def CASE10( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 133 | """ |
kelvin-onlab | b0b0dcb | 2015-07-22 16:51:33 -0700 | [diff] [blame] | 134 | Start Mininet topology with OF 1.0 switches |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 135 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 136 | if main.initialized == main.FALSE: |
| 137 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 138 | main.skipCase() |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 139 | main.OFProtocol = "1.0" |
kelvin-onlab | b0b0dcb | 2015-07-22 16:51:33 -0700 | [diff] [blame] | 140 | main.log.report( "Start Mininet topology with OF 1.0 switches" ) |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 141 | main.case( "Start Mininet topology with OF 1.0 switches" ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 142 | main.caseExplanation = "Start mininet topology with OF 1.0 " +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 143 | "switches to test intents, exits out if " +\ |
| 144 | "topology did not start correctly" |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 145 | |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 146 | main.step( "Starting Mininet topology with OF 1.0 switches" ) |
kelvin-onlab | b0b0dcb | 2015-07-22 16:51:33 -0700 | [diff] [blame] | 147 | args = "--switch ovs,protocols=OpenFlow10" |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 148 | topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath + |
kelvin-onlab | b0b0dcb | 2015-07-22 16:51:33 -0700 | [diff] [blame] | 149 | main.topology, |
| 150 | args=args ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 151 | stepResult = topoResult |
| 152 | utilities.assert_equals( expect=main.TRUE, |
| 153 | actual=stepResult, |
| 154 | onpass="Successfully loaded topology", |
| 155 | onfail="Failed to load topology" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 156 | |
| 157 | # Set flag to test cases if topology did not load properly |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 158 | if not topoResult: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 159 | main.initialized = main.FALSE |
| 160 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 161 | |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 162 | def CASE11( self, main ): |
| 163 | """ |
kelvin-onlab | b0b0dcb | 2015-07-22 16:51:33 -0700 | [diff] [blame] | 164 | Start Mininet topology with OF 1.3 switches |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 165 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 166 | if main.initialized == main.FALSE: |
| 167 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 168 | main.skipCase() |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 169 | main.OFProtocol = "1.3" |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 170 | main.log.report( "Start Mininet topology with OF 1.3 switches" ) |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 171 | main.case( "Start Mininet topology with OF 1.3 switches" ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 172 | main.caseExplanation = "Start mininet topology with OF 1.3 " +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 173 | "switches to test intents, exits out if " +\ |
| 174 | "topology did not start correctly" |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 175 | |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 176 | main.step( "Starting Mininet topology with OF 1.3 switches" ) |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 177 | args = "--switch ovs,protocols=OpenFlow13" |
| 178 | topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath + |
| 179 | main.topology, |
| 180 | args=args ) |
| 181 | stepResult = topoResult |
| 182 | utilities.assert_equals( expect=main.TRUE, |
| 183 | actual=stepResult, |
| 184 | onpass="Successfully loaded topology", |
| 185 | onfail="Failed to load topology" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 186 | # Set flag to skip test cases if topology did not load properly |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 187 | if not topoResult: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 188 | main.initialized = main.FALSE |
kelvin-onlab | b5cfab3 | 2015-07-22 16:38:22 -0700 | [diff] [blame] | 189 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 190 | def CASE12( self, main ): |
| 191 | """ |
| 192 | Assign mastership to controllers |
| 193 | """ |
| 194 | import re |
| 195 | |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 196 | if main.initialized == main.FALSE: |
| 197 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 198 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 199 | main.case( "Assign switches to controllers" ) |
| 200 | main.step( "Assigning switches to controllers" ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 201 | main.caseExplanation = "Assign OF " + main.OFProtocol +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 202 | " switches to ONOS nodes" |
| 203 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 204 | switchList = [] |
| 205 | |
| 206 | # Creates a list switch name, use getSwitch() function later... |
| 207 | for i in range( 1, ( main.numSwitch + 1 ) ): |
| 208 | switchList.append( 's' + str( i ) ) |
| 209 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 210 | tempONOSip = main.Cluster.getIps() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 211 | |
| 212 | assignResult = main.Mininet1.assignSwController( sw=switchList, |
| 213 | ip=tempONOSip, |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 214 | port="6653" ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 215 | if not assignResult: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 216 | main.log.error( "Problem assigning mastership of switches" ) |
| 217 | main.initialized = main.FALSE |
| 218 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 219 | |
| 220 | for i in range( 1, ( main.numSwitch + 1 ) ): |
| 221 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
Jon Hall | 860b815 | 2017-05-23 10:35:23 -0700 | [diff] [blame] | 222 | main.log.debug( "Response is " + str( response ) ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 223 | if re.search( "tcp:" + main.Cluster.active( 0 ).ipAddress, response ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 224 | assignResult = assignResult and main.TRUE |
| 225 | else: |
| 226 | assignResult = main.FALSE |
| 227 | stepResult = assignResult |
| 228 | utilities.assert_equals( expect=main.TRUE, |
| 229 | actual=stepResult, |
| 230 | onpass="Successfully assigned switches" + |
| 231 | "to controller", |
| 232 | onfail="Failed to assign switches to " + |
| 233 | "controller" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 234 | if not stepResult: |
| 235 | main.initialized = main.FALSE |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 236 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 237 | def CASE13( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 238 | """ |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 239 | Create Scapy components |
| 240 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 241 | if main.initialized == main.FALSE: |
| 242 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 243 | main.skipCase() |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 244 | main.case( "Create scapy components" ) |
| 245 | main.step( "Create scapy components" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 246 | scapyResult = main.TRUE |
| 247 | for hostName in main.scapyHostNames: |
| 248 | main.Scapy1.createHostComponent( hostName ) |
| 249 | main.scapyHosts.append( getattr( main, hostName ) ) |
| 250 | |
| 251 | main.step( "Start scapy components" ) |
| 252 | for host in main.scapyHosts: |
| 253 | host.startHostCli() |
| 254 | host.startScapy() |
| 255 | host.updateSelf() |
| 256 | main.log.debug( host.name ) |
| 257 | main.log.debug( host.hostIp ) |
| 258 | main.log.debug( host.hostMac ) |
| 259 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 260 | utilities.assert_equals( expect=main.TRUE, |
| 261 | actual=scapyResult, |
| 262 | onpass="Successfully created Scapy Components", |
| 263 | onfail="Failed to discover Scapy Components" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 264 | if not scapyResult: |
| 265 | main.initialized = main.FALSE |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 266 | |
| 267 | def CASE14( self, main ): |
| 268 | """ |
| 269 | Discover all hosts with fwd and pingall and store its data in a dictionary |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 270 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 271 | if main.initialized == main.FALSE: |
| 272 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 273 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 274 | main.case( "Discover all hosts" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 275 | main.step( "Pingall hosts and confirm ONOS discovery" ) |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 276 | utilities.retry( f=main.intents.fwdPingall, retValue=main.FALSE, args=[ main ] ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 277 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 278 | stepResult = utilities.retry( f=main.intents.confirmHostDiscovery, retValue=main.FALSE, |
| 279 | args=[ main ], attempts=main.checkTopoAttempts, sleep=2 ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 280 | utilities.assert_equals( expect=main.TRUE, |
| 281 | actual=stepResult, |
| 282 | onpass="Successfully discovered hosts", |
| 283 | onfail="Failed to discover hosts" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 284 | if not stepResult: |
| 285 | main.initialized = main.FALSE |
| 286 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 287 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 288 | main.step( "Populate hostsData" ) |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 289 | stepResult = main.intents.populateHostData( main ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 290 | utilities.assert_equals( expect=main.TRUE, |
| 291 | actual=stepResult, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 292 | onpass="Successfully populated hostsData", |
| 293 | onfail="Failed to populate hostsData" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 294 | if not stepResult: |
| 295 | main.initialized = main.FALSE |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 296 | |
| 297 | def CASE15( self, main ): |
| 298 | """ |
| 299 | Discover all hosts with scapy arp packets and store its data to a dictionary |
| 300 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 301 | if main.initialized == main.FALSE: |
| 302 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 303 | main.skipCase() |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 304 | main.case( "Discover all hosts using scapy" ) |
| 305 | main.step( "Send packets from each host to the first host and confirm onos discovery" ) |
| 306 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 307 | if len( main.scapyHosts ) < 1: |
| 308 | main.log.error( "No scapy hosts have been created" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 309 | main.initialized = main.FALSE |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 310 | main.skipCase() |
| 311 | |
| 312 | # Send ARP packets from each scapy host component |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 313 | main.intents.sendDiscoveryArp( main, main.scapyHosts ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 314 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 315 | stepResult = utilities.retry( f=main.intents.confirmHostDiscovery, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 316 | retValue=main.FALSE, args=[ main ], |
| 317 | attempts=main.checkTopoAttempts, sleep=2 ) |
| 318 | |
| 319 | utilities.assert_equals( expect=main.TRUE, |
| 320 | actual=stepResult, |
| 321 | onpass="ONOS correctly discovered all hosts", |
| 322 | onfail="ONOS incorrectly discovered hosts" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 323 | if not stepResult: |
| 324 | main.initialized = main.FALSE |
| 325 | main.skipCase() |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 326 | |
| 327 | main.step( "Populate hostsData" ) |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 328 | stepResult = main.intents.populateHostData( main ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 329 | utilities.assert_equals( expect=main.TRUE, |
| 330 | actual=stepResult, |
| 331 | onpass="Successfully populated hostsData", |
| 332 | onfail="Failed to populate hostsData" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 333 | if not stepResult: |
| 334 | main.initialized = main.FALSE |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 335 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 336 | def CASE16( self, main ): |
| 337 | """ |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 338 | Balance Masters |
| 339 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 340 | if main.initialized == main.FALSE: |
| 341 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 342 | main.stop() |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 343 | main.skipCase() |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 344 | main.case( "Balance mastership of switches" ) |
| 345 | main.step( "Balancing mastership of switches" ) |
| 346 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 347 | balanceResult = utilities.retry( f=main.Cluster.active( 0 ).CLI.balanceMasters, retValue=main.FALSE, args=[] ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 348 | |
| 349 | utilities.assert_equals( expect=main.TRUE, |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 350 | actual=balanceResult, |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 351 | onpass="Successfully balanced mastership of switches", |
| 352 | onfail="Failed to balance mastership of switches" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 353 | if not balanceResult: |
| 354 | main.initialized = main.FALSE |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 355 | |
| 356 | def CASE17( self, main ): |
| 357 | """ |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 358 | Use Flow Objectives |
| 359 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 360 | if main.initialized == main.FALSE: |
| 361 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 362 | main.skipCase() |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 363 | main.case( "Enable intent compilation using Flow Objectives" ) |
| 364 | main.step( "Enabling Flow Objectives" ) |
| 365 | |
| 366 | main.flowCompiler = "Flow Objectives" |
| 367 | |
| 368 | cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator" |
| 369 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 370 | stepResult = main.Cluster.active( 0 ).CLI.setCfg( component=cmd, |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 371 | propName="useFlowObjectives", value="true" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 372 | stepResult &= main.Cluster.active( 0 ).CLI.setCfg( component=cmd, |
You Wang | 106d0fa | 2017-05-15 17:22:15 -0700 | [diff] [blame] | 373 | propName="defaultFlowObjectiveCompiler", |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 374 | value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' ) |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 375 | |
| 376 | utilities.assert_equals( expect=main.TRUE, |
| 377 | actual=stepResult, |
| 378 | onpass="Successfully activated Flow Objectives", |
| 379 | onfail="Failed to activate Flow Objectives" ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 380 | if not balanceResult: |
| 381 | main.initialized = main.FALSE |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 382 | |
| 383 | def CASE18( self, main ): |
| 384 | """ |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 385 | Stop mininet and remove scapy host |
| 386 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 387 | try: |
| 388 | from tests.dependencies.utils import Utils |
| 389 | except ImportError: |
| 390 | main.log.error( "Utils not found exiting the test" ) |
| 391 | main.exit() |
| 392 | try: |
| 393 | main.Utils |
| 394 | except ( NameError, AttributeError ): |
| 395 | main.Utils = Utils() |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 396 | main.log.report( "Stop Mininet and Scapy" ) |
| 397 | main.case( "Stop Mininet and Scapy" ) |
| 398 | main.caseExplanation = "Stopping the current mininet topology " +\ |
| 399 | "to start up fresh" |
| 400 | main.step( "Stopping and Removing Scapy Host Components" ) |
| 401 | scapyResult = main.TRUE |
| 402 | for host in main.scapyHosts: |
| 403 | scapyResult = scapyResult and host.stopScapy() |
| 404 | main.log.info( "Stopped Scapy Host: {0}".format( host.name ) ) |
| 405 | |
| 406 | for host in main.scapyHosts: |
| 407 | scapyResult = scapyResult and main.Scapy1.removeHostComponent( host.name ) |
| 408 | main.log.info( "Removed Scapy Host Component: {0}".format( host.name ) ) |
| 409 | |
| 410 | main.scapyHosts = [] |
| 411 | main.scapyHostIPs = [] |
| 412 | |
| 413 | utilities.assert_equals( expect=main.TRUE, |
| 414 | actual=scapyResult, |
| 415 | onpass="Successfully stopped scapy and removed host components", |
| 416 | onfail="Failed to stop mininet and scapy" ) |
| 417 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 418 | mininetResult = main.Utils.mininetCleanup( main.Mininet1 ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 419 | # Exit if topology did not load properly |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 420 | if not ( mininetResult and scapyResult ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 421 | main.cleanup() |
| 422 | main.exit() |
| 423 | |
Jeremy Songster | 17147f2 | 2016-05-31 18:30:52 -0700 | [diff] [blame] | 424 | def CASE19( self, main ): |
| 425 | """ |
| 426 | Copy the karaf.log files after each testcase cycle |
| 427 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 428 | try: |
| 429 | from tests.dependencies.utils import Utils |
| 430 | except ImportError: |
| 431 | main.log.error( "Utils not found exiting the test" ) |
| 432 | main.exit() |
| 433 | try: |
| 434 | main.Utils |
| 435 | except ( NameError, AttributeError ): |
| 436 | main.Utils = Utils() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 437 | main.Utils.copyKarafLog( "cycle" + str( main.cycle ) ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 438 | def CASE1000( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 439 | """ |
| 440 | Add host intents between 2 host: |
| 441 | - Discover hosts |
| 442 | - Add host intents |
| 443 | - Check intents |
| 444 | - Verify flows |
| 445 | - Ping hosts |
| 446 | - Reroute |
| 447 | - Link down |
| 448 | - Verify flows |
| 449 | - Check topology |
| 450 | - Ping hosts |
| 451 | - Link up |
| 452 | - Verify flows |
| 453 | - Check topology |
| 454 | - Ping hosts |
| 455 | - Remove intents |
| 456 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 457 | if main.initialized == main.FALSE: |
| 458 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 459 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 460 | # Assert variables - These variable's name|format must be followed |
| 461 | # if you want to use the wrapper function |
| 462 | assert main, "There is no main" |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 463 | try: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 464 | assert main.Mininet1 |
| 465 | except AssertionError: |
| 466 | main.log.error( "Mininet handle should be named Mininet1, skipping test cases" ) |
| 467 | main.initialized = main.FALSE |
| 468 | main.skipCase() |
| 469 | try: |
| 470 | assert main.numSwitch |
| 471 | except AssertionError: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 472 | main.log.error( "Place the total number of switch topology in " + |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 473 | main.numSwitch ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 474 | main.initialized = main.FALSE |
| 475 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 476 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 477 | # Save leader candidates |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 478 | intentLeadersOld = main.Cluster.active( 0 ).CLI.leaderCandidates() |
acsmars | e6b410f | 2015-07-17 14:39:34 -0700 | [diff] [blame] | 479 | |
kelvin-onlab | 7bb2d97 | 2015-08-05 10:56:16 -0700 | [diff] [blame] | 480 | main.testName = "Host Intents" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 481 | main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) + |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 482 | " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 483 | main.caseExplanation = "This test case tests Host intents using " +\ |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 484 | str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 485 | "Different type of hosts will be tested in " +\ |
| 486 | "each step such as IPV4, Dual stack, VLAN " +\ |
Jeremy | eb51cb1 | 2016-03-28 17:53:35 -0700 | [diff] [blame] | 487 | "etc;\nThe test will use OF " + main.OFProtocol +\ |
| 488 | " OVS running in Mininet and compile intents" +\ |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 489 | " using " + main.flowCompiler |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 490 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 491 | main.step( "IPV4: Add host intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 492 | main.assertReturnString = "Assertion Result for IPV4 host intent with mac addresses\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 493 | host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" } |
| 494 | host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 495 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 496 | installResult = main.intents.installHostIntent( main, |
| 497 | name="IPV4", |
| 498 | onosNode=0, |
| 499 | host1=host1, |
| 500 | host2=host2 ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 501 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 502 | testResult = main.intents.testHostIntent( main, |
| 503 | name="IPV4", |
| 504 | intentId=installResult, |
| 505 | onosNode=0, |
| 506 | host1=host1, |
| 507 | host2=host2, |
| 508 | sw1="s5", |
| 509 | sw2="s2", |
| 510 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 511 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 512 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 513 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 514 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 515 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 516 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 517 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 518 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 519 | main.step( "DUALSTACK1: Add host intents between h3 and h11" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 520 | main.assertReturnString = "Assertion Result for dualstack IPV4 with MAC addresses\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 521 | host1 = { "name": "h3", "id": "00:00:00:00:00:03/-1" } |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 522 | host2 = { "name": "h11", "id": "00:00:00:00:00:0B/-1 " } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 523 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 524 | installResult = main.intents.installHostIntent( main, |
| 525 | name="DUALSTACK", |
| 526 | onosNode=0, |
| 527 | host1=host1, |
| 528 | host2=host2 ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 529 | |
| 530 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 531 | testResult = main.intents.testHostIntent( main, |
| 532 | name="DUALSTACK", |
| 533 | intentId=installResult, |
| 534 | onosNode=0, |
| 535 | host1=host1, |
| 536 | host2=host2, |
| 537 | sw1="s5", |
| 538 | sw2="s2", |
| 539 | expectedLink=18 ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 540 | |
| 541 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 542 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 543 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 544 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 545 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 546 | main.step( "DUALSTACK2: Add host intents between h1 and h11" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 547 | main.assertReturnString = "Assertion Result for dualstack2 host intent\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 548 | host1 = { "name": "h1" } |
| 549 | host2 = { "name": "h11" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 550 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 551 | installResult = main.intents.installHostIntent( main, |
| 552 | name="DUALSTACK2", |
| 553 | onosNode=0, |
| 554 | host1=host1, |
| 555 | host2=host2 ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 556 | |
| 557 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 558 | testResult = main.intents.testHostIntent( main, |
| 559 | name="DUALSTACK2", |
| 560 | intentId=installResult, |
| 561 | onosNode=0, |
| 562 | host1=host1, |
| 563 | host2=host2, |
| 564 | sw1="s5", |
| 565 | sw2="s2", |
| 566 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 567 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 568 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 569 | |
| 570 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 571 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 572 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 573 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 574 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 575 | main.step( "1HOP: Add host intents between h1 and h3" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 576 | main.assertReturnString = "Assertion Result for 1HOP for IPV4 same switch\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 577 | host1 = { "name": "h1" } |
| 578 | host2 = { "name": "h3" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 579 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 580 | installResult = main.intents.installHostIntent( main, |
| 581 | name="1HOP", |
| 582 | onosNode=0, |
| 583 | host1=host1, |
| 584 | host2=host2 ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 585 | |
| 586 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 587 | testResult = main.intents.testHostIntent( main, |
| 588 | name="1HOP", |
| 589 | intentId=installResult, |
| 590 | onosNode=0, |
| 591 | host1=host1, |
| 592 | host2=host2, |
| 593 | sw1="s5", |
| 594 | sw2="s2", |
| 595 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 596 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 597 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 598 | |
| 599 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 600 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 601 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 602 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 603 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 604 | main.step( "VLAN1: Add vlan host intents between h4 and h12" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 605 | main.assertReturnString = "Assertion Result vlan IPV4\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 606 | host1 = { "name": "h4", "id": "00:00:00:00:00:04/100", "vlan": "100" } |
| 607 | host2 = { "name": "h12", "id": "00:00:00:00:00:0C/100", "vlan": "100" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 608 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 609 | installResult = main.intents.installHostIntent( main, |
| 610 | name="VLAN1", |
| 611 | onosNode=0, |
| 612 | host1=host1, |
| 613 | host2=host2 ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 614 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 615 | testResult = main.intents.testHostIntent( main, |
| 616 | name="VLAN1", |
| 617 | intentId=installResult, |
| 618 | onosNode=0, |
| 619 | host1=host1, |
| 620 | host2=host2, |
| 621 | sw1="s5", |
| 622 | sw2="s2", |
| 623 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 624 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 625 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 626 | |
| 627 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 628 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 629 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 630 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 631 | |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 632 | main.step( "VLAN2: Add vlan host intents between h4 and h13" ) |
| 633 | main.assertReturnString = "Assertion Result vlan IPV4\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 634 | host1 = { "name": "h5", "vlan": "200" } |
| 635 | host2 = { "name": "h12", "vlan": "100" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 636 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 637 | installResult = main.intents.installHostIntent( main, |
| 638 | name="VLAN2", |
| 639 | onosNode=0, |
| 640 | host1=host1, |
| 641 | host2=host2 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 642 | |
| 643 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 644 | testResult = main.intents.testHostIntent( main, |
| 645 | name="VLAN2", |
| 646 | intentId=installResult, |
| 647 | onosNode=0, |
| 648 | host1=host1, |
| 649 | host2=host2, |
| 650 | sw1="s5", |
| 651 | sw2="s2", |
| 652 | expectedLink=18 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 653 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 654 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 655 | |
| 656 | utilities.assert_equals( expect=main.TRUE, |
| 657 | actual=testResult, |
| 658 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 659 | onfail=main.assertReturnString ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 660 | |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 661 | main.step( "Encapsulation: Add host intents between h1 and h9" ) |
| 662 | main.assertReturnString = "Assertion Result for VLAN Encapsulated host intent\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 663 | host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" } |
| 664 | host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" } |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 665 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 666 | installResult = main.intents.installHostIntent( main, |
| 667 | name="ENCAPSULATION", |
| 668 | onosNode=0, |
| 669 | host1=host1, |
| 670 | host2=host2, |
| 671 | encap="VLAN" ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 672 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 673 | testResult = main.intents.testHostIntent( main, |
| 674 | name="ENCAPSULATION", |
| 675 | intentId=installResult, |
| 676 | onosNode=0, |
| 677 | host1=host1, |
| 678 | host2=host2, |
| 679 | sw1="s5", |
| 680 | sw2="s2", |
| 681 | expectedLink=18 ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 682 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 683 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 684 | |
| 685 | utilities.assert_equals( expect=main.TRUE, |
| 686 | actual=testResult, |
| 687 | onpass=main.assertReturnString, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 688 | onfail=main.assertReturnString ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 689 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 690 | # Testing MPLS would require kernel version of 4.1 or higher ( Current version is 3.13 ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 691 | # main.step( "Encapsulation: Add host intents between h1 and h9" ) |
| 692 | # main.assertReturnString = "Assertion Result for MPLS Encapsulated host intent\n" |
| 693 | # host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" } |
| 694 | # host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" } |
| 695 | # testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 696 | # installResult = main.intents.installHostIntent( main, |
| 697 | # name="ENCAPSULATION", |
| 698 | # onosNode=0, |
| 699 | # host1=host1, |
| 700 | # host2=host2, |
| 701 | # encap="MPLS" ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 702 | # if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 703 | # testResult = main.intents.testHostIntent( main, |
| 704 | # name="ENCAPSULATION", |
| 705 | # intentId=installResult, |
| 706 | # onosNode=0, |
| 707 | # host1=host1, |
| 708 | # host2=host2, |
| 709 | # sw1="s5", |
| 710 | # sw2="s2", |
| 711 | # expectedLink=18 ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 712 | # else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 713 | # main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 714 | # |
| 715 | # utilities.assert_equals( expect=main.TRUE, |
| 716 | # actual=testResult, |
| 717 | # onpass=main.assertReturnString, |
| 718 | # onfail=main.assertReturnString ) |
| 719 | |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 720 | main.step( "Confirm that ONOS leadership is unchanged" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 721 | intentLeadersNew = main.Cluster.active( 0 ).CLI.leaderCandidates() |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 722 | testResult = main.intents.checkLeaderChange( intentLeadersOld, |
| 723 | intentLeadersNew ) |
acsmars | e6b410f | 2015-07-17 14:39:34 -0700 | [diff] [blame] | 724 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 725 | utilities.assert_equals( expect=main.TRUE, |
| 726 | actual=testResult, |
| 727 | onpass="ONOS Leaders Unchanged", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 728 | onfail="ONOS Leader Mismatch" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 729 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 730 | main.intents.report( main ) |
kelvin-onlab | 016dce2 | 2015-08-10 09:54:11 -0700 | [diff] [blame] | 731 | |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 732 | def CASE2000( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 733 | """ |
| 734 | Add point intents between 2 hosts: |
| 735 | - Get device ids | ports |
| 736 | - Add point intents |
| 737 | - Check intents |
| 738 | - Verify flows |
| 739 | - Ping hosts |
| 740 | - Reroute |
| 741 | - Link down |
| 742 | - Verify flows |
| 743 | - Check topology |
| 744 | - Ping hosts |
| 745 | - Link up |
| 746 | - Verify flows |
| 747 | - Check topology |
| 748 | - Ping hosts |
| 749 | - Remove intents |
| 750 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 751 | if main.initialized == main.FALSE: |
| 752 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 753 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 754 | # Assert variables - These variable's name|format must be followed |
| 755 | # if you want to use the wrapper function |
| 756 | assert main, "There is no main" |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 757 | try: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 758 | assert main.Mininet1 |
| 759 | except AssertionError: |
| 760 | main.log.error( "Mininet handle should be named Mininet1, skipping test cases" ) |
| 761 | main.initialized = main.FALSE |
| 762 | main.skipCase() |
| 763 | try: |
| 764 | assert main.numSwitch |
| 765 | except AssertionError: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 766 | main.log.error( "Place the total number of switch topology in " + |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 767 | main.numSwitch ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 768 | main.initialized = main.FALSE |
| 769 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 770 | |
kelvin-onlab | 7bb2d97 | 2015-08-05 10:56:16 -0700 | [diff] [blame] | 771 | main.testName = "Point Intents" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 772 | main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) + |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 773 | " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 774 | main.caseExplanation = "This test case will test point to point" +\ |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 775 | " intents using " + str( main.Cluster.numCtrls ) +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 776 | " node(s) cluster;\n" +\ |
| 777 | "Different type of hosts will be tested in " +\ |
| 778 | "each step such as IPV4, Dual stack, VLAN etc" +\ |
| 779 | ";\nThe test will use OF " + main.OFProtocol +\ |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 780 | " OVS running in Mininet and compile intents" +\ |
| 781 | " using " + main.flowCompiler |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 782 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 783 | # No option point intents |
| 784 | main.step( "NOOPTION: Add point intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 785 | main.assertReturnString = "Assertion Result for NOOPTION point intent\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 786 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 787 | { "name": "h1", "device": "of:0000000000000005/1" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 788 | ] |
| 789 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 790 | { "name": "h9", "device": "of:0000000000000006/1" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 791 | ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 792 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 793 | installResult = main.intents.installPointIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 794 | main, |
| 795 | name="NOOPTION", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 796 | senders=senders, |
| 797 | recipients=recipients ) |
| 798 | |
| 799 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 800 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 801 | main, |
| 802 | intentId=installResult, |
| 803 | name="NOOPTION", |
| 804 | senders=senders, |
| 805 | recipients=recipients, |
| 806 | sw1="s5", |
| 807 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 808 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 809 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 810 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 811 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 812 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 813 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 814 | onpass=main.assertReturnString, |
| 815 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 816 | |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 817 | main.step( "IPV4: Add point intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 818 | main.assertReturnString = "Assertion Result for IPV4 point intent\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 819 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 820 | { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 821 | ] |
| 822 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 823 | { "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 824 | ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 825 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 826 | installResult = main.intents.installPointIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 827 | main, |
| 828 | name="IPV4", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 829 | senders=senders, |
| 830 | recipients=recipients, |
| 831 | ethType="IPV4" ) |
| 832 | |
| 833 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 834 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 835 | main, |
| 836 | intentId=installResult, |
| 837 | name="IPV4", |
| 838 | senders=senders, |
| 839 | recipients=recipients, |
| 840 | sw1="s5", |
| 841 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 842 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 843 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 844 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 845 | |
| 846 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 847 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 848 | onpass=main.assertReturnString, |
| 849 | onfail=main.assertReturnString ) |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 850 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 851 | main.step( "Protected: Add point intents between h1 and h9" ) |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 852 | main.assertReturnString = "Assertion Result for protected point intent\n" |
| 853 | senders = [ |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 854 | { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01" } |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 855 | ] |
| 856 | recipients = [ |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 857 | { "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09" } |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 858 | ] |
| 859 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 860 | installResult = main.intents.installPointIntent( |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 861 | main, |
| 862 | name="Protected", |
| 863 | senders=senders, |
| 864 | recipients=recipients, |
| 865 | protected=True ) |
| 866 | |
| 867 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 868 | testResult = main.intents.testPointIntent( |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 869 | main, |
| 870 | name="Protected", |
| 871 | intentId=installResult, |
| 872 | senders=senders, |
| 873 | recipients=recipients, |
| 874 | sw1="s5", |
| 875 | sw2="s2", |
| 876 | protected=True, |
| 877 | expectedLink=18 ) |
| 878 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 879 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
alison | da15727 | 2016-12-22 01:13:21 -0800 | [diff] [blame] | 880 | |
| 881 | utilities.assert_equals( expect=main.TRUE, |
| 882 | actual=testResult, |
| 883 | onpass=main.assertReturnString, |
| 884 | onfail=main.assertReturnString ) |
| 885 | |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 886 | main.step( "IPV4_2: Add point intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 887 | main.assertReturnString = "Assertion Result for IPV4 no mac address point intents\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 888 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 889 | { "name": "h1", "device": "of:0000000000000005/1" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 890 | ] |
| 891 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 892 | { "name": "h9", "device": "of:0000000000000006/1" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 893 | ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 894 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 895 | installResult = main.intents.installPointIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 896 | main, |
| 897 | name="IPV4_2", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 898 | senders=senders, |
| 899 | recipients=recipients, |
| 900 | ethType="IPV4" ) |
| 901 | |
| 902 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 903 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 904 | main, |
| 905 | intentId=installResult, |
| 906 | name="IPV4_2", |
| 907 | senders=senders, |
| 908 | recipients=recipients, |
| 909 | sw1="s5", |
| 910 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 911 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 912 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 913 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 914 | |
| 915 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 916 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 917 | onpass=main.assertReturnString, |
| 918 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 919 | |
kelvin-onlab | b55e58e | 2015-08-04 00:13:48 -0700 | [diff] [blame] | 920 | main.step( "SDNIP-ICMP: Add point intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 921 | main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV4 using TCP point intents\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 922 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 923 | { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01", |
Jeremy | 6f000c6 | 2016-02-25 17:02:28 -0800 | [diff] [blame] | 924 | "ip":( main.h1.hostIp + "/24" ) } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 925 | ] |
| 926 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 927 | { "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09", |
Jeremy | 6f000c6 | 2016-02-25 17:02:28 -0800 | [diff] [blame] | 928 | "ip":( main.h9.hostIp + "/24" ) } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 929 | ] |
Jeremy | 6f000c6 | 2016-02-25 17:02:28 -0800 | [diff] [blame] | 930 | ipProto = main.params[ 'SDNIP' ][ 'ipPrototype' ] |
kelvin-onlab | 79ce049 | 2015-07-27 16:14:39 -0700 | [diff] [blame] | 931 | # Uneccessary, not including this in the selectors |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 932 | tcpSrc = main.params[ 'SDNIP' ][ 'srcPort' ] |
| 933 | tcpDst = main.params[ 'SDNIP' ][ 'dstPort' ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 934 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 935 | installResult = main.intents.installPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 936 | main, |
| 937 | name="SDNIP-ICMP", |
| 938 | senders=senders, |
| 939 | recipients=recipients, |
| 940 | ethType="IPV4", |
| 941 | ipProto=ipProto, |
| 942 | tcpSrc=tcpSrc, |
| 943 | tcpDst=tcpDst ) |
| 944 | |
| 945 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 946 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 947 | main, |
| 948 | intentId=installResult, |
| 949 | name="SDNIP_ICMP", |
| 950 | senders=senders, |
| 951 | recipients=recipients, |
| 952 | sw1="s5", |
| 953 | sw2="s2", |
Jeremy Songster | e405d3d | 2016-05-17 11:18:57 -0700 | [diff] [blame] | 954 | expectedLink=18, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 955 | useTCP=True ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 956 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 957 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 958 | |
| 959 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 960 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 961 | onpass=main.assertReturnString, |
| 962 | onfail=main.assertReturnString ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 963 | |
kelvin-onlab | b55e58e | 2015-08-04 00:13:48 -0700 | [diff] [blame] | 964 | main.step( "SDNIP-TCP: Add point intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 965 | main.assertReturnString = "Assertion Result for SDNIP-TCP IPV4 using ICMP point intents\n" |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 966 | mac1 = main.hostsData[ 'h1' ][ 'mac' ] |
| 967 | mac2 = main.hostsData[ 'h9' ][ 'mac' ] |
kelvin-onlab | 58dc39e | 2015-08-06 08:11:09 -0700 | [diff] [blame] | 968 | ip1 = str( main.hostsData[ 'h1' ][ 'ipAddresses' ][ 0 ] ) + "/32" |
| 969 | ip2 = str( main.hostsData[ 'h9' ][ 'ipAddresses' ][ 0 ] ) + "/32" |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 970 | ipProto = main.params[ 'SDNIP' ][ 'tcpProto' ] |
| 971 | tcp1 = main.params[ 'SDNIP' ][ 'srcPort' ] |
| 972 | tcp2 = main.params[ 'SDNIP' ][ 'dstPort' ] |
| 973 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 974 | stepResult = main.intents.pointIntentTcp( |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 975 | main, |
kelvin-onlab | b55e58e | 2015-08-04 00:13:48 -0700 | [diff] [blame] | 976 | name="SDNIP-TCP", |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 977 | host1="h1", |
| 978 | host2="h9", |
| 979 | deviceId1="of:0000000000000005/1", |
| 980 | deviceId2="of:0000000000000006/1", |
| 981 | mac1=mac1, |
| 982 | mac2=mac2, |
| 983 | ethType="IPV4", |
kelvin-onlab | b55e58e | 2015-08-04 00:13:48 -0700 | [diff] [blame] | 984 | ipProto=ipProto, |
| 985 | ip1=ip1, |
| 986 | ip2=ip2, |
| 987 | tcp1=tcp1, |
| 988 | tcp2=tcp2 ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 989 | |
| 990 | utilities.assert_equals( expect=main.TRUE, |
Jeremy | 6f000c6 | 2016-02-25 17:02:28 -0800 | [diff] [blame] | 991 | actual=stepResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 992 | onpass=main.assertReturnString, |
| 993 | onfail=main.assertReturnString ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 994 | |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 995 | main.step( "DUALSTACK1: Add point intents between h3 and h11" ) |
| 996 | main.assertReturnString = "Assertion Result for Dualstack1 IPV4 with mac address point intents\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 997 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 998 | { "name": "h3", "device": "of:0000000000000005/3", "mac": "00:00:00:00:00:03" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 999 | ] |
| 1000 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1001 | { "name": "h11", "device": "of:0000000000000006/3", "mac": "00:00:00:00:00:0B" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1002 | ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1003 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1004 | installResult = main.intents.installPointIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1005 | main, |
| 1006 | name="DUALSTACK1", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1007 | senders=senders, |
| 1008 | recipients=recipients, |
| 1009 | ethType="IPV4" ) |
| 1010 | |
| 1011 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1012 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1013 | main, |
| 1014 | intentId=installResult, |
| 1015 | name="DUALSTACK1", |
| 1016 | senders=senders, |
| 1017 | recipients=recipients, |
| 1018 | sw1="s5", |
| 1019 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1020 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1021 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1022 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1023 | |
| 1024 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1025 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1026 | onpass=main.assertReturnString, |
| 1027 | onfail=main.assertReturnString ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 1028 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1029 | main.step( "VLAN: Add point intents between h5 and h21" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1030 | main.assertReturnString = "Assertion Result for VLAN IPV4 with mac address point intents\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1031 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1032 | { "name": "h5", "device": "of:0000000000000005/5", "mac": "00:00:00:00:00:05", "vlan": "200" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1033 | ] |
| 1034 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1035 | { "name": "h21", "device": "of:0000000000000007/5", "mac": "00:00:00:00:00:15", "vlan": "200" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1036 | ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1037 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1038 | installResult = main.intents.installPointIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1039 | main, |
Jeremy Songster | 832f9e9 | 2016-05-05 14:30:49 -0700 | [diff] [blame] | 1040 | name="VLAN", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1041 | senders=senders, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1042 | recipients=recipients ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1043 | |
| 1044 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1045 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1046 | main, |
| 1047 | intentId=installResult, |
Jeremy Songster | 832f9e9 | 2016-05-05 14:30:49 -0700 | [diff] [blame] | 1048 | name="VLAN", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1049 | senders=senders, |
| 1050 | recipients=recipients, |
| 1051 | sw1="s5", |
| 1052 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1053 | expectedLink=18 ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1054 | |
| 1055 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1056 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1057 | onpass=main.assertReturnString, |
| 1058 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1059 | |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1060 | main.step( "VLAN: Add point intents between h5 and h21" ) |
| 1061 | main.assertReturnString = "Assertion Result for VLAN IPV4 point intents with VLAN treatment\n" |
| 1062 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1063 | { "name": "h4", "vlan": "100" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1064 | ] |
| 1065 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1066 | { "name": "h21", "vlan": "200" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1067 | ] |
| 1068 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1069 | installResult = main.intents.installPointIntent( |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1070 | main, |
| 1071 | name="VLAN2", |
| 1072 | senders=senders, |
| 1073 | recipients=recipients, |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1074 | setVlan=200 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1075 | |
| 1076 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1077 | testResult = main.intents.testPointIntent( |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1078 | main, |
| 1079 | intentId=installResult, |
| 1080 | name="VLAN2", |
| 1081 | senders=senders, |
| 1082 | recipients=recipients, |
| 1083 | sw1="s5", |
| 1084 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1085 | expectedLink=18 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1086 | |
| 1087 | utilities.assert_equals( expect=main.TRUE, |
| 1088 | actual=testResult, |
| 1089 | onpass=main.assertReturnString, |
| 1090 | onfail=main.assertReturnString ) |
| 1091 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1092 | main.step( "1HOP: Add point intents between h1 and h3" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1093 | main.assertReturnString = "Assertion Result for 1HOP IPV4 with no mac address point intents\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1094 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1095 | { "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1096 | ] |
| 1097 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1098 | { "name": "h3", "device": "of:0000000000000005/3", "mac": "00:00:00:00:00:03" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1099 | ] |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1100 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1101 | installResult = main.intents.installPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1102 | main, |
| 1103 | name="1HOP IPV4", |
| 1104 | senders=senders, |
| 1105 | recipients=recipients, |
| 1106 | ethType="IPV4" ) |
| 1107 | |
| 1108 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1109 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1110 | main, |
| 1111 | intentId=installResult, |
| 1112 | name="1HOP IPV4", |
| 1113 | senders=senders, |
| 1114 | recipients=recipients, |
| 1115 | sw1="s5", |
| 1116 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1117 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1118 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1119 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1120 | |
| 1121 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1122 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1123 | onpass=main.assertReturnString, |
| 1124 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1125 | |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1126 | main.step( "Add point to point intents using VLAN Encapsulation" ) |
| 1127 | main.assertReturnString = "Assertion Result for VLAN Encapsulation Point Intent" |
| 1128 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1129 | { "name": "h1", "device": "of:0000000000000005/1" } |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1130 | ] |
| 1131 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1132 | { "name": "h9", "device": "of:0000000000000006/1" } |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1133 | ] |
| 1134 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1135 | installResult = main.intents.installPointIntent( |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1136 | main, |
| 1137 | name="ENCAPSULATION", |
| 1138 | senders=senders, |
| 1139 | recipients=recipients, |
| 1140 | encap="VLAN" ) |
| 1141 | |
| 1142 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1143 | testResult = main.intents.testPointIntent( |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1144 | main, |
| 1145 | intentId=installResult, |
| 1146 | name="ENCAPSULATION", |
| 1147 | senders=senders, |
| 1148 | recipients=recipients, |
| 1149 | sw1="s5", |
| 1150 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1151 | expectedLink=18 ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1152 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1153 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1154 | |
| 1155 | utilities.assert_equals( expect=main.TRUE, |
| 1156 | actual=testResult, |
| 1157 | onpass=main.assertReturnString, |
| 1158 | onfail=main.assertReturnString ) |
| 1159 | |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1160 | main.step( "BANDWIDTH ALLOCATION: Checking bandwidth allocation for point intents between h1 and h9" ) |
| 1161 | main.assertReturnString = "Assertion Result for BANDWIDTH ALLOCATION for point intent\n" |
| 1162 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1163 | { "name": "h1", "device": "of:0000000000000005/1" } |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1164 | ] |
| 1165 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1166 | { "name": "h9", "device": "of:0000000000000006/1" } |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1167 | ] |
| 1168 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1169 | installResult = main.intents.installPointIntent( |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1170 | main, |
| 1171 | name="NOOPTION", |
| 1172 | senders=senders, |
| 1173 | recipients=recipients, |
Jon Hall | f539eb9 | 2017-05-22 17:18:42 -0700 | [diff] [blame] | 1174 | bandwidth=100 ) |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1175 | |
| 1176 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1177 | testResult = main.intents.testPointIntent( |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1178 | main, |
| 1179 | intentId=installResult, |
| 1180 | name="NOOPTION", |
| 1181 | senders=senders, |
| 1182 | recipients=recipients, |
| 1183 | sw1="s5", |
| 1184 | sw2="s2", |
| 1185 | expectedLink=18 ) |
| 1186 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1187 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Shreya Chowdhary | 6fbb96c | 2017-05-02 16:20:19 -0700 | [diff] [blame] | 1188 | |
| 1189 | utilities.assert_equals( expect=main.TRUE, |
| 1190 | actual=testResult, |
| 1191 | onpass=main.assertReturnString, |
| 1192 | onfail=main.assertReturnString ) |
| 1193 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1194 | # Testing MPLS would require kernel version of 4.1 or higher ( Current version is 3.13 ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1195 | # main.step( "Add point to point intents using MPLS Encapsulation" ) |
| 1196 | # main.assertReturnString = "Assertion Result for MPLS Encapsulation Point Intent" |
| 1197 | # senders = [ |
| 1198 | # { "name": "h1", "device": "of:0000000000000005/1" } |
| 1199 | # ] |
| 1200 | # recipients = [ |
| 1201 | # { "name": "h9", "device": "of:0000000000000006/1" } |
| 1202 | # ] |
| 1203 | # testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1204 | # installResult = main.intents.installPointIntent( |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1205 | # main, |
| 1206 | # name="ENCAPSULATION", |
| 1207 | # senders=senders, |
| 1208 | # recipients=recipients, |
| 1209 | # encap="MPLS" ) |
| 1210 | # |
| 1211 | # if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1212 | # testResult = main.intents.testPointIntent( |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1213 | # main, |
| 1214 | # intentId=installResult, |
| 1215 | # name="ENCAPSULATION", |
| 1216 | # senders=senders, |
| 1217 | # recipients=recipients, |
| 1218 | # sw1="s5", |
| 1219 | # sw2="s2", |
| 1220 | # expectedLink=18 ) |
| 1221 | # else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1222 | # main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1223 | # |
| 1224 | # utilities.assert_equals( expect=main.TRUE, |
| 1225 | # actual=testResult, |
| 1226 | # onpass=main.assertReturnString, |
| 1227 | # onfail=main.assertReturnString ) |
| 1228 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1229 | main.intents.report( main ) |
kelvin-onlab | 016dce2 | 2015-08-10 09:54:11 -0700 | [diff] [blame] | 1230 | |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 1231 | def CASE3000( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1232 | """ |
| 1233 | Add single point to multi point intents |
| 1234 | - Get device ids |
| 1235 | - Add single point to multi point intents |
| 1236 | - Check intents |
| 1237 | - Verify flows |
| 1238 | - Ping hosts |
| 1239 | - Reroute |
| 1240 | - Link down |
| 1241 | - Verify flows |
| 1242 | - Check topology |
| 1243 | - Ping hosts |
| 1244 | - Link up |
| 1245 | - Verify flows |
| 1246 | - Check topology |
| 1247 | - Ping hosts |
| 1248 | - Remove intents |
| 1249 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1250 | if main.initialized == main.FALSE: |
| 1251 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 1252 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1253 | assert main, "There is no main" |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1254 | try: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1255 | assert main.Mininet1 |
| 1256 | except AssertionError: |
| 1257 | main.log.error( "Mininet handle should be named Mininet1, skipping test cases" ) |
| 1258 | main.initialized = main.FALSE |
| 1259 | main.skipCase() |
| 1260 | try: |
| 1261 | assert main.numSwitch |
| 1262 | except AssertionError: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1263 | main.log.error( "Place the total number of switch topology in " + |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1264 | main.numSwitch ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1265 | main.initialized = main.FALSE |
| 1266 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1267 | |
kelvin-onlab | 7bb2d97 | 2015-08-05 10:56:16 -0700 | [diff] [blame] | 1268 | main.testName = "Single to Multi Point Intents" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1269 | main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) + |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 1270 | " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 1271 | main.caseExplanation = "This test case will test single point to" +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 1272 | " multi point intents using " +\ |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1273 | str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 1274 | "Different type of hosts will be tested in " +\ |
| 1275 | "each step such as IPV4, Dual stack, VLAN etc" +\ |
| 1276 | ";\nThe test will use OF " + main.OFProtocol +\ |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 1277 | " OVS running in Mininet and compile intents" +\ |
| 1278 | " using " + main.flowCompiler |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1279 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1280 | main.step( "NOOPTION: Install and test single point to multi point intents" ) |
| 1281 | main.assertReturnString = "Assertion results for IPV4 single to multi point intent with no options set\n" |
| 1282 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1283 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1284 | ] |
| 1285 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1286 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1287 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1288 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1289 | badSenders = [ { "name": "h9" } ] # Senders that are not in the intent |
| 1290 | badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1291 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1292 | installResult = main.intents.installSingleToMultiIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1293 | main, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1294 | name="NOOPTION", |
| 1295 | senders=senders, |
| 1296 | recipients=recipients, |
| 1297 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1298 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1299 | |
| 1300 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1301 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1302 | main, |
| 1303 | intentId=installResult, |
| 1304 | name="NOOPTION", |
| 1305 | senders=senders, |
| 1306 | recipients=recipients, |
| 1307 | badSenders=badSenders, |
| 1308 | badRecipients=badRecipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1309 | sw1="s5", |
| 1310 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1311 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1312 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1313 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1314 | |
| 1315 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1316 | actual=testResult, |
| 1317 | onpass=main.assertReturnString, |
| 1318 | onfail=main.assertReturnString ) |
| 1319 | |
| 1320 | main.step( "IPV4: Install and test single point to multi point intents" ) |
| 1321 | main.assertReturnString = "Assertion results for IPV4 single to multi point intent with IPV4 type and MAC addresses\n" |
| 1322 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1323 | { "name": "h8", "device": "of:0000000000000005/8", "mac": "00:00:00:00:00:08" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1324 | ] |
| 1325 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1326 | { "name": "h16", "device": "of:0000000000000006/8", "mac": "00:00:00:00:00:10" }, |
| 1327 | { "name": "h24", "device": "of:0000000000000007/8", "mac": "00:00:00:00:00:18" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1328 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1329 | badSenders = [ { "name": "h9" } ] # Senders that are not in the intent |
| 1330 | badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1331 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1332 | installResult = main.intents.installSingleToMultiIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1333 | main, |
| 1334 | name="IPV4", |
| 1335 | senders=senders, |
| 1336 | recipients=recipients, |
| 1337 | ethType="IPV4", |
| 1338 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1339 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1340 | |
| 1341 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1342 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1343 | main, |
| 1344 | intentId=installResult, |
| 1345 | name="IPV4", |
| 1346 | senders=senders, |
| 1347 | recipients=recipients, |
| 1348 | badSenders=badSenders, |
| 1349 | badRecipients=badRecipients, |
| 1350 | sw1="s5", |
| 1351 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1352 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1353 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1354 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1355 | |
| 1356 | utilities.assert_equals( expect=main.TRUE, |
| 1357 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1358 | onpass=main.assertReturnString, |
| 1359 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1360 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1361 | main.step( "IPV4_2: Add single point to multi point intents" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1362 | main.assertReturnString = "Assertion results for IPV4 single to multi point intent with IPV4 type and no MAC addresses\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1363 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1364 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1365 | ] |
| 1366 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1367 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1368 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1369 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1370 | badSenders = [ { "name": "h9" } ] # Senders that are not in the intent |
| 1371 | badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1372 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1373 | installResult = main.intents.installSingleToMultiIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1374 | main, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1375 | name="IPV4_2", |
| 1376 | senders=senders, |
| 1377 | recipients=recipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1378 | ethType="IPV4", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1379 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1380 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1381 | |
| 1382 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1383 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1384 | main, |
| 1385 | intentId=installResult, |
| 1386 | name="IPV4_2", |
| 1387 | senders=senders, |
| 1388 | recipients=recipients, |
| 1389 | badSenders=badSenders, |
| 1390 | badRecipients=badRecipients, |
| 1391 | sw1="s5", |
| 1392 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1393 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1394 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1395 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1396 | |
| 1397 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1398 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1399 | onpass=main.assertReturnString, |
| 1400 | onfail=main.assertReturnString ) |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 1401 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1402 | main.step( "VLAN: Add single point to multi point intents" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1403 | main.assertReturnString = "Assertion results for IPV4 single to multi point intent with IPV4 type and MAC addresses in the same VLAN\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1404 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1405 | { "name": "h4", "device": "of:0000000000000005/4", "mac": "00:00:00:00:00:04", "vlan": "100" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1406 | ] |
| 1407 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1408 | { "name": "h12", "device": "of:0000000000000006/4", "mac": "00:00:00:00:00:0C", "vlan": "100" }, |
| 1409 | { "name": "h20", "device": "of:0000000000000007/4", "mac": "00:00:00:00:00:14", "vlan": "100" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1410 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1411 | badSenders = [ { "name": "h13" } ] # Senders that are not in the intent |
| 1412 | badRecipients = [ { "name": "h21" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1413 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1414 | installResult = main.intents.installSingleToMultiIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1415 | main, |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1416 | name="VLAN", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1417 | senders=senders, |
| 1418 | recipients=recipients, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1419 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1420 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1421 | |
| 1422 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1423 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1424 | main, |
| 1425 | intentId=installResult, |
Jeremy Songster | 832f9e9 | 2016-05-05 14:30:49 -0700 | [diff] [blame] | 1426 | name="VLAN", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1427 | senders=senders, |
| 1428 | recipients=recipients, |
| 1429 | badSenders=badSenders, |
| 1430 | badRecipients=badRecipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1431 | sw1="s5", |
| 1432 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1433 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1434 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1435 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1436 | |
| 1437 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1438 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1439 | onpass=main.assertReturnString, |
| 1440 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1441 | |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1442 | main.step( "VLAN: Add single point to multi point intents" ) |
| 1443 | main.assertReturnString = "Assertion results for single to multi point intent with VLAN treatment\n" |
| 1444 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1445 | { "name": "h5", "vlan": "200" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1446 | ] |
| 1447 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1448 | { "name": "h12", "device": "of:0000000000000006/4", "mac": "00:00:00:00:00:0C", "vlan": "100" }, |
| 1449 | { "name": "h20", "device": "of:0000000000000007/4", "mac": "00:00:00:00:00:14", "vlan": "100" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1450 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1451 | badSenders = [ { "name": "h13" } ] # Senders that are not in the intent |
| 1452 | badRecipients = [ { "name": "h21" } ] # Recipients that are not in the intent |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1453 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1454 | installResult = main.intents.installSingleToMultiIntent( |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1455 | main, |
| 1456 | name="VLAN2", |
| 1457 | senders=senders, |
| 1458 | recipients=recipients, |
| 1459 | sw1="s5", |
| 1460 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1461 | setVlan=100 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1462 | |
| 1463 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1464 | testResult = main.intents.testPointIntent( |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1465 | main, |
| 1466 | intentId=installResult, |
| 1467 | name="VLAN2", |
| 1468 | senders=senders, |
| 1469 | recipients=recipients, |
| 1470 | badSenders=badSenders, |
| 1471 | badRecipients=badRecipients, |
| 1472 | sw1="s5", |
| 1473 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1474 | expectedLink=18 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1475 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1476 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1477 | |
| 1478 | utilities.assert_equals( expect=main.TRUE, |
| 1479 | actual=testResult, |
| 1480 | onpass=main.assertReturnString, |
| 1481 | onfail=main.assertReturnString ) |
| 1482 | |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1483 | # Does not support Single point to multi point encapsulation |
| 1484 | # main.step( "ENCAPSULATION: Install and test single point to multi point intents" ) |
| 1485 | # main.assertReturnString = "Assertion results for VLAN Encapsulation single to multi point intent\n" |
| 1486 | # senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1487 | # { "name": "h8", "device": "of:0000000000000005/8" } |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1488 | # ] |
| 1489 | # recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1490 | # { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1491 | # { "name": "h24", "device": "of:0000000000000007/8" } |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1492 | # ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1493 | # badSenders = [ { "name": "h9" } ] # Senders that are not in the intent |
| 1494 | # badRecipients = [ { "name": "h17" } ] # Recipients that are not in the intent |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1495 | # testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1496 | # installResult = main.intents.installSingleToMultiIntent( |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1497 | # main, |
| 1498 | # name="ENCAPSULATION", |
| 1499 | # senders=senders, |
| 1500 | # recipients=recipients, |
| 1501 | # sw1="s5", |
| 1502 | # sw2="s2", |
| 1503 | # encap="VLAN" ) |
| 1504 | # |
| 1505 | # if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1506 | # testResult = main.intents.testPointIntent( |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1507 | # main, |
| 1508 | # intentId=installResult, |
| 1509 | # name="ENCAPSULATION", |
| 1510 | # senders=senders, |
| 1511 | # recipients=recipients, |
| 1512 | # badSenders=badSenders, |
| 1513 | # badRecipients=badRecipients, |
| 1514 | # sw1="s5", |
| 1515 | # sw2="s2", |
| 1516 | # expectedLink=18 ) |
| 1517 | # else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1518 | # main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1519 | # |
| 1520 | # utilities.assert_equals( expect=main.TRUE, |
| 1521 | # actual=testResult, |
| 1522 | # onpass=main.assertReturnString, |
| 1523 | # onfail=main.assertReturnString ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1524 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1525 | main.intents.report( main ) |
kelvin-onlab | 016dce2 | 2015-08-10 09:54:11 -0700 | [diff] [blame] | 1526 | |
kelvin-onlab | b769f56 | 2015-07-15 17:05:10 -0700 | [diff] [blame] | 1527 | def CASE4000( self, main ): |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1528 | """ |
| 1529 | Add multi point to single point intents |
| 1530 | - Get device ids |
| 1531 | - Add multi point to single point intents |
| 1532 | - Check intents |
| 1533 | - Verify flows |
| 1534 | - Ping hosts |
| 1535 | - Reroute |
| 1536 | - Link down |
| 1537 | - Verify flows |
| 1538 | - Check topology |
| 1539 | - Ping hosts |
| 1540 | - Link up |
| 1541 | - Verify flows |
| 1542 | - Check topology |
| 1543 | - Ping hosts |
| 1544 | - Remove intents |
| 1545 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1546 | if main.initialized == main.FALSE: |
| 1547 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 1548 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1549 | assert main, "There is no main" |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1550 | try: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1551 | assert main.Mininet1 |
| 1552 | except AssertionError: |
| 1553 | main.log.error( "Mininet handle should be named Mininet1, skipping test cases" ) |
| 1554 | main.initialized = main.FALSE |
| 1555 | main.skipCase() |
| 1556 | try: |
| 1557 | assert main.numSwitch |
| 1558 | except AssertionError: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1559 | main.log.error( "Place the total number of switch topology in " + |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1560 | main.numSwitch ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1561 | main.initialized = main.FALSE |
| 1562 | main.skipCase() |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1563 | |
kelvin-onlab | 7bb2d97 | 2015-08-05 10:56:16 -0700 | [diff] [blame] | 1564 | main.testName = "Multi To Single Point Intents" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1565 | main.case( main.testName + " Test - " + str( main.Cluster.numCtrls ) + |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 1566 | " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler ) |
Jon Hall | 783bbf9 | 2015-07-23 14:33:19 -0700 | [diff] [blame] | 1567 | main.caseExplanation = "This test case will test single point to" +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 1568 | " multi point intents using " +\ |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1569 | str( main.Cluster.numCtrls ) + " node(s) cluster;\n" +\ |
kelvin-onlab | 6dea6e6 | 2015-07-23 13:07:26 -0700 | [diff] [blame] | 1570 | "Different type of hosts will be tested in " +\ |
| 1571 | "each step such as IPV4, Dual stack, VLAN etc" +\ |
| 1572 | ";\nThe test will use OF " + main.OFProtocol +\ |
Jeremy | 6e9748f | 2016-03-25 15:03:39 -0700 | [diff] [blame] | 1573 | " OVS running in Mininet and compile intents" +\ |
| 1574 | " using " + main.flowCompiler |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1575 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1576 | main.step( "NOOPTION: Add multi point to single point intents" ) |
| 1577 | main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n" |
| 1578 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1579 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1580 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1581 | ] |
| 1582 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1583 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1584 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1585 | badSenders = [ { "name": "h17" } ] # Senders that are not in the intent |
| 1586 | badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1587 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1588 | installResult = main.intents.installMultiToSingleIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1589 | main, |
| 1590 | name="NOOPTION", |
| 1591 | senders=senders, |
| 1592 | recipients=recipients, |
| 1593 | sw1="s5", |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1594 | sw2="s2" ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1595 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1596 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1597 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1598 | main, |
| 1599 | intentId=installResult, |
| 1600 | name="NOOPTION", |
| 1601 | senders=senders, |
| 1602 | recipients=recipients, |
| 1603 | badSenders=badSenders, |
| 1604 | badRecipients=badRecipients, |
| 1605 | sw1="s5", |
| 1606 | sw2="s2", |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1607 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1608 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1609 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1610 | |
| 1611 | utilities.assert_equals( expect=main.TRUE, |
| 1612 | actual=testResult, |
| 1613 | onpass=main.assertReturnString, |
| 1614 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1615 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1616 | main.step( "IPV4: Add multi point to single point intents" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1617 | main.assertReturnString = "Assertion results for IPV4 multi to single point intent with IPV4 type and MAC addresses\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1618 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1619 | { "name": "h16", "device": "of:0000000000000006/8", "mac": "00:00:00:00:00:10" }, |
| 1620 | { "name": "h24", "device": "of:0000000000000007/8", "mac": "00:00:00:00:00:18" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1621 | ] |
| 1622 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1623 | { "name": "h8", "device": "of:0000000000000005/8", "mac": "00:00:00:00:00:08" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1624 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1625 | badSenders = [ { "name": "h17" } ] # Senders that are not in the intent |
| 1626 | badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1627 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1628 | installResult = main.intents.installMultiToSingleIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1629 | main, |
| 1630 | name="IPV4", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1631 | senders=senders, |
| 1632 | recipients=recipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1633 | ethType="IPV4", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1634 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1635 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1636 | |
| 1637 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1638 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1639 | main, |
| 1640 | intentId=installResult, |
| 1641 | name="IPV4", |
| 1642 | senders=senders, |
| 1643 | recipients=recipients, |
| 1644 | badSenders=badSenders, |
| 1645 | badRecipients=badRecipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1646 | sw1="s5", |
| 1647 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1648 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1649 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1650 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1651 | |
| 1652 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1653 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1654 | onpass=main.assertReturnString, |
| 1655 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1656 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1657 | main.step( "IPV4_2: Add multi point to single point intents" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1658 | main.assertReturnString = "Assertion results for IPV4 multi to single point intent with IPV4 type and no MAC addresses\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1659 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1660 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1661 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1662 | ] |
| 1663 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1664 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1665 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1666 | badSenders = [ { "name": "h17" } ] # Senders that are not in the intent |
| 1667 | badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1668 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1669 | installResult = main.intents.installMultiToSingleIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1670 | main, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1671 | name="IPV4_2", |
| 1672 | senders=senders, |
| 1673 | recipients=recipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1674 | ethType="IPV4", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1675 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1676 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1677 | |
| 1678 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1679 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1680 | main, |
| 1681 | intentId=installResult, |
| 1682 | name="IPV4_2", |
| 1683 | senders=senders, |
| 1684 | recipients=recipients, |
| 1685 | badSenders=badSenders, |
| 1686 | badRecipients=badRecipients, |
| 1687 | sw1="s5", |
| 1688 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1689 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1690 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1691 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1692 | |
| 1693 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1694 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1695 | onpass=main.assertReturnString, |
| 1696 | onfail=main.assertReturnString ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1697 | |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1698 | main.step( "VLAN: Add multi point to single point intents" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1699 | main.assertReturnString = "Assertion results for IPV4 multi to single point intent with IPV4 type and no MAC addresses in the same VLAN\n" |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1700 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1701 | { "name": "h13", "device": "of:0000000000000006/5", "vlan": "200" }, |
| 1702 | { "name": "h21", "device": "of:0000000000000007/5", "vlan": "200" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1703 | ] |
| 1704 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1705 | { "name": "h5", "device": "of:0000000000000005/5", "vlan": "200" } |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1706 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1707 | badSenders = [ { "name": "h12" } ] # Senders that are not in the intent |
| 1708 | badRecipients = [ { "name": "h20" } ] # Recipients that are not in the intent |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1709 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1710 | installResult = main.intents.installMultiToSingleIntent( |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1711 | main, |
| 1712 | name="VLAN", |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1713 | senders=senders, |
| 1714 | recipients=recipients, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1715 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1716 | sw2="s2" ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1717 | |
| 1718 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1719 | testResult = main.intents.testPointIntent( |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1720 | main, |
| 1721 | intentId=installResult, |
| 1722 | name="VLAN", |
| 1723 | senders=senders, |
| 1724 | recipients=recipients, |
| 1725 | badSenders=badSenders, |
| 1726 | badRecipients=badRecipients, |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1727 | sw1="s5", |
| 1728 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1729 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1730 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1731 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | d48a68c | 2015-07-13 16:01:36 -0700 | [diff] [blame] | 1732 | |
| 1733 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1734 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1735 | onpass=main.assertReturnString, |
| 1736 | onfail=main.assertReturnString ) |
kelvin-onlab | f34a58a | 2015-07-23 16:41:52 -0700 | [diff] [blame] | 1737 | |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1738 | # Right now this fails because of this bug: https://jira.onosproject.org/browse/ONOS-4383 |
| 1739 | main.step( "VLAN: Add multi point to single point intents" ) |
| 1740 | main.assertReturnString = "Assertion results for multi to single point intent with VLAN ID treatment\n" |
| 1741 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1742 | { "name": "h13", "device": "of:0000000000000006/5", "vlan": "200" }, |
| 1743 | { "name": "h21", "device": "of:0000000000000007/5", "vlan": "200" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1744 | ] |
| 1745 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1746 | { "name": "h4", "vlan": "100" } |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1747 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1748 | badSenders = [ { "name": "h12" } ] # Senders that are not in the intent |
| 1749 | badRecipients = [ { "name": "h20" } ] # Recipients that are not in the intent |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1750 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1751 | installResult = main.intents.installMultiToSingleIntent( |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1752 | main, |
| 1753 | name="VLAN2", |
| 1754 | senders=senders, |
| 1755 | recipients=recipients, |
| 1756 | sw1="s5", |
| 1757 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1758 | setVlan=100 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1759 | |
| 1760 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1761 | testResult = main.intents.testPointIntent( |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1762 | main, |
| 1763 | intentId=installResult, |
| 1764 | name="VLAN2", |
| 1765 | senders=senders, |
| 1766 | recipients=recipients, |
| 1767 | badSenders=badSenders, |
| 1768 | badRecipients=badRecipients, |
| 1769 | sw1="s5", |
| 1770 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1771 | expectedLink=18 ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1772 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1773 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | ff55367 | 2016-05-12 17:06:23 -0700 | [diff] [blame] | 1774 | |
| 1775 | utilities.assert_equals( expect=main.TRUE, |
| 1776 | actual=testResult, |
| 1777 | onpass=main.assertReturnString, |
| 1778 | onfail=main.assertReturnString ) |
| 1779 | |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1780 | main.step( "ENCAPSULATION: Add multi point to single point intents" ) |
| 1781 | main.assertReturnString = "Assertion results for VLAN Encapsulation multi to single point intent\n" |
| 1782 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1783 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1784 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1785 | ] |
| 1786 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1787 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1788 | ] |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1789 | badSenders = [ { "name": "h17" } ] # Senders that are not in the intent |
| 1790 | badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1791 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1792 | installResult = main.intents.installMultiToSingleIntent( |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1793 | main, |
| 1794 | name="ENCAPSULATION", |
| 1795 | senders=senders, |
| 1796 | recipients=recipients, |
| 1797 | sw1="s5", |
| 1798 | sw2="s2", |
| 1799 | encap="VLAN" ) |
| 1800 | |
| 1801 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1802 | testResult = main.intents.testPointIntent( |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1803 | main, |
| 1804 | intentId=installResult, |
| 1805 | name="ENCAPSULATION", |
| 1806 | senders=senders, |
| 1807 | recipients=recipients, |
| 1808 | badSenders=badSenders, |
| 1809 | badRecipients=badRecipients, |
| 1810 | sw1="s5", |
| 1811 | sw2="s2", |
| 1812 | expectedLink=18 ) |
| 1813 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1814 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | c032f16 | 2016-08-04 17:14:49 -0700 | [diff] [blame] | 1815 | |
| 1816 | utilities.assert_equals( expect=main.TRUE, |
| 1817 | actual=testResult, |
| 1818 | onpass=main.assertReturnString, |
| 1819 | onfail=main.assertReturnString ) |
| 1820 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1821 | #Testing MPLS would require kernel version of 4.1 or higher ( Current version is 3.13 ) |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1822 | #main.step( "ENCAPSULATION: Add multi point to single point intents" ) |
| 1823 | #main.assertReturnString = "Assertion results for MPLS Encapsulation multi to single point intent\n" |
| 1824 | #senders = [ |
| 1825 | # { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1826 | # { "name": "h24", "device": "of:0000000000000007/8" } |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1827 | # ] |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1828 | #recipients = [ |
| 1829 | # { "name": "h8", "device": "of:0000000000000005/8" } |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1830 | # ] |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1831 | #badSenders = [ { "name": "h17" } ] # Senders that are not in the intent |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1832 | #badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1833 | #testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1834 | #installResult = main.intents.installMultiToSingleIntent( |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1835 | # main, |
| 1836 | # name="ENCAPSULATION", |
| 1837 | # senders=senders, |
| 1838 | # recipients=recipients, |
| 1839 | # sw1="s5", |
| 1840 | # sw2="s2", |
| 1841 | # encap="MPLS" ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1842 | # |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1843 | #if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1844 | # testResult = main.intents.testPointIntent( |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1845 | # main, |
| 1846 | # intentId=installResult, |
| 1847 | # name="ENCAPSULATION", |
| 1848 | # senders=senders, |
| 1849 | # recipients=recipients, |
| 1850 | # badSenders=badSenders, |
| 1851 | # badRecipients=badRecipients, |
| 1852 | # sw1="s5", |
| 1853 | # sw2="s2", |
| 1854 | # expectedLink=18 ) |
| 1855 | #else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1856 | # main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1857 | # |
Shreya | ca8990f | 2017-03-16 11:43:11 -0700 | [diff] [blame] | 1858 | #utilities.assert_equals( expect=main.TRUE, |
| 1859 | # actual=testResult, |
| 1860 | # onpass=main.assertReturnString, |
| 1861 | # onfail=main.assertReturnString ) |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1862 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1863 | main.intents.report( main ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1864 | |
acsmars | 1ff5e05 | 2015-07-23 11:27:48 -0700 | [diff] [blame] | 1865 | def CASE5000( self, main ): |
| 1866 | """ |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1867 | Tests Host Mobility |
| 1868 | Modifies the topology location of h1 |
acsmars | 1ff5e05 | 2015-07-23 11:27:48 -0700 | [diff] [blame] | 1869 | """ |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1870 | if main.initialized == main.FALSE: |
| 1871 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 1872 | main.skipCase() |
acsmars | 1ff5e05 | 2015-07-23 11:27:48 -0700 | [diff] [blame] | 1873 | assert main, "There is no main" |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1874 | try: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1875 | assert main.Mininet1 |
| 1876 | except AssertionError: |
| 1877 | main.log.error( "Mininet handle should be named Mininet1, skipping test cases" ) |
| 1878 | main.initialized = main.FALSE |
| 1879 | main.skipCase() |
| 1880 | try: |
| 1881 | assert main.numSwitch |
| 1882 | except AssertionError: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1883 | main.log.error( "Place the total number of switch topology in " + |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1884 | main.numSwitch ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1885 | main.initialized = main.FALSE |
| 1886 | main.skipCase() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1887 | main.case( "Test host mobility with host intents " + " - " + str( main.Cluster.numCtrls ) + |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1888 | " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1889 | main.step( "Testing host mobility by moving h1 from s5 to s6" ) |
acsmars | 1ff5e05 | 2015-07-23 11:27:48 -0700 | [diff] [blame] | 1890 | |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 1891 | main.log.info( "Moving h1 from s5 to s6" ) |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1892 | main.Mininet1.moveHost( "h1", "s5", "s6" ) |
acsmars | 1ff5e05 | 2015-07-23 11:27:48 -0700 | [diff] [blame] | 1893 | |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1894 | # Send discovery ping from moved host |
| 1895 | # Moving the host brings down the default interfaces and creates a new one. |
| 1896 | # Scapy is restarted on this host to detect the new interface |
| 1897 | main.h1.stopScapy() |
| 1898 | main.h1.startScapy() |
| 1899 | |
| 1900 | # Discover new host location in ONOS and populate host data. |
| 1901 | # Host 1 IP and MAC should be unchanged |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1902 | main.intents.sendDiscoveryArp( main, [ main.h1 ] ) |
| 1903 | main.intents.populateHostData( main ) |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1904 | |
acsmars | 1ff5e05 | 2015-07-23 11:27:48 -0700 | [diff] [blame] | 1905 | h1PostMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ] |
| 1906 | |
| 1907 | utilities.assert_equals( expect="of:0000000000000006", |
| 1908 | actual=h1PostMove, |
| 1909 | onpass="Mobility: Successfully moved h1 to s6", |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1910 | onfail="Mobility: Failed to move h1 to s6" + |
kelvin-onlab | f34a58a | 2015-07-23 16:41:52 -0700 | [diff] [blame] | 1911 | " to single point intents" + |
| 1912 | " with IPV4 type and MAC addresses" + |
| 1913 | " in the same VLAN" ) |
| 1914 | |
| 1915 | main.step( "IPV4: Add host intents between h1 and h9" ) |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1916 | main.assertReturnString = "Assert result for IPV4 host intent between h1, moved, and h9\n" |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1917 | host1 = { "name": "h1", "id": "00:00:00:00:00:01/-1" } |
| 1918 | host2 = { "name": "h9", "id": "00:00:00:00:00:09/-1" } |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1919 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1920 | installResult = main.intents.installHostIntent( main, |
| 1921 | name="IPV4 Mobility IPV4", |
| 1922 | onosNode=0, |
| 1923 | host1=host1, |
| 1924 | host2=host2 ) |
Jeremy | 2f190ca | 2016-01-29 15:23:57 -0800 | [diff] [blame] | 1925 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1926 | testResult = main.intents.testHostIntent( main, |
| 1927 | name="Host Mobility IPV4", |
| 1928 | intentId=installResult, |
| 1929 | onosNode=0, |
| 1930 | host1=host1, |
| 1931 | host2=host2, |
| 1932 | sw1="s6", |
| 1933 | sw2="s2", |
| 1934 | expectedLink=18 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 1935 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1936 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
kelvin-onlab | f34a58a | 2015-07-23 16:41:52 -0700 | [diff] [blame] | 1937 | |
| 1938 | utilities.assert_equals( expect=main.TRUE, |
Jeremy Songster | 1f39bf0 | 2016-01-20 17:17:25 -0800 | [diff] [blame] | 1939 | actual=testResult, |
acsmars | 5d8cc86 | 2015-09-25 09:44:50 -0700 | [diff] [blame] | 1940 | onpass=main.assertReturnString, |
| 1941 | onfail=main.assertReturnString ) |
kelvin-onlab | 016dce2 | 2015-08-10 09:54:11 -0700 | [diff] [blame] | 1942 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1943 | main.intents.report( main ) |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1944 | |
| 1945 | def CASE6000( self, main ): |
| 1946 | """ |
| 1947 | Tests Multi to Single Point Intent and Single to Multi Point Intent End Point Failure |
| 1948 | """ |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 1949 | # At some later point discussion on this behavior in MPSP and SPMP intents |
| 1950 | # will be reoppened and this test case may need to be updated to reflect |
| 1951 | # the outcomes of that discussion |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1952 | if main.initialized == main.FALSE: |
| 1953 | main.log.error( "Test components did not start correctly, skipping further tests" ) |
| 1954 | main.skipCase() |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1955 | assert main, "There is no main" |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1956 | try: |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1957 | assert main.Mininet1 |
| 1958 | except AssertionError: |
| 1959 | main.log.error( "Mininet handle should be named Mininet1, skipping test cases" ) |
| 1960 | main.initialized = main.FALSE |
| 1961 | main.skipCase() |
| 1962 | try: |
| 1963 | assert main.numSwitch |
| 1964 | except AssertionError: |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1965 | main.log.error( "Place the total number of switch topology in " + main.numSwitch ) |
Jeremy | d9e4eb1 | 2016-04-13 12:09:06 -0700 | [diff] [blame] | 1966 | main.initialized = main.FALSE |
| 1967 | main.skipCase() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1968 | main.case( "Test Multi to Single End Point Failure" + " - " + str( main.Cluster.numCtrls ) + |
alison | 52b2589 | 2016-09-19 10:53:48 -0700 | [diff] [blame] | 1969 | " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler ) |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 1970 | main.step( "Installing Multi to Single Point intents with no options set" ) |
| 1971 | main.assertReturnString = "Assertion results for IPV4 multi to single " +\ |
| 1972 | "point intent end point failure with no options set\n" |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1973 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1974 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 1975 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1976 | ] |
| 1977 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1978 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1979 | ] |
| 1980 | isolatedSenders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 1981 | { "name": "h24" } |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1982 | ] |
| 1983 | isolatedRecipients = [] |
| 1984 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1985 | installResult = main.intents.installMultiToSingleIntent( |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1986 | main, |
| 1987 | name="NOOPTION", |
| 1988 | senders=senders, |
| 1989 | recipients=recipients, |
| 1990 | sw1="s5", |
| 1991 | sw2="s2" ) |
| 1992 | |
| 1993 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 1994 | testResult = main.intents.testEndPointFail( |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 1995 | main, |
| 1996 | intentId=installResult, |
| 1997 | name="NOOPTION", |
| 1998 | senders=senders, |
| 1999 | recipients=recipients, |
| 2000 | isolatedSenders=isolatedSenders, |
| 2001 | isolatedRecipients=isolatedRecipients, |
| 2002 | sw1="s6", |
| 2003 | sw2="s2", |
| 2004 | sw3="s4", |
| 2005 | sw4="s1", |
| 2006 | sw5="s3", |
| 2007 | expectedLink1=16, |
| 2008 | expectedLink2=14 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 2009 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 2010 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2011 | |
| 2012 | utilities.assert_equals( expect=main.TRUE, |
| 2013 | actual=testResult, |
| 2014 | onpass=main.assertReturnString, |
| 2015 | onfail=main.assertReturnString ) |
| 2016 | |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2017 | main.step( "Installing Multi to Single Point intents with partial failure allowed" ) |
| 2018 | |
| 2019 | main.assertReturnString = "Assertion results for IPV4 multi to single " +\ |
| 2020 | "with partial failures allowed\n" |
| 2021 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2022 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 2023 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2024 | ] |
| 2025 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2026 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2027 | ] |
| 2028 | isolatedSenders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2029 | { "name": "h24" } |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2030 | ] |
| 2031 | isolatedRecipients = [] |
| 2032 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2033 | installResult = main.intents.installMultiToSingleIntent( |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2034 | main, |
| 2035 | name="NOOPTION", |
| 2036 | senders=senders, |
| 2037 | recipients=recipients, |
| 2038 | sw1="s5", |
| 2039 | sw2="s2", |
| 2040 | partial=True ) |
| 2041 | |
| 2042 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2043 | testResult = main.intents.testEndPointFail( |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2044 | main, |
| 2045 | intentId=installResult, |
| 2046 | name="NOOPTION", |
| 2047 | senders=senders, |
| 2048 | recipients=recipients, |
| 2049 | isolatedSenders=isolatedSenders, |
| 2050 | isolatedRecipients=isolatedRecipients, |
| 2051 | sw1="s6", |
| 2052 | sw2="s2", |
| 2053 | sw3="s4", |
| 2054 | sw4="s1", |
| 2055 | sw5="s3", |
| 2056 | expectedLink1=16, |
| 2057 | expectedLink2=14, |
| 2058 | partial=True ) |
| 2059 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 2060 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2061 | |
| 2062 | utilities.assert_equals( expect=main.TRUE, |
| 2063 | actual=testResult, |
| 2064 | onpass=main.assertReturnString, |
| 2065 | onfail=main.assertReturnString ) |
| 2066 | |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2067 | main.step( "NOOPTION: Install and test single point to multi point intents" ) |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2068 | main.assertReturnString = "Assertion results for IPV4 single to multi " +\ |
| 2069 | "point intent with no options set\n" |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2070 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2071 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2072 | ] |
| 2073 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2074 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 2075 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2076 | ] |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2077 | isolatedSenders = [] |
| 2078 | isolatedRecipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2079 | { "name": "h24" } |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2080 | ] |
| 2081 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2082 | installResult = main.intents.installSingleToMultiIntent( |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2083 | main, |
| 2084 | name="NOOPTION", |
| 2085 | senders=senders, |
| 2086 | recipients=recipients, |
| 2087 | sw1="s5", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 2088 | sw2="s2" ) |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2089 | |
| 2090 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2091 | testResult = main.intents.testEndPointFail( |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2092 | main, |
| 2093 | intentId=installResult, |
| 2094 | name="NOOPTION", |
| 2095 | senders=senders, |
| 2096 | recipients=recipients, |
| 2097 | isolatedSenders=isolatedSenders, |
| 2098 | isolatedRecipients=isolatedRecipients, |
| 2099 | sw1="s6", |
| 2100 | sw2="s2", |
| 2101 | sw3="s4", |
| 2102 | sw4="s1", |
| 2103 | sw5="s3", |
| 2104 | expectedLink1=16, |
| 2105 | expectedLink2=14 ) |
Jeremy | 42df2e7 | 2016-02-23 16:37:46 -0800 | [diff] [blame] | 2106 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 2107 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2108 | |
| 2109 | utilities.assert_equals( expect=main.TRUE, |
| 2110 | actual=testResult, |
| 2111 | onpass=main.assertReturnString, |
| 2112 | onfail=main.assertReturnString ) |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2113 | # Right now this functionality doesn't work properly in SPMP intents |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2114 | main.step( "NOOPTION: Install and test single point to multi point " + |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2115 | "intents with partial failures allowed" ) |
| 2116 | main.assertReturnString = "Assertion results for IPV4 single to multi " +\ |
| 2117 | "point intent with partial failures allowed\n" |
| 2118 | senders = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2119 | { "name": "h8", "device": "of:0000000000000005/8" } |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2120 | ] |
| 2121 | recipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2122 | { "name": "h16", "device": "of:0000000000000006/8" }, |
| 2123 | { "name": "h24", "device": "of:0000000000000007/8" } |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2124 | ] |
| 2125 | isolatedSenders = [] |
| 2126 | isolatedRecipients = [ |
Jon Hall | 9c88867 | 2017-05-15 18:03:54 -0700 | [diff] [blame] | 2127 | { "name": "h24" } |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2128 | ] |
| 2129 | testResult = main.FALSE |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2130 | installResult = main.intents.installSingleToMultiIntent( |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2131 | main, |
| 2132 | name="NOOPTION", |
| 2133 | senders=senders, |
| 2134 | recipients=recipients, |
| 2135 | sw1="s5", |
| 2136 | sw2="s2", |
Jeremy Songster | e7f3b34 | 2016-08-17 14:56:49 -0700 | [diff] [blame] | 2137 | partial=True ) |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2138 | |
| 2139 | if installResult: |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2140 | testResult = main.intents.testEndPointFail( |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2141 | main, |
| 2142 | intentId=installResult, |
| 2143 | name="NOOPTION", |
| 2144 | senders=senders, |
| 2145 | recipients=recipients, |
| 2146 | isolatedSenders=isolatedSenders, |
| 2147 | isolatedRecipients=isolatedRecipients, |
| 2148 | sw1="s6", |
| 2149 | sw2="s2", |
| 2150 | sw3="s4", |
| 2151 | sw4="s1", |
| 2152 | sw5="s3", |
| 2153 | expectedLink1=16, |
| 2154 | expectedLink2=14, |
| 2155 | partial=True ) |
| 2156 | else: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 2157 | main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True ) |
Jeremy Songster | 9385d41 | 2016-06-02 17:57:36 -0700 | [diff] [blame] | 2158 | |
| 2159 | utilities.assert_equals( expect=main.TRUE, |
| 2160 | actual=testResult, |
| 2161 | onpass=main.assertReturnString, |
| 2162 | onfail=main.assertReturnString ) |
Jeremy | e0cb5eb | 2016-01-27 17:39:09 -0800 | [diff] [blame] | 2163 | |
Jon Hall | 78be496 | 2017-05-23 14:53:53 -0700 | [diff] [blame] | 2164 | main.intents.report( main ) |