FIX: correct call of vpp_add_route
[csit.git] / resources / libraries / robot / crypto / ipsec.robot
index 74a1a53..5064646 100644 (file)
@@ -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:
@@ -99,8 +99,8 @@
 | | Set Interface 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 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}
 | | 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 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}
 
 | Set up IPv4 IPSec functional test
 | | [Documentation]
-| | ... | Set up IPv4 IPSec functional test
+| | ... | Set up IPv4 IPSec functional test.
 | | ...
 | | 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 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
+| | ... | Tear down IPSec functional test.
 | | ...
 | | ... | *Example:*
 | | ...
 | | ...
 | | VPP IPsec Show | ${dut_node}
 | | Tear down functional test
+
+| Set up IPSec SW device functional test
+| | [Documentation]
+| | ... | Set up IPSec SW device functional test for required IP version.
+| | ...
+| | ... | *Arguments:*
+| | ... | - ${ip_version} - IP version: IPv4 or IPv6. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Set up IPSec SW device functional test \| IPv4 \|
+| | ...
+| | [Arguments] | ${ip_version}
+| | ...
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | Import Library | resources.libraries.python.VppConfigGenerator
+| | | ... | WITH NAME | ${dut}
+| | | Run keyword | ${dut}.Set Node | ${nodes['${dut}']}
+| | | Run keyword | ${dut}.Set Vpp Startup Conf Backup
+| | | Run keyword | ${dut}.Set Vpp Logfile | /tmp/vpp.log
+| | | Run keyword | ${dut}.Add Unix Nodaemon
+| | | Run keyword | ${dut}.Add Unix Log
+| | | Run keyword | ${dut}.Add Unix Coredump
+| | | Run keyword | ${dut}.Add Unix CLI Listen | /run/vpp/cli.sock
+| | | Run keyword | ${dut}.Add Unix Gid
+| | | Run keyword | ${dut}.Add Api Segment Gid
+| | | ${socket_id}= | Set Variable | ${0}
+| | | ${sw_dev_count}= | Set Variable | ${1}
+| | | Run keyword | ${dut}.Add DPDK SW Cryptodev | aesni_mb | ${socket_id}
+| | | ... | ${sw_dev_count}
+| | | Run keyword | ${dut}.Add DPDK SW Cryptodev | aesni_gcm | ${socket_id}
+| | | ... | ${sw_dev_count}
+| | Apply startup configuration on all VPP DUTs | restart_vpp=${FALSE}
+| | Set up functional test
+| | Run Keyword | Configure topology for ${ip_version} IPsec testing
+
+| Tear down IPSec SW device functional test
+| | [Documentation]
+| | ... | Tear down IPSec SW device functional test.
+| | ...
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | VPP IPsec Show | ${nodes['${dut}']}
+| | | Run keyword | ${dut}.Restore Config
+| | Tear down functional test