diff options
author | Matej Klotton <mklotton@cisco.com> | 2016-07-22 09:34:25 +0200 |
---|---|---|
committer | Matej Klotton <mklotton@cisco.com> | 2016-07-22 13:32:53 +0200 |
commit | 70cbaaee0e6210682ce6d278ea645b8bea153b67 (patch) | |
tree | 9d82a1df0276cfb854d9fc8d5d1888b360fe9234 /tests/func | |
parent | 7c3e0cc41f55327d6eeb04fe757c6e80064ab28a (diff) |
CSIT-220: Rename directories in tests directory
- Move performance directory one level up and rename it to “perf”
- Rename “suites” directory to “func”
- Create __init__.py in “perf” directory
- Rename fds_related_tests to fds
Change-Id: I59f06afe1c5b95dd8a48417b8fbfd1fca8797097
Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'tests/func')
44 files changed, 9395 insertions, 0 deletions
diff --git a/tests/func/__init__.robot b/tests/func/__init__.robot new file mode 100644 index 0000000000..2016146e3b --- /dev/null +++ b/tests/func/__init__.robot @@ -0,0 +1,20 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/interfaces.robot +| Library | resources.libraries.python.SetupFramework +| Suite Setup | Run Keywords | Setup Framework | ${nodes} +| ... | AND | Setup All DUTs | ${nodes} +| ... | AND | Update All Interface Data On All Nodes | ${nodes} diff --git a/tests/func/bridge_domain/bridge_domain_untagged.robot b/tests/func/bridge_domain/bridge_domain_untagged.robot new file mode 100644 index 0000000000..1876d901bb --- /dev/null +++ b/tests/func/bridge_domain/bridge_domain_untagged.robot @@ -0,0 +1,369 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/qemu.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *L2 bridge-domain test cases* +| ... +| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links +| ... | between nodes; TG-DUT1-DUT2-TG 3-node circular topology with +| ... | single links between nodes; TG=DUT1=DUT2=TG 3-node circular +| ... | topology with double parallel links and TG=DUT=VM 3-node topology +| ... | with VM and double parallel links. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of +| ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply +| ... | to all links. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | bridge-domain (L2BD) switching combined with static MACs; MAC +| ... | learning enabled and Split Horizon Groups (SHG) depending on +| ... | test case. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets +| ... | are sent in both directions by TG on links to DUT1 and DUT2; on +| ... | receive TG verifies packets for correctness and their IPv4 (IPv6) +| ... | src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 +| ${shg1}= | 3 +| ${shg2}= | 4 +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +*** Test Cases *** +| TC01: DUT reports active interfaces +| | [Documentation] +| | ... | [Top] TG=DUT1; TG-DUT1-DUT2-TG. [Enc] None. [Cfg] Discovered \ +| | ... | active interfaces. [Ver] Report active interfaces on DUT. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | 3_NODE_SINGLE_LINK_TOPO +| | VPP reports interfaces on | ${nodes['DUT1']} + +| TC02: DUT with L2BD (MAC learning) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG=DUT1. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ +| | ... | two i/fs into L2BD with MAC learning. [Ver] Make TG verify +| | ... | ICMPv4 Echo Req pkts are switched thru DUT1 in both directions +| | ... | and are correct on receive. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When Bridge domain on DUT node is created | ${dut_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id1} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} + +| TC03: DUT1 and DUT2 with L2BD (MAC learning) switch between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 and DUT2 \ +| | ... | configure two i/fs into L2BD with MAC learning. [Ver] Make TG +| | ... | verify ICMPv4 Echo Req pkts are switched thru DUT1 and DUT2 in +| | ... | both directions and are correct on receive. [Ref] +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${bd_id2} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} + +| TC04: DUT1 and DUT2 with L2BD (static MACs) switch between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 and \ +| | ... | DUT2 configure two i/fs into L2BD with static MACs. [Ver] Make +| | ... | TG verify ICMPv4 Echo Req pkts are switched thru DUT1 and DUT2 +| | ... | in both directions and are correct on receive. [Ref] +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | ... | learn=${FALSE} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut1} +| | ... | ${dut1_node} +| | ... | ${dut1_to_tg} +| | ... | ${bd_id1} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut2} +| | ... | ${dut1_node} +| | ... | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | ... | learn=${FALSE} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${bd_id2} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut1} +| | ... | ${dut2_node} +| | ... | ${dut2_to_dut1} +| | ... | ${bd_id2} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut2} +| | ... | ${dut2_node} +| | ... | ${dut2_to_tg} +| | ... | ${bd_id2} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} + +| TC05: DUT1 and DUT2 with L2BD (MAC learn) and SHG switch between four TG links +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 and \ +| | ... | DUT2 configure four i/fs into L2BD with MAC learning and the +| | ... | same SHG on i/fs towards TG. [Ver] Make TG verify ICMPv4 Echo +| | ... | Req pkts are switched thru DUT1 and DUT2 in both directions and +| | ... | are correct on receive; verify no pkts are switched thru SHG +| | ... | isolated interfaces. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']} +| | ... | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} +| | And Interfaces in 3-node BD-SHG testing are up +| | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1} +| | ... | ${bd_id2} | ${shg2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2} +| | ... | ${bd_id2} | ${shg2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${bd_id2} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if2} +| | And Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMPv4 bidirectionally +| | | ... | ${tg_node} | ${tg_to_dut1_if1} +| | | ... | ${tg_to_dut1_if2} +| | And Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMPv4 bidirectionally +| | | ... | ${tg_node} | ${tg_to_dut2_if1} +| | | ... | ${tg_to_dut2_if2} + +| TC06: DUT with two L2BDs (MAC learn) switches ICMPv4 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local +| | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} +| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| | ... | AND | Show vpp trace dump on all DUTs +| | ... | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node} + +| TC07: DUT with two L2BDs (MAC learn) switches ICMPv6 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with MAC learning, each with vhost-user i/f to local +| | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} +| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| | ... | AND | Show vpp trace dump on all DUTs +| | ... | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node} + +| TC08: DUT with two L2BDs (static MACs) switches ICMPv4 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with static MACs, each with vhost-user i/f to local VM +| | ... | and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1} +| | ... | learn=${FALSE} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${vhost_if1} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2} +| | ... | learn=${FALSE} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${vhost_if2} +| | ... | ${bd_id2} +| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} +| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| | ... | AND | Show vpp trace dump on all DUTs +| | ... | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node} + +| TC09: DUT with two L2BDs (static MACs) switches ICMPv6 between TG and VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \ +| | ... | two L2BDs with static MACs, each with vhost-user i/f to local VM +| | ... | and i/f to TG; configure VM to loop pkts back betwen its two +| | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are +| | ... | switched thru DUT1 and VM in both directions and are correct on +| | ... | receive. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1} +| | ... | learn=${FALSE} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1} +| | ... | ${bd_id1} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${vhost_if1} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2} +| | ... | learn=${FALSE} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2} +| | ... | ${bd_id2} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if2} +| | ... | ${dut_node} +| | ... | ${dut_to_tg_if2} +| | ... | ${bd_id2} +| | And Destination port is added to L2FIB on DUT node | ${tg_node} +| | ... | ${tg_to_dut_if1} +| | ... | ${dut_node} +| | ... | ${vhost_if2} +| | ... | ${bd_id2} +| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} +| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| | ... | AND | Show vpp trace dump on all DUTs +| | ... | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node} diff --git a/tests/func/cop/cop_whitelist_blacklist.robot b/tests/func/cop/cop_whitelist_blacklist.robot new file mode 100644 index 0000000000..c84387d349 --- /dev/null +++ b/tests/func/cop/cop_whitelist_blacklist.robot @@ -0,0 +1,128 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.Cop +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/traffic.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Variables | resources/libraries/python/IPv4NodeAddress.py | ${nodes} +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *COP Security IPv4 Blacklist and Whitelist Tests* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 on all links. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv4 routing and +| ... | static routes. COP security white-lists are applied on DUT1 ingress +| ... | interface from TG. DUT2 is configured with L2XC. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in +| ... | one direction by TG on link to DUT1; on receive TG verifies packets for +| ... | correctness and drops as applicable. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${tg_node}= | ${nodes['TG']} +| ${dut1_node}= | ${nodes['DUT1']} +| ${dut2_node}= | ${nodes['DUT2']} + +| ${dut1_if1_ip}= | 192.168.1.1 +| ${dut1_if2_ip}= | 192.168.2.1 +| ${dut1_if1_ip_GW}= | 192.168.1.2 +| ${dut1_if2_ip_GW}= | 192.168.2.2 + +| ${test_dst_ip}= | 32.0.0.1 +| ${test_src_ip}= | 16.0.0.1 + +| ${cop_dut_ip}= | 16.0.0.0 + +| ${ip_prefix}= | 24 +| ${nodes_ipv4_addresses}= | ${nodes_ipv4_addr} + +| ${fib_table_number}= | 1 + +*** Test Cases *** +| TC01: DUT permits IPv4 pkts with COP whitelist set with IPv4 src-addr +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 \ +| | ... | configure interface IPv4 addresses and routes in the main +| | ... | routing domain, add COP whitelist on interface to TG with IPv4 +| | ... | src-addr matching packets generated by TG; on DUT2 configure L2 +| | ... | xconnect. [Ver] Make TG send ICMPv4 Echo Req on its interface to +| | ... | DUT1; verify received ICMPv4 Echo Req pkts are correct. [Ref] +| | Given Path for 3-node testing is set +| | ... | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip} | ${ip_prefix} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip_GW} | ${tg_to_dut1_mac} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip_GW} | ${tg_to_dut2_mac} +| | And Vpp Route Add | ${dut1_node} +| | ... | ${test_dst_ip} | ${ip_prefix} | ${dut1_if2_ip_GW} | ${dut1_to_dut2} +| | And Add fib table | ${dut1_node} +| | ... | ${cop_dut_ip} | ${ip_prefix} | ${fib_table_number} | local +| | When COP Add whitelist Entry +| | ... | ${dut1_node} | ${dut1_to_tg} | ip4 | ${fib_table_number} +| | And COP interface enable or disable | ${dut1_node} | ${dut1_to_tg} | enable +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac} +| | ... | ${tg_to_dut2_mac} + +| TC02: DUT drops IPv4 pkts with COP blacklist set with IPv4 src-addr +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 \ +| | ... | configure interface IPv4 addresses and routes in the main +| | ... | routing domain, add COP blacklist on interface to TG with IPv4 +| | ... | src-addr matching packets generated by TG; on DUT2 configure L2 +| | ... | xconnect. [Ver] Make TG send ICMPv4 Echo Req on its interface to +| | ... | DUT1; verify no ICMPv4 Echo Req pkts are received. [Ref] +| | Given Path for 3-node testing is set +| | ... | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip} | ${ip_prefix} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip_GW} | ${tg_to_dut1_mac} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip_GW} | ${tg_to_dut2_mac} +| | And Vpp Route Add | ${dut1_node} +| | ... | ${test_dst_ip} | ${ip_prefix} | ${dut1_if2_ip_GW} | ${dut1_to_dut2} +| | And Add fib table | ${dut1_node} +| | ... | ${cop_dut_ip} | ${ip_prefix} | ${fib_table_number} | drop +| | When COP Add whitelist Entry +| | ... | ${dut1_node} | ${dut1_to_tg} | ip4 | ${fib_table_number} +| | And COP interface enable or disable | ${dut1_node} | ${dut1_to_tg} | enable +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac} +| | ... | ${tg_to_dut2_mac} diff --git a/tests/func/cop/cop_whitelist_blacklist_IPv6.robot b/tests/func/cop/cop_whitelist_blacklist_IPv6.robot new file mode 100644 index 0000000000..3fb9428680 --- /dev/null +++ b/tests/func/cop/cop_whitelist_blacklist_IPv6.robot @@ -0,0 +1,142 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.Cop +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/traffic.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Variables | resources/libraries/python/IPv6NodesAddr.py | ${nodes} +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *COP Security IPv6 Blacklist and Whitelist Tests* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv6-ICMPv6 on all links. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv6 routing and +| ... | static routes. COP security white-lists are applied on DUT1 ingress +| ... | interface from TG. DUT2 is configured with L2XC. +| ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent in +| ... | one direction by TG on link to DUT1; on receive TG verifies packets for +| ... | correctness and drops as applicable. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${tg_node}= | ${nodes['TG']} +| ${dut1_node}= | ${nodes['DUT1']} +| ${dut2_node}= | ${nodes['DUT2']} + +| ${dut1_if1_ip}= | 3ffe:62::1 +| ${dut1_if2_ip}= | 3ffe:63::1 +| ${dut1_if1_ip_GW}= | 3ffe:62::2 +| ${dut1_if2_ip_GW}= | 3ffe:63::2 + +| ${dut2_if1_ip}= | 3ffe:72::1 +| ${dut2_if2_ip}= | 3ffe:73::1 + +| ${test_dst_ip}= | 3ffe:64::1 +| ${test_src_ip}= | 3ffe:61::1 + +| ${cop_dut_ip}= | 3ffe:61:: + +| ${ip_prefix}= | 64 + +| ${nodes_ipv6_addresses}= | ${nodes_ipv6_addr} + +| ${fib_table_number}= | 1 + +*** Test Cases *** +| TC01: DUT permits IPv6 pkts with COP whitelist set with IPv6 src-addr +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 \ +| | ... | configure interface IPv6 addresses and routes in the main +| | ... | routing domain, add COP whitelist on interface to TG with IPv6 +| | ... | src-addr matching packets generated by TG; on DUT2 configure L2 +| | ... | xconnect. [Ver] Make TG send ICMPv6 Echo Req on its interface to +| | ... | DUT1; verify received ICMPv6 Echo Req pkts are correct. [Ref] +| | Given Path for 3-node testing is set +| | ... | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip} | ${ip_prefix} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip} | ${ip_prefix} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if1_ip} | ${ip_prefix} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_if2_ip} | ${ip_prefix} +| | And Add IP Neighbor +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip_GW} | ${tg_to_dut1_mac} +| | And Add IP Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip_GW} | ${tg_to_dut2_mac} +| | And Vpp Route Add | ${dut1_node} +| | ... | ${test_dst_ip} | ${ip_prefix} | ${dut1_if2_ip_GW} | ${dut1_to_dut2} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | And Add fib table | ${dut1_node} | ${cop_dut_ip} | ${ip_prefix} | +| | ... | ${fib_table_number} | local +| | When COP Add whitelist Entry | ${dut1_node} | ${dut1_to_tg} | ip6 | +| | ... | ${fib_table_number} +| | And COP interface enable or disable | ${dut1_node} | ${dut1_to_tg} | enable +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac} +| | ... | ${tg_to_dut2_mac} + +| TC02: DUT drops IPv6 pkts with COP blacklist set with IPv6 src-addr +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 \ +| | ... | configure interface IPv6 addresses and routes in the main +| | ... | routing domain, add COP blacklist on interface to TG with IPv6 +| | ... | src-addr matching packets generated by TG; on DUT2 configure L2 +| | ... | xconnect. [Ver] Make TG send ICMPv6 Echo Req on its interface to +| | ... | DUT1; verify no ICMPv6 Echo Req pkts are received. [Ref] +| | Given Path for 3-node testing is set +| | ... | ${tg_node} | ${dut1_node} | ${dut2_node} | ${tg_node} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip} | ${ip_prefix} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip} | ${ip_prefix} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if1_ip} | ${ip_prefix} +| | And VPP Set IF IPv6 Addr +| | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_if2_ip} | ${ip_prefix} +| | And Add IP Neighbor +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_if1_ip_GW} | ${tg_to_dut1_mac} +| | And Add IP Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if2_ip_GW} | ${tg_to_dut2_mac} +| | And Vpp Route Add | ${dut1_node} +| | ... | ${test_dst_ip} | ${ip_prefix} | ${dut1_if2_ip_GW} | ${dut1_to_dut2} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | And Add fib table | ${dut1_node} +| | ... | ${cop_dut_ip} | ${ip_prefix} | ${fib_table_number} | drop +| | When COP Add whitelist Entry +| | ... | ${dut1_node} | ${dut1_to_tg} | ip6 | ${fib_table_number} +| | And COP interface enable or disable | ${dut1_node} | ${dut1_to_tg} | enable +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac} +| | ... | ${tg_to_dut2_mac} diff --git a/tests/func/dhcp/dhcp_client.robot b/tests/func/dhcp/dhcp_client.robot new file mode 100644 index 0000000000..eb34544d0b --- /dev/null +++ b/tests/func/dhcp/dhcp_client.robot @@ -0,0 +1,118 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/dhcp_client.robot +| Resource | resources/libraries/robot/ipv4.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *DHCP Client related test cases* + +*** Variables *** +| ${client_hostname}= | dhcp-client +| ${client_ip}= | 192.168.23.10 +| ${client_mask}= | 255.255.255.0 +| ${server_ip}= | 192.168.23.1 +| ${own_xid}= | 11112222 +| ${lease_time}= | ${15} + +*** Test Cases *** +| VPP sends a DHCP DISCOVER +| | [Documentation] | Configure DHCP client on interface to TG without hostname +| | ... | and check if DHCP DISCOVER message contains all required +| | ... | fields with expected values. +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1} +| | Then Check DHCP DISCOVER header | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} + +| VPP sends a DHCP DISCOVER with hostname +| | [Documentation] | Configure DHCP client on interface to TG with hostname +| | ... | and check if DHCP DISCOVER message contains all required +| | ... | fields with expected values. +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${client_hostname} +| | Then Check DHCP DISCOVER header | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${client_hostname} + +| VPP sends DHCP REQUEST after OFFER +| | [Documentation] | Configure DHCP client on interface to TG and check if +| | ... | DHCP REQUEST message contains all required fields. +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local +| | ... | ${FALSE} | ${NONE} +| | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1} +| | Then Check DHCP REQUEST after OFFER | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if1_mac} | ${server_ip} +| | ... | ${dut_to_tg_if1_mac} | ${client_ip} | ${client_mask} + +| VPP doesn't send DHCP REQUEST after OFFER with wrong XID +| | [ Tags ] | EXPECTED_FAILING +| | [Documentation] | Configure DHCP client on interface to TG. If server sends +| | ... | DHCP OFFER with different XID as in DHCP DISCOVER, +| | ... | DHCP REQUEST message shouldn't be sent. +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local +| | ... | ${FALSE} | ${NONE} +| | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1} +| | Then Run Keyword And Expect Error | DHCP REQUEST Rx timeout +| | ... | Check DHCP REQUEST after OFFER | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if1_mac} | ${server_ip} +| | ... | ${dut_to_tg_if1_mac} | ${client_ip} | ${client_mask} +| | ... | offer_xid=${own_xid} + +| VPP honors DHCPv4 lease time +| | [Documentation] | Send IP configuration to the VPP client via DHCP. Address +| | ... | is checked with ICMP echo request and there should be no +| | ... | reply for echo request when lease has expired. +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local +| | ... | ${FALSE} | ${NONE} +| | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1} +| | And Send IP configuration to client via DHCP +| | ... | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if1_mac} | ${server_ip} +| | ... | ${client_ip} | ${client_mask} +| | ... | ${lease_time} +| | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if1} | ${server_ip} +| | ... | ${tg_to_dut_if1_mac} +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} | ${client_ip} +| | ... | ${server_ip} +| | And Sleep | ${lease_time} +| | And Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Node replies to ICMP echo request | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} +| | ... | ${client_ip} | ${server_ip} diff --git a/tests/func/fds/provider_network.robot b/tests/func/fds/provider_network.robot new file mode 100644 index 0000000000..bda5525885 --- /dev/null +++ b/tests/func/fds/provider_network.robot @@ -0,0 +1,339 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/double_qemu_setup.robot +| Resource | resources/libraries/robot/qemu.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV | SKIP_PATCH +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| ... | AND | Qemu Teardown | ${dut1_node} | ${qemu_node1} +| ... | qemu_node1 +| ... | AND | Qemu Teardown | ${dut2_node} | ${qemu_node2} +| ... | qemu_node2 +| Documentation | *Provider network FDS related.* +| ... +| ... | Test suite uses 3-node topology TG - DUT1 - DUT2 - TG +| ... | with one link between nodes. Test packets are sent in both directions +| ... | between namespaces in DUT1 and DUT2 with both positive and negative +| ... | scenarios tested. + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 +| ${shg1}= | 3 +| ${shg2}= | 4 +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 +| ${sock3}= | /tmp/sock3 +| ${sock4}= | /tmp/sock4 + +| ${bid_b}= | 23 +| ${bid_r}= | 24 + +| ${vlan_red}= | 50 +| ${vlan_blue}= | 60 + +| ${dut1_if_ip}= | 16.0.0.1 +| ${dut2_if_ip}= | 16.0.0.2 + +| ${dut1_blue1}= | 16.0.10.1 +| ${dut1_blue2}= | 16.0.10.2 +| ${dut1_red1}= | 16.0.10.3 +| ${dut1_red2}= | 16.0.10.4 + +| ${dut2_blue1}= | 16.0.20.1 +| ${dut2_blue2}= | 16.0.20.2 +| ${dut2_red1}= | 16.0.20.3 +| ${dut2_red2}= | 16.0.20.4 + +| ${namespace1}= | nmspace1 +| ${namespace2}= | nmspace2 +| ${namespace3}= | nmspace3 +| ${namespace4}= | nmspace4 + +| ${prefix_length}= | 16 + +*** Test Cases *** +| Provider network test cases with provider physical networks (VLAN) +| | [Documentation] | Ping among all ports inside the same network should pass. +| | ... | a) test l2 connectivity inside every network +| | ... | b) test l2 connectivity between networks +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 3-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} +| | ... | ${prefix_length} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} +| | ... | ${prefix_length} +| | And Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up +| | And Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up +| | ${vhost_if1_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock1} +| | ${vhost_if2_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock2} +| | ${vhost_if3_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock3} +| | ${vhost_if4_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock4} +| | ${dut1_vhosts}= | And Create List | ${vhost_if1_DUT1} | ${vhost_if2_DUT1} +| | ... | ${vhost_if3_DUT1} | ${vhost_if4_DUT1} +| | ${vhost_if1_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock1} +| | ${vhost_if2_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock2} +| | ${vhost_if3_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock3} +| | ${vhost_if4_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock4} +| | ${dut2_vhosts}= | And Create List | ${vhost_if1_DUT2} | ${vhost_if2_DUT2} +| | ... | ${vhost_if3_DUT2} | ${vhost_if4_DUT2} +| | When Setup QEMU Vhost and Run | ${dut1_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut1_blue1} +| | ... | ${dut1_blue2} +| | ... | ${dut1_red1} +| | ... | ${dut1_red2} +| | ... | ${prefix_length} +| | ... | qemu_node1 +| | ... | 04 +| | And Setup QEMU Vhost and Run | ${dut2_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut2_blue1} +| | ... | ${dut2_blue2} +| | ... | ${dut2_red1} +| | ... | ${dut2_red2} +| | ... | ${prefix_length} +| | ... | qemu_node2 +| | ... | 06 +| | And Setup VLAN and BD on Dut | ${dut1_node} | ${dut1_to_dut2} +| | ... | @{dut1_vhosts} +| | And Setup VLAN and BD on Dut | ${dut2_node} | ${dut2_to_dut1} +| | ... | @{dut2_vhosts} +| | Then Positive Scenario Ping From DUT1 - Intra network +| | And Positive Scenario Ping From DUT1 - Inter network +| | And Positive Scenario Ping From DUT2 - Intra network +| | And Positive Scenario Ping From DUT2 - Inter network +| | And Negative Scenario Ping From DUT1 - Intra network +| | And Negative Scenario Ping From DUT1 - Inter network +| | And Negative Scenario Ping From DUT2 - Intra network +| | And Negative Scenario Ping From DUT2 - Inter network + +*** Keywords *** +| Setup VLAN and BD on Dut +| | [Documentation] | Setup VLAN and bridge domain on specific DUT and +| | ... | subsequently interconnect them properly. Also set VLAN tag +| | ... | rewrite on vhosts. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to setup VLAN and BD. Type: dict +| | ... | - interface - Interface where to create VLAN sub-interface. +| | ... | Type: string +| | ... | - vhosts - List containing vhost interfaces. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Setup VLAN and BD on Dut \| ${dut_node} \| GigabitEthernet0/6/0 \ +| | ... | \| @{vhosts} \| +| | ... +| | [Arguments] | ${dut_node} | ${interface} | @{vhosts} +| | Bridge domain on DUT node is created | ${dut_node} | ${bid_b} | learn=${TRUE} +| | Bridge domain on DUT node is created | ${dut_node} | ${bid_r} | learn=${TRUE} +| | ${interface_name}= | Get interface name | ${dut_node} | ${interface} +| | ${vlan1_name} | ${vlan1_index}= | Create Vlan Subinterface +| | ... | ${dut_node} | ${interface_name} | ${vlan_blue} +| | ${vlan2_name} | ${vlan2_index}= | Create Vlan Subinterface +| | ... | ${dut_node} | ${interface_name} | ${vlan_red} +| | L2 Tag Rewrite | ${dut_node} | @{vhosts}[0] | push-1 | ${vlan_blue} +| | L2 Tag Rewrite | ${dut_node} | @{vhosts}[1] | push-1 | ${vlan_blue} +| | L2 Tag Rewrite | ${dut_node} | @{vhosts}[2] | push-1 | ${vlan_red} +| | L2 Tag Rewrite | ${dut_node} | @{vhosts}[3] | push-1 | ${vlan_red} +| | Interface is added to bridge domain | ${dut_node} +| | ... | ${vlan1_index} | ${bid_b} | 0 +| | Interface is added to bridge domain | ${dut_node} +| | ... | @{vhosts}[0] | ${bid_b} | 0 +| | Interface is added to bridge domain | ${dut_node} +| | ... | @{vhosts}[1] | ${bid_b} | 0 +| | Interface is added to bridge domain | ${dut_node} +| | ... | ${vlan2_index} | ${bid_r} | 0 +| | Interface is added to bridge domain | ${dut_node} +| | ... | @{vhosts}[2] | ${bid_r} | 0 +| | Interface is added to bridge domain | ${dut_node} +| | ... | @{vhosts}[3] | ${bid_r} | 0 + +| Positive Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4} + +| Positive Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4} + +| Negative Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace4} + + +| Negative Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace4} + + +| Negative Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace4} diff --git a/tests/func/fds/tenant_network.robot b/tests/func/fds/tenant_network.robot new file mode 100644 index 0000000000..e57b374583 --- /dev/null +++ b/tests/func/fds/tenant_network.robot @@ -0,0 +1,335 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/double_qemu_setup.robot +| Resource | resources/libraries/robot/qemu.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV | SKIP_PATCH +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| ... | AND | Qemu Teardown | ${dut1_node} | ${qemu_node1} +| ... | qemu_node1 +| ... | AND | Qemu Teardown | ${dut2_node} | ${qemu_node2} +| ... | qemu_node2 +| Documentation | *Tenant network FDS related.* +| ... +| ... | Test suite uses 3-node topology TG - DUT1 - DUT2 - TG +| ... | with one link between nodes. Test packets are sent in both directions +| ... | between namespaces in DUT1 and DUT2 with both positive and negative +| ... | scenarios tested. + +*** Variables *** +| ${bd_id1}= | 1 +| ${bd_id2}= | 2 +| ${shg1}= | 3 +| ${shg2}= | 4 +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 +| ${sock3}= | /tmp/sock3 +| ${sock4}= | /tmp/sock4 + +| ${vni_blue}= | 23 +| ${vni_red}= | 24 + +| ${bid_b}= | 23 +| ${bid_r}= | 24 + +| ${dut1_if_ip}= | 16.0.0.1 +| ${dut2_if_ip}= | 16.0.0.2 + +| ${dut1_blue1}= | 16.0.10.1 +| ${dut1_blue2}= | 16.0.10.2 +| ${dut1_red1}= | 16.0.10.3 +| ${dut1_red2}= | 16.0.10.4 + +| ${dut2_blue1}= | 16.0.20.1 +| ${dut2_blue2}= | 16.0.20.2 +| ${dut2_red1}= | 16.0.20.3 +| ${dut2_red2}= | 16.0.20.4 + +| ${namespace1}= | nmspace1 +| ${namespace2}= | nmspace2 +| ${namespace3}= | nmspace3 +| ${namespace4}= | nmspace4 + +| ${prefix_length}= | 16 + +*** Test Cases *** +| L2 test cases with tenant networks (VXLAN) +| | [Documentation] | Ping among all ports inside the same network should pass. +| | ... | a) test l2 connectivity inside every network +| | ... | b) test l2 connectivity between networks +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} | ${prefix_length} +| | And Set Interface Address +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} | ${prefix_length} +| | And Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up +| | And Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up +| | ${vhost_if1_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock1} +| | ${vhost_if2_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock2} +| | ${vhost_if3_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock3} +| | ${vhost_if4_DUT1}= | And Vpp Create Vhost User Interface +| | ... | ${dut1_node} | ${sock4} +| | ${dut1_vhosts}= | And Create List | ${vhost_if1_DUT1} | ${vhost_if2_DUT1} +| | ... | ${vhost_if3_DUT1} | ${vhost_if4_DUT1} +| | ${vhost_if1_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock1} +| | ${vhost_if2_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock2} +| | ${vhost_if3_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock3} +| | ${vhost_if4_DUT2}= | And Vpp Create Vhost User Interface +| | ... | ${dut2_node} | ${sock4} +| | ${dut2_vhosts}= | And Create List | ${vhost_if1_DUT2} | ${vhost_if2_DUT2} +| | ... | ${vhost_if3_DUT2} | ${vhost_if4_DUT2} +| | When Setup QEMU Vhost and Run | ${dut1_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut1_blue1} +| | ... | ${dut1_blue2} +| | ... | ${dut1_red1} +| | ... | ${dut1_red2} +| | ... | ${prefix_length} +| | ... | qemu_node1 +| | ... | 04 +| | And Setup QEMU Vhost and Run | ${dut2_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | ... | ${sock3} +| | ... | ${sock4} +| | ... | ${dut2_blue1} +| | ... | ${dut2_blue2} +| | ... | ${dut2_red1} +| | ... | ${dut2_red2} +| | ... | ${prefix_length} +| | ... | qemu_node2 +| | ... | 06 +| | And Setup VXLAN and BD on Dut | ${dut1_node} | ${dut1_if_ip} | ${dut2_if_ip} +| | ... | @{dut1_vhosts} +| | And Setup VXLAN and BD on Dut | ${dut2_node} | ${dut2_if_ip} | ${dut1_if_ip} +| | ... | @{dut2_vhosts} +| | Then Positive Scenario Ping From DUT1 - Intra network +| | And Positive Scenario Ping From DUT1 - Inter network +| | And Positive Scenario Ping From DUT2 - Intra network +| | And Positive Scenario Ping From DUT2 - Inter network +| | And Negative Scenario Ping From DUT1 - Intra network +| | And Negative Scenario Ping From DUT1 - Inter network +| | And Negative Scenario Ping From DUT2 - Intra network +| | And Negative Scenario Ping From DUT2 - Inter network + +*** Keywords *** +| Setup VXLAN and BD on Dut +| | [Documentation] | Setup VXLAN and bridge domain on specific DUT and +| | ... | subsequently interconnect them properly. +| | ... +| | ... | *Arguments:* +| | ... | - dut_node - Node where to setup vxlan and BD. Type: dict +| | ... | - src_ip - Source IP for VXLAN. Type: string +| | ... | - dst_ip - Destination IP for vxlan. Type: string +| | ... | - vhosts - List containing vhost interfaces. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Setup VXLAN and BD on Dut \| ${dut_node} \| 16.0.0.1 \| 16.0.0.1 \ +| | ... | \| @{vhosts} \| +| | ... +| | [Arguments] | ${dut_node} | ${src_ip} | ${dst_ip} | @{vhosts} +| | Bridge domain on DUT node is created +| | ... | ${dut_node} | ${bid_b} | learn=${TRUE} +| | Bridge domain on DUT node is created +| | ... | ${dut_node} | ${bid_r} | learn=${TRUE} +| | ${vxlan1_if}= | Create VXLAN interface | ${dut_node} | ${vni_blue} +| | | ... | ${src_ip} | ${dst_ip} +| | ${vxlan2_if}= | Create VXLAN interface | ${dut_node} | ${vni_red} +| | | ... | ${src_ip} | ${dst_ip} +| | Interface is added to bridge domain +| | ... | ${dut_node} | ${vxlan1_if} | ${bid_b} | 0 +| | Interface is added to bridge domain +| | ... | ${dut_node} | @{vhosts}[0] | ${bid_b} | 0 +| | Interface is added to bridge domain +| | ... | ${dut_node} | @{vhosts}[1] | ${bid_b} | 0 +| | Interface is added to bridge domain +| | ... | ${dut_node} | ${vxlan2_if} | ${bid_r} | 0 +| | Interface is added to bridge domain +| | ... | ${dut_node} | @{vhosts}[2] | ${bid_r} | 0 +| | Interface is added to bridge domain +| | ... | ${dut_node} | @{vhosts}[3] | ${bid_r} | 0 + +| Positive Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4} + +| Positive Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4} + +| Positive Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test connectivity. +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4} +| | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4} + +| Negative Scenario Ping From DUT1 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} +| | ... | ${namespace4} + + +| Negative Scenario Ping From DUT1 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} +| | ... | ${namespace4} + +| Negative Scenario Ping From DUT2 - Intra network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} +| | ... | ${namespace4} + + +| Negative Scenario Ping From DUT2 - Inter network +| | [Documentation] | Send ping packets from specified namespaces to other in +| | ... | order to test unreachability of namespaces. +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace1} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} +| | ... | ${namespace2} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace3} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} +| | ... | ${namespace4} +| | Run keyword and expect error | Ping Not Successful +| | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} +| | ... | ${namespace4} diff --git a/tests/func/gre/gre_encapsulation.robot b/tests/func/gre/gre_encapsulation.robot new file mode 100644 index 0000000000..17b3fffff2 --- /dev/null +++ b/tests/func/gre/gre_encapsulation.robot @@ -0,0 +1,150 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/gre.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.IPUtil +| Library | resources.libraries.python.Trace +| Force Tags | VM_ENV | HW_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *GREoIPv4 test cases* +| ... +| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links +| ... | between nodes; TG-DUT1-DUT2-TG 3-node circular topology with single +| ... | links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-GRE-IPv4-ICMPv4 on DUT1-DUT2, +| ... | Eth-IPv4-ICMPv4 on TG-DUTn for routing over GRE tunnel; Eth-IPv4-ICMPv4 +| ... | on TG_if1-DUT, Eth-IPv4-GRE-IPv4-ICMPv4 on TG_if2_DUT for GREoIPv4 +| ... | encapsulation and decapsulation verification. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4 routing +| ... | and static routes. GREoIPv4 tunnel is configured between DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets are +| ... | sent in both directions by TG on links to DUT1 and DUT2; GREoIPv4 +| ... | encapsulation and decapsulation are verified separately by TG; on +| ... | receive TG verifies packets for correctness and their IPv4 (IPv6) +| ... | src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC2784. + +*** Variables *** +| ${net1_address}= | 192.168.0.0 +| ${net1_host_address}= | 192.168.0.100 +| ${net1_gw_address}= | 192.168.0.1 +| ${net2_address}= | 192.168.2.0 +| ${net2_host_address}= | 192.168.2.100 +| ${net2_gw_address}= | 192.168.2.1 +| ${dut1_ip_address}= | 192.168.1.1 +| ${dut2_ip_address}= | 192.168.1.2 +| ${dut1_gre_ip}= | 172.16.0.1 +| ${dut2_gre_ip}= | 172.16.0.2 +| ${prefix}= | 24 + +*** Test Cases *** +| TC01: DUT1 and DUT2 route over GREoIPv4 tunnel between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-GRE-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure GREoIPv4 tunnel with IPv4 routes towards each other. +| | ... | [Ver] Make TG send ICMPv4 Echo Req between its interfaces across +| | ... | both DUTs and GRE tunnel between them; verify IPv4 headers on +| | ... | received packets are correct. [Ref] RFC2784. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_ip_address} | ${prefix} +| | ... | ${dut1_node} | ${dut1_to_tg} | ${net1_gw_address} | ${prefix} +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_ip_address} | ${prefix} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${net2_gw_address} | ${prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_ip_address} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_ip_address} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${net2_host_address} +| | ... | ${tg_to_dut2_mac} +| | ${dut1_gre_interface} | ${dut1_gre_index}= +| | | ... | When GRE tunnel interface is created and up +| | | | ... | ${dut1_node} | ${dut1_ip_address} | ${dut2_ip_address} +| | ${dut2_gre_interface} | ${dut2_gre_index}= +| | | ... | And GRE tunnel interface is created and up +| | | | ... | ${dut2_node} | ${dut2_ip_address} | ${dut1_ip_address} +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_gre_index} | ${dut1_gre_ip} | ${prefix} +| | ... | ${dut2_node} | ${dut2_gre_index} | ${dut2_gre_ip} | ${prefix} +| | And Vpp Route Add | ${dut1_node} | ${net2_address} | ${prefix} +| | ... | ${dut2_gre_ip} | ${dut1_gre_index} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${net1_host_address} | ${net2_host_address} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} + +| TC02: DUT encapsulates IPv4 into GREoIPv4 tunnel - GRE header verification +| | [Documentation] +| | ... | [Top] TG=DUT1. [Enc] Eth-IPv4-ICMPv4 on TG_if1-DUT, \ +| | ... | Eth-IPv4-GRE-IPv4-ICMPv4 on TG_if2_DUT. [Cfg] On DUT1 configure +| | ... | GREoIPv4 tunnel with IPv4 route towards TG. [Ver] Make TG send +| | ... | non-encapsulated ICMPv4 Echo Req to DUT; verify TG received +| | ... | GREoIPv4 encapsulated packet is correct. [Ref] RFC2784. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut1_ip_address} | ${prefix} +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_gw_address} | ${prefix} +| | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if2} | ${dut2_ip_address} +| | ... | ${tg_to_dut_if2_mac} +| | ${dut1_gre_interface} | ${dut1_gre_index}= +| | | ... | When GRE tunnel interface is created and up +| | | | ... | ${dut_node} | ${dut1_ip_address} | ${dut2_ip_address} +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut1_gre_index} | ${dut1_gre_ip} | ${prefix} +| | And Vpp Route Add | ${dut_node} | ${net2_address} | ${prefix} +| | ... | ${dut2_gre_ip} | ${dut1_gre_index} +| | Then Send ICMPv4 and check received GRE header +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2_mac} +| | ... | ${net1_host_address} | ${net2_host_address} +| | ... | ${dut1_ip_address} | ${dut2_ip_address} + +| TC03: DUT decapsulates IPv4 from GREoIPv4 tunnel - IPv4 header verification +| | [Documentation] +| | ... | [Top] TG=DUT1. [Enc] Eth-IPv4-ICMPv4 on TG_if1-DUT, \ +| | ... | Eth-IPv4-GRE-IPv4-ICMPv4 on TG_if2_DUT. [Cfg] On DUT1 configure +| | ... | GREoIPv4 tunnel towards TG. [Ver] Make TG send ICMPv4 Echo Req +| | ... | encapsulated into GREoIPv4 towards VPP; verify TG received IPv4 +| | ... | de-encapsulated packet is correct. [Ref] RFC2784. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut1_ip_address} | ${prefix} +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_gw_address} | ${prefix} +| | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if1} | ${net1_host_address} +| | ... | ${tg_to_dut_if1_mac} +| | ${dut1_gre_interface} | ${dut1_gre_index}= +| | | ... | When GRE tunnel interface is created and up +| | | | ... | ${dut_node} | ${dut1_ip_address} | ${dut2_ip_address} +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut1_gre_index} | ${dut1_gre_ip} | ${prefix} +| | Then Send GRE and check received ICMPv4 header +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} +| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1_mac} +| | ... | ${net2_host_address} | ${net1_host_address} +| | ... | ${dut2_ip_address} | ${dut1_ip_address} diff --git a/tests/func/honeycomb/010_interface_management.robot b/tests/func/honeycomb/010_interface_management.robot new file mode 100644 index 0000000000..e9798167c7 --- /dev/null +++ b/tests/func/honeycomb/010_interface_management.robot @@ -0,0 +1,116 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +# Interface to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} +# Configuration which will be set and verified during tests. +| ${ipv4_address}= | 192.168.0.2 +| ${ipv4_address2}= | 192.168.0.3 +| ${ipv4_mask}= | 255.255.255.0 +| ${ipv4_prefix}= | ${24} +| @{ipv4_neighbor}= | 192.168.0.4 | 08:00:27:c0:5d:37 +| &{ipv4_settings}= | enabled=${True} | forwarding=${True} | mtu=${9000} +| @{ipv6_address}= | 10::10 | ${64} +| @{ipv6_neighbor}= | 10::11 | 08:00:27:c0:5d:37 +| &{ipv6_settings}= | enabled=${True} | forwarding=${True} | mtu=${9000} +| ... | dup-addr-detect-transmits=${5} +| &{ethernet}= | mtu=${9000} +| &{routing}= | vrf-id=${27} +| &{vxlan_settings}= | src=10.0.1.20 | dst=10.0.3.20 | vni=${1000} +| ... | encap-vrf-id=${1000} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Force Tags | honeycomb_sanity +| Documentation | *Honeycomb interface management test suite.* +| ... +| ... | Test suite uses the first interface of the first DUT node. + +*** Test Cases *** +| Honeycomb configures and reads interface state +| | [Documentation] | Check if Honeycomb API can modify the admin state of\ +| | ... | VPP interfaces. +| | Given Interface state is | ${node} | ${interface} | down +| | When Honeycomb sets interface state | ${node} | ${interface} | up +| | Then Interface state from Honeycomb should be +| | ... | ${node} | ${interface} | up +| | And Interface state from VAT should be | ${node} | ${interface} | up +| | When Honeycomb sets interface state | ${node} | ${interface} | down +| | Then Interface state from Honeycomb should be +| | ... | ${node} | ${interface} | down +| | And Interface state from VAT should be | ${node} | ${interface} | down + +| Honeycomb modifies interface configuration - ipv4 (netmask) +| | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4\ +| | ... | with address and netmask provided. +| | When Honeycomb sets interface ipv4 address | ${node} | ${interface} +| | ... | ${ipv4_address} | ${ipv4_mask} | ${ipv4_settings} +| | And Honeycomb adds interface ipv4 neighbor +| | ... | ${node} | ${interface} | @{ipv4_neighbor} +| | Then IPv4 config from Honeycomb should be +| | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix} +| | ... | @{ipv4_neighbor} | ${ipv4_settings} +| | And IPv4 config from VAT should be +| | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix} + +| Honeycomb removes ipv4 address from interface +| | [Documentation] | Check if Honeycomb API can remove configured ipv4\ +| | ... | addresses from interface. +| | Given IPv4 config from Honeycomb should be +| | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix} +| | ... | @{ipv4_neighbor} | ${ipv4_settings} +| | And IPv4 config from VAT should be +| | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix} +| | When Honeycomb removes interface ipv4 addresses | ${node} | ${interface} +| | Then IPv4 address from Honeycomb should be empty | ${node} |${interface} +| | And ipv4 address from VAT should be empty | ${node} | ${interface} + +| Honeycomb modifies interface configuration - ipv4 (prefix) +| | [Documentation] | Check if Honeycomb API can configure interfaces for ipv4\ +| | ... | with address and prefix provided. +| | [Teardown] | Honeycomb removes interface ipv4 addresses | ${node} +| | ... | ${interface} +| | When Honeycomb sets interface ipv4 address with prefix +| | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix} +| | ... | ${ipv4_settings} +| | And Honeycomb adds interface ipv4 neighbor +| | ... | ${node} | ${interface} | @{ipv4_neighbor} +| | Then IPv4 config from Honeycomb should be +| | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix} +| | ... | @{ipv4_neighbor} +| | ... | ${ipv4_settings} +| | And IPv4 config from VAT should be +| | ... | ${node} | ${interface} | ${ipv4_address2} | ${ipv4_prefix} + +| Honeycomb modifies interface configuration - ipv6 +| | [Documentation] | Check if Honeycomb API can configure interfaces for ipv6. +| | When Honeycomb sets interface ipv6 configuration +| | ... | ${node} | ${interface} | @{ipv6_address} | @{ipv6_neighbor} +| | ... | ${ipv6_settings} +| | Then IPv6 config from Honeycomb should be +| | ... | ${node} | ${interface} | @{ipv6_address} | @{ipv6_neighbor} +| | ... | ${ipv6_settings} +| | And IPv6 config from VAT should be +| | ... | ${node} | ${interface} | @{ipv6_address} + +| Honeycomb modifies interface configuration - ethernet,routing +| | [Documentation] | Check if Honeycomb API can configure interface ethernet\ +| | ... | and routing settings. +| | When Honeycomb sets interface ethernet and routing configuration +| | ... | ${node} | ${interface} | ${ethernet} | ${routing} +| | Then Interface ethernet and routing configuration from Honeycomb should be +| | ... | ${node} | ${interface} | ${ethernet} | ${routing} +| | And Interface ethernet and routing configuration from VAT should be +| | ... | ${node} | ${interface} | ${ethernet['mtu']} | ${routing['vrf-id']} diff --git a/tests/func/honeycomb/020_bridge_domain.robot b/tests/func/honeycomb/020_bridge_domain.robot new file mode 100644 index 0000000000..0bd4463ea0 --- /dev/null +++ b/tests/func/honeycomb/020_bridge_domain.robot @@ -0,0 +1,105 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +# Interfaces to run tests on. +| @{interfaces}= | ${node['interfaces']['port1']['name']} +| ... | ${node['interfaces']['port3']['name']} +# Configuration which will be set and verified during tests. +| ${bd1_name}= | bd-01 +| ${bd2_name}= | bd-02 +| &{bd_settings}= | flood=${True} | forward=${True} | learn=${True} +| ... | unknown-unicast-flood=${True} | arp-termination=${True} +| &{if_settings}= | split_horizon_group=${1} | bvi=${False} +| &{if_settings2}= | split_horizon_group=${2} | bvi=${True} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Resource | resources/libraries/robot/honeycomb/bridge_domain.robot +| Suite Teardown | Honeycomb removes all bridge domains | ${node} +| Force Tags | honeycomb_sanity +| Documentation | *Honeycomb bridge domain management test suite.* +| ... +| ... | Test suite uses the first two interfaces on the first DUT node. + +*** Test Cases *** +| Honeycomb sets up l2 bridge domain +| | [Documentation] | Check if Honeycomb can create bridge domains on VPP node. +| | When Honeycomb creates first l2 bridge domain +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | Then Bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | And Bridge domain configuration from VAT should be +| | ... | ${node} | ${0} | ${bd_settings} + +| Honeycomb manages multiple bridge domains on node +| | [Documentation] | Check if Honeycomb can manage multiple bridge domains on\ +| | ... | a single node. +| | Given Bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | When Honeycomb creates l2 bridge domain +| | ... | ${node} | ${bd2_name} | ${bd_settings} +| | Then Bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | And Bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd2_name} | ${bd_settings} +| | And Bridge domain configuration from VAT should be +| | ... | ${node} | ${0} | ${bd_settings} +| | And Bridge domain configuration from VAT should be +| | ... | ${node} | ${1} | ${bd_settings} + +| Honeycomb removes bridge domains +| | [Documentation] | Check if Honeycomb can remove bridge domains from a VPP\ +| | ... | node. +| | Given Bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | When Honeycomb removes all bridge domains | ${node} +| | Then Honeycomb should show no bridge domains | ${node} +| | And VAT should show no bridge domains | ${node} + +| Honeycomb assigns interfaces to bridge domain +| | [Documentation] | Check if Honeycomb can assign VPP interfaces to an\ +| | ... | existing bridge domain. +| | Given Honeycomb creates first l2 bridge domain +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | When Honeycomb adds interfaces to bridge domain +| | ... | ${node} | @{interfaces} | ${bd1_name} | ${if_settings} +| | Then Honeycomb should show interfaces assigned to bridge domain +| | ... | ${node} | @{interfaces} | ${bd1_name} | ${if_settings} +| | And VAT should show interfaces assigned to bridge domain +| | ... | ${node} | ${0} | @{interfaces} | ${if_settings} + +| Honeycomb removes bridge domain with an interface assigned +| | [Documentation] | Check if Honeycomb can remove a bridge domain that has an\ +| | ... | interface assigned to it. +| | Given Honeycomb should show interfaces assigned to bridge domain +| | ... | ${node} | @{interfaces} | ${bd1_name} | ${if_settings} +| | And VAT should show interfaces assigned to bridge domain +| | ... | ${node} | ${0} | @{interfaces} | ${if_settings} +| | When Honeycomb removes all bridge domains | ${node} +| | Then Honeycomb should show no bridge domains | ${node} +| | And VAT should show no bridge domains | ${node} + +| Honeycomb does not assign two bridged virtual interfaces to one bridge domain. +| | [Documentation] | Check if Honeycomb can assign two bridged virtual\ +| | ... | interfaces to a single bridge domain, and expect to fail. +| | [Teardown] | Honeycomb removes all bridge domains | ${node} +| | Given Honeycomb creates first l2 bridge domain +| | ... | ${node} | ${bd1_name} | ${bd_settings} +| | When Honeycomb fails to add interfaces to bridge domain +| | ... | ${node} | @{interfaces} | ${bd1_name} | ${if_settings2} +| | Then Honeycomb should not show interfaces assigned to bridge domain +| | ... | ${node} | @{interfaces} | ${bd1_name} | ${if_settings2} +| | And VAT should not show interfaces assigned to bridge domain +| | ... | ${node} | ${0} | @{interfaces} | ${if_settings2} diff --git a/tests/func/honeycomb/021_l2_fib.robot b/tests/func/honeycomb/021_l2_fib.robot new file mode 100644 index 0000000000..ec07e104ad --- /dev/null +++ b/tests/func/honeycomb/021_l2_fib.robot @@ -0,0 +1,228 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Resource | resources/libraries/robot/honeycomb/bridge_domain.robot +| Resource | resources/libraries/robot/honeycomb/l2_fib.robot +| Variables | resources/test_data/honeycomb/l2_fib.py +| Documentation | *Honeycomb L2 FIB management test suite.* +| Suite Setup | Run keywords +| ... | Set test interface down +| ... | AND +| ... | Honeycomb removes all bridge domains | ${node} +| Suite Teardown | Honeycomb removes all bridge domains | ${node} +| Force tags | honeycomb_sanity + +*** Variables *** +# Interface to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} + +*** Test Cases *** +| Honeycomb adds L2 FIB entry (forward) +| | [Documentation] | Honeycomb creates a bridge domain and assignes an \ +| | ... | interface to it. Then adds an L2 FIB entry (forward) to the bridge \ +| | ... | domain. +| | ... +| | [Teardown] | Honeycomb removes L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']} +| | ... +| | Given Interface state from Honeycomb should be +| | ... | ${node} | ${interface} | down +| | When Honeycomb sets interface state +| | ... | ${node} | ${interface} | up +| | Then Interface state from Honeycomb should be +| | ... | ${node} | ${interface} | up +| | When Honeycomb creates first l2 bridge domain +| | ... | ${node} | ${bd_name} | ${bd_settings} +| | Then Bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${bd_settings} +| | Given Bridge domain configuration in interface operational data should be empty +| | ... | ${node} | ${interface} +| | When Honeycomb adds interface to bridge domain +| | ... | ${node} | ${interface} | ${bd_name} | ${if_bd_settings} +| | Then Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | Given L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat} + +| Honeycomb adds L2 FIB entry (static, forward) +| | [Documentation] | Honeycomb adds an L2 FIB entry (static, forward) to the \ +| | ... | bridge domain. +| | ... +| | [Teardown] | Honeycomb removes L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_oper['phys-address']} +| | ... +| | Given Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | And L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_cfg} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_oper} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_static_forward_vat} + +| Honeycomb adds L2 FIB entry (static, filter) +| | [Documentation] | Honeycomb adds an L2 FIB entry (static, filter) to the \ +| | ... | bridge domain. +| | ... +| | [Teardown] | Honeycomb removes L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_filter_oper['phys-address']} +| | ... +| | Given Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | And L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_filter_cfg} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_filter_oper} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_filter_vat} + +| Honeycomb adds and removes L2 FIB entry (forward) +| | [Documentation] | Honeycomb adds an L2 FIB entry (forward) to the bridge \ +| | ... | domain and then Honeycomb removes it from the bridge domain. +| | ... +| | [Teardown] | Honeycomb removes L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']} +| | ... +| | Given Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | And L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat} +| | When Honeycomb removes L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']} +| | Then L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} + +| Honeycomb adds more than one L2 FIB entry +| | [Documentation] | Honeycomb adds three L2 FIB entries to the bridge domain. +| | ... +| | [Teardown] | Honeycomb removes all L2 FIB entries +| | ... | ${node} | ${bd_name} +| | ... +| | Given Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | And L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg} +| | And Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_cfg} +| | And Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_filter_cfg} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper} +| | And L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_static_forward_oper} +| | And L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_filter_oper} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_static_forward_vat} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_filter_vat} + +| Honeycomb fails to set wrong L2 FIB entry +| | [Documentation] | Honeycomb tries to add an L2 FIB entry with wrong \ +| | ... | parameters to the bridge domain. It must fail. +| | ... +| | [Teardown] | Honeycomb removes all L2 FIB entries +| | ... | ${node} | ${bd_name} +| | ... +| | Given Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | And L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb fails to add wrong L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg_wrong_mac} +| | Then L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb fails to add wrong L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg_wrong_if} +| | Then L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb fails to add wrong L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg_wrong_action} +| | Then L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} + +| Honeycomb fails to modify existing L2 FIB entry +| | [Documentation] | Honeycomb tries to modify an existing L2 FIB entry. It \ +| | ... | must fail. +| | ... +| | [Teardown] | Honeycomb removes all L2 FIB entries +| | ... | ${node} | ${bd_name} +| | ... +| | Given Bridge domain configuration in interface operational data should be +| | ... | ${node} | ${interface} | ${if_bd_settings} +| | And L2 FIB Table from Honeycomb should be empty +| | ... | ${node} | ${bd_name} +| | And L2 FIB Table from VAT should be empty +| | ... | ${node} | ${bd_index} +| | When Honeycomb adds L2 FIB entry to bridge domain +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper} +| | When Honeycomb fails to modify L2 FIB entry +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper['phys-address']} +| | ... | outgoing-interface +| | ... | ${l2_fib_forward_modified_cfg['outgoing-interface']} +| | Then L2 FIB Entry from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper} +| | And L2 FIB entry from VAT should be +| | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat} + +*** Keywords *** +| Set test interface down +| | [Documentation] | Set the interface used in tests down. +| | ... +| | Honeycomb sets interface state +| | ... | ${node} | ${interface} | down diff --git a/tests/func/honeycomb/030_vxlan.robot b/tests/func/honeycomb/030_vxlan.robot new file mode 100644 index 0000000000..7e192cea47 --- /dev/null +++ b/tests/func/honeycomb/030_vxlan.robot @@ -0,0 +1,115 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +# Interfaces to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} +| ${vx_interface}= | vx_tunnel_test +# Configuration which will be set and verified during tests. +| &{vxlan_settings}= | src=192.168.0.2 | dst=192.168.0.3 | vni=${88} +| ... | encap-vrf-id=${0} +| &{vxlan_settings2}= | src=192.168.0.4 | dst=192.168.0.5 | vni=${47} +| ... | encap-vrf-id=${0} +| &{vxlan_settings_ipv6}= | src=10::10 | dst=10::11 | vni=${88} +| ... | encap-vrf-id=${0} +| &{vxlan_settings_ipv6_long}= | src=10:0:0:0:0:0:0:10 | dst=10:0:0:0:0:0:0:11 +| ... | vni=${88} | encap-vrf-id=${0} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Resource | resources/libraries/robot/honeycomb/vxlan.robot +# import additional VxLAN settings from resource file +| Variables | resources/test_data/honeycomb/vxlan.py +| Force Tags | honeycomb_sanity +| Documentation | *Honeycomb VxLAN management test suite.* +| ... +| ... | Test suite uses the first interface of the first DUT node. + +*** Test Cases *** +| Honeycomb configures VxLAN tunnel +| | [Documentation] | Check if Honeycomb API can configure VxLAN settings. +| | Given VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${vx_interface} +| | And VxLAN configuration from VAT should be empty | ${node} +| | When Honeycomb sets interface VxLAN configuration +| | ... | ${node} | ${vx_interface} | ${vxlan_settings} +| | Then VxLAN configuration from Honeycomb should be +| | ... | ${node} | ${vx_interface} | ${vxlan_settings} +| | And VxLAN configuration from VAT should be +| | ... | ${node} | ${vxlan_settings} + +| Honeycomb disables VxLAN tunnel +| | [Documentation] | Check if Honeycomb API can reset VxLAN configuration. +| | Given VxLAN configuration from Honeycomb should be +| | ... | ${node} | ${vx_interface} | ${vxlan_settings} +| | And VxLAN configuration from VAT should be +| | ... | ${node} | ${vxlan_settings} +| | When Honeycomb removes VxLAN tunnel settings | ${node} | ${vx_interface} +| | Then VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${vx_interface} +| | And VxLAN configuration from VAT should be empty | ${node} + +Honeycomb can configure VXLAN tunnel after one has been disabled +| | [Documentation] | Check if Honeycomb API can configure VxLAN settings again\ +| | ... | after previous settings have been removed. +| | [Teardown] | Honeycomb removes VxLAN tunnel settings +| | ... | ${node} | ${vx_interface} +| | Given VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${vx_interface} +| | And VxLAN configuration from VAT should be empty | ${node} +| | When Honeycomb sets interface VxLAN configuration +| | ... | ${node} | ${vx_interface} | ${vxlan_settings2} +| | Then VxLAN configuration from Honeycomb should be +| | ... | ${node} | ${vx_interface} | ${vxlan_settings2} +| | And VxLAN configuration from VAT should be +| | ... | ${node} | ${vxlan_settings2} + +| Honeycomb does not set VxLAN configuration on another interface type +| | [Documentation] | Check if Honeycomb API prevents setting VxLAN\ +| | ... | on incorrect interface. +| | Given VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${interface} +| | And VxLAN configuration from VAT should be empty | ${node} +| | When Honeycomb fails setting VxLan on different interface type +| | ... | ${node} | ${interface} | ${vxlan_settings2} +| | Then VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${interface} +| | And VxLAN configuration from VAT should be empty +| | ... | ${node} + +| Honeycomb does not set invalid VxLAN configuration +| | [Documentation] | Check if Honeycomb API prevents setting incorrect VxLAN\ +| | ... | settings. +| | Given VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${vx_interface} +| | And VxLAN configuration from VAT should be empty | ${node} +| | When Honeycomb fails setting invalid VxLAN configuration +| | ... | ${node} | ${vx_interface} | ${vxlan_invalid} +| | Then VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${vx_interface} + +| Honeycomb configures VxLAN tunnel with ipv6 +| | [Documentation] | Check if Honeycomb API can configure VxLAN with\ +| | ... | ipv6 settings. +| | [Teardown] | Honeycomb removes VxLAN tunnel settings +| | ... | ${node} | ${vx_interface} +| | Given VxLAN configuration from Honeycomb should be empty +| | ... | ${node} | ${vx_interface} +| | And VxLAN configuration from VAT should be empty | ${node} +| | When Honeycomb sets interface VxLAN configuration +| | ... | ${node} | ${vx_interface} | ${vxlan_settings_ipv6} +| | Then VxLAN configuration from Honeycomb should be +| | ... | ${node} | ${vx_interface} | ${vxlan_settings_ipv6_long} +| | And VxLAN configuration from VAT should be +| | ... | ${node} | ${vxlan_settings_ipv6} diff --git a/tests/func/honeycomb/031_vxlan_gpe.robot b/tests/func/honeycomb/031_vxlan_gpe.robot new file mode 100644 index 0000000000..5c51319070 --- /dev/null +++ b/tests/func/honeycomb/031_vxlan_gpe.robot @@ -0,0 +1,174 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +# Interface to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} + +# Parameters to be set on existing interface +| ${vxlan_gpe_existing_if}= | ${interface} +| &{vxlan_gpe_base_wrong_interface_settings}= +| ... | name=${vxlan_gpe_existing_if} +| ... | type=iana-if-type:ethernetCsmacd +| ... | description=for testing purposes +| ... | enabled=true +| ... | link-up-down-trap-enable=enabled +| &{vxlan_gpe_wrong_interface_settings}= +| ... | local=192.168.50.77 +| ... | remote=192.168.50.72 +| ... | vni=${9} +| ... | next-protocol=wrong_ipv4 +| ... | encap-vrf-id=${0} +| ... | decap-vrf-id=${0} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Resource | resources/libraries/robot/honeycomb/vxlan_gpe.robot +# Import additional VxLAN GPE settings from resource file +| Variables | resources/test_data/honeycomb/vxlan_gpe.py +| Documentation | *Honeycomb VxLAN-GPE management test suite.* +| Force Tags | honeycomb_sanity + +*** Test Cases *** +| Honeycomb creates VxLAN GPE tunnel +| | [Documentation] | Check if Honeycomb API can configure VxLAN GPE tunnel. +| | ... +| | Given interface configuration from Honeycomb should be empty +| | ... | ${node} | ${vxlan_gpe_if1} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${vxlan_gpe_if1} +| | When Honeycomb creates VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_if1} +| | ... | ${vxlan_gpe_base_settings} | ${vxlan_gpe_settings} +| | Then run keyword and continue on failure +| | ... | VxLAN GPE configuration from Honeycomb should be +| | ... | ${node} | ${vxlan_gpe_if1} +| | ... | ${vxlan_gpe_base_settings} | ${vxlan_gpe_settings} +| | And run keyword and continue on failure +| | ... | VxLAN GPE configuration from VAT should be +| | ... | ${node} | ${vxlan_gpe_if1} | ${vxlan_gpe_settings} +| | And run keyword and continue on failure +| | ... | VxLAN GPE Interface indices from Honeycomb and VAT should correspond +| | ... | ${node} | ${vxlan_gpe_if1} + +| Honeycomb removes VxLAN GPE tunnel +| | [Documentation] | Check if Honeycomb API can remove VxLAN GPE tunnel. +| | ... +# Disabled beacuse of bug in Honeycomb. +# TODO: Enable when fixed. +#| | Given VxLAN GPE configuration from Honeycomb should be +#| | ... | ${node} | ${vxlan_gpe_if1} +#| | ... | ${vxlan_gpe_base_settings} | ${vxlan_gpe_settings} +#| | And VxLAN GPE configuration from VAT should be +#| | ... | ${node} | ${vxlan_gpe_if1} | ${vxlan_gpe_settings} +| | When Honeycomb removes VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_if1} +| | Then VxLAN GPE configuration from VAT should be empty +| | ... | ${node} +| | And VxLAN GPE configuration from Honeycomb should be +| | ... | ${node} | ${vxlan_gpe_if1} +| | ... | ${vxlan_gpe_disabled_base_settings} | ${vxlan_gpe_settings} + +| Honeycomb sets wrong interface type while creating VxLAN GPE tunnel +| | [Documentation] | Check if Honeycomb refuses to create a VxLAN GPE tunnel\ +| | ... | with a wrong interface type set. +| | ... +| | Given interface configuration from Honeycomb should be empty +| | ... | ${node} | ${vxlan_gpe_if2} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${vxlan_gpe_if2} +| | When Honeycomb fails to create VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_if2} +| | ... | ${vxlan_gpe_wrong_type_base_settings} | ${vxlan_gpe_settings} +| | Then interface configuration from Honeycomb should be empty +| | ... | ${node} | ${vxlan_gpe_if2} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${vxlan_gpe_if2} + +| Honeycomb sets wrong protocol while creating VxLAN GPE tunnel +| | [Documentation] | Check if Honeycomb refuses to create a VxLAN GPE tunnel\ +| | ... | with a wrong next-protocol set. +| | ... +| | Given interface configuration from Honeycomb should be empty +| | ... | ${node} | ${vxlan_gpe_if3} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${vxlan_gpe_if3} +| | When Honeycomb fails to create VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_if3} +| | ... | ${vxlan_gpe_wrong_protocol_base_settings} +| | ... | ${vxlan_gpe_wrong_protocol_settings} +| | Then interface configuration from Honeycomb should be empty +| | ... | ${node} | ${vxlan_gpe_if3} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${vxlan_gpe_if3} + +| Honeycomb sets VxLAN GPE tunnel on existing interface with wrong type +| | [Documentation] | Check if Honeycomb refuses to create a VxLAN GPE tunnel\ +| | ... | on existing interface with wrong type. +| | ... +| | Given VxLAN GPE configuration from VAT should be empty +| | ... | ${node} +| | When Honeycomb fails to create VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_existing_if} +| | ... | ${vxlan_gpe_base_wrong_interface_settings} +| | ... | ${vxlan_gpe_wrong_interface_settings} +| | Then VxLAN GPE configuration from VAT should be empty +| | ... | ${node} + +| Honeycomb creates VxLAN GPE tunnel with ipv6 +| | [Documentation] | Check if Honeycomb API can configure VxLAN GPE tunnel\ +| | ... | with IPv6 addresses. +| | ... +| | Given VxLAN GPE configuration from VAT should be empty +| | ... | ${node} +# Disabled beacuse of bug in Honeycomb +# TODO: Enable when fixed. +#| | And VxLAN GPE configuration from Honeycomb should be +#| | ... | ${node} | ${vxlan_gpe_if5} +#| | ... | ${vxlan_gpe_disabled_base_settings} | ${vxlan_gpe_settings} +| | When Honeycomb creates VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_if5} +| | ... | ${vxlan_gpe_base_ipv6_settings} | ${vxlan_gpe_ipv6_settings} +| | Then run keyword and continue on failure +| | ... | VxLAN GPE configuration from Honeycomb should be +| | ... | ${node} | ${vxlan_gpe_if5} +| | ... | ${vxlan_gpe_base_ipv6_settings} | ${vxlan_gpe_ipv6_settings} +| | And run keyword and continue on failure +| | ... | VxLAN GPE configuration from VAT should be +| | ... | ${node} | ${vxlan_gpe_if5} | ${vxlan_gpe_ipv6_settings} +| | And run keyword and continue on failure +| | ... | VxLAN GPE Interface indices from Honeycomb and VAT should correspond +| | ... | ${node} | ${vxlan_gpe_if5} + +| Honeycomb creates the second VxLAN GPE tunnel with ipv6 +| | [Documentation] | Check if Honeycomb API can configure another one VxLAN\ +| | ... | GPE tunnel with IPv6 addresses. +| | ... +| | Given interface configuration from Honeycomb should be empty +| | ... | ${node} | ${vxlan_gpe_if6} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${vxlan_gpe_if6} +| | When Honeycomb creates VxLAN GPE interface +| | ... | ${node} | ${vxlan_gpe_if6} +| | ... | ${vxlan_gpe_base_ipv6_settings2} | ${vxlan_gpe_ipv6_settings2} +| | Then run keyword and continue on failure +| | ... | VxLAN GPE configuration from Honeycomb should be +| | ... | ${node} | ${vxlan_gpe_if6} +| | ... | ${vxlan_gpe_base_ipv6_settings2} | ${vxlan_gpe_ipv6_settings2} +| | And run keyword and continue on failure +| | ... | VxLAN GPE configuration from VAT should be +| | ... | ${node} | ${vxlan_gpe_if6} | ${vxlan_gpe_ipv6_settings2} +| | And run keyword and continue on failure +| | ... | VxLAN GPE Interface indices from Honeycomb and VAT should correspond +| | ... | ${node} | ${vxlan_gpe_if6} diff --git a/tests/func/honeycomb/040_tap.robot b/tests/func/honeycomb/040_tap.robot new file mode 100644 index 0000000000..329ca8a3c1 --- /dev/null +++ b/tests/func/honeycomb/040_tap.robot @@ -0,0 +1,71 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +# Interfaces to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} +| ${tap_interface}= | tap_test +# Configuration which will be set and verified during tests. +| &{tap_settings}= | tap-name=tap_test | mac=08:00:27:c0:5d:37 +| ... | device-instance=${1} +| &{tap_settings2}= | tap-name=tap_test | mac=08:00:27:60:26:ab +| ... | device-instance=${2} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Resource | resources/libraries/robot/honeycomb/tap.robot +| Force Tags | honeycomb_sanity +| Documentation | *Honeycomb TAP management test suite.* +| ... +| ... | Test suite uses the first interface of the first DUT node. + +*** Test Cases *** +| Honeycomb configures TAP interface +| | [Documentation] | Check if Honeycomb API can configure a TAP interface. +| | Given TAP configuration from Honeycomb should be empty +| | ... | ${node} | ${tap_interface} +| | And TAP configuration from VAT should be empty +| | ... | ${node} | ${tap_interface} +| | When Honeycomb creates TAP interface +| | ... | ${node} | ${tap_interface} | ${tap_settings} +| | Then TAP configuration from Honeycomb should be +| | ... | ${node} | ${tap_interface} | ${tap_settings} +| | And TAP configuration from VAT should be +| | ... | ${node} | ${tap_interface} | ${tap_settings} + +| Honeycomb modifies existing TAP interface configuration +| | [Documentation] | Check if Honeycomb API can re-configure and existing TAP\ +| | ... | interface with new settings. +| | Given TAP configuration from Honeycomb should be +| | ... | ${node} | ${tap_interface} | ${tap_settings} +| | And TAP configuration from VAT should be +| | ... | ${node} | ${tap_interface} | ${tap_settings} +| | When Honeycomb configures TAP interface +| | ... | ${node} | ${tap_interface} | ${tap_settings2} +| | Then TAP configuration from Honeycomb should be +| | ... | ${node} | ${tap_interface} | ${tap_settings2} +| | And TAP configuration from VAT should be +| | ... | ${node} | ${tap_interface} | ${tap_settings2} + +| Honeycomb removes TAP interface +| | [Documentation] | Check if Honeycomb API can remove TAP interface. +| | Given TAP configuration from Honeycomb should be +| | ... | ${node} | ${tap_interface} | ${tap_settings2} +| | And TAP configuration from VAT should be +| | ... | ${node} | ${tap_interface} | ${tap_settings2} +| | When Honeycomb removes TAP interface | ${node} | ${tap_interface} +| | Then TAP configuration from Honeycomb should be empty +| | ... | ${node} | ${tap_interface} +| | And TAP configuration from VAT should be empty +| | ... | ${node} | ${tap_interface} diff --git a/tests/func/honeycomb/050_interface_vhost_user.robot b/tests/func/honeycomb/050_interface_vhost_user.robot new file mode 100644 index 0000000000..2c2a5ae91a --- /dev/null +++ b/tests/func/honeycomb/050_interface_vhost_user.robot @@ -0,0 +1,159 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +| ${interface}= | ${node['interfaces']['port1']['name']} +| ${vhost_interface}= | test_vhost +| &{vhost_user_server}= | socket=soc1 | role=server +| &{vhost_user_server_edit_1}= | socket=soc12 | role=server +| &{vhost_user_server_edit_2}= | socket=soc12 | role=client +| &{vhost_user_client}= | socket=soc2 | role=client +| &{vhost_user_client_edit_1}= | socket=soc22 | role=client +| &{vhost_user_client_edit_2}= | socket=soc22 | role=server +| &{vhost_user_wrong}= | socket=soc2 | role=wrong + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/vhost_user.robot +| Force Tags | honeycomb_sanity +| Documentation | *Honeycomb vhost-user interface management test suite.* +| ... +| ... | This test suite tests if it is posible to create, modify and\ +| ... | delete a vhost-user interface. + +*** Test Cases *** +| Honycomb creates vhost-user interface - server +| | [Documentation] | Check if Honeycomb creates a vhost-user interface, role:\ +| | ... | server. +| | ... +| | Given vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${vhost_interface} +| | When Honeycomb creates vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_server} + +| Honycomb modifies vhost-user interface - server +| | [Documentation] | Check if Honeycomb can modify properties of existing\ +| | ... | vhost-user interface, role: server. +| | ... +| | Given vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server} +| | When Honeycomb configures vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server_edit_1} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server_edit_1} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_server_edit_1} +| | When Honeycomb configures vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server_edit_2} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server_edit_2} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_server_edit_2} +| | When Honeycomb configures vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_server} + +| Honycomb deletes vhost-user interface - server +| | [Documentation] | Check if Honeycomb can delete an existing vhost-user\ +| | ... | interface, role: server. +| | ... +| | Given vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_server} +| | When Honeycomb removes vhost-user interface +| | ... | ${node} | ${vhost_interface} +| | Then vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${vhost_interface} +| | And vhost-user configuration from VAT should be empty +| | ... | ${node} + +| Honycomb creates vhost-user interface - client +| | [Documentation] | Check if Honeycomb creates a vhost-user interface, role:\ +| | ... | client. +| | ... +| | Given vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${vhost_interface} +| | When Honeycomb creates vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_client} + +| Honycomb modifies vhost-user interface - client +| | [Documentation] | Check if Honeycomb can modify properties of existing\ +| | ... | vhost-user interface, role: client. +| | ... +| | Given vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client} +| | When Honeycomb configures vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client_edit_1} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client_edit_1} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_client_edit_1} +| | When Honeycomb configures vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client_edit_2} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client_edit_2} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_client_edit_2} +| | When Honeycomb configures vhost-user interface +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client} +| | Then vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client} +| | And vhost-user configuration from VAT should be +| | ... | ${node} | ${vhost_user_client} + +| Honycomb deletes vhost-user interface - client +| | [Documentation] | Check if Honeycomb can delete an existing vhost-user\ +| | ... | interface, role: client. +| | ... +| | Given vhost-user configuration from Honeycomb should be +| | ... | ${node} | ${vhost_interface} | ${vhost_user_client} +| | When Honeycomb removes vhost-user interface +| | ... | ${node} | ${vhost_interface} +| | Then vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${vhost_interface} +| | And vhost-user configuration from VAT should be empty +| | ... | ${node} + +| Honeycomb does not set vhost-user configuration on another interface type +| | [Documentation] | Check if Honeycomb refuses to set vhost-user\ +| | ... | configuration for interface which is not v3po:vhost-user type. +| | ... +| | When Honeycomb fails setting vhost-user on different interface type +| | ... | ${node} | ${interface} | ${vhost_user_server} +| | Then vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${interface} +| | And vhost-user configuration from VAT should be empty +| | ... | ${node} + +| Honeycomb does not set invalid vhost-user configuration +| | [Documentation] | Check if Honeycomb refuses to set invalid parameters to\ +| | ... | vhost-user interface. +| | ... +| | Given vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${vhost_interface} +| | When Honeycomb fails setting invalid vhost-user configuration +| | ... | ${node} | ${vhost_interface} | ${vhost_user_wrong} +| | Then vhost-user configuration from Honeycomb should be empty +| | ... | ${node} | ${vhost_interface} +| | And vhost-user configuration from VAT should be empty +| | ... | ${node} diff --git a/tests/func/honeycomb/060_sub_interface.robot b/tests/func/honeycomb/060_sub_interface.robot new file mode 100644 index 0000000000..e67638ab97 --- /dev/null +++ b/tests/func/honeycomb/060_sub_interface.robot @@ -0,0 +1,445 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/sub_interface.robot +| Resource | resources/libraries/robot/honeycomb/bridge_domain.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Variables | resources/test_data/honeycomb/sub_interfaces.py +| Suite Teardown | Honeycomb removes all bridge domains | ${node} +| Force Tags | honeycomb_sanity +| Documentation | *Honeycomb sub-interface management test suite.* +| ... +| ... | This test suite tests if it is posible to create, modify and \ +| ... | delete a sub-interface. + +*** Variables *** +# Test interface 1 and its sub-interface parameters: +| ${super_if}= | ${node['interfaces']['port1']['name']} +| ${sub_if_id}= | ${sub_if_1_settings['identifier']} +| ${sub_if_name}= | ${super_if}.${sub_if_id} + +*** Test Cases *** +| Honycomb creates sub-interface +| | [Documentation] | Check if Honeycomb creates a sub-interface. +| | ... +| | Given interface state is | ${node} | ${super_if} | down +| | And sub-interface configuration from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And interface configuration from VAT should be empty +| | ... | ${node} | ${sub_if_name} +| | When Honeycomb creates sub-interface | ${node} | ${super_if} +| | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings} +| | Then run keyword and continue on failure +| | ... | Sub-interface configuration from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper} +| | And run keyword and continue on failure +| | ... | Sub-interface configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper} +| | And sub-interface indices from Honeycomb and VAT should correspond +| | ... | ${node} | ${super_if} | ${sub_if_id} + +| Honeycomb sets interface and sub-interface up +| | [Documentation] | Honeycomb changes the state of interface up and then \ +| | ... | changes the state of its sub-interface up, in this order. +| | ... +| | Given interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | down +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | down +| | When Honeycomb sets interface state +| | ... | ${node} | ${super_if} | up +| | Then interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | up +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | up +| | Given run keyword and continue on failure +| | ... | Sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | down | down +| | And run keyword and continue on failure +| | ... | Sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | down | down +| | When Honeycomb sets the sub-interface up +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | Then run keyword and continue on failure +| | ... | Sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | up | up +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | up | up + +| Honeycomb sets sub-interface down while its super-interface is up +| | [Documentation] | Honeycomb sets the sub-interface down while its \ +| | ... | super-interface is up. It must be possible. +| | ... +| | [Teardown] | Set super and sub interfaces up +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | up | up +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | up | up +| | And interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | up +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | up +| | When Honeycomb sets the sub-interface down +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | Then sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | down | down +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | down | down +| | And interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | up +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | up + +| Honeycomb sets interface and sub-interface down +| | [Documentation] | Honeycomb changes the state of interface down and then \ +| | ... | changes the state of its sub-interface down, in this order. +| | ... +| | [Teardown] | Set super and sub interfaces down +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | up +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | up +| | When Honeycomb sets interface state +| | ... | ${node} | ${super_if} | down +| | Then interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | down +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | down +| | Given sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | up | down +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | up | down +| | When Honeycomb sets the sub-interface down +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | Then sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | down | down +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | down | down + +| Honeycomb fails to set sub-interface up while its super-interface is down +| | [Documentation] | Honeycomb tries to set the sub-interface up while its \ +| | ... | super-interface is down. It must not be possible. +| | ... +| | Given interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | down +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | down +| | And sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | down | down +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | down | down +| | When Honeycomb fails to set sub-interface up +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | Then interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | down +| | And interface state from VAT should be +| | ... | ${node} | ${super_if} | down +| | And sub-interface state from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | down | down +| | And sub-interface state from VAT should be +| | ... | ${node} | ${sub_if_name} | down | down + +| Honeycomb fails to delete sub-interface +| | [Documentation] | Check if Honeycomb can delete an existing sub-interface. +| | ... +| | [Setup] | Set super and sub interfaces down +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given sub-interface configuration from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper} +| | And sub-interface configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper} +| | When Honeycomb fails to remove all sub-interfaces +| | ... | ${node} | ${super_if} +| | Then sub-interface configuration from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper} +| | And sub-interface configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper} + +| Honeycomb adds sub-interface to new bridge domain +| | [Documentation] | Check if Honeycomb adds a sub-interface to bridge domain. +| | ... +| | [Setup] | Set super and sub interfaces down +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given sub-interface configuration from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper} +| | And sub-interface configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper} +| | When Honeycomb creates L2 bridge domain +| | ... | ${node} | ${bd_name} | ${bd_settings} +| | Then bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${bd_name} | ${bd_settings} +| | When Honeycomb adds sub-interface to bridge domain +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_bd_settings} +| | Then sub-interface bridge domain configuration from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_bd_settings} +| | And sub-interface bridge domain configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_bd_settings} +| | And sub-interface configuration from VAT should be +| | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper} + +| Honeycomb enables tag-rewrite pop 1 +| | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its \ +| | ... | parameters correctly. Case: pop 1. +| | ... +| | [Teardown] | Honeycomb disables tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT} + +| Honeycomb enables tag-rewrite push +| | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its \ +| | ... | parameters correctly. Case: push. +| | ... +| | [Teardown] | Honeycomb disables tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_push_VAT} + +| Honeycomb enables tag-rewrite translate 1-2 +| | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its \ +| | ... | parameters correctly. Case: translate 1-2. +| | ... +| | [Teardown] | Honeycomb disables tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_translate_1_2} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${tag_rewrite_translate_1_2_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_translate_1_2_VAT} + +| Honeycomb disables tag-rewrite +| | [Documentation] | Check if Honeycomb disables the tag-rewrite. +| | ... +| | [Teardown] | Honeycomb disables tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled} +| | Then rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT} + +| Honeycomb enables tag-rewrite pop 1 again +| | [Documentation] | Check if Honeycomb can enable tag-rewrite again, once it \ +| | ... | was disabled by Honeycomb. +| | ... +| | [Teardown] | Honeycomb disables tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT} + +| Honeycomb modifies the tag-rewrite +| | [Documentation] | Honeycomb sets the tag-rewrite: +| | ... | 1. pop 1, then +| | ... | 2. push, then +| | ... | 3. translate 1 - 2 +| | ... | Then Honeycomb disables the tag-rewrite. +| | ... +| | [Teardown] | Honeycomb disables tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Given rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_push_VAT} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_translate_1_2} +| | Then rewrite tag from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${tag_rewrite_translate_1_2_oper} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_translate_1_2_VAT} +| | When Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled} +| | Then rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT} + +| Honeycomb fails to set wrong vlan-type in tag-rewrite +| | [Documentation] | Check that Honeycomb does not accept wrong values of \ +| | ... | vlan-type in tag-rewrite. +| | ... +| | Given rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | When Honeycomb fails to set wrong rewrite tag +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${tag_rewrite_translate_1_2_wrong} +| | Then rewrite tag from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And rewrite tag from VAT should be +| | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT} + +| Honeycomb configures sub-interface ipv4 address +| | [Documentation] | Check if Honeycomb can configure an ipv4 address on the\ +| | ... | sub-interface. +| | ... +| | Given sub-interface ipv4 address from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And sub-interface ipv4 address from VAT should be empty +| | ... | ${node} | ${sub_if_name} +| | When Honeycomb sets sub-interface ipv4 address +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${ipv4['address']} | ${ipv4['prefix-length']} +| | Then sub-interface ipv4 address from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${ipv4['address']} | ${ipv4['prefix-length']} +| | And sub-interface ipv4 address from VAT should be +| | ... | ${node} | ${sub_if_name} +| | ... | ${ipv4['address']} | ${ipv4['prefix-length']} + +| Honeycomb removes sub-interface ipv4 address +| | [Documentation] | Check if Honeycomb can remove configured ipv4 addresses\ +| | ... | from the sub-interface. +| | ... +| | Given sub-interface ipv4 address from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${ipv4['address']} | ${ipv4['prefix-length']} +| | And sub-interface ipv4 address from VAT should be +| | ... | ${node} | ${sub_if_name} +| | ... | ${ipv4['address']} | ${ipv4['prefix-length']} +| | When Honeycomb removes all sub-interface ipv4 addresses +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | Then sub-interface ipv4 address from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And sub-interface ipv4 address from VAT should be empty +| | ... | ${node} | ${sub_if_name} + +| Honeycomb modifies existing sub-interface ipv4 address +| | [Documentation] | Check if Honeycomb can modify an ipv4 address already\ +| | ... | configured on the sub-interface. +| | [Teardown] | Honeycomb removes all sub-interface ipv4 addresses +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | Given sub-interface ipv4 address from Honeycomb should be empty +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | And sub-interface ipv4 address from VAT should be empty +| | ... | ${node} | ${sub_if_name} +| | When Honeycomb sets sub-interface ipv4 address +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${ipv4['address']} | ${ipv4['prefix-length']} +| | And Honeycomb sets sub-interface ipv4 address +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${ipv4_2['address']} | ${ipv4_2['prefix-length']} +| | Then sub-interface ipv4 address from Honeycomb should be +| | ... | ${node} | ${super_if} | ${sub_if_id} +| | ... | ${ipv4_2['address']} | ${ipv4_2['prefix-length']} +| | And sub-interface ipv4 address from VAT should be +| | ... | ${node} | ${sub_if_name} +| | ... | ${ipv4_2['address']} | ${ipv4_2['prefix-length']} + +*** Keywords *** +| Set super and sub interfaces up +| | [Documentation] | Honeycomb sets super-interface and sub-interface up, in \ +| | ... | this order. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_interface - Super interface. Type: string +| | ... | - identifier - Sub-interface identifier. Type: integer or string +| | ... +| | ... | *Example:* +| | ... | \| Set super and sub interfaces up\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| +| | ... +| | [Arguments] | ${node} | ${super_interface} | ${identifier} +| | ... +| | Honeycomb sets interface state +| | ... | ${node} | ${super_interface} | up +| | Honeycomb sets the sub-interface up +| | ... | ${node} | ${super_interface} | ${identifier} + +| Set super and sub interfaces down +| | [Documentation] | Honeycomb sets super-interface and sub-interface down, in\ +| | ... | this order. +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_interface - Super interface. Type: string +| | ... | - identifier - Sub-interface identifier. Type: integer or string +| | ... +| | ... | *Example:* +| | ... | \| Set super and sub interfaces down\ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| +| | ... +| | [Arguments] | ${node} | ${super_interface} | ${identifier} +| | ... +| | Honeycomb sets interface state +| | ... | ${node} | ${super_interface} | down +| | Honeycomb sets the sub-interface down +| | ... | ${node} | ${super_interface} | ${identifier} + +| Honeycomb disables tag rewrite +| | [Documentation] | +| | ... +| | ... | *Arguments:* +| | ... | - node - Information about a DUT node. Type: dictionary +| | ... | - super_if - Super-interface. Type: string +| | ... | - identifier - Sub-interface ID. Type: integer or string +| | ... +| | ... | *Example:* +| | ... | \| Honeycomb disables tag rewrite \ +| | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| +| | ... +| | [Arguments] | ${node} | ${super_if} | ${sub_if_id} +| | ... +| | Honeycomb configures tag rewrite +| | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled} diff --git a/tests/func/honeycomb/070_netconf.robot b/tests/func/honeycomb/070_netconf.robot new file mode 100644 index 0000000000..9925dee15f --- /dev/null +++ b/tests/func/honeycomb/070_netconf.robot @@ -0,0 +1,29 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/netconf.robot +| Variables | resources/test_data/honeycomb/netconf/triggers.py +| Documentation | *Netconf test suite. Contains test cases that need to bypass\ +| ... | REST API.* +| Force Tags | honeycomb_sanity + +*** Test Cases *** +| Honeycomb can create and delete interfaces +| | [Documentation] | Repeatedly create and delete an interface through Netconf\ +| | ... | and check the reply for any errors. +| | Given Netconf session is established | ${node} +| | :FOR | ${index} | IN RANGE | 20 +| | | When Error trigger is sent | ${trigger_105} +| | | Then Replies should not contain RPC errors diff --git a/tests/func/honeycomb/071_notification.robot b/tests/func/honeycomb/071_notification.robot new file mode 100644 index 0000000000..117f024b21 --- /dev/null +++ b/tests/func/honeycomb/071_notification.robot @@ -0,0 +1,56 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables *** +# Interfaces to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} +| ${tap_interface}= | tap_test +| &{tap_settings}= | tap-name=tap_test | mac=08:00:27:c0:5d:37 +| ... | device-instance=${1} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/interfaces.robot +| Resource | resources/libraries/robot/honeycomb/tap.robot +| Resource | resources/libraries/robot/honeycomb/notifications.robot +| Suite Setup | Run keywords +| ... | Honeycomb sets interface state +| ... | ${node} | ${interface} | down | AND +| ... | Honeycomb creates TAP interface +| ... | ${node} | ${tap_interface} | ${tap_settings} +| Documentation | *Honeycomb notifications test suite.* +| Force Tags | honeycomb_sanity + +*** Test Cases *** +| Honeycomb sends notification on interface state change +| | [Documentation] | Check if Honeycomb sends a state-changed notification\ +| | ... | when the state of an interface is changed. +| | Given Interface state from Honeycomb should be +| | ... | ${node} | ${interface} | down +| | And Interface state from VAT should be | ${node} | ${interface} | down +| | And Notification listener is established | ${node} +| | When Honeycomb sets interface state | ${node} | ${interface} | up +| | Then Honeycomb should send interface state notification | ${interface} | up +| | When Honeycomb sets interface state | ${node} | ${interface} | down +| | And Honeycomb should send interface state notification | ${interface} | down + +| Honeycomb sends notification on interface deletion +| | [Documentation] | Check if Honeycomb sends an interface-deleted notification +| | ... | when an interface is deleted. +| | Given TAP configuration from Honeycomb should be +| | ... | ${node} | ${tap_interface} | ${tap_settings} +| | And TAP configuration from VAT should be +| | ... | ${node} | ${tap_interface} | ${tap_settings} +| | And Notification listener is established | ${node} +| | When Honeycomb removes TAP interface | ${node} | ${tap_interface} +| | Then Honeycomb should send interface deleted notification | ${tap_interface} diff --git a/tests/func/honeycomb/080_access_control_lists.robot b/tests/func/honeycomb/080_access_control_lists.robot new file mode 100644 index 0000000000..146a02edd3 --- /dev/null +++ b/tests/func/honeycomb/080_access_control_lists.robot @@ -0,0 +1,146 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables*** +# Interface to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/access_control_lists.robot +| Variables | resources/test_data/honeycomb/acl.py +| Suite Teardown | Clear all ACL settings | ${node} +| Documentation | *Honeycomb access control lists test suite.* +| Force Tags | Honeycomb_sanity + +*** Test Cases *** +| Honeycomb can create ACL classify table +| | [Documentation] | Check if Honeycomb API can create an ACL table. +| | Given ACL table from Honeycomb should not exist +| | ... | ${node} | ${hc_acl_table['name']} +| | And ACL table from VAT should not exist +| | ... | ${node} | ${table_index} +| | When Honeycomb creates ACL table +| | ... | ${node} | ${hc_acl_table} +| | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} + +| Honeycomb manages more than one ACL table +| | [Documentation] | Check if Honeycomb API can create another ACL table. +| | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} +| | And Honeycomb creates ACL table | ${node} | ${hc_acl_table2} +| | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} +| | And ACL table from Honeycomb should be | ${node} | ${hc_acl_table2} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index2} | ${vat_acl_table2} + +| Honeycomb can add ACL session to table +| | [Documentation] | Check if Honeycomb API can add an ACL session to a table. +| | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} +| | When Honeycomb adds ACL session +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | Then ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session} + +| Honeycomb manages more than one ACL session on one table +| | [Documentation] | Check if Honeycomb API can add another ACL session\ +| | ... | to a table. +| | Given ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session} +| | When Honeycomb adds ACL session +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2} +| | Then ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session} +| | And ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index2} | ${vat_acl_session2} + +| Honeycomb enables ACL on interface +| | [Documentation] | Check if Honeycomb API can enable ACL on an interface. +| | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} +| | And ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session} +| | When Honeycomb enables ACL on interface +| | ... | ${node} | ${interface} | ${hc_acl_table['name']} +| | Then Interface ACL settings from Honeycomb should be +| | ... | ${node} | ${interface} | ${hc_acl_table['name']} +| | And Interface ACL settings from VAT should be +| | ... | ${node} | ${interface} | ${table_index} + +| Honeycomb disables ACL on interface +| | [Documentation] | Check if Honeycomb API can disable ACL on an interface. +| | Given Interface ACL settings from Honeycomb should be +| | ... | ${node} | ${interface} | ${hc_acl_table['name']} +| | And Interface ACL settings from VAT should be +| | ... | ${node} | ${interface} | ${table_index} +| | When Honeycomb disables ACL on interface | ${node} | ${interface} +| | Then Interface ACL settings from Honeycomb should be empty +| | ... | ${node} | ${interface} +| | And Interface ACL settings from VAT should be empty +| | ... | ${node} | ${interface} + +| Honeycomb can remove ACL session +| | [Documentation] | Check if Honeycomb API can remove an ACL session. +| | Given ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session} +| | And ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index2} | ${vat_acl_session2} +| | When Honeycomb removes ACL session +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2['match']} +| | Then ACL session from Honeycomb should be +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session} +| | And ACL session from VAT should be +| | ... | ${node} | ${table_index} | ${session_index} | ${vat_acl_session} +| | And ACL session from Honeycomb should not exist +| | ... | ${node} | ${hc_acl_table['name']} | ${hc_acl_session2['match']} +| | And ACL session from VAT should not exist +| | ... | ${node} | ${table_index} | ${session_index2} + +| Honeycomb can remove ACL table +| | [Documentation] | Check if Honeycomb API can delete an ACL table. +| | Given ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} +| | And ACL table from Honeycomb should be | ${node} | ${hc_acl_table2} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index2} | ${vat_acl_table2} +| | When Honeycomb removes ACL table | ${node} | ${hc_acl_table2['name']} +| | Then ACL table from Honeycomb should be | ${node} | ${hc_acl_table} +| | And ACL table from VAT should be +| | ... | ${node} | ${table_index} | ${vat_acl_table} +| | And ACL table from Honeycomb should not exist +| | ... | ${node} | ${hc_acl_table2['name']} +| | And ACL table from VAT should not exist +| | ... | ${node} | ${table_index2} diff --git a/tests/func/honeycomb/900_persistence.robot b/tests/func/honeycomb/900_persistence.robot new file mode 100644 index 0000000000..e3f68ccc33 --- /dev/null +++ b/tests/func/honeycomb/900_persistence.robot @@ -0,0 +1,76 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables*** +# Interface to run tests on. +| ${interface}= | ${node['interfaces']['port1']['name']} + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/persistence.robot +| Suite Setup | Restart Honeycomb and VPP and clear persisted configuration +| ... | ${node} +| Force Tags | honeycomb_persistence +| Documentation | *Honeycomb configuration persistence test suite.* + +*** Test Cases *** +| Honeycomb persists configuration through restart of both Honeycomb and VPP +| | [Documentation] | Checks if Honeycomb maintains configuration after both\ +| | ... | Honeycomb and VPP are restarted. +| | Given Honeycomb configures every setting | ${node} | ${interface} +| | And Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | When Honeycomb and VPP are restarted | ${node} +| | Then Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | And Honeycomb should show no rogue interfaces | ${node} + +| Honeycomb persists configuration through restart of Honeycomb +| | [Documentation] | Checks if Honeycomb maintains configuration after it\ +| | ... | is restarted. +| | Given Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | When Honeycomb is restarted | ${node} +| | Then Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | And Honeycomb should show no rogue interfaces | ${node} + +| Honeycomb persists configuration through restart of VPP +| | [Documentation] | Checks if Honeycomb updates VPP settings after VPP is\ +| | ... | restarted. +| | Given Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | When VPP is restarted | ${node} +| | Then Honeycomb and VPP should verify every setting | ${node} | ${interface} +| | And Honeycomb should show no rogue interfaces | ${node} + +| Honeycomb reverts to defaults if persistence files are invalid +| | [Documentation] | Checks if Honeycomb reverts to default configuration when\ +| | ... | persistence files are damaged or invalid. +| | [Teardown] | Run keyword if test failed +| | ... | Restart both systems and clear persisted configuration | ${node} +| | Given Honeycomb and VPP should not have default configuration | ${node} +| | When Persistence file is damaged during restart | ${node} +| | Then Honeycomb and VPP should have default configuration | ${node} + +*** Keywords *** +| Restart Honeycomb and VPP and clear persisted configuration +| | [Documentation] | Restarts Honeycomb and VPP with default configuration. +| | ... +| | ... | *Arguments:* +| | ... | - node - information about a DUT node. Type: dictionary +| | ... +| | ... | *Example:* +| | ... +| | ... | Restart both systems and clear persisted configuration \ +| | ... | \| ${nodes['DUT1']} \| +| | [Arguments] | ${node} +| | Stop Honeycomb service on DUTs | ${node} +| | Clear persisted Honeycomb configuration | ${node} +| | Setup DUT | ${node} +| | Setup Honeycomb service on DUTs | ${node}
\ No newline at end of file diff --git a/tests/func/honeycomb/__init__.robot b/tests/func/honeycomb/__init__.robot new file mode 100644 index 0000000000..d38852a090 --- /dev/null +++ b/tests/func/honeycomb/__init__.robot @@ -0,0 +1,26 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Variables*** +# Honeycomb node to run tests on. +| ${node}= | ${nodes['DUT1']} + +*** Settings *** +| Library | resources.libraries.python.honeycomb.HcPersistence +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/honeycomb/honeycomb.robot +| Suite Setup | Run keywords | Setup all DUTs before test | AND +| ... | Clear persisted Honeycomb configuration | ${node} | AND +| ... | Setup Honeycomb service on DUTs | ${node} | AND +| ... | Set Global Variable | ${node} +| Suite Teardown | Stop Honeycomb service on DUTs | ${node} diff --git a/tests/func/iacl/ipv4_iacl_untagged.robot b/tests/func/iacl/ipv4_iacl_untagged.robot new file mode 100644 index 0000000000..d840f38538 --- /dev/null +++ b/tests/func/iacl/ipv4_iacl_untagged.robot @@ -0,0 +1,529 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Classify.Classify +| Library | resources.libraries.python.Trace + +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Vpp Show Errors | ${nodes['DUT1']} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *IPv4 routing with ingress ACL test cases* +| ... +| ... | Encapsulations: Eth-IPv4 on links TG-DUT1, TG-DUT2, DUT1-DUT2. IPv4 +| ... | ingress ACL (iACL) tests use 3-node topology TG - DUT1 - DUT2 - TG with +| ... | one link between the nodes. DUT1 and DUT2 are configured with IPv4 +| ... | routing and static routes. DUT1 is configured with iACL on link to TG, +| ... | iACL classification and permit/deny action are configured on a per test +| ... | case basis. Test ICMPv4 Echo Request packets are sent in one direction +| ... | by TG on link to DUT1 and received on TG link to DUT2. On receive TG +| ... | verifies if packets are dropped, or if received verifies packet IPv4 +| ... | src-addr, dst-addr and MAC addresses. + +*** Variables *** +| ${dut1_to_tg_ip}= | 192.168.1.1 +| ${dut1_to_dut2_ip}= | 192.168.2.1 +| ${dut1_to_dut2_ip_GW}= | 192.168.2.2 +| ${test_dst_ip}= | 32.0.0.1 +| ${test_src_ip}= | 16.0.0.1 +| ${non_drop_dst_ip}= | 33.0.0.1 +| ${non_drop_src_ip}= | 15.0.0.1 +| ${prefix_length}= | 24 +| ${ip_version}= | ip4 +| ${l2_table}= | l2 + +*** Test Cases *** +| TC01: DUT with iACL IPv4 src-addr drops matching pkts +| | [Documentation] +| | ... | On DUT1 add source IPv4 address to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L3 | ${dut1_node} +| | ... | ${ip_version} | src +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${ip_version} | src | ${test_src_ip} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC02: DUT with iACL IPv4 dst-addr drops matching pkts +| | [Documentation] +| | ... | On DUT1 add destination IPv4 address to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L3 | ${dut1_node} +| | ... | ${ip_version} | dst +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${ip_version} | dst | ${test_dst_ip} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC03: DUT with iACL IPv4 src-addr and dst-addr drops matching pkts +| | [Documentation] +| | ... | On DUT1 add source and destination IPv4 addresses to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${table_index_1} | ${skip_n_1} | ${match_n_1}= +| | ... | When Vpp Creates Classify Table L3 | ${dut1_node} +| | ... | ${ip_version} | src +| | ${table_index_2} | ${skip_n_2} | ${match_n_2}= +| | ... | And Vpp Creates Classify Table L3 | ${dut1_node} | ${ip_version} | dst +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_2} +| | ... | ${ip_version} | src | ${test_src_ip} +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2} +| | ... | ${ip_version} | dst | ${test_dst_ip} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_1} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_2} +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC04: DUT with iACL IPv4 protocol set to TCP drops matching pkts +| | [Documentation] +| | ... | On DUT1 add protocol mask and TCP protocol (0x06) to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex +| | ... | ${dut1_node} | 0000000000000000000000000000000000000000000000FF +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | 000000000000000000000000000000000000000000000006 +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 + +| TC05: DUT with iACL IPv4 protocol set to UDP drops matching pkts +| | [Documentation] +| | ... | On DUT1 add protocol mask and UDP protocol (0x11) to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex +| | ... | ${dut1_node} | 0000000000000000000000000000000000000000000000FF +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | 000000000000000000000000000000000000000000000011 +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 + +| TC06: DUT with iACL IPv4 TCP src-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP source ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP | source +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 0 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 20 + +| TC07: DUT with iACL IPv4 TCP dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP destination ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 110 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 80 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP | destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 0 | 80 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 80 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 110 + +| TC08: DUT with iACL IPv4 TCP src-ports and dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP source and destination ports to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP +| | ... | source + destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25 + +| TC09: DUT with iACL IPv4 UDP src-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add UDP source ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP | source +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 0 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 20 + +| TC10: DUT with iACL IPv4 UDP dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP destination ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 110 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 80 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP | destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 0 | 80 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 80 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 110 + +| TC11: DUT with iACL IPv4 UDP src-ports and dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add UDP source and destination ports to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP +| | ... | source + destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25 diff --git a/tests/func/iacl/ipv6_iacl_untagged.robot b/tests/func/iacl/ipv6_iacl_untagged.robot new file mode 100644 index 0000000000..db814b221b --- /dev/null +++ b/tests/func/iacl/ipv6_iacl_untagged.robot @@ -0,0 +1,583 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Classify.Classify +| Library | resources.libraries.python.Trace + +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Vpp Show Errors | ${nodes['DUT1']} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *IPv6 routing with ingress ACL test cases* +| ... +| ... | Encapsulations: Eth-IPv6 on links TG-DUT1, TG-DUT2, DUT1-DUT2. IPv6 +| ... | ingress ACL (iACL) tests use 3-node topology TG - DUT1 - DUT2 - TG with +| ... | one link between the nodes. DUT1 and DUT2 are configured with IPv6 +| ... | routing and static routes. DUT1 is configured with iACL on link to TG, +| ... | iACL classification and permit/deny action are configured on a per test +| ... | case basis. Test ICMPv6 Echo Request packets are sent in one direction +| ... | by TG on link to DUT1 and received on TG link to DUT2. On receive TG +| ... | verifies if packets are dropped, or if received verifies packet IPv6 +| ... | src-addr, dst-addr and MAC addresses. + +*** Variables *** +| ${dut1_to_tg_ip}= | 3ffe:62::1 +| ${dut1_to_dut2_ip}= | 3ffe:63::1 +| ${dut1_to_dut2_ip_GW}= | 3ffe:63::2 +| ${dut2_to_dut1_ip}= | 3ffe:72::1 +| ${dut2_to_tg_ip}= | 3ffe:73::1 +| ${test_dst_ip}= | 3ffe:64::1 +| ${test_src_ip}= | 3ffe:61::1 +| ${non_drop_dst_ip}= | 3ffe:54::1 +| ${non_drop_src_ip}= | 3ffe:51::1 +| ${prefix_length}= | 64 +| ${ip_version}= | ip6 +| ${l2_table}= | l2 + +*** Test Cases *** +| TC01: DUT with iACL IPv6 src-addr drops matching pkts +| | [Documentation] +| | ... | On DUT1 add source IPv6 address to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L3 | ${dut1_node} +| | ... | ${ip_version} | src +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${ip_version} | src | ${test_src_ip} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC02: DUT with iACL IPv6 dst-addr drops matching pkts +| | [Documentation] +| | ... | On DUT1 add destination IPv6 address to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L3 | ${dut1_node} +| | ... | ${ip_version} | dst +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${ip_version} | dst | ${test_dst_ip} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC03: DUT with iACL IPv6 src-addr and dst-addr drops matching pkts +| | [Documentation] +| | ... | On DUT1 add source and destination IPv6 addresses to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${table_index_1} | ${skip_n_1} | ${match_n_1}= +| | ... | When Vpp Creates Classify Table L3 | ${dut1_node} +| | ... | ${ip_version} | src +| | ${table_index_2} | ${skip_n_2} | ${match_n_2}= +| | ... | And Vpp Creates Classify Table L3 | ${dut1_node} | ${ip_version} | dst +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_2} +| | ... | ${ip_version} | src | ${test_src_ip} +| | And Vpp Configures Classify Session L3 +| | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2} +| | ... | ${ip_version} | dst | ${test_dst_ip} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_1} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_2} +| | Then Send packet from Port to Port should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC04: DUT with iACL IPv6 protocol set to TCP drops matching pkts +| | [Documentation] +| | ... | On DUT1 add protocol mask and TCP protocol (0x06) to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex +| | ... | ${dut1_node} | 0000000000000000000000000000000000000000FF +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | 000000000000000000000000000000000000000006 +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 + +| TC05: DUT with iACL IPv6 protocol set to UDP drops matching pkts +| | [Documentation] +| | ... | On DUT1 add protocol mask and UDP protocol (0x11) to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex +| | ... | ${dut1_node} | 0000000000000000000000000000000000000000FF +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | 000000000000000000000000000000000000000011 +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 + +| TC06: DUT with iACL IPv6 TCP src-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP source ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP | source +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 0 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 20 + +| TC07: DUT with iACL IPv6 TCP dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP destination ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 110 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 80 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP | destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 0 | 80 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 80 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 110 + +| TC08: DUT with iACL IPv6 TCP src-ports and dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP source and destination ports to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP +| | ... | source + destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25 + +| TC09: DUT with iACL IPv6 UDP src-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add UDP source ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP | source +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 0 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 20 + +| TC10: DUT with iACL IPv6 UDP dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add TCP destination ports to classify table with 'deny'.\ +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 110 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 80 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP | destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 0 | 80 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 80 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 110 + +| TC11: DUT with iACL IPv6 UDP src-ports and dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add UDP source and destination ports to classify table\ +| | ... | with 'deny'. Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Ip Neighbor +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP +| | ... | source + destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index} +| | Then Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25 + +| TC12: DUT with iACL MAC src-addr and iACL IPv6 UDP src-ports and dst-ports drops matching pkts +| | [Documentation] +| | ... | On DUT1 add source MAC address to classify (L2) table and add UDP\ +| | ... | source and destination ports to classify (hex) table with 'deny'. +| | ... | Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | And Vpp All Ra Suppress Link Layer | ${nodes} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25 +| | And Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src +| | And Vpp Configures Classify Session L2 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | src | ${tg_to_dut1_mac} +| | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP +| | ... | source + destination +| | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20 +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask} +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | ${hex_value} +| | And Vpp Enable Input Acl Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index} +| | Then Send TCP or UDP packet | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25 +| | And Send TCP or UDP packet should failed | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac} +| | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20 diff --git a/tests/func/iacl/l2_iacl_untagged.robot b/tests/func/iacl/l2_iacl_untagged.robot new file mode 100644 index 0000000000..071ce1b34c --- /dev/null +++ b/tests/func/iacl/l2_iacl_untagged.robot @@ -0,0 +1,150 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Classify.Classify +| Library | resources.libraries.python.Trace + +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| ... | 3_NODE_DOUBLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Vpp Show Errors | ${nodes['DUT1']} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *Ingress ACL test cases* +| ... +| ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG +| ... | with one link between the nodes. +| ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect. +| ... | DUT1 is configured with iACL classification on link to TG, +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent +| ... | in one direction by TG on link to DUT1 and received on TG link +| ... | to DUT2. On receive TG verifies if packets are dropped. + +*** Variables *** +| ${l2_table}= | l2 + +*** Test Cases *** +| TC01: DUT with iACL MAC src-addr drops matching pkts +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. +| | ... | [Cfg] On DUT1 add source MAC address to classify table with 'deny'. +| | ... | [Ver] Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src +| | And Vpp Configures Classify Session L2 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | src | ${tg_to_dut1_mac} +| | And Vpp Enable Input ACL Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index} +| | Then Send and receive ICMP Packet should fail +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} + +| TC02: DUT with iACL MAC dst-addr drops matching pkts +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. +| | ... | [Cfg] On DUT1 add destination MAC address to classify +| | ... | table with 'deny'. +| | ... | [Ver] Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | dst +| | And Vpp Configures Classify Session L2 +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | dst | ${tg_to_dut2_mac} +| | And Vpp Enable Input ACL Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index} +| | Then Send and receive ICMP Packet should fail +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} + +| TC03: DUT with iACL MAC src-addr and dst-addr drops matching pkts +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. +| | ... | [Cfg] On DUT1 add source and destination MAC address to classify +| | ... | table with 'deny'. +| | ... | [Ver] Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} +| | ${table_index_1} | ${skip_n_1} | ${match_n_1}= +| | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | src +| | And Vpp Configures Classify Session L2 +| | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_1} +| | ... | src | ${tg_to_dut1_mac} +| | ${table_index_2} | ${skip_n_2} | ${match_n_2}= +| | ... | When Vpp Creates Classify Table L2 | ${dut1_node} | dst +| | And Vpp Configures Classify Session L2 +| | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2} +| | ... | dst | ${tg_to_dut1_mac} +| | And Vpp Enable Input ACL Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_1} +| | And Vpp Enable Input ACL Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index_2} +| | Then Send and receive ICMP Packet should fail +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} + +| TC04: DUT with iACL EtherType drops matching pkts +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. +| | ... | [Cfg] On DUT1 add EtherType IPv4(0x0800) to classify table with 'deny'. +| | ... | [Ver] Make TG verify matching packets are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_tg} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} +| | ${table_index} | ${skip_n} | ${match_n}= +| | ... | When Vpp Creates Classify Table Hex +| | ... | ${dut1_node} | 000000000000000000000000ffff +| | And Vpp Configures Classify Session Hex +| | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n} +| | ... | 0000000000000000000000000800 +| | And Vpp Enable Input ACL Interface +| | ... | ${dut1_node} | ${dut1_to_tg} | ${l2_table} | ${table_index} +| | Then Send and receive ICMP Packet should fail +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} diff --git a/tests/func/ipv4/ipv4_arp_untagged.robot b/tests/func/ipv4/ipv4_arp_untagged.robot new file mode 100644 index 0000000000..5bec624262 --- /dev/null +++ b/tests/func/ipv4/ipv4_arp_untagged.robot @@ -0,0 +1,86 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Trace + +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *IPv4 ARP test cases* +| ... +| ... | RFC826 ARP: Eth-IPv4 and Eth-ARP on links TG-DUT1, TG-DUT2, DUT1-DUT2: +| ... | IPv4 ARP tests use 3-node topology TG - DUT1 - DUT2 - TG with one link +| ... | between the nodes. DUT1 and DUT2 are configured with IPv4 routing and +| ... | static routes. DUT ARP functionality is tested by making TG send ICMPv4 +| ... | Echo Requests towards its other interface via DUT1 and DUT2. + +*** Variables *** +| ${dut1_to_tg_ip}= | 192.168.1.1 +| ${dut1_to_dut2_ip}= | 192.168.2.1 +| ${dut1_to_dut2_ip_GW}= | 192.168.2.2 +| ${test_dst_ip}= | 32.0.0.1 +| ${test_src_ip}= | 16.0.0.1 +| ${prefix_length}= | 24 + +*** Test Cases *** +| TC01: DUT sends ARP Request for unresolved locally connected IPv4 address +| | [Documentation] +| | ... | Make TG send test packet destined to IPv4 address of its other\ +| | ... | interface connected to DUT2. Make TG verify DUT2 sends ARP +| | ... | Request for locally connected TG IPv4 address. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | Then Send Packet And Check ARP Request | ${tg_node} +| | ... | ${test_src_ip} | ${dut1_to_dut2_ip_GW} | ${tg_to_dut1} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac} +| | ... | ${dut1_to_dut2_ip} | ${dut1_to_dut2_ip_GW} + +| TC02: DUT sends ARP Request for route next hop IPv4 address +| | [Documentation] | +| | ... | Make TG send test packet destined to IPv4 address matching\ +| | ... | static route on DUT2. Make TG verify DUT2 sends ARP Request for +| | ... | next hop of the static route. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE} +| | Then Send Packet And Check ARP Request | ${tg_node} +| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac} +| | ... | ${dut1_to_dut2_ip} | ${dut1_to_dut2_ip_GW} diff --git a/tests/func/ipv4/ipv4_proxy_arp_untagged.robot b/tests/func/ipv4/ipv4_proxy_arp_untagged.robot new file mode 100644 index 0000000000..716a84b900 --- /dev/null +++ b/tests/func/ipv4/ipv4_proxy_arp_untagged.robot @@ -0,0 +1,158 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.ProxyArp +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Show packet trace on all DUTs | ${nodes} +| Documentation | *RFC1027 Proxy ARP test cases* +| ... +| ... | *[Top] Network topologies:* TG-DUT1 2-node topology with +| ... | single link between nodes. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with Proxy ARP +| ... | *[Ver] TG verification:* Test ARP Request packet is sent +| ... | from TG on link to DUT1; on receive TG verifies ARP reply packet +| ... | for correctness and their IPv4 src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC1027. + +*** Variables *** +| ${tg_to_dut1_ip}= | 10.0.0.100 +| ${dut1_to_tg_ip}= | 10.0.0.1 +| ${prefix_length}= | 24 +| ${lo_ip4_addr}= | 192.168.1.2 +| ${hi_ip4_addr}= | 192.168.1.10 +| ${pass_test_ip}= | 192.168.1.5 +| ${pass_test_lo_ip}= | 192.168.1.2 +| ${pass_test_hi_ip}= | 192.168.1.10 +| ${fail_test_lo_ip}= | 192.168.1.1 +| ${fail_test_hi_ip}= | 192.168.1.11 + +*** Test Cases *** +| TC01: DUT sends ARP reply on behalf of another machine from the IP range +| | [Documentation] +| | ... | [Top] TG-DUT1. +| | ... | [Ref] RFC1027. +| | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP +| | ... | for IP range. +| | ... | [Ver] Make TG send ARP request to DUT1 interface, +| | ... | verify if DUT1 sends correct ARP reply on behalf of machine which +| | ... | IP is in range. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg} +| | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr} +| | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send ARP Request | ${tg_node} | ${tg_to_dut1_name} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut1_ip} | ${pass_test_ip} + +| TC02: DUT sends ARP reply on behalf of another machine from beginning of the IP range +| | [Documentation] +| | ... | [Top] TG-DUT1. +| | ... | [Ref] RFC1027. +| | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP +| | ... | for IP range. +| | ... | [Ver] Make TG send ARP request to DUT1 interface, +| | ... | verify if DUT1 sends correct ARP reply on behalf of machine which +| | ... | IP is from beginning of the IP range. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg} +| | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr} +| | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send ARP Request | ${tg_node} | ${tg_to_dut1_name} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut1_ip} | ${pass_test_lo_ip} + +| TC03: DUT sends ARP reply on behalf of another machine from end of the IP range +| | [Documentation] +| | ... | [Top] TG-DUT1. +| | ... | [Ref] RFC1027. +| | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP +| | ... | for IP range. +| | ... | [Ver] Make TG send ARP request to DUT1 interface, +| | ... | verify if DUT1 sends correct ARP reply on behalf of machine which +| | ... | IP is from end of the IP range. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg} +| | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr} +| | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send ARP Request | ${tg_node} | ${tg_to_dut1_name} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut1_ip} | ${pass_test_hi_ip} + +| TC04: DUT does not send ARP reply on behalf of another machine from below of the IP range +| | [Documentation] +| | ... | [Top] TG-DUT1. +| | ... | [Ref] RFC1027. +| | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP +| | ... | for IP range. +| | ... | [Ver] Make TG send ARP request to DUT1 interface, +| | ... | verify if DUT1 does not send ARP reply on behalf of machine which +| | ... | IP is from below of the IP range. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg} +| | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr} +| | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send ARP Request should failed | ${tg_node} | ${tg_to_dut1_name} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut1_ip} | ${fail_test_lo_ip} + +| TC05: DUT does not send ARP reply on behalf of another machine from above of the IP range +| | [Documentation] +| | ... | [Top] TG-DUT1. +| | ... | [Ref] RFC1027. +| | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP +| | ... | for IP range. +| | ... | [Ver] Make TG send ARP request to DUT1 interface, +| | ... | verify if DUT1 does not send ARP reply on behalf of machine which +| | ... | IP is from above of the IP range. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg} +| | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1} +| | When Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr} +| | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send ARP Request should failed | ${tg_node} | ${tg_to_dut1_name} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut1_ip} | ${fail_test_hi_ip} diff --git a/tests/func/ipv4/ipv4_untagged.robot b/tests/func/ipv4/ipv4_untagged.robot new file mode 100644 index 0000000000..3b6716d858 --- /dev/null +++ b/tests/func/ipv4/ipv4_untagged.robot @@ -0,0 +1,144 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.Trace +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/ipv4.robot +| Force Tags | HW_ENV +| Suite Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| ... | AND | Setup DUT nodes for IPv4 testing +| Test Setup | Clear interface counters on all vpp nodes in topology | ${nodes} +| Test Teardown | Run Keyword If Test Failed | Show packet trace on all DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *IPv4 routing test cases* +| ... +| ... | RFC791 IPv4, RFC826 ARP, RFC792 ICMPv4. Encapsulations: Eth-IPv4-ICMPv4 +| ... | on links TG-DUT1, TG-DUT2, DUT1-DUT2. IPv4 routing tests use circular +| ... | 3-node topology TG - DUT1 - DUT2 - TG with one link between the nodes. +| ... | DUT1 and DUT2 are configured with IPv4 routing and static routes. Test +| ... | ICMPv4 Echo Request packets are sent in both directions by TG on links +| ... | to DUT1 and DUT2 and received on TG links on the other side of circular +| ... | topology. On receive TG verifies packets IPv4 src-addr, dst-addr and MAC +| ... | addresses. + +*** Test Cases *** + +| TC01: DUT replies to ICMPv4 Echo Req to its ingress interface +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Req to DUT ingress interface. Make TG\ +| | ... | verify ICMP Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${hops}= | Set Variable | ${0} +| | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4 + +| TC02: DUT routes IPv4 to its egress interface +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Req towards DUT1 egress interface\ +| | ... | connected to DUT2. Make TG verify ICMPv4 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Egress Interface +| | ${hops}= | Set Variable | ${0} +| | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4 + +| TC03: DUT1 routes IPv4 to DUT2 ingress interface +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Req towards DUT2 ingress interface\ +| | ... | connected to DUT1. Make TG verify ICMPv4 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${hops}= | Set Variable | ${1} +| | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4 + +| TC04: DUT1 routes IPv4 to DUT2 egress interface +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Req towards DUT2 egress interface\ +| | ... | connected to TG. Make TG verify ICMPv4 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Egress Interface +| | ${hops}= | Set Variable | ${1} +| | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4 + +| TC05: DUT1 and DUT2 route IPv4 between TG interfaces +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Req between its interfaces across DUT1\ +| | ... | and DUT2. Make TG verify ICMPv4 Echo Replies are correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | Compute Path +| | ${src_port} | ${src_node}= | First Interface +| | ${dst_port} | ${dst_node}= | Last Interface +| | ${hops}= | Set Variable | ${2} +| | Node "${src_node}" interface "${src_port}" can route to node "${dst_node}" interface "${dst_port}" ${hops} hops away using IPv4 +| | ${port} | ${node}= | Next Interface +| | ${port} | ${node}= | Next Interface +| | ${exp_counter_val}= | Set Variable | ${1} +| | Vpp dump stats table | ${node} +| | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val} +| | ${port} | ${node}= | Next Interface +| | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val} +| | ${port} | ${node}= | Next Interface +| | Vpp dump stats table | ${node} +| | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val} +| | ${port} | ${node}= | Next Interface +| | Check ipv4 interface counter | ${node} | ${port} | ${exp_counter_val} + +| TC06: DUT replies to ICMPv4 Echo Reqs with size 64B-to-1500B-incr-1B +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Reqs to DUT ingress interface,\ +| | ... | incrementating frame size from 64B to 1500B with increment step +| | ... | of 1Byte. Make TG verify ICMP Echo Replies are correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv4 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']} | 0 | 1452 | 1 + +| TC07: DUT replies to ICMPv4 Echo Reqs with size 1500B-to-9000B-incr-10B +| | [Documentation] +| | ... | Make TG send ICMPv4 Echo Reqs to DUT ingress interface,\ +| | ... | incrementating frame size from 1500B to 9000B with increment +| | ... | step of 10Bytes. Make TG verify ICMPv4 Echo Replies are correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO +| | [Setup] | Setup MTU on TG based on MTU on DUT | ${nodes['TG']} | ${nodes['DUT1']} +| | [Teardown] | Set default Ethernet MTU on all interfaces on node | ${nodes['TG']} +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} +| | Compute Path +| | ${dut_port} | ${dut_node}= | Last Interface +| | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port} +| | # ICMP payload size is frame size minus size of Ehternet header, FCS, +| | # IPv4 header and ICMP header +| | ${end_size}= | Evaluate | ${mtu} - 14 - 4 - 20 - 8 +| | Run Keyword If | ${mtu} > 1518 +| | ... | Ipv4 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | 1452 | ${end_size} | 10 + +| TC08: DUT replies to ARP request +| | [Documentation] +| | ... | Make TG send ARP Request to DUT and verify ARP Reply is correct.\ +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Send ARP request and validate response | ${nodes['TG']} | ${nodes['DUT1']} diff --git a/tests/func/ipv6/ipv6_ra.robot b/tests/func/ipv6/ipv6_ra.robot new file mode 100644 index 0000000000..cf6d09ef8e --- /dev/null +++ b/tests/func/ipv6/ipv6_ra.robot @@ -0,0 +1,56 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Classify.Classify +| Library | resources.libraries.python.Trace + +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *IPv6 Router Advertisement test cases* +| ... +| ... | RFC4861 Neighbor Discovery. Encapsulations: Eth-IPv6-RA on links +| ... | TG-DUT1. IPv6 Router Advertisement tests use 3-node topology TG - DUT1 - +| ... | DUT2 - TG with one link between the nodes. DUT1 and DUT2 are configured +| ... | with IPv6 routing and static routes. TG verifies received RA packets. + + +*** Variables *** +| ${dut1_to_tg_ip}= | 3ffe:62::1 +| ${prefix_length}= | 64 + +*** Test Cases *** +| TC01: DUT transmits RA on IPv6 enabled interface +| | [Documentation] +| | ... | On DUT1 configure IPv6 interface on the link to TG. Make TG wait\ +| | ... | for IPv6 Router Advertisement packet to be sent out by DUT1 and +| | ... | verify the received RA packet is correct. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vpp Set If Ipv6 Addr | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | When Vpp RA Send After Interval | ${dut1_node} | ${dut1_to_tg} +| | Then Receive And Check Router Advertisement Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${dut1_to_tg_mac} diff --git a/tests/func/ipv6/ipv6_untagged.robot b/tests/func/ipv6/ipv6_untagged.robot new file mode 100644 index 0000000000..8557182a5f --- /dev/null +++ b/tests/func/ipv6/ipv6_untagged.robot @@ -0,0 +1,114 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Library | resources.libraries.python.Trace +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/default.robot +| Variables | resources/libraries/python/IPv6NodesAddr.py | ${nodes} +| Force Tags | HW_ENV +| Suite Setup | Run Keywords | Setup ipv6 to all dut in topology | ${nodes} | ${nodes_ipv6_addr} +| ... | AND | Vpp nodes ra suppress link layer | ${nodes} +| ... | AND | Vpp nodes setup ipv6 routing | ${nodes} | ${nodes_ipv6_addr} +| ... | AND | Setup all TGs before traffic script +| Test Setup | Clear interface counters on all vpp nodes in topology | ${nodes} +| Test Teardown | Run Keyword If Test Failed | Show packet trace on all DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *IPv6 routing test cases* +| ... +| ... | RFC2460 IPv6, RFC4443 ICMPv6, RFC4861 Neighbor Discovery. +| ... | Encapsulations: Eth-IPv6-ICMPv6 on links TG-DUT1, TG-DUT2, DUT1-DUT2; +| ... | Eth-IPv6-NS/NA on links TG-DUT. IPv6 routing tests use circular 3-node +| ... | topology TG - DUT1 - DUT2 - TG with one link between the nodes. DUT1 and +| ... | DUT2 are configured with IPv6 routing and static routes. Test ICMPv6 +| ... | Echo Request packets are sent in both directions by TG on links to DUT1 +| ... | and DUT2 and received on TG links on the other side of circular +| ... | topology. On receive TG verifies packets IPv6 src-addr, dst-addr and MAC +| ... | addresses. + +*** Test Cases *** +| TC01: DUT replies to ICMPv6 Echo Req to its ingress interface +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Req to DUT ingress interface. Make TG\ +| | ... | verify ICMPv6 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 icmp echo | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes_ipv6_addr} + +| TC02: DUT replies to ICMPv6 Echo Req pkt with size 64B-to-1500B-incr-1B +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Reqs to DUT ingress interface,\ +| | ... | incrementating frame size from 64B to 1500B with increment step +| | ... | of 1Byte. Make TG verify ICMP Echo Replies are correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']} | 0 | 1452 | 1 | ${nodes_ipv6_addr} + +| TC03: DUT replies to ICMPv6 Echo Req pkt with size 1500B-to-9000B-incr-10B +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Reqs to DUT ingress interface,\ +| | ... | incrementating frame size from 1500B to 9000B with increment +| | ... | step of 10Bytes. Make TG verify ICMPv6 Echo Replies are correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO +| | [Setup] | Setup MTU on TG based on MTU on DUT | ${nodes['TG']} | ${nodes['DUT1']} +| | [Teardown] | Set default Ethernet MTU on all interfaces on node | ${nodes['TG']} +| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} +| | Compute Path +| | ${dut_port} | ${dut_node}= | Last Interface +| | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port} +| | # ICMPv6 payload size is frame size minus size of Ehternet header, FCS, +| | # IPv6 header and ICMPv6 header +| | ${end_size}= | Evaluate | ${mtu} - 14 - 4 - 40 - 8 +| | Run Keyword If | ${mtu} > 1518 +| | ... | Ipv6 icmp echo sweep | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | 1452 | ${end_size} | 10 | ${nodes_ipv6_addr} + +| TC04: DUT routes to its egress interface +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Req towards DUT1 egress interface\ +| | ... | connected to DUT2. Make TG verify ICMPv6 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 tg to dut1 egress | ${nodes['TG']} | ${nodes['DUT1']} | +| | ... | ${nodes['DUT2']} | ${nodes_ipv6_addr} + +| TC05: DUT1 routes to DUT2 ingress interface +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Req towards DUT2 ingress interface\ +| | ... | connected to DUT1. Make TG verify ICMPv6 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 tg to dut2 via dut1 | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes_ipv6_addr} + +| TC06: DUT1 routes to DUT2 egress interface +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Req towards DUT2 egress interface\ +| | ... | connected to TG. Make TG verify ICMPv6 Echo Reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 tg to dut2 egress via dut1 | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes_ipv6_addr} + +| TC07: DUT1 and DUT2 route between TG interfaces +| | [Documentation] +| | ... | Make TG send ICMPv6 Echo Req between its interfaces across DUT1\ +| | ... | and DUT2. Make TG verify ICMPv6 Echo Replies are correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 tg to tg routed | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} +| | ... | ${nodes_ipv6_addr} + +| TC08: DUT replies to IPv6 Neighbor Solicitation +| | [Documentation] +| | ... | On DUT configure interface IPv6 address in the main routing\ +| | ... | domain. Make TG send Neighbor Solicitation message on the link +| | ... | to DUT and verify DUT Neighbor Advertisement reply is correct. +| | [Tags] | 3_NODE_SINGLE_LINK_TOPO | VM_ENV +| | Ipv6 neighbor solicitation | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes_ipv6_addr} diff --git a/tests/func/l2_xconnect/l2_xconnect_untagged.robot b/tests/func/l2_xconnect/l2_xconnect_untagged.robot new file mode 100644 index 0000000000..05da05308d --- /dev/null +++ b/tests/func/l2_xconnect/l2_xconnect_untagged.robot @@ -0,0 +1,137 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/qemu.robot +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.NodePath +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV +| Test Setup | Setup all DUTs before test +| Suite Setup | Setup all TGs before traffic script +| Documentation | *L2 cross-connect test cases* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology with +| ... | single links between nodes; TG=DUT1=DUT2=TG 3-node circular topology +| ... | with double parallel links and TG=DUT=VM 3-node topology with VM and +| ... | double parallel links. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of IPv4; +| ... | Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply to all links. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | cross-connect (L2XC) switching. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets are +| ... | sent in both directions by TG on links to DUT1 and DUT2; on receive TG +| ... | verifies packets for correctness and their IPv4 (IPv6) src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${sock1}= | /tmp/sock1 +| ${sock2}= | /tmp/sock2 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2XC switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 and \ +| | ... | DUT2 configure L2 cross-connect (L2XC), each with one interface +| | ... | to TG and one Ethernet interface towards the other DUT. [Ver] +| | ... | Make TG send ICMPv4 Echo Req in both directions between two of +| | ... | its interfaces to be switched by DUT1 and DUT2; verify all +| | ... | packets are received. [Ref] +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | When All Vpp Interfaces Ready Wait | ${nodes} +| | Then Send and receive ICMPv4 bidirectionally +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} +| | [Teardown] | Run Keyword | Show vpp trace dump on all DUTs + +| TC02: DUT1 and DUT2 with L2XC switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 and \ +| | ... | DUT2 configure L2 cross-connect (L2XC), each with one interface +| | ... | to TG and one Ethernet interface towards the other DUT. [Ver] +| | ... | Make TG send ICMPv6 Echo Req in both directions between two of +| | ... | its interfaces to be switched by DUT1 and DUT2; verify all +| | ... | packets are received. [Ref] +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And L2 setup xconnect on DUT +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_dut2} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | When All Vpp Interfaces Ready Wait | ${nodes} +| | Then Send and receive ICMPv6 bidirectionally +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} +| | [Teardown] | Run Keyword | Show vpp trace dump on all DUTs + +| TC03: DUT with two L2XCs switches ICMPv4 between TG and local VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT configure \ +| | ... | two L2 cross-connects (L2XC), each with one untagged interface +| | ... | to TG and untagged i/f to local VM over vhost-user. [Ver] Make +| | ... | TG send ICMPv4 Echo Reqs in both directions between two of its +| | ... | i/fs to be switched by DUT to and from VM; verify all packets +| | ... | are received. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1} +| | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2} +| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} +| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| | ... | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node} +| | ... | AND | Show vpp trace dump on all DUTs + +| TC04: DUT with two L2XCs switches ICMPv6 between TG and local VM links +| | [Documentation] +| | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT configure \ +| | ... | two L2 cross-connects (L2XC), each with one untagged i/f to TG +| | ... | and untagged i/f to local VM over vhost-user. [Ver] Make TG send +| | ... | ICMPv6 Echo Reqs in both directions between two of its i/fs to +| | ... | be switched by DUT to and from VM; verify all packets are +| | ... | received. [Ref] +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node} +| | ... | ${sock1} +| | ... | ${sock2} +| | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1} +| | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2} +| | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1} +| | ... | ${sock2} +| | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tg_to_dut_if2} +| | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| | ... | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node} +| | ... | AND | Show vpp trace dump on all DUTs + diff --git a/tests/func/lisp/lisp_api_untagged.robot b/tests/func/lisp/lisp_api_untagged.robot new file mode 100644 index 0000000000..f92a92d435 --- /dev/null +++ b/tests/func/lisp/lisp_api_untagged.robot @@ -0,0 +1,119 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Library | resources.libraries.python.topology.Topology +| Library | resources.libraries.python.NodePath +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.LispUtil +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/lisp/lisp_api.robot +# import additional Lisp settings from resource file +| Variables | resources/test_data/lisp/api/lisp_api_resources.py +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO +| ... | VM_ENV | HW_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *LISP API test cases* +| ... +| ... | *[Top] Network Topologies:* DUT1 1-node topology. +| ... | *[Enc] Packet Encapsulations:* None. +| ... | *[Cfg] DUT configuration:* DUT1 gets configured with all LISP +| ... | parameters. +| ... | *[Ver] Verification:* DUT1 operational data gets verified following +| ... | configuration. +| ... | *[Ref] Applicable standard specifications:* RFC6830. + +*** Variables *** +| ${locator_set_num}= | 3 + +*** Test Cases *** + +| TC01: DUT can enable and disable LISP +| | [Documentation] +| | ... | [Top] DUT1. [Enc] None. [Cfg1] Test LISP enable/disable API; On \ +| | ... | DUT1 enable LISP. [Ver1] Check DUT1 if LISP is enabled. [Cfg2] +| | ... | Then disable LISP. [Ver2] Check DUT1 if LISP is disabled. [Ref] +| | ... | RFC6830. +| | [Tags] | EXPECTED_FAILING +| | When Enable lisp | ${nodes['DUT1']} +| | Then Check if lisp is enabled | ${nodes['DUT1']} | ${lisp_status} +| | When Disable lisp | ${nodes['DUT1']} +| | Then Check if lisp is disabled | ${nodes['DUT1']} | ${lisp_status} + +| TC02: DUT can add and delete locator_set +| | [Documentation] +| | ... | [Top] DUT1. [Enc] None. [Cfg1] Test LISP locator_set API; on \ +| | ... | DUT1 configure locator_set and locator. [Ver1] Check DUT1 +| | ... | configured locator_set and locator are correct. [Cfg2] Then +| | ... | remove locator_set and locator. [Ver2] check DUT1 locator_set +| | ... | and locator are removed. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Lisp locator_set data is prepared +| | ... | ${nodes['DUT1']} | ${locator_set_num} +| | And Enable lisp | ${nodes['DUT1']} +| | When Lisp locator_set data is set | ${nodes['DUT1']} +| | Then Lisp locator_set is set correctly | ${nodes['DUT1']} +| | When Delete all lisp locator_set from VPP | ${nodes['DUT1']} +| | Then Lisp locator_set should be unset | ${nodes['DUT1']} + +| TC03: DUT can add, reset and delete locator_set +| | [Documentation] +| | ... | [Top] DUT1. [Enc] None. [Cfg1] Test LISP locator_set API; on \ +| | ... | DUT1 configure locator_set and locator. [Ver1] Check DUT1 +| | ... | locator_set and locator are correct. [Cfg2] Then reset +| | ... | locator_set and set it again. [Ver2] Check DUT1 locator_set and +| | ... | locator are correct. [Cfg3] Then remove locator_set and locator. +| | ... | [Ver3] Check DUT1 all locator_set and locators are removed. +| | ... | [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Lisp locator_set data use for test reset locator_set are prepared +| | ... | ${nodes['DUT1']} | ${locator_set_num} +| | And Enable lisp | ${nodes['DUT1']} +| | When Lisp locator_set data is set | ${nodes['DUT1']} +| | Then Lisp locator_set is set correctly | ${nodes['DUT1']} +| | When Delete all lisp locator_set from VPP | ${nodes['DUT1']} +| | Then Lisp locator_set should be unset | ${nodes['DUT1']} + +| TC04: DUT can add and delete eid address +| | [Documentation] +| | ... | [Top] DUT1. [Enc] None. [Cfg1] Test LISP eid API; on DUT1 \ +| | ... | configure LISP eid IP address. [Ver1] Check DUT1 configured data +| | ... | is correct. [Cfg2] Remove configured data. [Ver2] Check DUT1 all +| | ... | eid IP addresses are removed. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Enable lisp | ${nodes['DUT1']} +| | When Lisp eid address is set | ${nodes['DUT1']} | ${eid_table} +| | Then Lisp eid address is set correctly to eid table | ${nodes['DUT1']} +| | ... | ${eid_table} +| | When Delete all lisp eid address from VPP | ${nodes['DUT1']} | ${eid_table} +| | Then Lisp eid table should be empty | ${nodes['DUT1']} + +| TC05: DUT can add and delete LISP map resolver address +| | [Documentation] +| | ... | [Top] DUT1. [Enc] None. [Cfg1] Test LISP map resolver address \ +| | ... | API; on DUT1 configure LISP map resolver address. [Ver1] Check +| | ... | DUT1 configured data is correct. [Cfg2] Remove configured data. +| | ... | [Ver2] Check DUT1 all map resolver addresses are removed. [Ref] +| | ... | RFC6830. +| | Given Enable lisp | ${nodes['DUT1']} +| | When Lisp map resolver address is set | ${nodes['DUT1']} | ${map_resolver} +| | Then Lisp map resolver address is set correctly | ${nodes['DUT1']} +| | ... | ${map_resolver} +| | When Delete all lisp map resolver address from VPP | ${nodes['DUT1']} +| | ... | ${map_resolver} +| | Then Lip map resolver address should be empty | ${nodes['DUT1']} diff --git a/tests/func/lisp/lisp_dataplane_untagged.robot b/tests/func/lisp/lisp_dataplane_untagged.robot new file mode 100644 index 0000000000..0808d366c6 --- /dev/null +++ b/tests/func/lisp/lisp_dataplane_untagged.robot @@ -0,0 +1,277 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/traffic.robot +| Resource | resources/libraries/robot/lisp/lisp_static_mapping.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.IPUtil +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.IPv4Util.IPv4Util +# import additional Lisp settings from resource file +| Variables | resources/test_data/lisp/static_mapping/lisp_static_mapping.py +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO +| ... | VM_ENV | HW_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *LISP static remote mapping test cases* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv4-ICMPv4 on DUT1-DUT2, +| ... | Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv4 tunnel; +| ... | Eth-IPv6-LISP-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn for +| ... | IPv6 routing over LISPoIPv6 tunnel; Eth-IPv6-LISP-IPv4-ICMPv4 on +| ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv6 +| ... | tunnel; Eth-IPv4-LISP-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on +| ... | TG-DUTn for IPv6 routing over LISPoIPv4 tunnel. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4 (IPv6) +| ... | routing and static routes. LISPoIPv4 (oIPv6) tunnel is configured +| ... | between DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets +| ... | are sent in both directions by TG on links to DUT1 and DUT2; on receive +| ... | TG verifies packets for correctness and their IPv4 (IPv6) src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC6830. + +*** Test Cases *** +| TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISPoIPv4 tunnel +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-LISP-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure IPv4 LISP remote static mappings. [Ver] Make TG send +| | ... | ICMPv4 Echo Req between its interfaces across both DUTs and LISP +| | ... | tunnel between them; verify IPv4 headers on received packets are +| | ... | correct. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${dut1_to_dut2_ip4} | ${prefix4} +| | ... | ${dut1_node} | ${dut1_to_tg} +| | ... | ${dut1_to_tg_ip4} | ${prefix4} +| | ... | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${dut2_to_dut1_ip4} | ${prefix4} +| | ... | ${dut2_node} | ${dut2_to_tg} +| | ... | ${dut2_to_tg_ip4} | ${prefix4} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4} +| | ... | ${tg_to_dut2_mac} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4} +| | ... | ${tg_to_dut1_mac} +| | When Set up Lisp topology +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE} +| | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid} +| | ... | ${dut1_ip4_static_mapping} | ${dut2_ip4_static_mapping} +| | Then Send Packet And Check Headers +| | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers +| | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} + +| TC02: DUT1 and DUT2 route IPv6 bidirectionally over LISPoIPv6 tunnel +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-LISP-IPv6-ICMPv6 on \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure IPv6 LISP remote static mappings. [Ver] Make TG send +| | ... | ICMPv6 Echo Req between its interfaces across both DUTs and LISP +| | ... | tunnel between them; verify IPv4 headers on received packets are +| | ... | correct. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${dut1_to_dut2_ip6} | ${prefix6} +| | ... | ${dut1_node} | ${dut1_to_tg} +| | ... | ${dut1_to_tg_ip6} | ${prefix6} +| | ... | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${dut2_to_dut1_ip6} | ${prefix6} +| | ... | ${dut2_node} | ${dut2_to_tg} +| | ... | ${dut2_to_tg_ip6} | ${prefix6} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6} +| | ... | ${tg_to_dut2_mac} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6} +| | ... | ${tg_to_dut1_mac} +| | When Set up Lisp topology +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE} +| | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid} +| | ... | ${dut1_ip6_static_mapping} | ${dut2_ip6_static_mapping} +| | Then Send Packet And Check Headers +| | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers +| | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} + +| TC03: DUT1 and DUT2 route IPv4 bidirectionally over LISPoIPv6 tunnel +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-LISP-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure IPv6 LISP remote static mappings. [Ver] Make TG send +| | ... | ICMPv4 Echo Req between its interfaces across both DUTs and LISP +| | ... | tunnel between them; verify IPv4 headers on received packets are +| | ... | correct. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${dut1_to_dut2_ip4o6} | ${dut_prefix4o6} +| | ... | ${dut1_node} | ${dut1_to_tg} +| | ... | ${dut1_to_tg_ip4o6} | ${tg_prefix4o6} +| | ... | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${dut2_to_dut1_ip4o6} | ${dut_prefix4o6} +| | ... | ${dut2_node} | ${dut2_to_tg} +| | ... | ${dut2_to_tg_ip4o6} | ${tg_prefix4o6} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4o6} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4o6} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4o6} +| | ... | ${tg_to_dut2_mac} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4o6} +| | ... | ${tg_to_dut1_mac} +| | When Set up Lisp topology +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE} +| | ... | ${duts_locator_set} | ${dut1_ip4o6_eid} | ${dut2_ip4o6_eid} +| | ... | ${dut1_ip4o6_static_mapping} | ${dut2_ip4o6_static_mapping} +| | Then Send Packet And Check Headers +| | ... | ${tg_node} | ${tg1_ip4o6} | ${tg2_ip4o6} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers +| | ... | ${tg_node} | ${tg2_ip4o6} | ${tg1_ip4o6} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} + +| TC04: DUT1 and DUT2 route IPv6 bidirectionally over LISPoIPv4 tunnel +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-LISP-IPv6-ICMPv6 on \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure IPv4 LISP remote static mappings. [Ver] Make TG send +| | ... | ICMPv6 Echo Req between its interfaces across both DUTs and LISP +| | ... | tunnel between them; verify IPv4 headers on received packets are +| | ... | correct. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${dut1_to_dut2_ip6o4} | ${dut_prefix6o4} +| | ... | ${dut1_node} | ${dut1_to_tg} +| | ... | ${dut1_to_tg_ip6o4} | ${tg_prefix6o4} +| | ... | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${dut2_to_dut1_ip6o4} | ${dut_prefix6o4} +| | ... | ${dut2_node} | ${dut2_to_tg} +| | ... | ${dut2_to_tg_ip6o4} | ${tg_prefix6o4} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6o4} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6o4} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6o4} +| | ... | ${tg_to_dut2_mac} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6o4} +| | ... | ${tg_to_dut1_mac} +| | When Set up Lisp topology +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE} +| | ... | ${duts_locator_set} | ${dut1_ip6o4_eid} | ${dut2_ip6o4_eid} +| | ... | ${dut1_ip6o4_static_mapping} | ${dut2_ip6o4_static_mapping} +| | Then Send Packet And Check Headers +| | ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers +| | ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} + +| TC05: DUT1 and DUT2 route IPv4 over LISPoIPv4 tunnel after disable-enable +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-LISP-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg1] On DUT1 and DUT2 +| | ... | configure IPv4 LISP remote static mappings. [Ver1] Make TG send +| | ... | ICMPv4 Echo Req between its interfaces across both DUTs and LISP +| | ... | tunnel between them; verify IPv4 headers on received packets are +| | ... | correct. [Cfg2] Disable LISP. [Ver2] verify packets are not +| | ... | received via LISP tunnel. [Cfg3] Re-enable LISP. [Ver3] verify +| | ... | packets are received again via LISP tunnel. [Ref] RFC6830. +| | [Tags] | EXPECTED_FAILING +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${dut1_to_dut2_ip4} | ${prefix4} +| | ... | ${dut1_node} | ${dut1_to_tg} +| | ... | ${dut1_to_tg_ip4} | ${prefix4} +| | ... | ${dut2_node} | ${dut2_to_dut1} +| | ... | ${dut2_to_dut1_ip4} | ${prefix4} +| | ... | ${dut2_node} | ${dut2_to_tg} +| | ... | ${dut2_to_tg_ip4} | ${prefix4} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4} +| | ... | ${tg_to_dut2_mac} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4} +| | ... | ${tg_to_dut1_mac} +| | When Set up Lisp topology +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE} +| | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid} +| | ... | ${dut1_ip4_static_mapping} | ${dut2_ip4_static_mapping} +| | Then Send Packet And Check Headers +| | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers +| | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} +| | When Disable Lisp | ${dut1_node} +| | Then Send packet from Port to Port should failed +| | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Send packet from Port to Port should failed +| | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} +| | When Enable Lisp | ${dut1_node} +| | Then Wait Until Keyword Succeeds | 2x | 5s | Send Packet And Check Headers +| | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4} +| | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} +| | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac} +| | And Wait Until Keyword Succeeds | 2x | 5s | Send Packet And Check Headers +| | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4} +| | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac} +| | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} diff --git a/tests/func/rpf/ipv4_rpf_untagged.robot b/tests/func/rpf/ipv4_rpf_untagged.robot new file mode 100644 index 0000000000..c91436a1f1 --- /dev/null +++ b/tests/func/rpf/ipv4_rpf_untagged.robot @@ -0,0 +1,139 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/counters.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/l2_xconnect.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Trace + +| Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO +| Suite Setup | Run Keywords | Setup all TGs before traffic script +| ... | AND | Update All Interface Data On All Nodes | ${nodes} +| Test Setup | Setup all DUTs before test +| Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes} +| ... | AND | Vpp Show Errors | ${nodes['DUT1']} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *Source RPF check on IPv4 test cases* +| ... +| ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG +| ... | with one link between the nodes. +| ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect. +| ... | DUT1 is configured with IP source check on link to TG, +| ... | *[Ver] TG verification:*Test ICMP Echo Request packets are sent +| ... | in one direction by TG on link to DUT1 and received on TG link +| ... | to DUT2. On receive TG verifies if packets which source address +| ... | is not in routes are dropped. + +*** Variables *** +| ${dut1_to_tg_ip}= | 192.168.1.1 +| ${dut1_to_tg_ip_GW}= | 192.168.1.2 +| ${dut1_to_dut2_ip}= | 192.168.2.1 +| ${dut1_to_dut2_ip_GW}= | 192.168.2.2 +| ${test_dst_ip}= | 32.0.0.1 +| ${pass_test_src_ip}= | 16.0.0.1 +| ${drop_test_src_ip}= | 24.0.0.1 +| ${prefix_length}= | 24 + +*** Test Cases *** +| TC01: VPP source RPF check on IPv4 src-addr +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG +| | ... | [Cfg] On DUT1 setup IP source check. +| | ... | [Ver] Make TG verify matching packets which source address +| | ... | is not in routes are dropped. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW} +| | ... | ${tg_to_dut1_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length} +| | ... | ${dut1_to_tg_ip_GW} | ${dut1_to_tg} | resolve_attempts=${NONE} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg} +| | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${dut1_to_tg_ip_GW} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} +| | And Send packet from Port to Port should failed | ${tg_node} +| | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} +| | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2} +| | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac} + +| TC02: VPP pass traffic on non-enabled RPF interface +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG +| | ... | [Cfg] On DUT1 setup IP source check. +| | ... | [Ver] Make TG verify matching packets on non-enabled RPF interface +| | ... | are passed. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length} +| | And Set Interface Address | ${dut1_node} +| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW} +| | ... | ${tg_to_dut2_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length} +| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE} +| | And Add Arp On Dut +| | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW} +| | ... | ${tg_to_dut1_mac} +| | And Vpp Route Add +| | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length} +| | ... | ${dut1_to_tg_ip_GW} | ${dut1_to_tg} | resolve_attempts=${NONE} +| | And L2 setup xconnect on DUT +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg} +| | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg} +| | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name} +| | Then Send Packet And Check Headers | ${tg_node} +| | ... | ${test_dst_ip} | ${pass_test_src_ip} | ${tg_to_dut2} +| | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${test_dst_ip} | ${dut1_to_tg_ip_GW} | ${tg_to_dut2} +| | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1} +| | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac} diff --git a/tests/func/softwire/lightweight_4over6.robot b/tests/func/softwire/lightweight_4over6.robot new file mode 100644 index 0000000000..68eea42d8e --- /dev/null +++ b/tests/func/softwire/lightweight_4over6.robot @@ -0,0 +1,200 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/map.robot +| Library | resources.libraries.python.Trace +| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Show Packet Trace on All DUTs | ${nodes} +| Documentation | *Lightweight 4 over 6 test cases* +| ... +| ... | LW4o6 is a subset of MAP-E, with per-subscriber rules. It uses the +| ... | same tunneling mechanism and configuration as MAP-E. It does not use +| ... | embedded address bits. +| ... +| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links +| ... | between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP on TG_if1-DUT, +| ... | Eth-IPv6-IPv4-UDP on TG_if2_DUT. +| ... | *[Cfg] DUT configuration:* DUT1 is configured as lwAFTR. +| ... | *[Ver] TG verification:* Test UDP ICMP Echo Request in IPv4 are +| ... | sent to lwAFTR and are verified by TG for correctness their +| ... | encapsulation in IPv6 src-addr, dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7596 RFC7597. + +*** Variables *** +| ${dut_ip4}= | 10.0.0.1 +| ${dut_ip6}= | 2001:0::1 +| ${ipv4_prefix_len}= | 24 +| ${ipv6_prefix_len}= | 64 + +| ${lw_ipv4_pfx}= | 20.0.0.1/32 +| ${lw_ipv6_pfx}= | 2001:1::/64 +| ${lw_ipv6_src}= | 2001:1::1 +| ${lw_psid_length}= | ${8} +| ${lw_psid_offset}= | ${6} +| ${lw_rule_psid}= | ${52} +| ${lw_rule_ipv6_dst}= | 2001:1::2 +| ${lw_rule_2_psid}= | ${22} +| ${lw_rule_2_ipv6_dst}= | 2001:1::3 +| ${test_ipv4_inside}= | 20.0.0.1 +| ${test_ipv4_outside}= | 10.0.0.100 +# test_port depends on psid, length, offset +| ${test_port}= | ${1232} +| ${test_icmp_id}= | ${1232} +| ${test_2_port}= | ${6232} + +*** Test Cases *** +| TC01: Encapsulate IPv4 into IPv6. IPv6 dst depends on IPv4 and UDP destination +| | [Documentation] +| | ... | [Top] TG=DUT1. +| | ... | [Enc] Eth-IPv4-UDP on TG_if1-DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT. +| | ... | [Cfg] On DUT1 configure Map domain and Map rule. +| | ... | [Ver] Make TG send non-encapsulated UDP to DUT; verify TG received +| | ... | IPv4oIPv6 encapsulated packet is correct. +| | ... | [Ref] RFC7596 RFC7597 +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add IP Neighbor +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${lw_rule_ipv6_dst} +| | ... | ${tg_to_dut_if2_mac} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | Then Send IPv4 UDP and check headers for lightweight 4over6 +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside} +| | ... | ${test_port} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} +| | ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src} + +TC02: Encapsulate IPv4 ICMP into IPv6. IPv6 dst depends on IPv4 addr and ICMP ID +| | [Documentation] +| | ... | [Top] TG=DUT1. +| | ... | [Enc] Eth-IPv4-ICMP(type 0 and 8) on TG_if1-DUT, Eth-IPv6-IPv4-ICMP +| | ... | on TG_if2_DUT. +| | ... | [Cfg] On DUT1 configure Map domain and Map rule. +| | ... | [Ver] Make TG send non-encapsulated ICMP to DUT; verify TG received +| | ... | IPv4oIPv6 encapsulated packet is correct. Checks IPv6 +| | ... | destination based on ICMP Identifier field. +| | ... | [Ref] RFC7596 section 8.1 +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add IP Neighbor +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${lw_rule_ipv6_dst} +| | ... | ${tg_to_dut_if2_mac} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | Then Send IPv4 ICMP and check headers for lightweight 4over6 +| | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if1_mac} | ${test_ipv4_inside} | ${test_ipv4_outside} +| | ... | ${test_icmp_id} | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} +| | ... | ${lw_rule_ipv6_dst} | ${lw_ipv6_src} + +TC03: Decapsulate IPv4 UDP from IPv6. +| | [Documentation] +| | ... | [Top] TG=DUT1. +| | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv4-UDP on TG_if1-DUT. +| | ... | [Cfg] On DUT1 configure Map domain and Map rule. +| | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received +| | ... | IPv4 non-encapsulated packet is correct. +| | ... | [Ref] RFC7596 RFC7597 +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add Arp on DUT +| | ... | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${test_ipv4_outside} +| | ... | ${tg_to_dut_if1_mac} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | Then Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} +| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac} +| | ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst} +| | ... | ${test_ipv4_outside} | ${test_ipv4_inside} | ${test_port} +| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} + +TC04: Hairpinning of traffic between two lwB4 +| | [Documentation] +| | ... | [Top] DUT1-TG. +| | ... | [Enc] Eth-IPv6-IPv4-UDP on TG_if2_DUT, Eth-IPv6-IPv4-UDP on TG_if2_DUT. +| | ... | [Cfg] On DUT1 configure Map domain and two Map rules. +| | ... | [Ver] Make TG send encapsulated UDP to DUT; verify TG received +| | ... | encapsulated packet is correct. +| | ... | [Ref] RFC7596 RFC7597 +| | ... +| | Given Path for 2-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | And IP addresses are set on interfaces +| | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_ip4} | ${ipv4_prefix_len} +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${dut_ip6} | ${ipv6_prefix_len} +| | And Add IP Neighbor +| | ... | ${dut_node} | ${dut_to_tg_if2} | ${lw_rule_2_ipv6_dst} +| | ... | ${tg_to_dut_if2_mac} +| | ${domain_index}= +| | ... | When Map Add Domain +| | ... | ${dut_node} | ${lw_ipv4_pfx} | ${lw_ipv6_pfx} +| | ... | ${lw_ipv6_src} | 0 | ${lw_psid_offset} +| | ... | ${lw_psid_length} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_psid} +| | ... | ${lw_rule_ipv6_dst} +| | And Map Add Rule +| | ... | ${dut_node} | ${domain_index} | ${lw_rule_2_psid} +| | ... | ${lw_rule_2_ipv6_dst} +| | Then Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning +| | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if2} +| | ... | ${dut_to_tg_if2_mac} +| | ... | ${lw_ipv6_src} | ${lw_rule_ipv6_dst} +| | ... | ${test_ipv4_inside} | ${test_ipv4_inside} +| | ... | ${test_2_port} | ${test_port} +| | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} +| | ... | ${lw_rule_2_ipv6_dst} | ${lw_ipv6_src} diff --git a/tests/func/tap/tap_interface.robot b/tests/func/tap/tap_interface.robot new file mode 100644 index 0000000000..d32a970aca --- /dev/null +++ b/tests/func/tap/tap_interface.robot @@ -0,0 +1,305 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/traffic.robot +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.Tap +| Library | resources.libraries.python.Namespaces +| Library | resources.libraries.python.IPUtil +| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} +| Documentation | *Tap Interface Traffic Tests* +| ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links +| ... | between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of +| ... | IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG) +| ... | are set depending on test case; Namespaces (NM) +| ... | are set on DUT1 with attached linux-TAP. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets +| ... | are sent by TG on link to DUT1; On receipt TG verifies packets +| ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${tap1_VPP_ip}= | 16.0.10.1 +| ${tap2_VPP_ip}= | 16.0.20.1 + +| ${tap1_NM_ip}= | 16.0.10.2 +| ${tap2_NM_ip}= | 16.0.20.2 +| ${tap2_NM_SHG}= | 16.0.10.3 + +| ${bid_from_TG}= | 19 +| ${bid_to_TG}= | 20 +| ${bid_NM}= | container1_br +| ${bid_TAP}= | tapBr +| ${bd_id1}= | 21 +| ${bd_id2}= | 22 +| ${shg1}= | 2 +| ${shg2}= | 3 + +| ${tap1_NM_mac}= | 02:00:00:00:00:02 +| ${tap2_NM_mac}= | 02:00:00:00:00:04 + +| ${tap_int1}= | tap_int1 +| ${tap_int2}= | tap_int2 +| ${mod_tap_name}= | tap_int1MOD + +| ${namespace1}= | nmspace1 +| ${namespace2}= | nmspace2 + +| ${tg_ip_address}= | 192.168.0.2 +| ${tg_ip_address_SHG}= | 16.0.10.20 +| ${tg_ip_address_GW}= | 192.168.0.0 + +| ${prefix}= | 24 + +*** Test Cases *** +| TC01: Tap Interface Simple BD +| | [Documentation] +| | ... | [Top] TG-DUT1-TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] On DUT1 configure two +| | ... | L2BD with two if's for each L2BD with MAC learning and one L2BD +| | ... | joining two linux-TAP interfaces created by VPP located in namespace. +| | ... | [Ver] Packet sent from TG is passed through all L2BD and received +| | ... | back on TG. Then src_ip, dst_ip and MAC are checked. +| | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} +| | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} +| | And Set Interface State | ${dut_node} | ${int1} | up +| | And Set Interface State | ${dut_node} | ${int2} | up +| | And Bridge domain on DUT node is created | ${dut_node} +| | ... | ${bid_from_TG} | learn=${TRUE} +| | And Bridge domain on DUT node is created | ${dut_node} +| | ... | ${bid_to_TG} | learn=${TRUE} +| | And Linux Add Bridge | ${dut_node} +| | ... | ${bid_TAP} | ${tap_int1} | ${tap_int2} +| | And Interface is added to bridge domain | ${dut_node} +| | ... | ${int1} | ${bid_to_TG} | 0 +| | And Interface is added to bridge domain | ${dut_node} +| | ... | ${dut_to_tg_if1} | ${bid_to_TG} | 0 +| | And Interface is added to bridge domain | ${dut_node} +| | ... | ${int2} | ${bid_from_TG} | 0 +| | And Interface is added to bridge domain | ${dut_node} +| | ... | ${dut_to_tg_if2} | ${bid_from_TG} | 0 +| | Then Send and receive ICMP Packet | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2} + +| TC02: Tap Interface IP Ping Without Namespace +| | [Documentation] +| | ... | [Top] TG-DUT1-TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which +| | ... | one is TAP interface ( dut_to_tg_if and TAP ). +| | ... | and one is linux-TAP. +| | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is +| | ... | received on TG. +| | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | +| | And Set Interface Address +| | ... | ${dut_node} | ${int1} | ${tap1_VPP_ip} | ${prefix} +| | And Set Interface State | ${dut_node} | ${int1} | up +| | And Set Linux Interface MAC | ${dut_node} | ${tap_int1} | ${tap1_NM_mac} +| | And Set Linux Interface IP | ${dut_node} +| | ... | ${tap_int1} | ${tap1_NM_ip} | ${prefix} +| | And Add Route | ${dut_node} +| | ... | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip} +| | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${tg_ip_address} | ${tg_to_dut_if1_mac} +| | And Add Arp On Dut | ${dut_node} | ${int1} +| | ... | ${tap1_NM_ip} | ${tap1_NM_mac} +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} +| | ... | ${tap1_NM_ip} | ${tg_ip_address} + +| TC03: Tap Interface IP Ping With Namespace +| | [Documentation] +| | ... | [Top] TG-DUT1-TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] On DUT1 configure two interface addresses with IPv4 of which +| | ... | one is TAP interface ( dut_to_tg_if and TAP ). +| | ... | and one is linux-TAP in namespace. +| | ... | [Ver] Packet sent from TG gets to the destination and ICMP-reply is +| | ... | received on TG. +| | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | +| | And Set Interface Address +| | ... | ${dut_node} | ${int1} | ${tap1_VPP_ip} | ${prefix} +| | And Set Interface State | ${dut_node} | ${int1} | up +| | When Create Namespace | ${dut_node} | ${namespace1} +| | And Attach Interface To Namespace | ${dut_node} +| | ... | ${namespace1} | ${tap_int1} +| | And Set Linux Interface MAC | ${dut_node} +| | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1} +| | And Set Linux Interface IP | ${dut_node} +| | ... | ${tap_int1} | ${tap1_NM_ip} | ${prefix} | ${namespace1} +| | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${tg_ip_address} | ${tg_to_dut_if1_mac} +| | And Add Arp On Dut | ${dut_node} | ${int1} +| | ... | ${tap1_NM_ip} | ${tap1_NM_mac} +| | And Add Route | ${dut_node} +| | ... | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip} | ${namespace1} +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} +| | ... | ${tap1_NM_ip} | ${tg_ip_address} + +| TC04: Tap Interface BD - Different Split Horizon +| | [Documentation] +| | ... | [Top] TG-DUT1-TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] On DUT1 +| | ... | configure one if into L2BD with MAC learning. Add two TAP interfaces +| | ... | into this L2BD and assign them different SHG. Setup two namespaces +| | ... | and assign two linux-TAP interfaces to it respectively. +| | ... | [Ver] Packet is sent from TG to both linux-TAP interfaces and reply +| | ... | is checked. Ping from First linux-TAP to another should pass. +| | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} +| | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} +| | And Set Interface State | ${dut_node} | ${int1} | up +| | And Set Interface State | ${dut_node} | ${int2} | up +| | When Create Namespace | ${dut_node} | ${namespace1} +| | And Attach Interface To Namespace | ${dut_node} +| | ... | ${namespace1} | ${tap_int1} +| | And Create Namespace | ${dut_node} | ${namespace2} +| | And Attach Interface To Namespace | ${dut_node} +| | ... | ${namespace2} | ${tap_int2} +| | And Set Linux Interface IP | ${dut_node} | ${tap_int1} +| | ... | ${tap1_NM_ip} | ${prefix} | ${namespace1} +| | And Set Linux Interface IP | ${dut_node} | ${tap_int2} +| | ... | ${tap2_NM_SHG} | ${prefix} | ${namespace2} +| | And Set Linux Interface MAC | ${dut_node} +| | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1} +| | And Set Linux Interface MAC | ${dut_node} +| | ... | ${tap_int2} | ${tap2_NM_mac} | ${namespace2} +| | And Set Linux Interface ARP | ${dut_node} | ${tap_int1} +| | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace1} +| | And Set Linux Interface ARP | ${dut_node} | ${tap_int2} +| | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace2} +| | And Bridge domain on DUT node is created | ${dut_node} +| | ... | ${bd_id1} | learn=${TRUE} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${int1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut_node} | ${int2} +| | ... | ${bd_id1} | ${shg2} +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tap1_NM_mac} | ${tg_to_dut_if1_mac} +| | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG} +| | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tap2_NM_mac} | ${tg_to_dut_if1_mac} +| | ... | ${tap2_NM_SHG} | ${tg_ip_address_SHG} +| | And Send Ping From Node To Dst | ${dut_node} | ${tap1_NM_ip} | namespace=${namespace2} +| | And Send Ping From Node To Dst | ${dut_node} | ${tap2_NM_SHG} | namespace=${namespace1} + +| TC05: Tap Interface BD - Same Split Horizon +| | [Documentation] +| | ... | [Top] TG-DUT1-TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] On DUT1 +| | ... | configure one if into L2BD with MAC learning. Add two TAP interfaces +| | ... | into this L2BD and assign them same SHG. Setup two namespaces +| | ... | and assign two linux-TAP interfaces to it respectively. +| | ... | [Ver] Packet is sent from TG to both linux-TAP interfaces and reply +| | ... | is checked. Ping from First linux-TAP to another should fail. +| | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} +| | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} +| | And Set Interface State | ${dut_node} | ${int1} | up +| | And Set Interface State | ${dut_node} | ${int2} | up +| | When Create Namespace | ${dut_node} | ${namespace1} +| | And Attach Interface To Namespace | ${dut_node} +| | ... | ${namespace1} | ${tap_int1} +| | And Create Namespace | ${dut_node} | ${namespace2} +| | And Attach Interface To Namespace | ${dut_node} +| | ... | ${namespace2} | ${tap_int2} +| | And Set Linux Interface IP | ${dut_node} | ${tap_int1} +| | ... | ${tap1_NM_ip} | ${prefix} | ${namespace1} +| | And Set Linux Interface IP | ${dut_node} | ${tap_int2} +| | ... | ${tap2_NM_SHG} | ${prefix} | ${namespace2} +| | And Set Linux Interface MAC | ${dut_node} +| | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1} +| | And Set Linux Interface MAC | ${dut_node} +| | ... | ${tap_int2} | ${tap2_NM_mac} | ${namespace2} +| | And Set Linux Interface ARP | ${dut_node} | ${tap_int1} +| | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace1} +| | And Set Linux Interface ARP | ${dut_node} | ${tap_int2} +| | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace2} +| | And Bridge domain on DUT node is created | ${dut_node} +| | ... | ${bd_id1} | learn=${TRUE} +| | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut_node} | ${int1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut_node} | ${int2} +| | ... | ${bd_id1} | ${shg1} +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tap1_NM_mac} | ${tg_to_dut_if1_mac} +| | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG} +| | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1} +| | ... | ${tap2_NM_mac} | ${tg_to_dut_if1_mac} +| | ... | ${tap2_NM_SHG} | ${tg_ip_address_SHG} +| | And Run Keyword And Expect Error | Ping Not Successful | Send Ping From Node To Dst +| | ... | ${dut_node} | ${tap2_NM_SHG} | namespace=${namespace1} +| | And Run Keyword And Expect Error | Ping Not Successful | Send Ping From Node To Dst +| | ... | ${dut_node} | ${tap1_NM_ip} | namespace=${namespace2} + +| TC06: Tap Interface Modify And Delete +| | [Documentation] +| | ... | [Top] TG-DUT1-TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] Set two TAP interfaces. +| | ... | [Ver] Verify that TAP interface can be modified, deleted, and no other +| | ... | TAP interface is affected. +| | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['TG']} +| | And Interfaces in 2-node path are up +| | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} +| | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} +| | And Set Interface State | ${dut_node} | ${int1} | up +| | And Set Interface State | ${dut_node} | ${int2} | up +| | When Modify Tap Interface | ${dut_node} | ${int1} | ${mod_tap_name} +| | Then Check Tap Present | ${dut_node} | ${mod_tap_name} +| | When Delete Tap Interface | ${dut_node} | ${int1} +| | Then Run Keyword And Expect Error +| | ... | Tap interface :${mod_tap_name} does not exist +| | ... | Check Tap Present | ${dut_node} | ${mod_tap_name} +| | And Check Tap Present | ${dut_node} | ${tap_int2} +| | When Delete Tap Interface | ${dut_node} | ${int2} +| | Then Run Keyword And Expect Error +| | ... | ValueError: No JSON object could be decoded +| | ... | Check Tap Present | ${dut_node} | ${tap_int2} diff --git a/tests/func/vlan/qinq_l2_xconnect.robot b/tests/func/vlan/qinq_l2_xconnect.robot new file mode 100644 index 0000000000..35fdcde6ca --- /dev/null +++ b/tests/func/vlan/qinq_l2_xconnect.robot @@ -0,0 +1,71 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/tagging.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV +| Test Setup | Setup all DUTs before test +| Suite Setup | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *L2 cross-connect with QinQ test cases* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology with +| ... | single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, +| ... | Eth-IPv4-ICMPv4 on TG-DUTn for L2 switching of IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | cross-connect (L2XC) switching with 802.1ad QinQ VLAN tag push and pop. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are +| ... | sent in both directions by TG on links to DUT1 and DUT2; on receive TG +| ... | verifies packets for correctness and their IPv4 src-addr, dst-addr and +| ... | MAC addresses. +| ... | *[Ref] Applicable standard specifications:* IEEE 802.1ad. + +*** Variables *** +| ${subid}= | 10 +| ${outer_vlan_id}= | 100 +| ${inner_vlan_id}= | 200 +| ${type_subif}= | two_tags +| ${tag_rewrite_method}= | pop-2 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2XC and two VLAN push-pop switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure L2 cross-connect (L2XC), each with one interface to TG +| | ... | and one Ethernet interface towards the other DUT; each DUT +| | ... | pushes two VLAN tags on packets received from local TG, and +| | ... | popping two VLAN tags on packets transmitted to local TG. [Ver] +| | ... | Make TG send ICMPv4 Echo Req in both directions between two of +| | ... | its interfaces to be switched by DUT1 and DUT2; verify all +| | ... | packets are received. [Ref] IEEE 802.1ad. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | When VLAN subinterfaces initialized on 3-node topology +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | ${outer_vlan_id} | ${inner_vlan_id} | ${type_subif} +| | And L2 tag rewrite method setup on interfaces +| | ... | ${dut1_node} | ${subif_index_1} | ${dut2_node} | ${subif_index_2} +| | ... | ${tag_rewrite_method} +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subif_index_1} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${subif_index_2} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} diff --git a/tests/func/vlan/vlan_tag_translate_l2_bridge_domain_ipv4.robot b/tests/func/vlan/vlan_tag_translate_l2_bridge_domain_ipv4.robot new file mode 100644 index 0000000000..0ff10cd328 --- /dev/null +++ b/tests/func/vlan/vlan_tag_translate_l2_bridge_domain_ipv4.robot @@ -0,0 +1,552 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/tagging.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV +| Test Setup | Setup all DUTs before test +| Suite Setup | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *L2 bridge domain with VLAN tag rewrite test cases - IPv4* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-ICMPv4 or +| ... | Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and DUT1-DUT2, Eth-IPv4-ICMPv4 +| ... | on TG-DUT2 for L2 switching of IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with bridge domain (L2BD) +| ... | switching combined with MAC learning enabled and added VLAN +| ... | sub-interface with VLAN tag rewrite translate-1-1 method +| ... | of interface towards TG and interface towards DUT2. DUT2 is configured +| ... | with L2 bridge domain (L2BD) switching between VLAN sub-interface +| ... | with VLAN tag rewrite pop-1 method of interface towards DUT1 and +| ... | interface towards TG. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are +| ... | sent from TG on link to DUT1 and received in TG on link form DUT2; +| ... | on receive TG verifies packets for correctness and their IPv4 src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad. + +*** Variables *** +| ${bd_id1}= | 1 + +| ${subid}= | 10 + +| ${outer_vlan_id1}= | 110 +| ${outer_vlan_id2}= | 120 +| ${outer_vlan_wrong}= | 150 + +| ${inner_vlan_id1}= | 210 +| ${inner_vlan_id2}= | 220 +| ${inner_vlan_wrong}= | 250 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2BD and VLAN translate-1-1 (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1q +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC02: DUT1 and DUT2 with L2BD and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method +| | ... | to set tag different from tag set on VLAN sub-interface of DUT2; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1q +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC03: DUT1 and DUT2 with L2BD and VLAN translate-1-2 (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method; on DUT2 configure L2 bridge domain (L2BD) with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC04: DUT1 and DUT2 with L2BD and VLAN translate-1-2 with wrong inner tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set inner tag different from inner tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 bridge domain with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC05: DUT1 and DUT2 with L2BD and VLAN translate-1-2 with wrong outer tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer tag different from outer tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 bridge domain with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC06: DUT1 and DUT2 with L2BD and VLAN translate-1-2 with wrong outer and inner tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer and inner tags different from tags +| | ... | set on Dot1ad sub-interface of DUT2; on DUT2 configure L2 +| | ... | bridge domain with one interface to TG and one Dot1ad sub-interface +| | ... | towards DUT1 with VLAN tag rewrite pop-2 method. [Ver] Make TG send +| | ... | ICMPv4 Echo Req tagged with one Dot1q tag from one of its interfaces +| | ... | to another one via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC07: DUT1 and DUT2 with L2BD and VLAN translate-2-1 (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method; on DUT2 configure L2 bridge domain (L2BD) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC08: DUT1 and DUT2 with L2BD and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method to set tag different from tag set on VLAN +| | ... | sub-interface of DUT2; on DUT2 configure L2 bridge domain (L2BD) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC09: DUT1 and DUT2 with L2BD and VLAN translate-2-2 switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG and +| | ... | one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC10: DUT1 and DUT2 with L2BD and VLAN translate-2-2 with wrong inner tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set inner tag different from inner tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 bridge domain (L2BD) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagged with Dot1ad tags from one of its interfaces to another +| | ... | one method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC11: DUT1 and DUT2 with L2BD and VLAN translate-2-2 with wrong outer tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set outer tag different from outer tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 bridge domain (L2BD) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagged with Dot1ad tags from one of its interfaces to another +| | ... | one method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC12: DUT1 and DUT2 with L2BD and VLAN translate-2-2 with wrong outer and inner tags used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set tags different from tags set on Dot1ad sub-interface of DUT2; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG +| | ... | and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} diff --git a/tests/func/vlan/vlan_tag_translate_l2_bridge_domain_ipv6.robot b/tests/func/vlan/vlan_tag_translate_l2_bridge_domain_ipv6.robot new file mode 100644 index 0000000000..e3d2d39dd5 --- /dev/null +++ b/tests/func/vlan/vlan_tag_translate_l2_bridge_domain_ipv6.robot @@ -0,0 +1,561 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/bridge_domain.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/tagging.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV +| Test Setup | Setup all DUTs before test +| Suite Setup | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *L2 bridge domain with VLAN tag rewrite test cases - IPv6* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv6-ICMPv6 or +| ... | Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and DUT1-DUT2, Eth-IPv6-ICMPv6 +| ... | on TG-DUT2 for L2 switching of IPv6. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with bridge domain (L2BD) +| ... | switching combined with MAC learning enabled and added VLAN +| ... | sub-interface with VLAN tag rewrite translate-1-1 method +| ... | of interface towards TG and interface towards DUT2. DUT2 is configured +| ... | with L2 bridge domain (L2BD) switching between VLAN sub-interface +| ... | with VLAN tag rewrite pop-1 method of interface towards DUT1 and +| ... | interface towards TG. +| ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are +| ... | sent from TG on link to DUT1 and received in TG on link form DUT2; +| ... | on receive TG verifies packets for correctness and their IPv6 src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad. + +*** Variables *** +| ${bd_id1}= | 1 + +| ${subid}= | 10 + +| ${outer_vlan_id1}= | 110 +| ${outer_vlan_id2}= | 120 +| ${outer_vlan_wrong}= | 150 + +| ${inner_vlan_id1}= | 210 +| ${inner_vlan_id2}= | 220 +| ${inner_vlan_wrong}= | 250 + +| ${src_ip}= | 3ffe:63::1 +| ${dst_ip}= | 3ffe:63::2 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2BD and VLAN translate-1-1 (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1q +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC02: DUT1 and DUT2 with L2BD and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method +| | ... | to set tag different from tag set on VLAN sub-interface of DUT2; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1q +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC03: DUT1 and DUT2 with L2BD and VLAN translate-1-2 (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method; on DUT2 configure L2 bridge domain (L2BD) with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC04: DUT1 and DUT2 with L2BD and VLAN translate-1-2 with wrong inner tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set inner tag different from inner tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 bridge domain with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC05: DUT1 and DUT2 with L2BD and VLAN translate-1-2 with wrong outer tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer tag different from outer tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 bridge domain with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC06: DUT1 and DUT2 with L2BD and VLAN translate-1-2 with wrong outer and inner tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer and inner tags different from tags +| | ... | set on Dot1ad sub-interface of DUT2; on DUT2 configure L2 +| | ... | bridge domain with one interface to TG and one Dot1ad sub-interface +| | ... | towards DUT1 with VLAN tag rewrite pop-2 method. [Ver] Make TG send +| | ... | ICMPv6 Echo Req tagged with one Dot1q tag from one of its interfaces +| | ... | to another one via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC07: DUT1 and DUT2 with L2BD and VLAN translate-2-1 (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method; on DUT2 configure L2 bridge domain (L2BD) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC08: DUT1 and DUT2 with L2BD and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method to set tag different from tag set on VLAN +| | ... | sub-interface of DUT2; on DUT2 configure L2 bridge domain (L2BD) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC09: DUT1 and DUT2 with L2BD and VLAN translate-2-2 switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG and +| | ... | one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC10: DUT1 and DUT2 with L2BD and VLAN translate-2-2 with wrong inner tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set inner tag different from inner tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 bridge domain (L2BD) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagged with Dot1ad tags from one of its interfaces to another +| | ... | one method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC11: DUT1 and DUT2 with L2BD and VLAN translate-2-2 with wrong outer tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set outer tag different from outer tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 bridge domain (L2BD) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagged with Dot1ad tags from one of its interfaces to another +| | ... | one method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC12: DUT1 and DUT2 with L2BD and VLAN translate-2-2 with wrong outer and inner tags used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | bridge domain (L2BD) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set tags different from tags set on Dot1ad sub-interface of DUT2; +| | ... | on DUT2 configure L2 bridge domain (L2BD) with one interface to TG +| | ... | and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${vlan1_index} +| | ... | ${bd_id1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut2_node} | ${vlan2_index} +| | ... | ${bd_id1} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} diff --git a/tests/func/vlan/vlan_tag_translate_l2_xconnect_ipv4.robot b/tests/func/vlan/vlan_tag_translate_l2_xconnect_ipv4.robot new file mode 100644 index 0000000000..f1a954f4d0 --- /dev/null +++ b/tests/func/vlan/vlan_tag_translate_l2_xconnect_ipv4.robot @@ -0,0 +1,453 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/tagging.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV +| Test Setup | Setup all DUTs before test +| Suite Setup | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *L2 cross-connect with VLAN tag rewrite test cases - IPv4* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-ICMPv4 or +| ... | Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and DUT1-DUT2, Eth-IPv4-ICMPv4 +| ... | on TG-DUT2 for L2 switching of IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect +| ... | (L2XC) switching between VLAN sub-interface with VLAN tag rewrite +| ... | translate-1-1 method of interface towards TG and interface towards DUT2. +| ... | DUT2 is configured configured with L2 cross-connect (L2XC) switching +| ... | between VLAN sub-interface with VLAN tag rewrite pop-1 method +| ... | of interface towards DUT1 and interface towards TG. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are +| ... | sent from TG on link to DUT1 and received in TG on link form DUT2; +| ... | on receive TG verifies packets for correctness and their IPv4 src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad. + +*** Variables *** +| ${subid}= | 10 +| ${outer_vlan_id1}= | 110 +| ${outer_vlan_id2}= | 120 +| ${outer_vlan_wrong}= | 150 +| ${inner_vlan_id1}= | 210 +| ${inner_vlan_id2}= | 220 +| ${inner_vlan_wrong}= | 250 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2XC and VLAN translate-1-1 (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1q +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC02: DUT1 and DUT2 with L2XC and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one VLAN tagged sub-interface to DUT2 and +| | ... | one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | (translate-1-1) on sub-interface to DUT2; on DUT2 configure L2XC with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with VLAN +| | ... | tag pop-1. [Ver] Make TG send ICMPv4 Echo Req tagged with one dot1q +| | ... | tag from one of its interfaces to another one via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1q +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC03: DUT1 and DUT2 with L2XC and VLAN translate-1-2 (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method; on DUT2 configure L2 cross-connect (L2XC) with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC04: DUT1 and DUT2 with L2XC and VLAN translate-1-2 with wrong inner tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set inner tag different from inner tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 cross-connect with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC05: DUT1 and DUT2 with L2XC and VLAN translate-1-2 with wrong outer tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer tag different from outer tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 cross-connect with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC06: DUT1 and DUT2 with L2XC and VLAN translate-1-2 with wrong outer and inner tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer and inner tags different from tags +| | ... | set on Dot1ad sub-interface of DUT2; on DUT2 configure L2 +| | ... | cross-connect with one interface to TG and one Dot1ad sub-interface +| | ... | towards DUT1 with VLAN tag rewrite pop-2 method. [Ver] Make TG send +| | ... | ICMPv4 Echo Req tagged with one Dot1q tag from one of its interfaces +| | ... | to another one via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC07: DUT1 and DUT2 with L2XC and VLAN translate-2-1 (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method; on DUT2 configure L2 cross-connect (L2XC) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC08: DUT1 and DUT2 with L2XC and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method to set tag different from tag set on VLAN +| | ... | sub-interface of DUT2; on DUT2 configure L2 cross-connect (L2XC) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC09: DUT1 and DUT2 with L2XC and VLAN translate-2-2 switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG and +| | ... | one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC10: DUT1 and DUT2 with L2XC and VLAN translate-2-2 with wrong inner tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set inner tag different from inner tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 cross-connect (L2XC) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC11: DUT1 and DUT2 with L2XC and VLAN translate-2-2 with wrong outer tag used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set outer tag different from outer tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 cross-connect (L2XC) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagged with Dot1ad tags from one of its interfaces to another +| | ... | one method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC12: DUT1 and DUT2 with L2XC and VLAN translate-2-2 with wrong outer and inner tags used (DUT1) switch ICMPv4 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set tags different from tags set on Dot1ad sub-interface of DUT2; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG +| | ... | and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagged with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv4 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} diff --git a/tests/func/vlan/vlan_tag_translate_l2_xconnect_ipv6.robot b/tests/func/vlan/vlan_tag_translate_l2_xconnect_ipv6.robot new file mode 100644 index 0000000000..9557fb9d6b --- /dev/null +++ b/tests/func/vlan/vlan_tag_translate_l2_xconnect_ipv6.robot @@ -0,0 +1,473 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/tagging.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV +| Test Setup | Setup all DUTs before test +| Suite Setup | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *L2 cross-connect with VLAN tag rewrite test cases - IPv6* +| ... +| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv6-ICMPv6 or +| ... | Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and DUT1-DUT2, Eth-IPv6-ICMPv6 +| ... | on TG-DUT2 for L2 switching of IPv6. +| ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect +| ... | (L2XC) switching between VLAN sub-interface with VLAN tag rewrite +| ... | translate-1-1 method of interface towards TG and interface towards DUT2. +| ... | DUT2 is configured configured with L2 cross-connect (L2XC) switching +| ... | between VLAN sub-interface with VLAN tag rewrite pop-1 method +| ... | of interface towards DUT1 and interface towards TG. +| ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are +| ... | sent from TG on link to DUT1 and received in TG on link form DUT2; +| ... | on receive TG verifies packets for correctness and their IPv6 src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad. + +*** Variables *** +| ${subid}= | 10 + +| ${outer_vlan_id1}= | 110 +| ${outer_vlan_id2}= | 120 +| ${outer_vlan_wrong}= | 150 + +| ${inner_vlan_id1}= | 210 +| ${inner_vlan_id2}= | 220 +| ${inner_vlan_wrong}= | 250 + +| ${src_ip}= | 3ffe:63::1 +| ${dst_ip}= | 3ffe:63::2 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2XC and VLAN translate-1-1 (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagegd with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1q +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC02: DUT1 and DUT2 with L2XC and VLAN translate-1-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one VLAN +| | ... | sub-interface towards TG with VLAN tag rewrite translate-1-1 method +| | ... | to set tag different from tag set on VLAN sub-interface of DUT2; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG +| | ... | and one VLAN sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req tagegd with one Dot1q tag +| | ... | from one of its interfaces to another one via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1q +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC03: DUT1 and DUT2 with L2XC and VLAN translate-1-2 (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method; on DUT2 configure L2 cross-connect (L2XC) with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagegd with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1q | vlan1=${outer_vlan_id1} + +| TC04: DUT1 and DUT2 with L2XC and VLAN translate-1-2 with wrong inner tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set inner tag different from inner tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 cross-connect with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagegd with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC05: DUT1 and DUT2 with L2XC and VLAN translate-1-2 with wrong outer tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer tag different from outer tag set on +| | ... | Dot1ad sub-interface of DUT2; on DUT2 configure L2 cross-connect with +| | ... | one interface to TG and one Dot1ad sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-2 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagegd with one Dot1q tag from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC06: DUT1 and DUT2 with L2XC and VLAN translate-1-2 with wrong outer and inner tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1ad-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one VLAN sub-interface towards TG with VLAN tag rewrite +| | ... | translate-1-2 method to set outer and inner tags different from tags +| | ... | set on Dot1ad sub-interface of DUT2; on DUT2 configure L2 +| | ... | cross-connect with one interface to TG and one Dot1ad sub-interface +| | ... | towards DUT1 with VLAN tag rewrite pop-2 method. [Ver] Make TG send +| | ... | ICMPv6 Echo Req tagegd with one Dot1q tag from one of its interfaces +| | ... | to another one via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${outer_vlan_id1} +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-1-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1q +| | ... | vlan1=${outer_vlan_id1} + +| TC07: DUT1 and DUT2 with L2XC and VLAN translate-2-1 (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method; on DUT2 configure L2 cross-connect (L2XC) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagegd with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC08: DUT1 and DUT2 with L2XC and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \ +| | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. +| | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to +| | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite +| | ... | translate-2-1 method to set tag different from tag set on VLAN +| | ... | sub-interface of DUT2; on DUT2 configure L2 cross-connect (L2XC) with +| | ... | one interface to TG and one VLAN sub-interface towards DUT1 with +| | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req +| | ... | tagegd with Dot1ad tags from one of its interfaces to another one +| | ... | via DUT1 and DUT2; verify that packet is not received. +| | ... | [Ref] IEEE 802.1q, IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-1 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC09: DUT1 and DUT2 with L2XC and VLAN translate-2-2 switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG and +| | ... | one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagegd with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is received. [Ref] IEEE 802.1ad +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Send and receive ICMP Packet +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip} +| | ... | dst_ip=${dst_ip} | encaps=Dot1ad | vlan1=${outer_vlan_id1} +| | ... | vlan2=${inner_vlan_id1} + +| TC10: DUT1 and DUT2 with L2XC and VLAN translate-2-2 with wrong inner tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set inner tag different from inner tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 cross-connect (L2XC) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagegd with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_id2} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC11: DUT1 and DUT2 with L2XC and VLAN translate-2-2 with wrong outer tag used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set outer tag different from outer tag set on Dot1ad sub-interface of +| | ... | DUT2; on DUT2 configure L2 cross-connect (L2XC) with one interface to +| | ... | TG and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite +| | ... | pop-1 tagegd with Dot1ad tags from one of its interfaces to another +| | ... | one method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; +| | ... | verify that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_id2} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} + +| TC12: DUT1 and DUT2 with L2XC and VLAN translate-2-2 with wrong outer and inner tags used (DUT1) switch ICMPv6 between two TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1 and \ +| | ... | on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2. [Cfg] On DUT1 configure L2 +| | ... | cross-connect (L2XC) with one interface to DUT2 and one Dot1ad +| | ... | sub-interface towards TG with VLAN tag rewrite translate-2-2 method to +| | ... | set tags different from tags set on Dot1ad sub-interface of DUT2; +| | ... | on DUT2 configure L2 cross-connect (L2XC) with one interface to TG +| | ... | and one Dot1ad sub-interface towards DUT1 with VLAN tag rewrite pop-1 +| | ... | tagegd with Dot1ad tags from one of its interfaces to another one +| | ... | method. [Ver] Make TG send ICMPv6 Echo Req via DUT1 and DUT2; verify +| | ... | that packet is not received. [Ref] IEEE 802.1ad +| | [Tags] | SKIP_PATCH +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created +| | ... | ${dut1_node} | ${dut1_to_tg} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1} +| | ... | type_subif=two_tags dot1ad +| | ${vlan2_name} | ${vlan2_index}= | And Tagged Subinterface Created +| | ... | ${dut2_node} | ${dut2_to_dut1} | ${subid} +| | ... | outer_vlan_id=${outer_vlan_id2} | inner_vlan_id=${inner_vlan_id2} +| | ... | type_subif=two_tags dot1ad +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node} +| | ... | ${vlan1_index} | translate-2-2 | push_dot1q=${False} +| | ... | tag1_id=${outer_vlan_wrong} | tag2_id=${inner_vlan_wrong} +| | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node} +| | ... | ${vlan2_index} | pop-2 +| | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect +| | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index} +| | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index} +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1} +| | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad +| | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1} diff --git a/tests/func/vrf/vrf_tests.robot b/tests/func/vrf/vrf_tests.robot new file mode 100644 index 0000000000..239900c1eb --- /dev/null +++ b/tests/func/vrf/vrf_tests.robot @@ -0,0 +1,392 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/ipv4.robot +| Resource | resources/libraries/robot/ipv6.robot +| Resource | resources/libraries/robot/interfaces.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/traffic.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Library | resources.libraries.python.IPUtil +| Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Show Packet Trace on All DUTs | ${nodes} +| Documentation | *Vpn routed forwarding - baseline* +| ... | *[Top] Network Topologies:* TG=DUT1=DUT2=TG 3-node topology with two +| ... | links in between nodes. +| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of +| ... | IPv4. +| ... | *[Cfg] DUT configuration:*Each DUT is configured with two VRF tables; +| ... | Separation of traffic is tested by IP packets; Basic ARP and ROUTES are +| ... | set on DUT nodes; IP addresses are set on DUT interfaces. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets +| ... | are sent by TG on link to DUT1, DUT2 or back to TG; On receipt TG +| ... | verifies packets for correctness and their IPv4 src-addr, dst-addr, +| ... | and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* + +*** Variables *** +| ${fib_table_1}= | 9 +| ${fib_table_2}= | 99 + +| ${dut1_to_tg_ip1}= | 10.0.0.3 +| ${dut1_to_tg_ip2}= | 10.0.0.4 +| ${dut2_to_tg_ip1}= | 30.0.0.3 +| ${dut2_to_tg_ip2}= | 30.0.0.4 + +| ${dut1_to_dut2_ip1}= | 20.0.0.1 +| ${dut1_to_dut2_ip2}= | 20.0.0.2 +| ${dut2_to_dut1_ip1}= | 20.0.0.3 +| ${dut2_to_dut1_ip2}= | 20.0.0.4 + +| ${tg_dut1_ip1}= | 10.0.0.1 +| ${tg_dut1_ip2}= | 10.0.0.2 +| ${tg_dut2_ip1}= | 30.0.0.1 +| ${tg_dut2_ip2}= | 30.0.0.2 + +| ${ip_prefix}= | 24 + +*** Test Cases *** +| TC01: TG packets routed to DUT ingress interface, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT1->TG-if1 and from +| | ... | TG->DUT1-if2 to DUT1->TG-if2 and checked if arrived. +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Node replies to ICMP echo request | ${tg_node} +| | ... | ${tg_to_dut1_if1} | ${dut1_to_tg_if1_mac} +| | ... | ${tg_to_dut1_if1_mac} | ${dut1_to_tg_ip1} | ${tg_dut1_ip1} | 5 +| | And Node replies to ICMP echo request | ${tg_node} +| | ... | ${tg_to_dut1_if2} | ${dut1_to_tg_if2_mac} +| | ... | ${tg_to_dut1_if2_mac} | ${dut1_to_tg_ip2} | ${tg_dut1_ip2} | 5 + +| TC02: TG packets routed to DUT egress interface, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT1->DUT2-if1 and from +| | ... | TG->DUT1-if2 to DUT1->DUT2-if2 and checked if arrived. +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut1_to_dut2_ip1} | ${tg_dut1_ip1} | 5 +| | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut1_if2} +| | ... | ${dut1_to_tg_if2_mac} | ${tg_to_dut1_if2_mac} +| | ... | ${dut1_to_dut2_ip2} | ${tg_dut1_ip2} | 5 + +| TC03: TG packets routed to DUT2 ingress interface through DUT1, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT2->DUT1-if1 and from +| | ... | TG->DUT1-if2 to DUT2->DUT1-if2 and checked if arrived. +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut2_to_dut1_ip1} | ${tg_dut1_ip1} | 5 +| | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut1_if2} +| | ... | ${dut1_to_tg_if2_mac} | ${tg_to_dut1_if2_mac} +| | ... | ${dut2_to_dut1_ip2} | ${tg_dut1_ip2} | 5 + +| TC04: TG packets routed to DUT2 egress interface through DUT1, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT2->TG-if1 and from +| | ... | TG->DUT1-if2 to DUT2->TG-if2 and checked if arrived. +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut2_to_tg_ip1} | ${tg_dut1_ip1} | 5 +| | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut1_if2} +| | ... | ${dut1_to_tg_if2_mac} | ${tg_to_dut1_if2_mac} +| | ... | ${dut2_to_tg_ip2} | ${tg_dut1_ip2} | 5 + +| TC05: TG packets routed to TG through DUT1 and DUT2, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to TG->DUT2-if1 and from +| | ... | TG->DUT1-if2 to TG->DUT2-if2 and checked if arrived. +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Send Packet And Check Headers | ${tg_node} | ${tg_dut1_ip1} +| | ... | ${tg_dut2_ip1} | ${tg_to_dut1_if1} | ${tg_to_dut1_if1_mac} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut2_if1} | ${dut2_to_tg_if1_mac} +| | ... | ${tg_to_dut2_if1_mac} +| | And Send Packet And Check Headers | ${tg_node} +| | ... | ${tg_dut1_ip2} | ${tg_dut2_ip2} | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut1_if2_mac} | ${dut1_to_tg_if2_mac} | ${tg_to_dut2_if2} +| | ... | ${dut2_to_tg_if2_mac} | ${tg_to_dut2_if2_mac} + +| TC06: TG packets not routed to DUT ingress interface in different VRF, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT1->TG-if2 where it +| | ... | should not arrive. +| | [Tags] | SKIP_PATCH +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Node replies to ICMP echo request +| | ... | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut1_to_tg_ip2} | ${tg_dut1_ip1} | 5 + +| TC07: TG packets not routed to DUT egress interface in different VRF, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT1->DUT2-if2 where it +| | ... | should not arrive. +| | [Tags] | SKIP_PATCH +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Node replies to ICMP echo request +| | ... | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut1_to_dut2_ip2} | ${tg_dut1_ip1} | 5 + +| TC08: TG packets not routed to DUT2 ingress interface in different VRF through DUT1, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT2->DUT1-if2 where it +| | ... | should not arrive. +| | [Tags] | SKIP_PATCH +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Node replies to ICMP echo request +| | ... | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut2_to_dut1_ip2} | ${tg_dut1_ip1} | 5 + +| TC09: TG packets not routed to DUT2 egress interface in different VRF through DUT1, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to DUT2->TG-if2 where it +| | ... | should not arrive. +| | [Tags] | SKIP_PATCH +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Node replies to ICMP echo request +| | ... | ${tg_node} | ${tg_to_dut1_if1} +| | ... | ${dut1_to_tg_if1_mac} | ${tg_to_dut1_if1_mac} +| | ... | ${dut2_to_tg_ip2} | ${tg_dut1_ip1} | 5 + +| TC10: TG packets not routed to TG in different VRF through DUT1 and DUT2, VPP configured with two VRFs +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG. +| | ... | [Enc] Eth-IPv4-ICMPv4. +| | ... | [Cfg] DUT1 and DUT2 are both configured with two fib tables. Each +| | ... | table is assigned to 2 interfaces to separate the traffic. Interfaces +| | ... | are configured with IP addresses from *Variables*. On every ingress +| | ... | and egress port on DUT is configured ARP and each DUT is configured +| | ... | with one route. +| | ... | [Ver] Packet is send from TG->DUT1-if1 to TG->DUT2-if2 where it +| | ... | should not arrive. +| | [Tags] | SKIP_PATCH +| | Given Path for Double-Link 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in Double-Link 3-node path are UP +| | When Setup Env - 2xVRF Each Node +| | Then Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send Packet And Check Headers | ${tg_node} | ${tg_dut1_ip1} +| | ... | ${tg_dut2_ip2} | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut1_if1_mac} | ${dut1_to_tg_if1_mac} | ${tg_to_dut2_if2} +| | ... | ${dut2_to_tg_if2_mac} | ${tg_to_dut2_if2_mac} + +*** Keywords *** +| Setup Env - 2xVRF Each Node +| | [Documentation] +| | ... | Environment is set up with 2 fib tables on each DUT. DUT1-TG-IF1 and \ +| | ... | DUT1-DUT2-IF1 are assigned to FIB1, and DUT1-TG-IF2 and DUT1-DUT2-IF2 +| | ... | are assigned to FIB2 (the some done on DUT2, just opposite). IP +| | ... | addresses are subsequently set on interfaces, and ARP is set for +| | ... | neighbors. The last setting is route for each fib table. +| | ... +| | ${dut1_if1_idx}= | Get Interface SW Index +| | ... | ${dut1_node} | ${dut1_to_dut2_if1} +| | ${dut1_if2_idx}= | Get Interface SW Index +| | ... | ${dut1_node} | ${dut1_to_dut2_if2} +| | ${dut2_if1_idx}= | Get Interface SW Index +| | ... | ${dut2_node} | ${dut2_to_dut1_if1} +| | ${dut2_if2_idx}= | Get Interface SW Index +| | ... | ${dut2_node} | ${dut2_to_dut1_if2} +| | And Add fib table | ${dut1_node} +| | ... | ${tg_dut2_ip1} | ${ip_prefix} | ${fib_table_1} +| | ... | via ${dut2_to_dut1_ip1} sw_if_index ${dut1_if1_idx} multipath +| | And Add fib table | ${dut1_node} +| | ... | ${tg_dut2_ip2} | ${ip_prefix} | ${fib_table_2} +| | ... | via ${dut1_to_dut2_ip2} sw_if_index ${dut1_if2_idx} multipath +| | And Add fib table | ${dut2_node} +| | ... | ${tg_dut1_ip1} | ${ip_prefix} | ${fib_table_1} +| | ... | via ${dut2_to_dut1_ip1} sw_if_index ${dut2_if1_idx} multipath +| | And Add fib table | ${dut2_node} +| | ... | ${tg_dut1_ip2} | ${ip_prefix} | ${fib_table_2} +| | ... | via ${dut2_to_dut1_ip2} sw_if_index ${dut2_if2_idx} multipath + +| | Assign Interface To Fib Table +| | ... | ${dut1_node} | ${dut1_to_dut2_if1} | ${fib_table_1} +| | Assign Interface To Fib Table +| | ... | ${dut1_node} | ${dut1_to_dut2_if2} | ${fib_table_2} +| | Assign Interface To Fib Table +| | ... | ${dut1_node} | ${dut1_to_tg_if1} | ${fib_table_1} +| | Assign Interface To Fib Table +| | ... | ${dut1_node} | ${dut1_to_tg_if2} | ${fib_table_2} + +| | Assign Interface To Fib Table +| | ... | ${dut2_node} | ${dut2_to_dut1_if1} | ${fib_table_1} +| | Assign Interface To Fib Table +| | ... | ${dut2_node} | ${dut2_to_dut1_if2} | ${fib_table_2} +| | Assign Interface To Fib Table +| | ... | ${dut2_node} | ${dut2_to_tg_if1} | ${fib_table_1} +| | Assign Interface To Fib Table +| | ... | ${dut2_node} | ${dut2_to_tg_if2} | ${fib_table_2} + +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_tg_if1} | ${dut1_to_tg_ip1} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_tg_if2} | ${dut1_to_tg_ip2} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_dut2_if1} +| | ... | ${dut1_to_dut2_ip1} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut1_node} | ${dut1_to_dut2_if2} +| | ... | ${dut1_to_dut2_ip2} | ${ip_prefix} + +| | And Set Interface Address +| | ... | ${dut2_node} | ${dut2_to_tg_if1} | ${dut2_to_tg_ip1} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut2_node} | ${dut2_to_tg_if2} | ${dut2_to_tg_ip2} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut2_node} | ${dut2_to_dut1_if1} +| | ... | ${dut2_to_dut1_ip1} | ${ip_prefix} +| | And Set Interface Address +| | ... | ${dut2_node} | ${dut2_to_dut1_if2} +| | ... | ${dut2_to_dut1_ip2} | ${ip_prefix} + +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg_if1} +| | ... | ${tg_dut1_ip1} | ${tg_to_dut1_if1_mac} | vrf=${fib_table_1} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2_if1} +| | ... | ${dut2_to_dut1_ip1} | ${dut2_to_dut1_if1_mac} | vrf=${fib_table_1} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg_if1} +| | ... | ${tg_dut2_ip1} | ${tg_to_dut2_if1_mac} | vrf=${fib_table_1} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1_if1} +| | ... | ${dut1_to_dut2_ip1} | ${dut1_to_dut2_if1_mac} | vrf=${fib_table_1} + +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg_if2} +| | ... | ${tg_dut1_ip2} | ${tg_to_dut1_if2_mac} | vrf=${fib_table_2} +| | And Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2_if2} +| | ... | ${dut2_to_dut1_ip2} | ${dut2_to_dut1_if2_mac} | vrf=${fib_table_2} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg_if2} +| | ... | ${tg_dut2_ip2} | ${tg_to_dut2_if2_mac} | vrf=${fib_table_2} +| | And Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1_if2} +| | ... | ${dut1_to_dut2_ip2} | ${dut1_to_dut2_if2_mac} | vrf=${fib_table_2} + +| | And Vpp Route Add | ${dut1_node} | ${tg_dut2_ip1} | ${ip_prefix} +| | ... | ${dut2_to_dut1_ip1} | ${dut1_to_dut2_if1} | vrf=${fib_table_1} +| | And Vpp Route Add | ${dut2_node} | ${tg_dut1_ip1} | ${ip_prefix} +| | ... | ${dut1_to_dut2_ip1} | ${dut2_to_dut1_if1} | vrf=${fib_table_1} + +| | And Vpp Route Add | ${dut1_node} | ${tg_dut2_ip2} | ${ip_prefix} +| | ... | ${dut2_to_dut1_ip2} | ${dut1_to_dut2_if2} | vrf=${fib_table_2} +| | And Vpp Route Add | ${dut2_node} | ${tg_dut1_ip2} | ${ip_prefix} +| | ... | ${dut1_to_dut2_ip2} | ${dut2_to_dut1_if2} | vrf=${fib_table_2} diff --git a/tests/func/vxlan/vxlan_bd_dot1q.robot b/tests/func/vxlan/vxlan_bd_dot1q.robot new file mode 100644 index 0000000000..425017ea67 --- /dev/null +++ b/tests/func/vxlan/vxlan_bd_dot1q.robot @@ -0,0 +1,73 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/vxlan.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | HW_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *RFC7348 VXLAN: Bridge-domain with VXLAN over VLAN test cases* +| ... +| ... | *[Top] Network topologies:* TG-DUT1-DUT2-TG 3-node circular topology with +| ... | single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-VXLAN-Eth-IPv4-ICMPv4 on +| ... | DUT1-DUT2, Eth-dot1q-IPv4-ICMPv4 on TG-DUTn for L2 switching of IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | bridge-domain (L2BD) switching combined with static MACs, MAC learning +| ... | enabled and Split Horizon Groups (SHG) depending on test case; VXLAN +| ... | tunnels are configured between L2BDs on DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are +| ... | sent in both directions by TG on links to DUT1 and DUT2; on receive TG +| ... | verifies packets for correctness and their IPv4 src-addr, dst-addr and +| ... | MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7348. + +*** Variables *** +| ${VNI}= | 23 +| ${BID}= | 23 +| ${VLAN}= | 10 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2BD and VXLANoIPv4oVLAN tunnels switch ICMPv4 between TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1q-IPv4-VXLAN-Eth-IPv4-ICMPv4 on\ +| | ... | DUT1-DUT2; Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure L2 bridge-domain (MAC learning enabled), each with one +| | ... | interface to TG and one VXLAN tunnel interface towards the other DUT +| | ... | over VLAN sub-interface. [Ver] Make TG send ICMPv4 Echo Req between +| | ... | two of its interfaces, verify all packets are received. [Ref] RFC7348. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Vlan interfaces for VXLAN are created | ${VLAN} +| | ... | ${dut1_node} | ${dut1_to_dut2} +| | ... | ${dut2_node} | ${dut2_to_dut1} +| | And IP addresses are set on interfaces +| | ... | ${dut1_node} | ${dut1s_vlan_name} | ${dut1s_vlan_index} +| | ... | ${dut2_node} | ${dut2s_vlan_name} | ${dut2s_vlan_index} +| | ${dut1s_vxlan}= | When Create VXLAN interface | ${dut1_node} | ${VNI} +| | | ... | ${dut1s_ip_address} | ${dut2s_ip_address} +| | And Interfaces are added to BD | ${dut1_node} | ${BID} +| | ... | ${dut1_to_tg} | ${dut1s_vxlan} +| | ${dut2s_vxlan}= | And Create VXLAN interface | ${dut2_node} | ${VNI} +| | | ... | ${dut2s_ip_address} | ${dut1s_ip_address} +| | And Interfaces are added to BD | ${dut2_node} | ${BID} +| | ... | ${dut2_to_tg} | ${dut2s_vxlan} +| | Then Send and receive ICMPv4 bidirectionally +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} diff --git a/tests/func/vxlan/vxlan_bd_untagged.robot b/tests/func/vxlan/vxlan_bd_untagged.robot new file mode 100644 index 0000000000..f579f11d57 --- /dev/null +++ b/tests/func/vxlan/vxlan_bd_untagged.robot @@ -0,0 +1,408 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/vxlan.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | HW_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *RFC7348 VXLAN: Bridge-domain with VXLAN test cases* +| ... +| ... | *[Top] Network topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes; TG=DUT1=DUT2=TG 3-node circular +| ... | topology with double parallel links. +| ... | *[Enc] Packet encapsulations:* Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on +| ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn for L2 switching of IPv4; +| ... | Eth-IPv6-VXLAN-Eth-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on +| ... | TG-DUTn for L2 switching of IPv6. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | bridge-domain (L2BD) switching combined with static MACs, MAC learning +| ... | enabled and Split Horizon Groups (SHG) depending on test case; VXLAN +| ... | tunnels are configured between L2BDs on DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets +| ... | are sent in both directions by TG on links to DUT1 and DUT2; on receive +| ... | TG verifies packets for correctness and their IPv4 (IPv6) src-addr, +| ... | dst-addr and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7348. + +*** Variables *** +| ${vni_1}= | 23 +| ${vni_2}= | 35 + +| ${bd_id1}= | 10 +| ${bd_id2}= | 20 +| ${bd_id3}= | 30 +| ${shg1}= | 1 +| ${shg2}= | 2 + +| ${ip4_addr1}= | 172.16.0.1 +| ${ip4_addr2}= | 172.16.0.2 +| ${ip4_prefix}= | 24 + +| ${ip6_addr1}= | 3ffe:64::1 +| ${ip6_addr2}= | 3ffe:64::2 +| ${ip6_prefix}= | 64 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2BD and VXLANoIPv4 tunnels switch ICMPv4 between TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2; Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure two i/fs into L2BD with MAC learning. [Ver] Make TG +| | ... | verify ICMPv4 Echo Req pkts are switched thru DUT1 and DUT2 in +| | ... | both directions and are correct on receive. [Ref] RFC7348. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_dut2_name}= | Get interface name | ${dut1_node} | ${dut1_to_dut2} +| | ${dut2_to_dut1_name}= | Get interface name | ${dut2_node} | ${dut2_to_dut1} +| | And IP addresses are set on interfaces | ${dut1_node} | ${dut1_to_dut2_name} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1_name} | ${NONE} +| | ${dut1s_vxlan}= | When Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${dut1s_ip_address} | ${dut2s_ip_address} +| | And Interfaces are added to BD | ${dut1_node} | ${bd_id1} +| | ... | ${dut1_to_tg} | ${dut1s_vxlan} +| | ${dut2s_vxlan}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${dut2s_ip_address} | ${dut1s_ip_address} +| | And Interfaces are added to BD | ${dut2_node} | ${bd_id1} +| | ... | ${dut2_to_tg} | ${dut2s_vxlan} +| | Then Send and receive ICMPv4 bidirectionally +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} + +| TC02: DUT1 and DUT2 with L2BD and VXLANoIPv4 tunnels in SHG switch ICMPv4 between TG links +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG. [Enc] Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2; Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 configure L2 +| | ... | bridge-domain (MAC learning enabled) with two untagged interfaces +| | ... | to TG and two VXLAN interfaces towards the DUT2 and put both VXLAN +| | ... | interfaces into the same Split-Horizon-Group (SHG). On DUT2 configure +| | ... | two L2 bridge-domain (MAC learning enabled), each with one untagged +| | ... | interface to TG and one VXLAN interface towards the DUT1. [Ver] Make +| | ... | TG send ICMPv4 Echo Reqs between all four of its interfaces to be +| | ... | switched by DUT1 and DUT2; verify packets are not switched between +| | ... | TG interfaces connected to DUT2 that are isolated by SHG on DUT1. +| | ... | [Ref] RFC7348. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']} +| | ... | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} +| | And Interfaces in 3-node BD-SHG testing are up +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip4_addr1} +| | ... | ${ip4_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip4_addr2} +| | ... | ${ip4_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip4_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip4_addr1} +| | ${dut1s_vxlan1}= | When Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip4_addr1} | ${ip4_addr2} +| | ${dut1s_vxlan2}= | And Create VXLAN interface | ${dut1_node} | ${vni_2} +| | | ... | ${ip4_addr1} | ${ip4_addr2} +| | ${dut2s_vxlan1}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip4_addr2} | ${ip4_addr1} +| | ${dut2s_vxlan2}= | And Create VXLAN interface | ${dut2_node} | ${vni_2} +| | | ... | ${ip4_addr2} | ${ip4_addr1} +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan1} | up +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan2} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan1} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan2} | up +| | And Vpp Node Interfaces Ready Wait | ${dut1_node} +| | And Vpp Node Interfaces Ready Wait | ${dut2_node} +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan2} +| | ... | ${bd_id1} | ${shg1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan1} +| | ... | ${bd_id2} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2} +| | ... | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan2} +| | ... | ${bd_id3} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if2} +| | And Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMPv4 bidirectionally +| | | ... | ${tg_node} | ${tg_to_dut2_if1} +| | | ... | ${tg_to_dut2_if2} + +| TC03: DUT1 and DUT2 with L2BD and VXLANoIPv4 tunnels in different SHGs switch ICMPv4 between TG links +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG.[Enc] Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on \ +| | ... | DUT1-DUT2; Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 configure L2 +| | ... | bridge-domain (MAC learning enabled) with two untagged interfaces +| | ... | to TG and two VXLAN interfaces towards the DUT2 and put both VXLAN +| | ... | interfaces into the different Split-Horizon-Group (SHGs). On DUT2 +| | ... | configure two L2 bridge-domain (MAC learning enabled), each with one +| | ... | untagged interface to TG and one VXLAN interface towards the DUT1. +| | ... | [Ver] Make TG send ICMPv4 Echo Req between all four of its interfaces +| | ... | to be switched by DUT1 and DUT2; verify packets are switched between +| | ... | all TG interfaces. [Ref] RFC7348. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']} +| | ... | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} +| | And Interfaces in 3-node BD-SHG testing are up +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip4_addr1} +| | ... | ${ip4_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip4_addr2} +| | ... | ${ip4_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip4_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip4_addr1} +| | ${dut1s_vxlan1}= | When Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip4_addr1} | ${ip4_addr2} +| | ${dut1s_vxlan2}= | And Create VXLAN interface | ${dut1_node} | ${vni_2} +| | | ... | ${ip4_addr1} | ${ip4_addr2} +| | ${dut2s_vxlan1}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip4_addr2} | ${ip4_addr1} +| | ${dut2s_vxlan2}= | And Create VXLAN interface | ${dut2_node} | ${vni_2} +| | | ... | ${ip4_addr2} | ${ip4_addr1} +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan1} | up +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan2} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan1} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan2} | up +| | And Vpp Node Interfaces Ready Wait | ${dut1_node} +| | And Vpp Node Interfaces Ready Wait | ${dut2_node} +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan2} +| | ... | ${bd_id1} | ${shg2} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan1} +| | ... | ${bd_id2} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2} +| | ... | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan2} +| | ... | ${bd_id3} +| | Then Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv4 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut2_if1} +| | ... | ${tg_to_dut2_if2} + +| TC04: DUT1 and DUT2 with L2BD and VXLANoIPv6 tunnels switch ICMPv6 between TG links +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG.[Enc] Eth-IPv6-VXLAN-Eth-IPv6-ICMPv6 on \ +| | ... | DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 and DUT2 +| | ... | configure L2 bridge-domain (MAC learning enabled), each with one +| | ... | interface to TG and one VXLAN tunnel interface towards the other +| | ... | DUT. [Ver] Make TG send ICMPv6 Echo Req between two of its +| | ... | interfaces to be switched by DUT1 and DUT2; verify all packets +| | ... | are received. [Ref] RFC7348. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr1} +| | ... | ${ip6_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr2} +| | ... | ${ip6_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr1} +| | ${dut1s_vxlan}= | When Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip6_addr1} | ${ip6_addr2} +| | And Interfaces are added to BD | ${dut1_node} | ${bd_id1} +| | ... | ${dut1_to_tg} | ${dut1s_vxlan} +| | ${dut2s_vxlan}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip6_addr2} | ${ip6_addr1} +| | And Interfaces are added to BD | ${dut2_node} | ${bd_id1} +| | ... | ${dut2_to_tg} | ${dut2s_vxlan} +| | Then Send and receive ICMPv6 bidirectionally +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} + +| TC05: DUT1 and DUT2 with L2BD and VXLANoIPv6 tunnels in SHG switch ICMPv6 between TG links +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG. [Enc] Eth-IPv6-VXLAN-Eth-IPv6-ICMPv6 on \ +| | ... | DUT1-DUT2; Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 configure L2 +| | ... | bridge-domain (MAC learning enabled) with two untagged interfaces +| | ... | to TG and two VXLAN interfaces towards the DUT2 and put both VXLAN +| | ... | interfaces into the same Split-Horizon-Group (SHG). On DUT2 configure +| | ... | two L2 bridge-domain (MAC learning enabled), each with one untagged +| | ... | interface to TG and one VXLAN interface towards the DUT1. [Ver] Make +| | ... | TG send ICMPv6 Echo Reqs between all four of its interfaces to be +| | ... | switched by DUT1 and DUT2; verify packets are not switched between +| | ... | TG interfaces connected to DUT2 that are isolated by SHG on DUT1. +| | ... | [Ref] RFC7348. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']} +| | ... | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} +| | And Interfaces in 3-node BD-SHG testing are up +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr1} +| | ... | ${ip6_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr2} +| | ... | ${ip6_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr1} +| | ${dut1s_vxlan1}= | When Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip6_addr1} | ${ip6_addr2} +| | ${dut1s_vxlan2}= | And Create VXLAN interface | ${dut1_node} | ${vni_2} +| | | ... | ${ip6_addr1} | ${ip6_addr2} +| | ${dut2s_vxlan1}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip6_addr2} | ${ip6_addr1} +| | ${dut2s_vxlan2}= | And Create VXLAN interface | ${dut2_node} | ${vni_2} +| | | ... | ${ip6_addr2} | ${ip6_addr1} +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan1} | up +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan2} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan1} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan2} | up +| | And Vpp Node Interfaces Ready Wait | ${dut1_node} +| | And Vpp Node Interfaces Ready Wait | ${dut2_node} +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan2} +| | ... | ${bd_id1} | ${shg1} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan1} +| | ... | ${bd_id2} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2} +| | ... | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan2} +| | ... | ${bd_id3} +| | Then Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if2} +| | And Run Keyword And Expect Error | ICMP echo Rx timeout +| | ... | Send and receive ICMPv6 bidirectionally +| | | ... | ${tg_node} | ${tg_to_dut2_if1} +| | | ... | ${tg_to_dut2_if2} + +| TC06: DUT1 and DUT2 with L2BD and VXLANoIPv6 tunnels in different SHGs switch ICMPv6 between TG links +| | [Documentation] +| | ... | [Top] TG=DUT1=DUT2=TG.[Enc] Eth-IPv6-VXLAN-Eth-IPv6-ICMPv6 on \ +| | ... | DUT1-DUT2; Eth-IPv6-ICMPv6 on TG-DUTn. [Cfg] On DUT1 configure L2 +| | ... | bridge-domain (MAC learning enabled) with two untagged interfaces +| | ... | to TG and two VXLAN interfaces towards the DUT2 and put both VXLAN +| | ... | interfaces into the different Split-Horizon-Group (SHGs). On DUT2 +| | ... | configure two L2 bridge-domain (MAC learning enabled), each with one +| | ... | untagged interface to TG and one VXLAN interface towards the DUT1. +| | ... | [Ver] Make TG send ICMPv6 Echo Req between all four of its interfaces +| | ... | to be switched by DUT1 and DUT2; verify packets are switched between +| | ... | all TG interfaces. [Ref] RFC7348. +| | [Tags] | 3_NODE_DOUBLE_LINK_TOPO +| | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']} +| | ... | ${nodes['DUT1']} +| | ... | ${nodes['DUT2']} +| | And Interfaces in 3-node BD-SHG testing are up +| | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr1} +| | ... | ${ip6_prefix} +| | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr2} +| | ... | ${ip6_prefix} +| | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${ip6_addr2} +| | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${ip6_addr1} +| | ${dut1s_vxlan1}= | When Create VXLAN interface | ${dut1_node} | ${vni_1} +| | | ... | ${ip6_addr1} | ${ip6_addr2} +| | ${dut1s_vxlan2}= | And Create VXLAN interface | ${dut1_node} | ${vni_2} +| | | ... | ${ip6_addr1} | ${ip6_addr2} +| | ${dut2s_vxlan1}= | And Create VXLAN interface | ${dut2_node} | ${vni_1} +| | | ... | ${ip6_addr2} | ${ip6_addr1} +| | ${dut2s_vxlan2}= | And Create VXLAN interface | ${dut2_node} | ${vni_2} +| | | ... | ${ip6_addr2} | ${ip6_addr1} +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan1} | up +| | And Set Interface State | ${dut1_node} | ${dut1s_vxlan2} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan1} | up +| | And Set Interface State | ${dut2_node} | ${dut2s_vxlan2} | up +| | And Vpp Node Interfaces Ready Wait | ${dut1_node} +| | And Vpp Node Interfaces Ready Wait | ${dut2_node} +| | And Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2} +| | ... | ${bd_id1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan1} +| | ... | ${bd_id1} | ${shg1} +| | And Interface is added to bridge domain | ${dut1_node} | ${dut1s_vxlan2} +| | ... | ${bd_id1} | ${shg2} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1} +| | ... | ${bd_id2} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan1} +| | ... | ${bd_id2} +| | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2} +| | ... | ${bd_id3} +| | And Interface is added to bridge domain | ${dut2_node} | ${dut2s_vxlan2} +| | ... | ${bd_id3} +| | Then Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if1} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if1} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut1_if2} +| | ... | ${tg_to_dut2_if2} +| | And Send and receive ICMPv6 bidirectionally | ${tg_node} +| | ... | ${tg_to_dut2_if1} +| | ... | ${tg_to_dut2_if2} diff --git a/tests/func/vxlan/vxlan_xconnect_untagged.robot b/tests/func/vxlan/vxlan_xconnect_untagged.robot new file mode 100644 index 0000000000..32e8c9f478 --- /dev/null +++ b/tests/func/vxlan/vxlan_xconnect_untagged.robot @@ -0,0 +1,68 @@ +# Copyright (c) 2016 Cisco and/or its affiliates. +# 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. + +*** Settings *** +| Resource | resources/libraries/robot/default.robot +| Resource | resources/libraries/robot/testing_path.robot +| Resource | resources/libraries/robot/vxlan.robot +| Resource | resources/libraries/robot/l2_traffic.robot +| Library | resources.libraries.python.Trace +| Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | HW_ENV +| Test Setup | Run Keywords | Setup all DUTs before test +| ... | AND | Setup all TGs before traffic script +| Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes} +| ... | AND | Show vpp trace dump on all DUTs +| Documentation | *RFC7348 VXLAN: L2 cross-connect with VXLAN test cases* +| ... +| ... | *[Top] Network topologies:* TG-DUT1-DUT2-TG 3-node circular topology +| ... | with single links between nodes. +| ... | *[Enc] Packet encapsulations:* Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on +| ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn for L2 switching of IPv4. +| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2 +| ... | cross-connect (L2XC) switching; VXLAN tunnels are configured between +| ... | L2XCs on DUT1 and DUT2. +| ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets +| ... | are sent in both directions by TG on links to DUT1 and DUT2; on receive +| ... | TG verifies packets for correctness and their IPv4 src-addr, dst-addr +| ... | and MAC addresses. +| ... | *[Ref] Applicable standard specifications:* RFC7348. + +*** Variables *** +| ${VNI}= | 24 + +*** Test Cases *** +| TC01: DUT1 and DUT2 with L2XC and VXLANoIPv4 tunnels switch ICMPv4 between TG links +| | [Documentation] +| | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-VXLAN-Eth-IPv4-ICMPv4 on \ +| | ... | [Ref] RFC7348.DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On +| | ... | DUT1 and DUT2 configure L2 cross-connect (L2XC), each with one +| | ... | interface to TG and one VXLAN tunnel interface towards the other +| | ... | DUT. [Ver] Make TG send ICMPv4 Echo Req between two of its +| | ... | interfaces; verify all packets are received. [Ref] RFC7348. +| | Given Path for 3-node testing is set +| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']} +| | And Interfaces in 3-node path are up +| | ${dut1_to_dut2_name}= | Get interface name | ${dut1_node} | ${dut1_to_dut2} +| | ${dut2_to_dut1_name}= | Get interface name | ${dut2_node} | ${dut2_to_dut1} +| | And IP addresses are set on interfaces | ${dut1_node} | ${dut1_to_dut2_name} | ${NONE} +| | ... | ${dut2_node} | ${dut2_to_dut1_name} | ${NONE} +| | ${dut1s_vxlan}= | When Create VXLAN interface | ${dut1_node} | ${VNI} +| | | ... | ${dut1s_ip_address} | ${dut2s_ip_address} +| | And Interfaces are added to xconnect | ${dut1_node} +| | ... | ${dut1_to_tg} | ${dut1s_vxlan} +| | ${dut2s_vxlan}= | And Create VXLAN interface | ${dut2_node} | ${VNI} +| | | ... | ${dut2s_ip_address} | ${dut1s_ip_address} +| | And Interfaces are added to xconnect | ${dut2_node} +| | ... | ${dut2_to_tg} | ${dut2s_vxlan} +| | Then Send and receive ICMPv4 bidirectionally +| | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} |