Matteo Scandolo | a229eca | 2017-08-08 13:05:28 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Rich Lane | 1568b65 | 2013-01-04 16:53:13 -0800 | [diff] [blame] | 17 | """ |
| 18 | These tests require a switch that drops packet-ins. |
| 19 | """ |
| 20 | |
| 21 | import logging |
| 22 | |
| 23 | from oftest import config |
| 24 | import oftest.controller as controller |
Rich Lane | d7b0ffa | 2013-03-08 15:53:42 -0800 | [diff] [blame] | 25 | import ofp |
Rich Lane | 1568b65 | 2013-01-04 16:53:13 -0800 | [diff] [blame] | 26 | import oftest.dataplane as dataplane |
Rich Lane | 1568b65 | 2013-01-04 16:53:13 -0800 | [diff] [blame] | 27 | import oftest.base_tests as base_tests |
| 28 | |
| 29 | from oftest.testutils import * |
| 30 | |
| 31 | @nonstandard |
| 32 | class PacketInDefaultDrop(base_tests.SimpleDataPlane): |
| 33 | """ |
| 34 | Verify that packet-ins are not received. |
| 35 | """ |
| 36 | |
| 37 | def runTest(self): |
| 38 | delete_all_flows(self.controller) |
| 39 | do_barrier(self.controller) |
| 40 | |
| 41 | for of_port in config["port_map"].keys(): |
Rich Lane | 4c504f3 | 2013-06-07 17:24:14 -0700 | [diff] [blame] | 42 | pkt = str(simple_tcp_packet()) |
| 43 | self.dataplane.send(of_port, pkt) |
| 44 | verify_no_packet_in(self, pkt, of_port) |