summaryrefslogtreecommitdiffhomepage
path: root/tests/mininet/l2/vlan
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-06-30 14:23:03 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-06-30 14:23:03 +0900
commita991fed7e4faa485dc67daf50ba64fe01f83415d (patch)
treea600daa350a36c1fdc7776c111575bef56f78627 /tests/mininet/l2/vlan
parenta67ed2858417b9d795460f05126c01fb0cd344f9 (diff)
Revert "tests: Separate test files from Ryu module"
This reverts commit a67ed2858417b9d795460f05126c01fb0cd344f9. The commit breaks OpenStack neutron dynamic routing.
Diffstat (limited to 'tests/mininet/l2/vlan')
-rw-r--r--tests/mininet/l2/vlan/PopVLAN_vlan.mn6
-rw-r--r--tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn6
-rw-r--r--tests/mininet/l2/vlan/PushVLAN_icmp.mn6
-rw-r--r--tests/mininet/l2/vlan/test_vlan.py130
4 files changed, 0 insertions, 148 deletions
diff --git a/tests/mininet/l2/vlan/PopVLAN_vlan.mn b/tests/mininet/l2/vlan/PopVLAN_vlan.mn
deleted file mode 100644
index f1d1c6dd..00000000
--- a/tests/mininet/l2/vlan/PopVLAN_vlan.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-TEST_NAME=VLAN-PopVLAN
-DUMP_HOST=h2
-DUMP_IF=h2-eth0
-RYU_APP=test_vlan
-PCAP_MZ="-t tcp -Q 8 -P $TEST_NAME -c 3 -r"
-PCAP_FILTER="! vlan && ip.proto==TCP"
diff --git a/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn b/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn
deleted file mode 100644
index 90444a75..00000000
--- a/tests/mininet/l2/vlan/PopVLAN_vlanvlan.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-TEST_NAME=VLAN:VLAN-PopVLAN
-DUMP_HOST=h2
-DUMP_IF=h2-eth0
-RYU_APP=test_vlan
-PCAP_MZ="-t tcp -Q 100,99 -P $TEST_NAME -c 3 -r"
-PCAP_FILTER="vlan.id!=100 && vlan.id==99 && ip.proto==TCP"
diff --git a/tests/mininet/l2/vlan/PushVLAN_icmp.mn b/tests/mininet/l2/vlan/PushVLAN_icmp.mn
deleted file mode 100644
index 439ad233..00000000
--- a/tests/mininet/l2/vlan/PushVLAN_icmp.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-TEST_NAME=ICMP-PushVLAN
-DUMP_HOST=h2
-DUMP_IF=h2-eth0
-RYU_APP=test_vlan
-PCAP_MZ="-t icmp ping -P $TEST_NAME -c 3 -r -b 00:00:00:00:00:02"
-PCAP_FILTER="vlan && icmp.type==8"
diff --git a/tests/mininet/l2/vlan/test_vlan.py b/tests/mininet/l2/vlan/test_vlan.py
deleted file mode 100644
index 0b1be7fc..00000000
--- a/tests/mininet/l2/vlan/test_vlan.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import logging
-import struct
-
-from ryu.base import app_manager
-from ryu.controller import ofp_event
-from ryu.controller import dpset
-from ryu.controller.handler import MAIN_DISPATCHER
-from ryu.controller.handler import set_ev_cls
-from ryu.ofproto import ofproto_v1_2
-from ryu.ofproto import ether
-from ryu.ofproto import inet
-from ryu.lib.mac import haddr_to_str
-
-
-LOG = logging.getLogger(__name__)
-
-
-class RunTestMininet(app_manager.RyuApp):
-
- _CONTEXTS = {'dpset': dpset.DPSet}
- OFP_VERSIONS = [ofproto_v1_2.OFP_VERSION]
-
- def __init__(self, *args, **kwargs):
- super(RunTestMininet, self).__init__(*args, **kwargs)
-
- def _add_flow(self, dp, match, actions):
- inst = [dp.ofproto_parser.OFPInstructionActions(
- dp.ofproto.OFPIT_APPLY_ACTIONS, actions)]
-
- mod = dp.ofproto_parser.OFPFlowMod(
- dp, cookie=0, cookie_mask=0, table_id=0,
- command=dp.ofproto.OFPFC_ADD, idle_timeout=0, hard_timeout=0,
- priority=0xff, buffer_id=0xffffffff,
- out_port=dp.ofproto.OFPP_ANY, out_group=dp.ofproto.OFPG_ANY,
- flags=0, match=match, instructions=inst)
-
- dp.send_msg(mod)
-
- def _define_flow(self, dp):
- in_port = 1
- out_port = 2
-
- eth_IP = ether.ETH_TYPE_IP
- eth_VLAN = ether.ETH_TYPE_8021Q
- ip_ICMP = inet.IPPROTO_ICMP
-
- # VLAN(8) -> PopVLAN
- LOG.debug("--- add_flow VLAN(8) to PopVLAN")
- m_vid = 8
- match = dp.ofproto_parser.OFPMatch()
- match.set_in_port(in_port)
- match.set_dl_type(eth_IP)
- match.set_vlan_vid(m_vid)
- actions = [dp.ofproto_parser.OFPActionPopVlan(),
- dp.ofproto_parser.OFPActionOutput(out_port, 0)]
- self._add_flow(dp, match, actions)
-
- # ICMP -> PushVLAN(9)
- LOG.debug("--- add_flow ICMP to PushVLAN(9)")
- s_vid = 9
- match = dp.ofproto_parser.OFPMatch()
- match.set_in_port(in_port)
- match.set_dl_type(eth_IP)
- match.set_ip_proto(ip_ICMP)
- f = dp.ofproto_parser.OFPMatchField.make(
- dp.ofproto.OXM_OF_VLAN_VID, s_vid)
- actions = [dp.ofproto_parser.OFPActionPushVlan(eth_VLAN),
- dp.ofproto_parser.OFPActionSetField(f),
- dp.ofproto_parser.OFPActionOutput(out_port, 0)]
- self._add_flow(dp, match, actions)
-
- # VLAN(10) -> PushVLAN(20)
- # LOG.debug("--- add_flow VLAN(10) to PushVLAN(100)")
- # SKIP: ovs not supported
- m_vid = 10
- s_vid = 20
- match = dp.ofproto_parser.OFPMatch()
- match.set_in_port(in_port)
- match.set_dl_type(eth_IP)
- match.set_vlan_vid(m_vid)
- f = dp.ofproto_parser.OFPMatchField.make(
- dp.ofproto.OXM_OF_VLAN_VID, s_vid)
- actions = [dp.ofproto_parser.OFPActionPushVlan(eth_VLAN),
- dp.ofproto_parser.OFPActionSetField(f),
- dp.ofproto_parser.OFPActionOutput(out_port, 0)]
- # self._add_flow(dp, match, actions)
-
- # VLAN(100):VLAN -> PopVLAN
- LOG.debug("--- add_flow VLAN(100):VLAN to PopVLAN")
- m_vid = 100
- match = dp.ofproto_parser.OFPMatch()
- match.set_in_port(in_port)
- match.set_dl_type(eth_VLAN)
- match.set_vlan_vid(m_vid)
- actions = [dp.ofproto_parser.OFPActionPopVlan(),
- dp.ofproto_parser.OFPActionOutput(out_port, 0)]
- self._add_flow(dp, match, actions)
-
- @set_ev_cls(dpset.EventDP, dpset.DPSET_EV_DISPATCHER)
- def handler_datapath(self, ev):
- if ev.enter:
- self._define_flow(ev.dp)
-
- @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
- def packet_in_handler(self, ev):
- msg = ev.msg
- dst, src, eth_type = struct.unpack_from('!6s6sH', buffer(msg.data), 0)
- in_port = msg.match.fields[0].value
-
- LOG.info("----------------------------------------")
- LOG.info("* PacketIn")
- LOG.info("in_port=%d, eth_type: %s", in_port, hex(eth_type))
- LOG.info("packet reason=%d buffer_id=%d", msg.reason, msg.buffer_id)
- LOG.info("packet in datapath_id=%s src=%s dst=%s",
- msg.datapath.id, haddr_to_str(src), haddr_to_str(dst))