X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fcrypto%2Fipsec.robot;h=135881f83e72bb8ffe084ef12506b7f298aca8c3;hp=74a1a53f254672c5a42bc056c154206d90c5251d;hb=6871d4e7f6ed43ce0bb003cb08e88b2581a474eb;hpb=6721e7f09aa95bff6622068332a3f56afad9c87b diff --git a/resources/libraries/robot/crypto/ipsec.robot b/resources/libraries/robot/crypto/ipsec.robot index 74a1a53f25..135881f83e 100644 --- a/resources/libraries/robot/crypto/ipsec.robot +++ b/resources/libraries/robot/crypto/ipsec.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: @@ -12,19 +12,17 @@ # limitations under the License. *** Settings *** -| Resource | resources/libraries/robot/shared/default.robot +| Library | String +| Library | resources.libraries.python.InterfaceUtil | Library | resources.libraries.python.IPsecUtil +| Library | resources.libraries.python.IPUtil +| Library | resources.libraries.python.IPv6Util | Library | resources.libraries.python.NodePath | Library | resources.libraries.python.TrafficScriptExecutor -| Library | resources.libraries.python.IPv4Util.IPv4Util -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.Routing -| Library | String -| Library | resources.libraries.python.IPv6Util -| Library | resources.libraries.python.IPv6Setup -| Library | resources.libraries.python.IPv4Setup.Dut | ${nodes['DUT1']} -| ... | WITH NAME | dut1_v4 -| Documentation | *IPsec keywords.* +| ... +| Resource | resources/libraries/robot/shared/default.robot +| ... +| Documentation | IPsec keywords *** Keywords *** | Generate keys for IPSec @@ -94,13 +92,13 @@ | | ... | *Example:* | | ... | \| Configure topology for IPv4 IPsec testing \| | | Configure path for IPSec test -| | Set Interface Address | ${dut_node} | ${dut_if} | ${dut_if_ip4} +| | VPP Interface Set IP Address | ${dut_node} | ${dut_if} | ${dut_if_ip4} | | ... | ${ip4_plen} -| | Set Interface Address | ${dut_node} | ${dut_lo} | ${dut_lo_ip4} +| | VPP Interface Set IP Address | ${dut_node} | ${dut_lo} | ${dut_lo_ip4} | | ... | ${ip4_plen} -| | dut1_v4.Set Arp | ${dut_if} | ${tg_if_ip4} | ${tg_if_mac} -| | Vpp Route Add | ${dut_node} | ${tg_lo_ip4} | ${ip4_plen} | ${tg_if_ip4} -| | ... | ${dut_if} +| | VPP Add IP Neighbor | ${dut_node} | ${dut_if} | ${tg_if_ip4} | ${tg_if_mac} +| | Vpp Route Add | ${dut_node} | ${tg_lo_ip4} | ${ip4_plen} +| | ... | gateway=${tg_if_ip4} | interface=${dut_if} | | 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} @@ -118,12 +116,14 @@ | | ... | *Example:* | | ... | \| Configure topology for IPv6 IPsec testing \| | | Configure path for IPSec test -| | VPP Set If IPv6 Addr | ${dut_node} | ${dut_if} | ${dut_if_ip6} | ${ip6_plen} -| | VPP Set If IPv6 Addr | ${dut_node} | ${dut_lo} | ${dut_lo_ip6} | ${ip6_plen} -| | Add IP Neighbor | ${dut_node} | ${dut_if} | ${tg_if_ip6} | ${tg_if_mac} +| | VPP Interface Set IP Address +| | ... | ${dut_node} | ${dut_if} | ${dut_if_ip6} | ${ip6_plen} +| | VPP Interface Set IP Address +| | ... | ${dut_node} | ${dut_lo} | ${dut_lo_ip6} | ${ip6_plen} +| | VPP Add IP Neighbor | ${dut_node} | ${dut_if} | ${tg_if_ip6} | ${tg_if_mac} | | Vpp All RA Suppress Link Layer | ${nodes} -| | Vpp Route Add | ${dut_node} | ${tg_lo_ip6} | ${ip6_plen_rt} | ${tg_if_ip6} -| | ... | ${dut_if} +| | Vpp Route Add | ${dut_node} | ${tg_lo_ip6} | ${ip6_plen_rt} +| | ... | gateway=${tg_if_ip6} | interface=${dut_if} | | 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} @@ -157,9 +157,12 @@ | | ... | \| GigabitEthernet0/8/0 \| ${encr_alg} \| sixteenbytes_key \ | | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1000} \| ${1001} \ | | ... | \| 192.168.4.4 \| 192.168.3.3 \| 192.168.100.3 \| 192.168.100.2 \| +| | ... | | [Arguments] | ${node} | ${interface} | ${crypto_alg} | ${crypto_key} | | ... | ${integ_alg} | ${integ_key} | ${l_spi} | ${r_spi} | ${l_ip} | | ... | ${r_ip} | ${l_tunnel}=${None} | ${r_tunnel}=${None} +| | ... | ${is_ipv6}=${FALSE} +| | ... | | Set Test Variable | ${l_sa_id} | ${10} | | Set Test Variable | ${r_sa_id} | ${20} | | ${spd_id}= | Set Variable | ${1} @@ -174,38 +177,20 @@ | | VPP IPsec Add SPD | ${node} | ${spd_id} | | VPP IPsec SPD Add If | ${node} | ${spd_id} | ${interface} | | ${action}= | Policy Action Bypass -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_hi} | ${action} -| | ... | inbound=${TRUE} | proto=${ESP_PROTO} -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_hi} | ${action} -| | ... | inbound=${FALSE} | proto=${ESP_PROTO} +| | VPP IPsec Policy Add | ${node} | ${spd_id} | ${p_hi} | ${action} +| | ... | inbound=${TRUE} | proto=${ESP_PROTO} | is_ipv6=${is_ipv6} +| | ... | laddr_range=${tg_tun_ip} | raddr_range=${dut_tun_ip} +| | VPP IPsec Policy Add | ${node} | ${spd_id} | ${p_hi} | ${action} +| | ... | inbound=${FALSE} | proto=${ESP_PROTO} | is_ipv6=${is_ipv6} +| | ... | laddr_range=${dut_tun_ip} | raddr_range=${tg_tun_ip} | | ${action}= | Policy Action Protect -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_lo} | ${action} +| | VPP IPsec Policy Add | ${node} | ${spd_id} | ${p_lo} | ${action} | | ... | sa_id=${r_sa_id} | laddr_range=${l_ip} | | ... | raddr_range=${r_ip} | inbound=${TRUE} -| | VPP IPsec SPD Add Entry | ${node} | ${spd_id} | ${p_lo} | ${action} +| | VPP IPsec Policy Add | ${node} | ${spd_id} | ${p_lo} | ${action} | | ... | sa_id=${l_sa_id} | laddr_range=${l_ip} | | ... | raddr_range=${r_ip} | inbound=${FALSE} -| Update IPSec SA keys -| | [Documentation] | Update IPsec SA keys on VPP node. -| | ... -| | ... | *Arguments:* -| | ... | - node - VPP node to update SA keys. Type: dictionary -| | ... | - l_sa_id - Local SA ID. Type: string -| | ... | - r_sa_id - Remote SA ID. Type: string -| | ... | - crypto_key - Encryption key. Type: string -| | ... | - integ_key - Integrity key. Type: string -| | ... -| | ... | *Example:* -| | ... | \| Update IPSec SA keys \| ${nodes['DUT1']} \ -| | ... | \| 10 \| 20 \| sixteenbytes_key \| twentybytessecretkey \| -| | [Arguments] | ${node} | ${l_sa_id} | ${r_sa_id} | ${crypto_key} -| | ... | ${integ_key} -| | VPP IPsec SA Set Key | ${dut_node} | ${l_sa_id} | ${crypto_key} -| | ... | ${integ_key} -| | VPP IPsec SA Set Key | ${dut_node} | ${r_sa_id} | ${crypto_key} -| | ... | ${integ_key} - | Send IPsec Packet and verify ESP encapsulation in received packet | | [Documentation] | Send IPsec packet from TG to DUT. Receive IPsec packet\ | | ... | from DUT on TG and verify ESP encapsulation. @@ -252,29 +237,18 @@ | | ... | ${args} --dst_tun ${r_tunnel} | | Run Traffic Script On Node | ipsec.py | ${node} | ${args} -| Set up IPv4 IPSec functional test +| Set up IPSec SW device functional test | | [Documentation] -| | ... | Set up IPv4 IPSec functional test +| | ... | Set up IPSec SW device functional test for required IP version. | | ... -| | Set up functional test -| | Configure topology for IPv4 IPsec testing - -| Set up IPv6 IPSec functional test -| | [Documentation] -| | ... | Set up IPv6 IPSec functional test -| | ... -| | Set up functional test -| | Configure topology for IPv6 IPsec testing - -| Tear down IPSec functional test -| | [Documentation] -| | ... | Tear down IPSec functional test +| | ... | *Arguments:* +| | ... | - ${ip_version} - IP version: IPv4 or IPv6. Type: string | | ... | | ... | *Example:* | | ... -| | ... | \| Tear down IPSec functional test \| ${dut_node} \| +| | ... | \| Set up IPSec SW device functional test \| IPv4 \| | | ... -| | [Arguments] | ${dut_node} +| | [Arguments] | ${ip_version} | | ... -| | VPP IPsec Show | ${dut_node} -| | Tear down functional test +| | Set up VPP device test +| | Run Keyword | Configure topology for ${ip_version} IPsec testing