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