From 53d69321e41aa6fd94abc16c7050314dc2e53f08 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Thu, 8 Jun 2017 14:45:26 +0200 Subject: CSIT-664: Refactor setups and teardowns - Add suite setup for performance IPSec tests - Add test teardown for performance SNAT tests - Add setups and teardowns for functional tests - Clean up the code Change-Id: Ia456e9f3ff0f0f2bb9a03f692f27c7f9a2817621 Signed-off-by: Tibor Frank --- tests/func/tap/api-crud-tap-func.robot | 19 +++--- .../eth2p-eth-l2bdbasemaclrn-eth-2tap-func.robot | 23 +++---- ...2p-eth-l2bdbasemaclrn-l2shg-eth-2tap-func.robot | 74 ++++++++++++---------- .../tap/eth2p-ethip4-ip4base-eth-1tap-func.robot | 43 +++++++------ 4 files changed, 86 insertions(+), 73 deletions(-) (limited to 'tests/func/tap') diff --git a/tests/func/tap/api-crud-tap-func.robot b/tests/func/tap/api-crud-tap-func.robot index 99014a9583..c1a830937c 100644 --- a/tests/func/tap/api-crud-tap-func.robot +++ b/tests/func/tap/api-crud-tap-func.robot @@ -23,11 +23,13 @@ | 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 | Set up functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} -| Test Teardown | Run Keywords | Tear down functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} +| ... +| Test Setup | Set up TAP functional test +| ... +| Test Teardown | Tear down TAP functional test +| ... | Documentation | *Tap Interface CRUD Tests* | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links | ... | between nodes. @@ -47,10 +49,11 @@ | | ... | [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 Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} +| | ... | [Ver] Verify that TAP interface can be modified, deleted, and no\ +| | ... | other TAP interface is affected. +| | ... +| | Given Configure path in 2-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['TG']} | | And Set interfaces in 2-node circular topology up | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} diff --git a/tests/func/tap/eth2p-eth-l2bdbasemaclrn-eth-2tap-func.robot b/tests/func/tap/eth2p-eth-l2bdbasemaclrn-eth-2tap-func.robot index f7d267f272..984b6e42ef 100644 --- a/tests/func/tap/eth2p-eth-l2bdbasemaclrn-eth-2tap-func.robot +++ b/tests/func/tap/eth2p-eth-l2bdbasemaclrn-eth-2tap-func.robot @@ -23,12 +23,13 @@ | 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 | Set up functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} -| Test Teardown | Run Keywords | Tear down functional test -| ... | AND | Linux Del Bridge | ${nodes['DUT1']} | ${bid_TAP} -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} +| ... +| Test Setup | Set up TAP functional test +| ... +| Test Teardown | Tear down TAP functional test with Linux bridge | ${bid_TAP} +| ... | Documentation | *Tap Interface Traffic Tests* | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links | ... | between nodes. @@ -56,14 +57,14 @@ | | [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 +| | ... | [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 Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} +| | Given Configure path in 2-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['TG']} | | And Set interfaces in 2-node circular topology up | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} diff --git a/tests/func/tap/eth2p-eth-l2bdbasemaclrn-l2shg-eth-2tap-func.robot b/tests/func/tap/eth2p-eth-l2bdbasemaclrn-l2shg-eth-2tap-func.robot index 8b3d25d051..8cfd10ac25 100644 --- a/tests/func/tap/eth2p-eth-l2bdbasemaclrn-l2shg-eth-2tap-func.robot +++ b/tests/func/tap/eth2p-eth-l2bdbasemaclrn-l2shg-eth-2tap-func.robot @@ -23,11 +23,13 @@ | 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 | Set up functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} -| Test Teardown | Run Keywords | Tear down functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} +| ... +| Test Setup | Set up TAP functional test +| ... +| Test Teardown | Tear down TAP functional test +| ... | Documentation | *Tap Interface Traffic Tests* | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links | ... | between nodes. @@ -67,14 +69,14 @@ | | [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 +| | ... | [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 Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} +| | ... +| | Given Configure path in 2-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['TG']} | | And Set interfaces in 2-node circular topology up | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} @@ -101,32 +103,34 @@ | | And Create bridge domain | ${dut_node} | | ... | ${bd_id1} | learn=${TRUE} | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${bd_id1} +| | ... | ${bd_id1} | | And Add interface to bridge domain | ${dut_node} | ${int1} -| | ... | ${bd_id1} | ${shg1} +| | ... | ${bd_id1} | ${shg1} | | And Add interface to bridge domain | ${dut_node} | ${int2} -| | ... | ${bd_id1} | ${shg2} -| | Then Send ICMP echo request and verify answer | ${tg_node} | ${tg_to_dut_if1} -| | ... | ${tap1_NM_mac} | ${tg_to_dut_if1_mac} +| | ... | ${bd_id1} | ${shg2} +| | Then Send ICMP echo request and verify answer | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tap1_NM_mac} | ${tg_to_dut_if1_mac} | | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG} | | And Send ICMP echo request and verify answer | ${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} +| | 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} | TC02: 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 +| | ... | [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 Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} +| | ... +| | Given Configure path in 2-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['TG']} | | And Set interfaces in 2-node circular topology up | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2} @@ -153,18 +157,20 @@ | | And Create bridge domain | ${dut_node} | | ... | ${bd_id1} | learn=${TRUE} | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1} -| | ... | ${bd_id1} +| | ... | ${bd_id1} | | And Add interface to bridge domain | ${dut_node} | ${int1} -| | ... | ${bd_id1} | ${shg1} +| | ... | ${bd_id1} | ${shg1} | | And Add interface to bridge domain | ${dut_node} | ${int2} -| | ... | ${bd_id1} | ${shg1} -| | Then Send ICMP echo request and verify answer | ${tg_node} | ${tg_to_dut_if1} -| | ... | ${tap1_NM_mac} | ${tg_to_dut_if1_mac} +| | ... | ${bd_id1} | ${shg1} +| | Then Send ICMP echo request and verify answer | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${tap1_NM_mac} | ${tg_to_dut_if1_mac} | | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG} | | And Send ICMP echo request and verify answer | ${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} +| | 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} diff --git a/tests/func/tap/eth2p-ethip4-ip4base-eth-1tap-func.robot b/tests/func/tap/eth2p-ethip4-ip4base-eth-1tap-func.robot index 7b84a00028..9500debfbc 100644 --- a/tests/func/tap/eth2p-ethip4-ip4base-eth-1tap-func.robot +++ b/tests/func/tap/eth2p-ethip4-ip4base-eth-1tap-func.robot @@ -23,11 +23,13 @@ | 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 | Set up functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} -| Test Teardown | Run Keywords | Tear down functional test -| ... | AND | Clean Up Namespaces | ${nodes['DUT1']} +| ... +| Test Setup | Set up TAP functional test +| ... +| Test Teardown | Tear down TAP functional test +| ... | Documentation | *Tap Interface Traffic Tests* | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links | ... | between nodes. @@ -60,13 +62,13 @@ | | [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 +| | ... | [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 Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} +| | ... +| | Given Configure path in 2-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['TG']} | | And Set interfaces in 2-node circular topology up | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | | | And Set Interface Address @@ -83,21 +85,22 @@ | | ... | ${tg_ip_address} | ${tg_to_dut_if1_mac} | | And Add Arp On Dut | ${dut_node} | ${int1} | | ... | ${tap1_NM_ip} | ${tap1_NM_mac} -| | Then Send ICMP echo request and verify answer | ${tg_node} | ${tg_to_dut_if1} -| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} +| | Then Send ICMP echo request and verify answer | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} | | ... | ${tap1_NM_ip} | ${tg_ip_address} | TC02: 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 +| | ... | [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 Configure path in 2-node circular topology | ${nodes['TG']} | ${nodes['DUT1']} -| | ... | ${nodes['TG']} +| | ... +| | Given Configure path in 2-node circular topology | ${nodes['TG']} +| | ... | ${nodes['DUT1']} | ${nodes['TG']} | | And Set interfaces in 2-node circular topology up | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1} | | | And Set Interface Address @@ -118,6 +121,6 @@ | | ... | ${tap1_NM_ip} | ${tap1_NM_mac} | | And Add Route | ${dut_node} | | ... | ${tg_ip_address_GW} | ${prefix} | ${tap1_VPP_ip} | ${namespace1} -| | Then Send ICMP echo request and verify answer | ${tg_node} | ${tg_to_dut_if1} -| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} +| | Then Send ICMP echo request and verify answer | ${tg_node} +| | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} | | ... | ${tap1_NM_ip} | ${tg_ip_address} -- cgit 1.2.3-korg