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