diff options
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/TrafficScriptExecutor.py | 4 | ||||
-rw-r--r-- | resources/libraries/robot/crypto/ipsec.robot | 43 | ||||
-rw-r--r-- | resources/libraries/robot/l2/l2_traffic.robot | 79 | ||||
-rw-r--r-- | resources/libraries/robot/shared/traffic.robot | 53 |
4 files changed, 88 insertions, 91 deletions
diff --git a/resources/libraries/python/TrafficScriptExecutor.py b/resources/libraries/python/TrafficScriptExecutor.py index 7b5368fa9f..abd97e6fc6 100644 --- a/resources/libraries/python/TrafficScriptExecutor.py +++ b/resources/libraries/python/TrafficScriptExecutor.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Cisco and/or its affiliates. +# Copyright (c) 2019 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: @@ -68,6 +68,8 @@ class TrafficScriptExecutor(object): if ret_code != 0: if "RuntimeError: ICMP echo Rx timeout" in stderr: raise RuntimeError("ICMP echo Rx timeout") + elif "RuntimeError: IP packet Rx timeout" in stderr: + raise RuntimeError("IP packet Rx timeout") elif "RuntimeError: DHCP REQUEST Rx timeout" in stderr: raise RuntimeError("DHCP REQUEST Rx timeout") elif "RuntimeError: DHCP DISCOVER Rx timeout" in stderr: diff --git a/resources/libraries/robot/crypto/ipsec.robot b/resources/libraries/robot/crypto/ipsec.robot index f7d065ee4a..a37c18db77 100644 --- a/resources/libraries/robot/crypto/ipsec.robot +++ b/resources/libraries/robot/crypto/ipsec.robot @@ -49,17 +49,12 @@ | Configure path for IPSec test | | [Documentation] | Setup path for IPsec testing TG<-->DUT1. | | ... -| | ... | _NOTE:_ This KW sets following test case variable: -| | ... | - dut_lo - DUT loopback interface. Type: string -| | ... | | ... | *Example:* | | ... | \| Configure path for IPSec test \| | | ... -| | ${dut1_lo1}= | Vpp Create Loopback | ${dut1} | | Set Interface State | ${dut1} | ${dut1_if1} | up -| | Set Interface State | ${dut1} | ${dut1_lo1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up | | Vpp Node Interfaces Ready Wait | ${dut1} -| | Set Test Variable | ${dut1_lo1} | Configure topology for IPv4 IPsec testing | | [Documentation] | Setup topology for IPv4 IPsec testing. @@ -75,18 +70,20 @@ | | ... | | Configure path for IPSec test | | VPP Interface Set IP Address -| | ... | ${dut1} | ${dut1_if1} | ${dut_if_ip4} | ${ip4_plen} +| | ... | ${dut1} | ${dut1_if1} | ${dut_if1_ip4} | ${ip4_plen} | | VPP Interface Set IP Address -| | ... | ${dut1} | ${dut1_lo1} | ${dut_lo_ip4} | ${ip4_plen} +| | ... | ${dut1} | ${dut1_if2} | ${dut_if2_ip4} | ${ip4_plen} | | VPP Add IP Neighbor -| | ... | ${dut1} | ${dut1_if1} | ${tg_if_ip4} | ${tg_if1_mac} +| | ... | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac} +| | VPP Add IP Neighbor +| | ... | ${dut1} | ${dut1_if2} | ${tg_if2_ip4} | ${tg_if2_mac} | | Vpp Route Add -| | ... | ${dut1} | ${tg_lo_ip4} | ${ip4_plen} | gateway=${tg_if_ip4} +| | ... | ${dut1} | ${tg_host_ip4} | ${ip4_plen} | gateway=${tg_if1_ip4} | | ... | interface=${dut1_if1} -| | Set Test Variable | ${dut_tun_ip} | ${dut_if_ip4} -| | Set Test Variable | ${dut_src_ip} | ${dut_lo_ip4} -| | Set Test Variable | ${tg_tun_ip} | ${tg_if_ip4} -| | Set Test Variable | ${tg_src_ip} | ${tg_lo_ip4} +| | Set Test Variable | ${dut_tun_ip} | ${dut_if1_ip4} +| | Set Test Variable | ${tg_tun_ip} | ${tg_if1_ip4} +| | Set Test Variable | ${tg_src_ip} | ${tg_host_ip4} +| | Set Test Variable | ${tg_dst_ip} | ${tg_if2_ip4} | Configure topology for IPv6 IPsec testing | | [Documentation] | Setup topology fo IPv6 IPsec testing. @@ -102,19 +99,21 @@ | | ... | | Configure path for IPSec test | | VPP Interface Set IP Address -| | ... | ${dut1} | ${dut1_if1} | ${dut_if_ip6} | ${ip6_plen} +| | ... | ${dut1} | ${dut1_if1} | ${dut_if1_ip6} | ${ip6_plen} | | VPP Interface Set IP Address -| | ... | ${dut1} | ${dut1_lo1} | ${dut_lo_ip6} | ${ip6_plen} +| | ... | ${dut1} | ${dut1_if2} | ${dut_if2_ip6} | ${ip6_plen} +| | VPP Add IP Neighbor +| | ... | ${dut1} | ${dut1_if1} | ${tg_if1_ip6} | ${tg_if1_mac} | | VPP Add IP Neighbor -| | ... | ${dut1} | ${dut1_if1} | ${tg_if_ip6} | ${tg_if1_mac} +| | ... | ${dut1} | ${dut1_if2} | ${tg_if2_ip6} | ${tg_if2_mac} | | Vpp All RA Suppress Link Layer | ${nodes} | | Vpp Route Add -| | ... | ${dut1} | ${tg_lo_ip6} | ${ip6_plen_rt} | gateway=${tg_if_ip6} +| | ... | ${dut1} | ${tg_host_ip6} | ${ip6_plen_rt} | gateway=${tg_if1_ip6} | | ... | interface=${dut1_if1} -| | Set Test Variable | ${dut_tun_ip} | ${dut_if_ip6} -| | Set Test Variable | ${dut_src_ip} | ${dut_lo_ip6} -| | Set Test Variable | ${tg_tun_ip} | ${tg_if_ip6} -| | Set Test Variable | ${tg_src_ip} | ${tg_lo_ip6} +| | Set Test Variable | ${dut_tun_ip} | ${dut_if1_ip6} +| | Set Test Variable | ${tg_tun_ip} | ${tg_if1_ip6} +| | Set Test Variable | ${tg_src_ip} | ${tg_host_ip6} +| | Set Test Variable | ${tg_dst_ip} | ${tg_if2_ip6} | Configure manual keyed connection for IPSec | | [Documentation] | Setup IPsec manual keyed connection on VPP node. diff --git a/resources/libraries/robot/l2/l2_traffic.robot b/resources/libraries/robot/l2/l2_traffic.robot index bca801778e..93506d585e 100644 --- a/resources/libraries/robot/l2/l2_traffic.robot +++ b/resources/libraries/robot/l2/l2_traffic.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2019 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: @@ -18,8 +18,8 @@ | ... | through L2 network. *** Keywords *** -| Send ICMP packet and verify received packet -| | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to \ +| Send IP packet and verify received packet +| | [Documentation] | Send IPv4/IPv6 packet from source interface to \ | | ... | destination interface. Packet can be set with Dot1q or | | ... | Dot1ad tag(s) when required. | | ... @@ -46,47 +46,34 @@ | | ... | | ... | _NOTE:_ Default IP is IPv4 | | ... -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| Send IP packet and verify received packet \| ${nodes['TG']} \ | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| Send IP packet and verify received packet \| ${nodes['TG']} \ | | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=100 \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| Send IP packet and verify received packet \| ${nodes['TG']} \ | | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1ad \| vlan1=110 \ | | ... | \| vlan2=220 \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| Send IP packet and verify received packet \| ${nodes['TG']} \ | | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ | | ... | \| encaps_rx=Dot1q \| -| | ... | \| Send ICMP packet and verify received packet \| ${nodes['TG']} \ +| | ... | \| Send IP packet and verify received packet \| ${nodes['TG']} \ | | ... | \| ${tg_to_dut1} \| ${tg_to_dut2} \| encaps=Dot1q \| vlan1=110 \ | | ... | \| encaps_rx=Dot1q \| vlan1_rx=120 \| | | ... -| | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} -| | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 | ${encaps}=${EMPTY} -| | ... | ${vlan1}=${EMPTY} | ${vlan2}=${EMPTY} | ${encaps_rx}=${EMPTY} -| | ... | ${vlan1_rx}=${EMPTY} | ${vlan2_rx}=${EMPTY} -| | ... -| | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int} -| | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int} -| | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int} -| | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int} -| | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} -| | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | ${args}= | Run Keyword If | '${encaps}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --encaps ${encaps} | --vlan1 ${vlan1} -| | ${args}= | Run Keyword If | '${vlan2}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan2 ${vlan2} -| | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --encaps_rx ${encaps_rx} -| | ${args}= | Run Keyword If | '${vlan1_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan1_rx ${vlan1_rx} -| | ${args}= | Run Keyword If | '${vlan2_rx}' == '${EMPTY}' -| | | ... | Set Variable | ${args} -| | ... | ELSE | Catenate | ${args} | --vlan2_rx ${vlan2_rx} -| | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} +| | [Arguments] | ${tg_node} | ${tx_src_port} | ${rx_dst_port} +| | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2 +| | ... | ${encaps}=${EMPTY} | ${vlan1}=${EMPTY} | ${vlan2}=${EMPTY} +| | ... | ${encaps_rx}=${EMPTY} | ${vlan1_rx}=${EMPTY} | ${vlan2_rx}=${EMPTY} +| | ... +| | ${tx_src_mac}= | Get Interface Mac | ${tg_node} | ${tx_src_port} +| | ${rx_dst_mac}= | Get Interface Mac | ${tg_node} | ${rx_dst_port} +| | Then Send packet and verify headers +| | ... | ${tg} | 192.168.0.1 | 192.168.0.2 +| | ... | ${tx_src_port} | ${tx_src_mac} | ${rx_dst_mac} +| | ... | ${rx_dst_port} | ${tx_src_mac} | ${rx_dst_mac} +| | ... | encaps_tx=${encaps} | vlan_tx=${vlan1} | vlan_outer_tx=${vlan2} +| | ... | encaps_rx=${encaps_rx} | vlan_rx=${vlan1_rx} +| | ... | vlan_outer_rx=${vlan2_rx} | ICMP packet transmission should fail | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to @@ -121,11 +108,11 @@ | | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int} | | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip} -| | Run Keyword And Expect Error | ICMP echo Rx timeout | +| | Run Keyword And Expect Error | IP echo Rx timeout | | | ... | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args} -| Send ICMPv4 bidirectionally and verify received packets -| | [Documentation] | Send ICMPv4 echo request from both directions, +| Send IPv4 bidirectionally and verify received packets +| | [Documentation] | Send IPv4 packets from both directions, | | ... | from interface1 to interface2 and from interface2 to interface1. | | ... | | ... | *Arguments:* @@ -142,19 +129,19 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Send ICMPv4 bidirectionally and verify received packets \ +| | ... | \| Send IPv4 bidirectionally and verify received packets \ | | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| | | ... | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 | | | ... | ${dst_ip}=192.168.100.2 | | ... -| | Send ICMP packet and verify received packet +| | Send IP packet and verify received packet | | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} -| | Send ICMP packet and verify received packet +| | Send IP packet and verify received packet | | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} -| Send ICMPv6 bidirectionally and verify received packets -| | [Documentation] | Send ICMPv6 echo request from both directions, +| Send IPv6 bidirectionally and verify received packets +| | [Documentation] | Send IPv6 packets from both directions, | | ... | from interface1 to interface2 and from interface2 to interface1. | | ... | | ... | *Arguments:* @@ -171,13 +158,13 @@ | | ... | | ... | *Example:* | | ... -| | ... | \| Send ICMPv6 bidirectionally and verify received packets \ +| | ... | \| Send IPv6 bidirectionally and verify received packets \ | | ... | \| ${nodes['TG']} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \| | | ... | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 | | | ... | ${dst_ip}=3ffe:63::2 | | ... -| | Send ICMP packet and verify received packet +| | Send IP packet and verify received packet | | ... | ${tg_node} | ${int1} | ${int2} | ${src_ip} | ${dst_ip} -| | Send ICMP packet and verify received packet +| | Send IP packet and verify received packet | | ... | ${tg_node} | ${int2} | ${int1} | ${dst_ip} | ${src_ip} diff --git a/resources/libraries/robot/shared/traffic.robot b/resources/libraries/robot/shared/traffic.robot index 5d11618f62..df74017f6a 100644 --- a/resources/libraries/robot/shared/traffic.robot +++ b/resources/libraries/robot/shared/traffic.robot @@ -40,7 +40,7 @@ | | ... | - tx_src_port - Interface of TG-if1. Type: string | | ... | - tx_src_mac - MAC address of TG-if1. Type: string | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string -| | ... | - rx_port - Interface of TG-if1. Type: string +| | ... | - rx_dst_port - Interface of TG-if1. Type: string | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string | | ... | - encaps_tx - Expected encapsulation on TX side: Dot1q or Dot1ad @@ -66,14 +66,14 @@ | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| | | ... | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} -| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} +| | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_dst_port} | ${rx_src_mac} | | ... | ${rx_dst_mac} | ${encaps_tx}=${EMPTY} | ${vlan_tx}=${EMPTY} | | ... | ${vlan_outer_tx}=${EMPTY} | ${encaps_rx}=${EMPTY} | | ... | ${vlan_rx}=${EMPTY} | ${vlan_outer_rx}=${EMPTY} -| | ... | ${traffic_script}=send_icmp_check_headers +| | ... | ${traffic_script}=send_ip_check_headers | | ... | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port} -| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port} +| | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_dst_port} | | ${args}= | Catenate | --tg_src_mac ${tx_src_mac} | | ... | --tg_dst_mac ${rx_dst_mac} | --dut_if1_mac ${tx_dst_mac} | | ... | --dut_if2_mac ${rx_src_mac} | --src_ip ${src_ip} | --dst_ip ${dst_ip} @@ -133,8 +133,8 @@ | | ... | --tg_dst_mac ${rx_dst_mac} | --dut_if1_mac ${tx_dst_mac} | | ... | --dut_if2_mac ${rx_src_mac} | --src_ip ${src_ip} | --dst_ip ${dst_ip} | | ... | --tx_if ${tx_port_name} | --rx_if ${rx_port_name} -| | Run Keyword And Expect Error | ICMP echo Rx timeout | -| | ... | Run Traffic Script On Node | send_icmp_check_headers.py +| | Run Keyword And Expect Error | IP packet Rx timeout | +| | ... | Run Traffic Script On Node | send_ip_check_headers.py | | ... | ${tg_node} | ${args} | Send packet and verify ARP request @@ -845,8 +845,12 @@ | | ... | | ... | *Arguments:* | | ... | - node - TG node. Type: dictionary -| | ... | - interface - TG Interface. Type: string -| | ... | - dst_mac - Destination MAC. Type: string +| | ... | - tx_interface - TG Interface 1. Type: string +| | ... | - rx_interface - TG Interface 2. Type: string +| | ... | - tx_dst_mac - Destination MAC for TX interface / DUT interface 1 MAC. +| | ... | Type: string +| | ... | - rx_src_mac - Source MAC for RX interface / DUT interface 2 MAC. +| | ... | Type: string | | ... | - crypto_alg - Encrytion algorithm. Type: enum | | ... | - crypto_key - Encryption key. Type: string | | ... | - integ_alg - Integrity algorithm. Type: enum @@ -862,20 +866,25 @@ | | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \| | | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \| | | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\ -| | ... | \| ${nodes['TG']} \| eth1 \ -| | ... | \| 52:54:00:d4:d8:22 \| ${encr_alg} \| sixteenbytes_key \ -| | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1001} \| ${1000} \ -| | ... | \| 192.168.3.3 \| 192.168.4.4 \| 192.168.100.2 \| 192.168.100.3 \| -| | ... -| | [Arguments] | ${node} | ${interface} | ${dst_mac} | ${crypto_alg} -| | ... | ${crypto_key} | ${integ_alg} | ${integ_key} | ${l_spi} -| | ... | ${r_spi} | ${l_ip} | ${r_ip} | ${l_tunnel}=${None} -| | ... | ${r_tunnel}=${None} -| | ... -| | ${src_mac}= | Get Interface Mac | ${node} | ${interface} -| | ${if_name}= | Get Interface Name | ${node} | ${interface} -| | ${args}= | Traffic Script Gen Arg | ${if_name} | ${if_name} | ${src_mac} -| | ... | ${dst_mac} | ${l_ip} | ${r_ip} +| | ... | \| ${nodes['TG']} \| eth1 \| eth2 \ +| | ... | \| 52:54:00:d4:d8:22 \| 52:54:00:d4:d8:3e \| ${encr_alg} \ +| | ... | \| sixteenbytes_key \| ${auth_alg} \| twentybytessecretkey \ +| | ... | \| ${1001} \| ${1000} \| 192.168.3.3 \| 192.168.4.4 \| 192.168.100.2 \ +| | ... | \| 192.168.100.3 \| +| | ... +| | [Arguments] | ${node} | ${tx_interface} | ${rx_interface} | ${tx_dst_mac} +| | ... | ${rx_src_mac} | ${crypto_alg} | ${crypto_key} | ${integ_alg} +| | ... | ${integ_key} | ${l_spi} | ${r_spi} | ${l_ip} | ${r_ip} +| | ... | ${l_tunnel}=${None} | ${r_tunnel}=${None} +| | ... +| | ${tx_src_mac}= | Get Interface Mac | ${node} | ${tx_interface} +| | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_interface} +| | ${rx_dst_mac}= | Get Interface Mac | ${node} | ${tx_interface} +| | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_interface} +| | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name} +| | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac} +| | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac} +| | ... | --src_ip ${l_ip} | --dst_ip ${r_ip} | | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg} | | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg} | | ${args}= | Catenate | ${args} | --crypto_alg ${crypto_alg_str} |