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 | |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 22 | class FUNCflow: |
| 23 | |
| 24 | def __init__( self ): |
| 25 | self.default = '' |
| 26 | |
| 27 | def CASE1( self, main ): |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 28 | import os |
| 29 | import imp |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 30 | try: |
| 31 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 32 | except ImportError: |
| 33 | main.log.error( "SetUp not found exiting the test" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame^] | 34 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 35 | try: |
| 36 | main.testSetUp |
| 37 | except ( NameError, AttributeError ): |
| 38 | main.testSetUp = ONOSSetup() |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 39 | """ |
| 40 | - Construct tests variables |
| 41 | - GIT ( optional ) |
| 42 | - Checkout ONOS master branch |
| 43 | - Pull latest ONOS code |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 44 | """ |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 45 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 46 | main.testSetUp.envSetupDescription() |
| 47 | stepResult = main.FALSE |
| 48 | try: |
| 49 | # Test variables |
| 50 | main.cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 51 | main.apps = main.params[ 'ENV' ][ 'cellApps' ] |
| 52 | main.ONOSport = main.params[ 'CTRL' ][ 'port' ] |
| 53 | main.dependencyPath = main.testOnDirectory + \ |
| 54 | main.params[ 'DEPENDENCY' ][ 'path' ] |
| 55 | wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ] |
| 56 | wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ] |
| 57 | main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ] |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 58 | main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] ) |
| 59 | main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] ) |
| 60 | main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] ) |
| 61 | main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] ) |
| 62 | main.debug = main.params[ 'DEBUG' ] |
| 63 | main.swDPID = main.params[ 'TEST' ][ 'swDPID' ] |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 64 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 65 | main.debug = True if "on" in main.debug else False |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 66 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 67 | # -- INIT SECTION, ONLY RUNS ONCE -- # |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 68 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 69 | try: |
| 70 | from tests.FUNC.FUNCflow.dependencies.checkingFlow import CheckingFlow |
| 71 | main.checkingFlow = CheckingFlow() |
| 72 | except ImportError as e: |
| 73 | print e |
| 74 | main.log.error("CheckingFlow not found exiting the test") |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame^] | 75 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 76 | copyResult = main.ONOSbench.scp( main.Mininet1, |
| 77 | main.dependencyPath + main.topology, |
| 78 | main.Mininet1.home + '/custom/', |
| 79 | direction="to" ) |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 80 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 81 | utilities.assert_equals( expect=main.TRUE, |
| 82 | actual=copyResult, |
| 83 | onpass="Successfully copy " + "test variables ", |
| 84 | onfail="Failed to copy test variables" ) |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 85 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 86 | stepResult = main.testSetUp.envSetup() |
GlennRC | 1704d07 | 2015-10-07 18:40:45 -0700 | [diff] [blame] | 87 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 88 | except Exception as e: |
| 89 | main.testSetUp.envSetupException( e ) |
| 90 | main.testSetUp.evnSetupConclusion( stepResult ) |
Devin Lim | 8d7c778 | 2017-06-07 16:21:20 -0700 | [diff] [blame] | 91 | |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 92 | |
| 93 | def CASE2( self, main ): |
| 94 | """ |
| 95 | - Set up cell |
| 96 | - Create cell file |
| 97 | - Set cell file |
| 98 | - Verify cell file |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 99 | - Building ONOS |
| 100 | - Install ONOS package |
| 101 | - Build ONOS package |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 102 | - Kill ONOS process |
| 103 | - Uninstall ONOS cluster |
| 104 | - Verify ONOS start up |
| 105 | - Install ONOS cluster |
| 106 | - Connect to cli |
| 107 | """ |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 108 | main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster ) |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 109 | |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 110 | def CASE10( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 111 | """ |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 112 | Start Mininet |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 113 | """ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 114 | import json |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 115 | import time |
| 116 | try: |
| 117 | from tests.dependencies.topology import Topology |
| 118 | except ImportError: |
| 119 | main.log.error( "Topology not found exiting the test" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame^] | 120 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 121 | try: |
| 122 | main.topoRelated |
| 123 | except ( NameError, AttributeError ): |
| 124 | main.topoRelated = Topology() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 125 | |
| 126 | main.case( "Setup mininet and compare ONOS topology view to Mininet topology" ) |
| 127 | main.caseExplanation = "Start mininet with custom topology and compare topology " +\ |
| 128 | "elements between Mininet and ONOS" |
| 129 | |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 130 | main.step( "Setup Mininet Topology" ) |
| 131 | topology = main.Mininet1.home + '/custom/' + main.topology |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 132 | stepResult = main.Mininet1.startNet( topoFile=topology ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 133 | |
| 134 | utilities.assert_equals( expect=main.TRUE, |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 135 | actual=stepResult, |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 136 | onpass="Successfully loaded topology", |
| 137 | onfail="Failed to load topology" ) |
| 138 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 139 | main.step( "Assign switch to controller" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 140 | stepResult = main.Mininet1.assignSwController( "s1", main.Cluster.active( 0 ).ipAddress ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 141 | |
| 142 | utilities.assert_equals( expect=main.TRUE, |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 143 | actual=stepResult, |
| 144 | onpass="Successfully assigned switch to controller", |
| 145 | onfail="Failed to assign switch to controller" ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 146 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 147 | time.sleep( main.startMNSleep ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 148 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 149 | main.topoRelated.compareTopos( main.Mininet1 ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 150 | |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 151 | def CASE66( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 152 | """ |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 153 | Testing scapy |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 154 | """ |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 155 | main.case( "Testing scapy" ) |
| 156 | main.step( "Creating Host1 component" ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 157 | main.Scapy.createHostComponent( "h1" ) |
| 158 | main.Scapy.createHostComponent( "h2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 159 | hosts = [ main.h1, main.h2 ] |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 160 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 161 | host.startHostCli() |
| 162 | host.startScapy() |
| 163 | host.updateSelf() |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 164 | main.log.debug( host.name ) |
| 165 | main.log.debug( host.hostIp ) |
| 166 | main.log.debug( host.hostMac ) |
| 167 | |
| 168 | main.step( "Sending/Receiving Test packet - Filter doesn't match" ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 169 | main.log.info( "Starting Filter..." ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 170 | main.h2.startFilter() |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 171 | main.log.info( "Building Ether frame..." ) |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 172 | main.h1.buildEther( dst=main.h2.hostMac ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 173 | main.log.info( "Sending Packet..." ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 174 | main.h1.sendPacket() |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 175 | main.log.info( "Checking Filter..." ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 176 | finished = main.h2.checkFilter() |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 177 | main.log.debug( finished ) |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 178 | i = "" |
| 179 | if finished: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 180 | a = main.h2.readPackets() |
| 181 | for i in a.splitlines(): |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 182 | main.log.info( i ) |
| 183 | else: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 184 | kill = main.h2.killFilter() |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 185 | main.log.debug( kill ) |
| 186 | main.h2.handle.sendline( "" ) |
| 187 | main.h2.handle.expect( main.h2.scapyPrompt ) |
| 188 | main.log.debug( main.h2.handle.before ) |
| 189 | utilities.assert_equals( expect=True, |
| 190 | actual="dst=00:00:00:00:00:02 src=00:00:00:00:00:01" in i, |
| 191 | onpass="Pass", |
| 192 | onfail="Fail" ) |
| 193 | |
| 194 | main.step( "Sending/Receiving Test packet - Filter matches" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 195 | main.h2.startFilter() |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 196 | main.h1.buildEther( dst=main.h2.hostMac ) |
| 197 | main.h1.buildIP( dst=main.h2.hostIp ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 198 | main.h1.sendPacket() |
| 199 | finished = main.h2.checkFilter() |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 200 | i = "" |
| 201 | if finished: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 202 | a = main.h2.readPackets() |
| 203 | for i in a.splitlines(): |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 204 | main.log.info( i ) |
| 205 | else: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 206 | kill = main.h2.killFilter() |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 207 | main.log.debug( kill ) |
| 208 | main.h2.handle.sendline( "" ) |
| 209 | main.h2.handle.expect( main.h2.scapyPrompt ) |
| 210 | main.log.debug( main.h2.handle.before ) |
| 211 | utilities.assert_equals( expect=True, |
| 212 | actual="dst=00:00:00:00:00:02 src=00:00:00:00:00:01" in i, |
| 213 | onpass="Pass", |
| 214 | onfail="Fail" ) |
| 215 | |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 216 | main.step( "Clean up host components" ) |
| 217 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 218 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 219 | main.Mininet1.removeHostComponent( "h1" ) |
| 220 | main.Mininet1.removeHostComponent( "h2" ) |
Jon Hall | 892818c | 2015-10-20 17:58:34 -0700 | [diff] [blame] | 221 | |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 222 | def CASE1000( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 223 | """ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 224 | Add flows with MAC selectors and verify the flows |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 225 | """ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 226 | import json |
| 227 | import time |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 228 | ctrl = main.Cluster.active( 0 ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 229 | main.case( "Verify flow MAC selectors are correctly compiled" ) |
| 230 | main.caseExplanation = "Install two flows with only MAC selectors " +\ |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 231 | "specified, then verify flows are added in ONOS, finally " +\ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 232 | "send a packet that only specifies the MAC src and dst." |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 233 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 234 | main.step( "Add flows with MAC addresses as the only selectors" ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 235 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 236 | main.log.info( "Creating host components" ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 237 | main.Scapy.createHostComponent( "h1" ) |
| 238 | main.Scapy.createHostComponent( "h2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 239 | hosts = [ main.h1, main.h2 ] |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 240 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 241 | host.startHostCli() |
| 242 | host.startScapy() |
| 243 | host.updateSelf() |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 244 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 245 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 246 | # send output on port2 |
| 247 | # recieve input on port1 |
| 248 | egress = 2 |
| 249 | ingress = 1 |
| 250 | |
| 251 | # Add flows that sends packets from port1 to port2 with correct |
| 252 | # MAC src and dst addresses |
| 253 | main.log.info( "Adding flow with MAC selectors" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 254 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 255 | egressPort=egress, |
| 256 | ingressPort=ingress, |
| 257 | ethSrc=main.h1.hostMac, |
| 258 | ethDst=main.h2.hostMac, |
| 259 | debug=main.debug ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 260 | |
GlennRC | a539137 | 2015-10-14 17:28:15 -0700 | [diff] [blame] | 261 | utilities.assert_equals( expect=main.TRUE, |
| 262 | actual=stepResult, |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 263 | onpass="Successfully added flows", |
| 264 | onfail="Failed add flows" ) |
GlennRC | a539137 | 2015-10-14 17:28:15 -0700 | [diff] [blame] | 265 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 266 | # Giving ONOS time to add the flows |
| 267 | time.sleep( main.addFlowSleep ) |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 268 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 269 | main.checkingFlow.checkFlow() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 270 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 271 | main.step( "Send a packet to verify the flows are correct" ) |
| 272 | |
| 273 | # Specify the src and dst MAC addr |
| 274 | main.log.info( "Constructing packet" ) |
| 275 | main.h1.buildEther( src=main.h1.hostMac, dst=main.h2.hostMac ) |
| 276 | |
| 277 | # Filter for packets with the correct host name. Otherwise, |
| 278 | # the filter we catch any packet that is sent to host2 |
| 279 | # NOTE: I believe it doesn't matter which host name it is, |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 280 | # as long as the src and dst are both specified |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 281 | main.log.info( "Starting filter on host2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 282 | main.h2.startFilter( pktFilter="ether host %s" % main.h1.hostMac ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 283 | |
| 284 | main.log.info( "Sending packet to host2" ) |
| 285 | main.h1.sendPacket() |
| 286 | |
| 287 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 288 | stepResult = main.h2.checkFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 289 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 290 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 291 | else: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 292 | main.h2.killFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 293 | |
| 294 | main.log.info( "Clean up host components" ) |
| 295 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 296 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 297 | main.Mininet1.removeHostComponent( "h1" ) |
| 298 | main.Mininet1.removeHostComponent( "h2" ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 299 | |
| 300 | utilities.assert_equals( expect=main.TRUE, |
| 301 | actual=stepResult, |
| 302 | onpass="Successfully sent a packet", |
| 303 | onfail="Failed to send a packet" ) |
| 304 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 305 | def CASE1400( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 306 | """ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 307 | Add flows with IPv4 selectors and verify the flows |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 308 | """ |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 309 | import json |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 310 | import time |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 311 | ctrl = main.Cluster.active( 0 ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 312 | main.case( "Verify flow IP selectors are correctly compiled" ) |
| 313 | main.caseExplanation = "Install two flows with only IP selectors " +\ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 314 | "specified, then verify flows are added in ONOS, finally " +\ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 315 | "send a packet that only specifies the IP src and dst." |
| 316 | |
| 317 | main.step( "Add flows with IPv4 addresses as the only selectors" ) |
| 318 | |
| 319 | main.log.info( "Creating host components" ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 320 | main.Scapy.createHostComponent( "h1" ) |
| 321 | main.Scapy.createHostComponent( "h2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 322 | hosts = [ main.h1, main.h2 ] |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 323 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 324 | host.startHostCli() |
| 325 | host.startScapy() |
| 326 | host.updateSelf() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 327 | |
| 328 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 329 | # send output on port2 |
| 330 | # recieve input on port1 |
| 331 | egress = 2 |
| 332 | ingress = 1 |
| 333 | # IPv4 etherType = 0x800 |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 334 | ethType = main.params[ 'TEST' ][ 'ip4Type' ] |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 335 | |
| 336 | # Add flows that connects host1 to host2 |
| 337 | main.log.info( "Add flow with port ingress 1 to port egress 2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 338 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 339 | egressPort=egress, |
| 340 | ingressPort=ingress, |
| 341 | ethType=ethType, |
| 342 | ipSrc=( "IPV4_SRC", main.h1.hostIp + "/32" ), |
| 343 | ipDst=( "IPV4_DST", main.h2.hostIp + "/32" ), |
| 344 | debug=main.debug ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 345 | |
| 346 | utilities.assert_equals( expect=main.TRUE, |
| 347 | actual=stepResult, |
| 348 | onpass="Successfully added flows", |
| 349 | onfail="Failed add flows" ) |
| 350 | |
| 351 | # Giving ONOS time to add the flow |
| 352 | time.sleep( main.addFlowSleep ) |
| 353 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 354 | main.checkingFlow.checkFlow() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 355 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 356 | main.step( "Send a packet to verify the flow is correct" ) |
| 357 | |
| 358 | main.log.info( "Constructing packet" ) |
| 359 | # No need for the MAC src dst |
| 360 | main.h1.buildEther( dst=main.h2.hostMac ) |
| 361 | main.h1.buildIP( src=main.h1.hostIp, dst=main.h2.hostIp ) |
| 362 | |
| 363 | main.log.info( "Starting filter on host2" ) |
| 364 | # Defaults to ip |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 365 | main.h2.startFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 366 | |
| 367 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 368 | main.h1.sendPacket() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 369 | |
| 370 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 371 | stepResult = main.h2.checkFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 372 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 373 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
| 374 | else: |
| 375 | main.h2.killFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 376 | |
| 377 | main.log.info( "Clean up host components" ) |
| 378 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 379 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 380 | main.Mininet1.removeHostComponent( "h1" ) |
| 381 | main.Mininet1.removeHostComponent( "h2" ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 382 | |
| 383 | utilities.assert_equals( expect=main.TRUE, |
| 384 | actual=stepResult, |
| 385 | onpass="Successfully sent a packet", |
| 386 | onfail="Failed to send a packet" ) |
| 387 | |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 388 | def CASE1500( self, main ): |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 389 | """ |
| 390 | Add flow with IPv6 selector and verify the flow |
| 391 | """ |
| 392 | import json |
| 393 | import time |
| 394 | main.case( "Verify IPv6 selector is correctly compiled" ) |
| 395 | main.caseExplanation = "Install two flows with only IP selectors " + \ |
| 396 | "specified, then verify flows are added in ONOS, finally " + \ |
| 397 | "send a packet that only specifies the IP src and dst." |
| 398 | |
| 399 | main.step( "Add flows with IPv6 addresses as the only selectors" ) |
| 400 | |
| 401 | main.log.info( "Creating host components" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 402 | ctrl = main.Cluster.active( 0 ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 403 | main.Scapy.createHostComponent( "h5" ) |
| 404 | main.Scapy.createHostComponent( "h6" ) |
| 405 | hosts = [ main.h5, main.h6 ] |
| 406 | |
| 407 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 408 | host.startHostCli() |
| 409 | host.startScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 410 | host.updateSelf( IPv6=True ) |
| 411 | |
| 412 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 413 | # send output on port2 |
| 414 | # recieve input on port1 |
| 415 | egress = 6 |
| 416 | ingress = 5 |
| 417 | # IPv6 etherType = 0x86DD |
| 418 | ethType = main.params[ 'TEST' ][ 'ip6Type' ] |
| 419 | |
| 420 | # Add flows that connects host1 to host2 |
| 421 | main.log.info( "Add flow with port ingress 5 to port egress 6" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 422 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 423 | egressPort=egress, |
| 424 | ingressPort=ingress, |
| 425 | ethType=ethType, |
| 426 | ipSrc=( "IPV6_SRC", main.h5.hostIp + "/128" ), |
| 427 | ipDst=( "IPV6_DST", main.h6.hostIp + "/128" ), |
| 428 | debug=main.debug ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 429 | |
| 430 | utilities.assert_equals( expect=main.TRUE, |
| 431 | actual=stepResult, |
| 432 | onpass="Successfully added flows", |
| 433 | onfail="Failed add flows" ) |
| 434 | |
| 435 | # Giving ONOS time to add the flow |
| 436 | time.sleep( main.addFlowSleep ) |
| 437 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 438 | main.checkingFlow.checkFlow() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 439 | |
| 440 | main.step( "Send a packet to verify the flow is correct" ) |
| 441 | |
| 442 | main.log.info( "Constructing packet" ) |
| 443 | # No need for the MAC src dst |
| 444 | main.h5.buildEther( dst=main.h6.hostMac ) |
| 445 | main.h5.buildIPv6( src=main.h5.hostIp, dst=main.h6.hostIp ) |
| 446 | |
| 447 | main.log.info( "Starting filter on host6" ) |
| 448 | # Defaults to ip |
| 449 | main.h6.startFilter( pktFilter="ip6" ) |
| 450 | main.log.info( "Sending packet to host6" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 451 | main.h5.sendPacket() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 452 | |
| 453 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 454 | stepResult = main.h6.checkFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 455 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 456 | main.log.info( "Packet: %s" % main.h6.readPackets() ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 457 | else: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 458 | main.h6.killFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 459 | |
| 460 | main.log.info( "Clean up host components" ) |
| 461 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 462 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 463 | main.Mininet1.removeHostComponent( "h5" ) |
| 464 | main.Mininet1.removeHostComponent( "h6" ) |
| 465 | |
| 466 | utilities.assert_equals( expect=main.TRUE, |
| 467 | actual=stepResult, |
| 468 | onpass="Successfully sent a packet", |
| 469 | onfail="Failed to send a packet" ) |
| 470 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 471 | def CASE1100( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 472 | """ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 473 | Add flow with VLAN selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 474 | """ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 475 | import json |
| 476 | import time |
| 477 | |
| 478 | main.case( "Verify VLAN selector is correctly compiled" ) |
| 479 | main.caseExplanation = "Install one flow with only the VLAN selector " +\ |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 480 | "specified, then verify the flow is added in ONOS, and finally " +\ |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 481 | "broadcast a packet with the correct VLAN tag." |
| 482 | |
| 483 | # We do this here to utilize the hosts information |
| 484 | main.log.info( "Creating host components" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 485 | ctrl = main.Cluster.active( 0 ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 486 | main.Scapy.createHostComponent( "h3" ) |
| 487 | main.Scapy.createHostComponent( "h4" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 488 | hosts = [ main.h3, main.h4 ] |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 489 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 490 | host.startHostCli() |
| 491 | host.startScapy() |
| 492 | host.updateSelf() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 493 | |
| 494 | main.step( "Add a flow with the VLAN tag as the only selector" ) |
| 495 | |
| 496 | # Add flows that connects the two vlan hosts h3 and h4 |
| 497 | # Host 3 is on port 3 and host 4 is on port 4 |
| 498 | vlan = main.params[ 'TEST' ][ 'vlan' ] |
| 499 | egress = 4 |
| 500 | ingress = 3 |
| 501 | # VLAN ethType = 0x8100 |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 502 | ethType = main.params[ 'TEST' ][ 'vlanType' ] |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 503 | |
| 504 | # Add only one flow because we don't need a response |
| 505 | main.log.info( "Add flow with port ingress 1 to port egress 2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 506 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 507 | egressPort=egress, |
| 508 | ingressPort=ingress, |
| 509 | ethType=ethType, |
| 510 | vlan=vlan, |
| 511 | debug=main.debug ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 512 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 513 | utilities.assert_equals( expect=main.TRUE, |
| 514 | actual=stepResult, |
| 515 | onpass="Successfully added flow", |
| 516 | onfail="Failed add flows" ) |
| 517 | |
| 518 | # Giving ONOS time to add the flows |
| 519 | time.sleep( main.addFlowSleep ) |
| 520 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 521 | main.checkingFlow.checkFlow() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 522 | |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 523 | main.step( "Send a packet to verify the flow are correct" ) |
| 524 | |
| 525 | # The receiving interface |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 526 | recIface = "{}-eth0.{}".format( main.h4.name, vlan ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 527 | main.log.info( "Starting filter on host2" ) |
| 528 | # Filter is setup to catch any packet on the vlan interface with the correct vlan tag |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 529 | main.h4.startFilter( ifaceName=recIface, pktFilter="" ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 530 | |
| 531 | # Broadcast the packet on the vlan interface. We only care if the flow forwards |
| 532 | # the packet with the correct vlan tag, not if the mac addr is correct |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 533 | sendIface = "{}-eth0.{}".format( main.h3.name, vlan ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 534 | main.log.info( "Broadcasting the packet with a vlan tag" ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 535 | main.h3.sendPacket( iface=sendIface, |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 536 | packet="Ether()/Dot1Q(vlan={})".format( vlan ) ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 537 | |
| 538 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 539 | stepResult = main.h4.checkFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 540 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 541 | main.log.info( "Packet: %s" % main.h4.readPackets() ) |
| 542 | else: |
| 543 | main.h4.killFilter() |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 544 | |
| 545 | main.log.info( "Clean up host components" ) |
| 546 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 547 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 548 | main.Mininet1.removeHostComponent( "h3" ) |
| 549 | main.Mininet1.removeHostComponent( "h4" ) |
GlennRC | 073e8bc | 2015-10-27 17:11:28 -0700 | [diff] [blame] | 550 | |
| 551 | utilities.assert_equals( expect=main.TRUE, |
| 552 | actual=stepResult, |
| 553 | onpass="Successfully sent a packet", |
| 554 | onfail="Failed to send a packet" ) |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 555 | |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 556 | def CASE1300( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 557 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 558 | Add flows with MPLS selector and verify the flows |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 559 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 560 | import json |
| 561 | import time |
| 562 | |
| 563 | main.case( "Verify the MPLS selector is correctly compiled on the flow." ) |
| 564 | main.caseExplanation = "Install one flow with an MPLS selector, " +\ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 565 | "verify the flow is added in ONOS, and finally " +\ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 566 | "send a packet via scapy that has a MPLS label." |
| 567 | |
| 568 | main.step( "Add a flow with a MPLS selector" ) |
| 569 | |
| 570 | main.log.info( "Creating host components" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 571 | ctrl = main.Cluster.active( 0 ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 572 | main.Scapy.createHostComponent( "h1" ) |
| 573 | main.Scapy.createHostComponent( "h2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 574 | hosts = [ main.h1, main.h2 ] |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 575 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 576 | host.startHostCli() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 577 | host.startScapy( main.dependencyPath ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 578 | host.updateSelf() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 579 | |
| 580 | # ports |
| 581 | egress = 2 |
| 582 | ingress = 1 |
| 583 | # MPLS etherType |
| 584 | ethType = main.params[ 'TEST' ][ 'mplsType' ] |
| 585 | # MPLS label |
| 586 | mplsLabel = main.params[ 'TEST' ][ 'mpls' ] |
| 587 | |
| 588 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 589 | main.log.info( "Adding flow with MPLS selector" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 590 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 591 | egressPort=egress, |
| 592 | ingressPort=ingress, |
| 593 | ethType=ethType, |
| 594 | mpls=mplsLabel, |
| 595 | debug=main.debug ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 596 | |
| 597 | utilities.assert_equals( expect=main.TRUE, |
| 598 | actual=stepResult, |
| 599 | onpass="Successfully added flow", |
| 600 | onfail="Failed add flow" ) |
| 601 | |
| 602 | # Giving ONOS time to add the flow |
| 603 | time.sleep( main.addFlowSleep ) |
| 604 | |
| 605 | main.step( "Check flow is in the ADDED state" ) |
| 606 | |
| 607 | main.log.info( "Get the flows from ONOS" ) |
Jeremy | 8616099 | 2016-04-11 10:05:53 -0700 | [diff] [blame] | 608 | try: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 609 | flows = json.loads( ctrl.REST.flows() ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 610 | |
Jeremy | 8616099 | 2016-04-11 10:05:53 -0700 | [diff] [blame] | 611 | stepResult = main.TRUE |
| 612 | for f in flows: |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 613 | if "rest" in f.get( "appId" ): |
| 614 | if "ADDED" not in f.get( "state" ): |
Jeremy | 8616099 | 2016-04-11 10:05:53 -0700 | [diff] [blame] | 615 | stepResult = main.FALSE |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 616 | main.log.error( "Flow: %s in state: %s" % ( f.get( "id" ), f.get( "state" ) ) ) |
Jeremy | 8616099 | 2016-04-11 10:05:53 -0700 | [diff] [blame] | 617 | except TypeError: |
| 618 | main.log.error( "No Flows found by the REST API" ) |
| 619 | stepResult = main.FALSE |
| 620 | except ValueError: |
| 621 | main.log.error( "Problem getting Flows state from REST API. Exiting test" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame^] | 622 | main.cleanAndExit() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 623 | |
| 624 | utilities.assert_equals( expect=main.TRUE, |
| 625 | actual=stepResult, |
| 626 | onpass="All flows are in the ADDED state", |
| 627 | onfail="All flows are NOT in the ADDED state" ) |
| 628 | |
| 629 | main.step( "Check flows are in Mininet's flow table" ) |
| 630 | |
| 631 | # get the flow IDs that were added through rest |
| 632 | main.log.info( "Getting the flow IDs from ONOS" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 633 | flowIds = [ f.get( "id" ) for f in flows if "rest" in f.get( "appId" ) ] |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 634 | # convert the flowIDs to ints then hex and finally back to strings |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 635 | flowIds = [ str( hex( int( x ) ) ) for x in flowIds ] |
| 636 | main.log.info( "ONOS flow IDs: {}".format( flowIds ) ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 637 | |
| 638 | stepResult = main.Mininet1.checkFlowId( "s1", flowIds, debug=True ) |
| 639 | |
| 640 | utilities.assert_equals( expect=main.TRUE, |
| 641 | actual=stepResult, |
| 642 | onpass="All flows are in mininet", |
| 643 | onfail="All flows are NOT in mininet" ) |
| 644 | |
| 645 | main.step( "Send a packet to verify the flow is correct" ) |
| 646 | |
| 647 | main.log.info( "Starting filter on host2" ) |
| 648 | main.h2.startFilter( pktFilter="mpls" ) |
| 649 | |
| 650 | main.log.info( "Constructing packet" ) |
| 651 | main.log.info( "Sending packet to host2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 652 | main.h1.sendPacket( packet='Ether()/MPLS(label={})'.format( mplsLabel ) ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 653 | |
| 654 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 655 | stepResult = main.h2.checkFilter() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 656 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 657 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
| 658 | else: |
| 659 | main.h2.killFilter() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 660 | |
| 661 | main.log.info( "Clean up host components" ) |
| 662 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 663 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 664 | main.Mininet1.removeHostComponent( "h1" ) |
| 665 | main.Mininet1.removeHostComponent( "h2" ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 666 | |
| 667 | utilities.assert_equals( expect=main.TRUE, |
| 668 | actual=stepResult, |
| 669 | onpass="Successfully sent a packet", |
| 670 | onfail="Failed to send a packet" ) |
| 671 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 672 | def CASE1700( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 673 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 674 | Add flows with a TCP selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 675 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 676 | import json |
| 677 | import time |
| 678 | |
| 679 | main.case( "Verify the TCP selector is correctly compiled on the flow" ) |
| 680 | main.caseExplanation = "Install a flow with only the TCP selector " +\ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 681 | "specified, verify the flow is added in ONOS, and finally " +\ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 682 | "send a TCP packet to verify the TCP selector is compiled correctly." |
| 683 | |
| 684 | main.step( "Add a flow with a TCP selector" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 685 | ctrl = main.Cluster.active( 0 ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 686 | main.log.info( "Creating host components" ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 687 | main.Scapy.createHostComponent( "h1" ) |
| 688 | main.Scapy.createHostComponent( "h2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 689 | hosts = [ main.h1, main.h2 ] |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 690 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 691 | host.startHostCli() |
| 692 | host.startScapy() |
| 693 | host.updateSelf() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 694 | |
| 695 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 696 | egress = 2 |
| 697 | ingress = 1 |
| 698 | # IPv4 etherType |
| 699 | ethType = main.params[ 'TEST' ][ 'ip4Type' ] |
| 700 | # IP protocol |
| 701 | ipProto = main.params[ 'TEST' ][ 'tcpProto' ] |
| 702 | # TCP port destination |
| 703 | tcpDst = main.params[ 'TEST' ][ 'tcpDst' ] |
| 704 | |
| 705 | main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 706 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 707 | egressPort=egress, |
| 708 | ingressPort=ingress, |
| 709 | ethType=ethType, |
| 710 | ipProto=ipProto, |
| 711 | tcpDst=tcpDst, |
| 712 | debug=main.debug ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 713 | |
| 714 | utilities.assert_equals( expect=main.TRUE, |
| 715 | actual=stepResult, |
| 716 | onpass="Successfully added flows", |
| 717 | onfail="Failed add flows" ) |
| 718 | |
| 719 | # Giving ONOS time to add the flow |
| 720 | time.sleep( main.addFlowSleep ) |
| 721 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 722 | main.checkingFlow.checkFlow() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 723 | |
| 724 | main.step( "Send a packet to verify the flow is correct" ) |
| 725 | |
| 726 | main.log.info( "Constructing packet" ) |
| 727 | # No need for the MAC src dst |
| 728 | main.h1.buildEther( dst=main.h2.hostMac ) |
| 729 | main.h1.buildIP( dst=main.h2.hostIp ) |
| 730 | main.h1.buildTCP( dport=tcpDst ) |
| 731 | |
| 732 | main.log.info( "Starting filter on host2" ) |
| 733 | # Defaults to ip |
| 734 | main.h2.startFilter( pktFilter="tcp" ) |
| 735 | |
| 736 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 737 | main.h1.sendPacket() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 738 | |
| 739 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 740 | stepResult = main.h2.checkFilter() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 741 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 742 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
| 743 | else: |
| 744 | main.h2.killFilter() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 745 | |
| 746 | main.log.info( "Clean up host components" ) |
| 747 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 748 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 749 | main.Mininet1.removeHostComponent( "h1" ) |
| 750 | main.Mininet1.removeHostComponent( "h2" ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 751 | |
| 752 | utilities.assert_equals( expect=main.TRUE, |
| 753 | actual=stepResult, |
| 754 | onpass="Successfully sent a packet", |
| 755 | onfail="Failed to send a packet" ) |
| 756 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 757 | def CASE1600( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 758 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 759 | Add flows with a UDP selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 760 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 761 | import json |
| 762 | import time |
| 763 | |
| 764 | main.case( "Verify the UDP selector is correctly compiled on the flow" ) |
| 765 | main.caseExplanation = "Install a flow with only the UDP selector " +\ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 766 | "specified, verify the flow is added in ONOS, and finally " +\ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 767 | "send a UDP packet to verify the UDP selector is compiled correctly." |
| 768 | |
| 769 | main.step( "Add a flow with a UDP selector" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 770 | ctrl = main.Cluster.active( 0 ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 771 | main.log.info( "Creating host components" ) |
Jon Hall | a510a8a | 2016-05-04 15:09:28 -0700 | [diff] [blame] | 772 | main.Scapy.createHostComponent( "h1" ) |
| 773 | main.Scapy.createHostComponent( "h2" ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 774 | hosts = [ main.h1, main.h2 ] |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 775 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 776 | host.startHostCli() |
| 777 | host.startScapy() |
| 778 | host.updateSelf() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 779 | |
| 780 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 781 | egress = 2 |
| 782 | ingress = 1 |
| 783 | # IPv4 etherType |
| 784 | ethType = main.params[ 'TEST' ][ 'ip4Type' ] |
| 785 | # IP protocol |
| 786 | ipProto = main.params[ 'TEST' ][ 'udpProto' ] |
| 787 | # UDP port destination |
| 788 | udpDst = main.params[ 'TEST' ][ 'udpDst' ] |
| 789 | |
| 790 | main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 791 | stepResult =ctrl.REST.addFlow( deviceId=main.swDPID, |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 792 | egressPort=egress, |
| 793 | ingressPort=ingress, |
| 794 | ethType=ethType, |
| 795 | ipProto=ipProto, |
| 796 | udpDst=udpDst, |
| 797 | debug=main.debug ) |
| 798 | |
| 799 | utilities.assert_equals( expect=main.TRUE, |
| 800 | actual=stepResult, |
| 801 | onpass="Successfully added flows", |
| 802 | onfail="Failed add flows" ) |
| 803 | |
| 804 | # Giving ONOS time to add the flow |
| 805 | time.sleep( main.addFlowSleep ) |
| 806 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 807 | main.checkingFlow.checkFlow() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 808 | |
| 809 | main.step( "Send a packet to verify the flow is correct" ) |
| 810 | |
| 811 | main.log.info( "Constructing packet" ) |
| 812 | # No need for the MAC src dst |
| 813 | main.h1.buildEther( dst=main.h2.hostMac ) |
| 814 | main.h1.buildIP( dst=main.h2.hostIp ) |
| 815 | main.h1.buildUDP( dport=udpDst ) |
| 816 | |
| 817 | main.log.info( "Starting filter on host2" ) |
| 818 | # Defaults to ip |
| 819 | main.h2.startFilter( pktFilter="udp" ) |
| 820 | |
| 821 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 822 | main.h1.sendPacket() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 823 | |
| 824 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 825 | stepResult = main.h2.checkFilter() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 826 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 827 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
| 828 | else: |
| 829 | main.h2.killFilter() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 830 | |
| 831 | main.log.info( "Clean up host components" ) |
| 832 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 833 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 834 | main.Mininet1.removeHostComponent( "h1" ) |
| 835 | main.Mininet1.removeHostComponent( "h2" ) |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 836 | |
| 837 | utilities.assert_equals( expect=main.TRUE, |
| 838 | actual=stepResult, |
| 839 | onpass="Successfully sent a packet", |
| 840 | onfail="Failed to send a packet" ) |
| 841 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 842 | def CASE1900( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 843 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 844 | Add flows with a ICMPv4 selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 845 | """ |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 846 | import json |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 847 | import time |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 848 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 849 | main.case( "Verify the ICMPv4 selector is correctly compiled on the flow" ) |
| 850 | main.caseExplanation = "Install a flow with only the ICMPv4 selector " +\ |
| 851 | "specified, verify the flow is added in ONOS, and finally " +\ |
| 852 | "send a IMCPv4 packet to verify the ICMPv4 selector is compiled correctly." |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 853 | |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 854 | main.step( "Add a flow with a ICMPv4 selector" ) |
| 855 | |
| 856 | main.log.info( "Creating host components" ) |
| 857 | main.Scapy.createHostComponent( "h1" ) |
| 858 | main.Scapy.createHostComponent( "h2" ) |
| 859 | hosts = [ main.h1, main.h2 ] |
| 860 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 861 | host.startHostCli() |
| 862 | host.startScapy() |
| 863 | host.updateSelf() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 864 | |
| 865 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 866 | egress = 2 |
| 867 | ingress = 1 |
| 868 | # IPv4 etherType |
| 869 | ethType = main.params[ 'TEST' ][ 'ip4Type' ] |
| 870 | # IP protocol |
| 871 | ipProto = main.params[ 'TEST' ][ 'icmpProto' ] |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 872 | ctrl = main.Cluster.active( 0 ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 873 | main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 874 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 875 | egressPort=egress, |
| 876 | ingressPort=ingress, |
| 877 | ethType=ethType, |
| 878 | ipProto=ipProto, |
| 879 | debug=main.debug ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 880 | |
| 881 | utilities.assert_equals( expect=main.TRUE, |
| 882 | actual=stepResult, |
| 883 | onpass="Successfully added flows", |
| 884 | onfail="Failed add flows" ) |
| 885 | |
| 886 | # Giving ONOS time to add the flow |
| 887 | time.sleep( main.addFlowSleep ) |
| 888 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 889 | main.checkingFlow.checkFlow() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 890 | |
| 891 | main.step( "Send a packet to verify the flow is correct" ) |
| 892 | |
| 893 | main.log.info( "Constructing packet" ) |
| 894 | # No need for the MAC src dst |
| 895 | main.h1.buildEther( dst=main.h2.hostMac ) |
| 896 | main.h1.buildIP( dst=main.h2.hostIp ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 897 | main.h1.buildICMP() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 898 | |
| 899 | main.log.info( "Starting filter on host2" ) |
| 900 | # Defaults to ip |
| 901 | main.h2.startFilter( pktFilter="icmp" ) |
| 902 | |
| 903 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 904 | main.h1.sendPacket() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 905 | |
| 906 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 907 | stepResult = main.h2.checkFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 908 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 909 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
| 910 | else: |
| 911 | main.h2.killFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 912 | |
| 913 | main.log.info( "Clean up host components" ) |
| 914 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 915 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 916 | main.Mininet1.removeHostComponent( "h1" ) |
| 917 | main.Mininet1.removeHostComponent( "h2" ) |
| 918 | |
| 919 | utilities.assert_equals( expect=main.TRUE, |
| 920 | actual=stepResult, |
| 921 | onpass="Successfully sent a packet", |
| 922 | onfail="Failed to send a packet" ) |
| 923 | |
| 924 | def CASE2000( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 925 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 926 | Add flows with a ICMPv6 selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 927 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 928 | import json |
| 929 | import time |
| 930 | |
| 931 | main.case( "Verify the ICMPv6 selector is correctly compiled on the flow" ) |
| 932 | main.caseExplanation = "Install a flow with only the ICMPv6 selector " +\ |
| 933 | "specified, verify the flow is added in ONOS, and finally " +\ |
| 934 | "send a IMCPv6 packet to verify the ICMPv6 selector is compiled correctly." |
| 935 | |
| 936 | main.step( "Add a flow with a ICMPv6 selector" ) |
| 937 | |
| 938 | main.log.info( "Creating host components" ) |
| 939 | main.Scapy.createHostComponent( "h5" ) |
| 940 | main.Scapy.createHostComponent( "h6" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 941 | hosts = [ main.h5, main.h6 ] |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 942 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 943 | host.startHostCli() |
| 944 | host.startScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 945 | host.updateSelf( IPv6=True ) |
| 946 | |
| 947 | # Add a flow that connects host1 on port1 to host2 on port2 |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 948 | egress = 6 |
| 949 | ingress = 5 |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 950 | # IPv6 etherType |
| 951 | ethType = main.params[ 'TEST' ][ 'ip6Type' ] |
| 952 | # IP protocol |
| 953 | ipProto = main.params[ 'TEST' ][ 'icmp6Proto' ] |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 954 | ctrl = main.Cluster.active( 0 ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 955 | main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 956 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 957 | egressPort=egress, |
| 958 | ingressPort=ingress, |
| 959 | ethType=ethType, |
| 960 | ipProto=ipProto, |
| 961 | debug=main.debug ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 962 | |
| 963 | utilities.assert_equals( expect=main.TRUE, |
| 964 | actual=stepResult, |
| 965 | onpass="Successfully added flows", |
| 966 | onfail="Failed add flows" ) |
| 967 | |
| 968 | # Giving ONOS time to add the flow |
| 969 | time.sleep( main.addFlowSleep ) |
| 970 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 971 | main.checkingFlow.checkFlow() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 972 | |
| 973 | main.step( "Send a packet to verify the flow is correct" ) |
| 974 | |
| 975 | main.log.info( "Constructing packet" ) |
| 976 | # No need for the MAC src dst |
| 977 | main.h5.buildEther( dst=main.h6.hostMac ) |
| 978 | main.h5.buildIPv6( dst=main.h6.hostIp ) |
| 979 | main.h5.buildICMP( ipVersion=6 ) |
| 980 | |
| 981 | main.log.info( "Starting filter on host2" ) |
| 982 | # Defaults to ip |
| 983 | main.h6.startFilter( pktFilter="icmp6" ) |
| 984 | |
| 985 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 986 | main.h5.sendPacket() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 987 | |
| 988 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 989 | stepResult = main.h6.checkFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 990 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 991 | main.log.info( "Packet: %s" % main.h6.readPackets() ) |
| 992 | else: |
| 993 | main.h6.killFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 994 | |
| 995 | main.log.info( "Clean up host components" ) |
| 996 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 997 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 998 | main.Mininet1.removeHostComponent( "h5" ) |
| 999 | main.Mininet1.removeHostComponent( "h6" ) |
| 1000 | |
| 1001 | utilities.assert_equals( expect=main.TRUE, |
| 1002 | actual=stepResult, |
| 1003 | onpass="Successfully sent a packet", |
| 1004 | onfail="Failed to send a packet" ) |
| 1005 | |
| 1006 | def CASE3000( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1007 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1008 | Delete flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1009 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1010 | import json |
| 1011 | |
| 1012 | main.case( "Delete flows that were added through rest" ) |
| 1013 | main.step( "Deleting flows" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1014 | ctrl = main.Cluster.active( 0 ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1015 | main.log.info( "Getting flows" ) |
| 1016 | try: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1017 | flows = json.loads( ctrl.REST.flows() ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1018 | |
| 1019 | stepResult = main.TRUE |
| 1020 | for f in flows: |
| 1021 | if "rest" in f.get( "appId" ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1022 | if main.debug: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1023 | main.log.debug( "Flow to be deleted:\n{}".format( ctrl.REST.pprint( f ) ) ) |
| 1024 | stepResult = stepResult and ctrl.REST.removeFlow( f.get( "deviceId" ), f.get( "id" ) ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1025 | except TypeError: |
| 1026 | main.log.error( "No Flows found by the REST API" ) |
| 1027 | stepResult = main.FALSE |
| 1028 | except ValueError: |
| 1029 | main.log.error( "Problem getting Flows state from REST API. Exiting test" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame^] | 1030 | main.cleanAndExit() |
GlennRC | 956ea74 | 2015-11-05 16:14:15 -0800 | [diff] [blame] | 1031 | |
| 1032 | utilities.assert_equals( expect=main.TRUE, |
| 1033 | actual=stepResult, |
| 1034 | onpass="Successfully deleting flows", |
| 1035 | onfail="Failed to delete flows" ) |
| 1036 | |
| 1037 | time.sleep( main.delFlowSleep ) |
| 1038 | |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1039 | def CASE1200( self, main ): |
| 1040 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1041 | Add flows with a ARP selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1042 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1043 | import json |
| 1044 | import time |
| 1045 | |
| 1046 | main.case( "Verify flow IP selectors are correctly compiled" ) |
| 1047 | main.caseExplanation = "Install two flows with only IP selectors " + \ |
| 1048 | "specified, then verify flows are added in ONOS, finally " + \ |
| 1049 | "send a packet that only specifies the IP src and dst." |
| 1050 | |
| 1051 | main.step( "Add flows with ARP addresses as the only selectors" ) |
| 1052 | |
| 1053 | main.log.info( "Creating host components" ) |
| 1054 | main.Scapy.createHostComponent( "h1" ) |
| 1055 | main.Scapy.createHostComponent( "h2" ) |
| 1056 | hosts = [ main.h1, main.h2 ] |
| 1057 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1058 | host.startHostCli() |
| 1059 | host.startScapy() |
| 1060 | host.updateSelf() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1061 | ctrl = main.Cluster.active( 0 ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1062 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 1063 | # send output on port2 |
| 1064 | # recieve input on port1 |
| 1065 | egress = 2 |
| 1066 | ingress = 1 |
| 1067 | # ARP etherType = 0x0806 |
| 1068 | ethType = main.params[ 'TEST' ][ 'arpType' ] |
| 1069 | |
| 1070 | # Add flows that connects host1 to host2 |
| 1071 | main.log.info( "Add flow with port ingress 1 to port egress 2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1072 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 1073 | egressPort=egress, |
| 1074 | ingressPort=ingress, |
| 1075 | ethType=ethType, |
| 1076 | priority=40001, |
| 1077 | debug=main.debug ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1078 | |
| 1079 | utilities.assert_equals( expect=main.TRUE, |
| 1080 | actual=stepResult, |
| 1081 | onpass="Successfully added flows", |
| 1082 | onfail="Failed add flows" ) |
| 1083 | |
| 1084 | # Giving ONOS time to add the flow |
| 1085 | time.sleep( main.addFlowSleep ) |
| 1086 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 1087 | main.checkingFlow.checkFlow() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1088 | |
| 1089 | main.step( "Send a packet to verify the flow is correct" ) |
| 1090 | |
| 1091 | main.log.info( "Constructing packet" ) |
| 1092 | # No need for the MAC src dst |
| 1093 | main.h1.buildEther( src=main.h1.hostMac, dst=main.h2.hostMac ) |
| 1094 | main.h1.buildARP( pdst=main.h2.hostIp ) |
| 1095 | |
| 1096 | main.log.info( "Starting filter on host2" ) |
| 1097 | # Defaults to ip |
| 1098 | main.h2.startFilter( pktFilter="arp" ) |
| 1099 | |
| 1100 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1101 | main.h1.sendPacket() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1102 | |
| 1103 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1104 | stepResult = main.h2.checkFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1105 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1106 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1107 | else: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1108 | main.h2.killFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1109 | |
| 1110 | main.log.info( "Clean up host components" ) |
| 1111 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1112 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1113 | main.Mininet1.removeHostComponent( "h1" ) |
| 1114 | main.Mininet1.removeHostComponent( "h2" ) |
| 1115 | |
| 1116 | utilities.assert_equals( expect=main.TRUE, |
| 1117 | actual=stepResult, |
| 1118 | onpass="Successfully sent a packet", |
| 1119 | onfail="Failed to send a packet" ) |
| 1120 | |
| 1121 | def CASE1800( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1122 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1123 | Add flows with a SCTP selector and verify the flow |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1124 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1125 | import json |
| 1126 | import time |
| 1127 | |
| 1128 | main.case( "Verify the UDP selector is correctly compiled on the flow" ) |
| 1129 | main.caseExplanation = "Install a flow with only the UDP selector " + \ |
| 1130 | "specified, verify the flow is added in ONOS, and finally " + \ |
| 1131 | "send a UDP packet to verify the UDP selector is compiled correctly." |
| 1132 | |
| 1133 | main.step( "Add a flow with a SCTP selector" ) |
| 1134 | |
| 1135 | main.log.info( "Creating host components" ) |
| 1136 | main.Scapy.createHostComponent( "h1" ) |
| 1137 | main.Scapy.createHostComponent( "h2" ) |
| 1138 | hosts = [ main.h1, main.h2 ] |
| 1139 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1140 | host.startHostCli() |
| 1141 | host.startScapy() |
| 1142 | host.updateSelf() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1143 | |
| 1144 | # Add a flow that connects host1 on port1 to host2 on port2 |
| 1145 | egress = 2 |
| 1146 | ingress = 1 |
| 1147 | # IPv4 etherType |
| 1148 | ethType = main.params[ 'TEST' ][ 'ip4Type' ] |
| 1149 | # IP protocol |
| 1150 | ipProto = main.params[ 'TEST' ][ 'sctpProto' ] |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1151 | ctrl = main.Cluster.active( 0 ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1152 | main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1153 | stepResult = ctrl.REST.addFlow( deviceId=main.swDPID, |
| 1154 | egressPort=egress, |
| 1155 | ingressPort=ingress, |
| 1156 | ethType=ethType, |
| 1157 | ipProto=ipProto, |
| 1158 | debug=main.debug ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1159 | |
| 1160 | utilities.assert_equals( expect=main.TRUE, |
| 1161 | actual=stepResult, |
| 1162 | onpass="Successfully added flows", |
| 1163 | onfail="Failed add flows" ) |
| 1164 | |
| 1165 | # Giving ONOS time to add the flow |
| 1166 | time.sleep( main.addFlowSleep ) |
| 1167 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 1168 | main.checkingFlow.checkFlow() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1169 | |
| 1170 | main.step( "Send a packet to verify the flow is correct" ) |
| 1171 | |
| 1172 | main.log.info( "Constructing packet" ) |
| 1173 | # No need for the MAC src dst |
| 1174 | main.h1.buildEther( dst=main.h2.hostMac ) |
| 1175 | main.h1.buildIP( dst=main.h2.hostIp ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1176 | main.h1.buildSCTP() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1177 | |
| 1178 | main.log.info( "Starting filter on host2" ) |
| 1179 | # Defaults to ip |
| 1180 | main.h2.startFilter( pktFilter="sctp" ) |
| 1181 | |
| 1182 | main.log.info( "Sending packet to host2" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1183 | main.h1.sendPacket() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1184 | |
| 1185 | main.log.info( "Checking filter for our packet" ) |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1186 | stepResult = main.h2.checkFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1187 | if stepResult: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1188 | main.log.info( "Packet: %s" % main.h2.readPackets() ) |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1189 | else: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1190 | main.h2.killFilter() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1191 | |
| 1192 | main.log.info( "Clean up host components" ) |
| 1193 | for host in hosts: |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1194 | host.stopScapy() |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1195 | main.Mininet1.removeHostComponent( "h1" ) |
| 1196 | main.Mininet1.removeHostComponent( "h2" ) |
| 1197 | |
| 1198 | utilities.assert_equals( expect=main.TRUE, |
| 1199 | actual=stepResult, |
| 1200 | onpass="Successfully sent a packet", |
| 1201 | onfail="Failed to send a packet" ) |
| 1202 | |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 1203 | def CASE100( self, main ): |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1204 | """ |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 1205 | Report errors/warnings/exceptions |
Jon Hall | fc95107 | 2017-05-24 15:55:34 -0700 | [diff] [blame] | 1206 | """ |
alison | e14d7b0 | 2016-07-06 10:31:51 -0700 | [diff] [blame] | 1207 | main.log.info( "Error report: \n" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1208 | main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress, |
GlennRC | 5147a42 | 2015-10-06 17:26:17 -0700 | [diff] [blame] | 1209 | [ "INFO", |
| 1210 | "FOLLOWER", |
| 1211 | "WARN", |
| 1212 | "flow", |
| 1213 | "ERROR", |
| 1214 | "Except" ], |
GlennRC | 6844994 | 2015-10-16 16:03:12 -0700 | [diff] [blame] | 1215 | "s" ) |