3.11. shared

3.11.1. container suite

3.11.1.1. Construct container on all DUTs

Construct 1 CNF of specific technology on all DUT nodes.

Arguments: - nf_chains: Total number of chains (Optional). Type: integer, default value: ${1} - nf_nodes: Total number of nodes per chain (Optional). Type: integer, default value: ${1} - nf_chain: Chain ID (Optional). Type: integer, default value: ${1} - nf_node: Node ID (Optional). Type: integer, default value: ${1} - auto_scale - If True, use same amount of Dataplane threads for network function as DUT, otherwise use single physical core for every network function. Type: boolean - nested: Set True if starting nested containers. Type: boolean, default value: ${False}

Example:

| Construct container on all DUTs | 1 | 1 | 1 | 1 | ${True} |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    ${nf_id}=  Evaluate  (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
\    ${env}=  Create List  DEBIAN_FRONTEND=noninteractive
\    ${uuid}=  Get Variable Value  ${dcr_uuid}  ${Empty}
\    ${root}=  Get Variable Value  ${dcr_root}  ${Empty}
\    ${mnt}=  Create List  ${root}/tmp/:/mnt/host/  ${root}/dev/vfio/:/dev/vfio/  ${root}/usr/bin/vpp:/usr/bin/vpp  ${root}/usr/bin/vppctl:/usr/bin/vppctl  ${root}/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/  ${root}/usr/share/vpp/:/usr/share/vpp/  ${root}/usr/lib/vpp_plugins/:/usr/lib/vpp_plugins/
\    ${nf_cpus}=  Set Variable  ${None}
\    ${nf_cpus}=  Run Keyword Unless  ${nested}  Create network function CPU list  ${dut}  chains=${nf_chains}  nodeness=${nf_nodes}  chain_id=${nf_chain}  node_id=${nf_node}  auto_scale=${auto_scale}
\    &{cont_args}=  Create Dictionary  name=${dut}_${container_group}${nf_id}${uuid}  node=${nodes['${dut}']}  mnt=${mnt}  env=${env}
\    Run Keyword Unless  ${nested}  Set To Dictionary  ${cont_args}  cpuset_cpus=${nf_cpus}
\    Run Keyword  ${container_group}.Construct container  &{cont_args}

3.11.1.2. Construct chain of containers on all DUTs

Construct 1 chain of 1..N CNFs on all DUT nodes.

Arguments: - nf_chains: Total number of chains. Type: integer - nf_nodes: Total number of nodes per chain. Type: integer - nf_chain: Chain ID. Type: integer - auto_scale - If True, use same amount of Dataplane threads for network function as DUT, otherwise use single physical core for every network function. Type: boolean - nested: Set True if starting nested containers. Type: boolean, default value: ${False}

Example:

| Construct chain of containers on all DUTs | 1 | 1 | 1 | ${True} |


: FOR  ${nf_node}  IN RANGE  1  ${nf_nodes}+1
\    Construct container on all DUTs  nf_chains=${nf_chains}  nf_nodes=${nf_nodes}  nf_chain=${nf_chain}  nf_node=${nf_node}  auto_scale=${auto_scale}  nested=${nested}

3.11.1.3. Construct chains of containers on all DUTs

Construct 1..N chains of 1..N CNFs on all DUT nodes.

Arguments: - nf_chains: Total number of chains (Optional). Type: integer, default value: ${1} - nf_nodes: Total number of nodes per chain (Optional). Type: integer, default value: ${1} - auto_scale - If True, use same amount of Dataplane threads for network function as DUT, otherwise use single physical core for every network function. Type: boolean - nested: Set True if starting nested containers. Type: boolean, default value: ${False}

Example:

| Construct chains of containers on all DUTs | 1 | 1 |


: FOR  ${nf_chain}  IN RANGE  1  ${nf_chains}+1
\    Construct chain of containers on all DUTs  nf_chains=${nf_chains}  nf_nodes=${nf_nodes}  nf_chain=${nf_chain}  auto_scale=${auto_scale}  nested=${nested}

3.11.1.4. Acquire all ‘${group}’ containers

Acquire all container(s) in specific container group on all DUT nodes.

${group}
Run Keyword  ${group}.Acquire all containers

3.11.1.5. Create all ‘${group}’ containers

Create/deploy all container(s) in specific container group on all DUT nodes.

${group}
Run Keyword  ${group}.Create all containers

3.11.1.6. Start VPP in all ‘${group}’ containers

Start VPP on all container(s) in specific container group on all DUT nodes.

${group}
Run Keyword  ${group}.Start VPP In All Containers

3.11.1.7. Restart VPP in all ‘${group}’ containers

Restart VPP on all container(s) in specific container group on all DUT nodes.

${group}
Run Keyword  ${group}.Restart VPP In All Containers

3.11.1.8. Configure VPP in all ‘${group}’ containers

Configure VPP on all container(s) in specific container group on all DUT nodes.

${group}
${dut1_if2} =  Get Variable Value  \${dut1_if2}  ${None}
${dut2_if2} =  Get Variable Value  \${dut2_if2}  ${None}
Run Keyword If  '${container_chain_topology}' == 'chain_ip4'  ${group}.Configure VPP In All Containers  ${container_chain_topology}  tg_if1_mac=${tg_if1_mac}  tg_if2_mac=${tg_if2_mac}  nodes=${nf_nodes}  ELSE IF  '${container_chain_topology}' == 'pipeline_ip4'  ${group}.Configure VPP In All Containers  ${container_chain_topology}  tg_if1_mac=${tg_if1_mac}  tg_if2_mac=${tg_if2_mac}  nodes=${nf_nodes}  ELSE IF  '${container_chain_topology}' == 'cross_horiz'  ${group}.Configure VPP In All Containers  ${container_chain_topology}  dut1_if=${dut1_if2}  dut2_if=${dut2_if2}  ELSE  ${group}.Configure VPP In All Containers  ${container_chain_topology}

3.11.1.9. Stop all ‘${group}’ containers

Stop all container(s) in specific container group on all DUT nodes.

${group}
Run Keyword  ${group}.Stop all containers

3.11.1.10. Destroy all ‘${group}’ containers

Destroy all container(s) in specific container group on all DUT nodes.

${group}
Run Keyword  ${group}.Destroy all containers

3.11.2. counters suite

3.11.2.1. Clear interface counters on all vpp nodes in topology

Clear interface counters on all VPP nodes in topology


Clear Interface Counters on all DUTs  ${nodes}

3.11.2.2. Check ipv4 interface counter

Check that ipv4 interface counter has right value


${ipv4_counter}=  Vpp get ipv4 interface counter  ${node}  ${interface}
Should Be Equal  ${ipv4_counter}  ${value}

3.11.2.3. Clear all counters on all DUTs

Clear runtime, interface, hardware and error counters on all DUTs with VPP instance


Clear runtime counters on all DUTs  ${nodes}
Clear interface counters on all DUTs  ${nodes}
Clear hardware counters on all DUTs  ${nodes}
Clear error counters on all DUTs  ${nodes}

3.11.3. default suite

3.11.3.1. Configure all DUTs before test

Setup all DUTs in topology before test execution.


Setup All DUTs  ${nodes}

3.11.3.2. Configure all TGs for traffic script

Prepare all TGs before traffic scripts execution.


All TGs Set Interface Default Driver  ${nodes}

3.11.3.3. Show Vpp Errors On All DUTs

Show VPP errors verbose on all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Vpp Show Errors  ${nodes['${dut}']}

3.11.3.4. Show VPP trace dump on all DUTs

Save API trace and dump output on all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Vpp api trace save  ${nodes['${dut}']}
\    Vpp api trace dump  ${nodes['${dut}']}

3.11.3.5. Show Bridge Domain Data On All DUTs

Show Bridge Domain data on all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Vpp Get Bridge Domain Data  ${nodes['${dut}']}

3.11.3.6. Setup Scheduler Policy for Vpp On All DUTs

Set realtime scheduling policy (SCHED_RR) with priority 1 on all VPP worker threads on all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Set VPP Scheduling rr  ${nodes['${dut}']}

3.11.3.7. Configure crypto device on all DUTs

Verify if Crypto QAT device virtual functions are initialized on all DUTs. If parameter force_init is set to True, then try to initialize/disable.

Arguments: - force_init - Force to initialize. Type: boolean - numvfs - Number of VFs to initialize, 0 - disable the VFs (Optional). Type: integer, default value: ${32}

Example:

| Configure crypto device on all DUTs | ${True} |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Crypto Device Verify  ${nodes['${dut}']}  force_init=${force_init}  numvfs=${numvfs}

3.11.3.8. Configure AVF interfaces on all DUTs

Configure virtual functions for AVF interfaces on PCI interface on all DUTs.

Arguments: - numvfs - Number of VFs to initialize, 0 - disable the VFs (Optional). Type: integer, default value: ${1} - topology_type - Topology type. (Optional). Type: string, default value: L2

Example:

| Configure AVF device on all DUTs | ${1} | L2 |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    ${if1_avf_arr}=  Init AVF interface  ${nodes['${dut}']}  ${${dut}_if1}  numvfs=${numvfs}  topology_type=${topology_type}
\    ${if2_avf_arr}=  Init AVF interface  ${nodes['${dut}']}  ${${dut}_if2}  numvfs=${numvfs}  topology_type=${topology_type}
\    Set Suite Variable  ${${dut}_if1_vf0}  ${if1_avf_arr[0]}
\    Set Suite Variable  ${${dut}_if2_vf0}  ${if2_avf_arr[0]}

3.11.3.9. Configure kernel module on all DUTs

Verify if specific kernel module is loaded on all DUTs. If parameter force_load is set to True, then try to load.

Arguments: - module - Module to verify. Type: string - force_load - Try to load module. Type: boolean

Example:

| Configure kernel module on all DUTs | ${True} |


Verify Kernel Module on All DUTs  ${nodes}  ${module}  force_load=${force_load}

3.11.3.10. Create base startup configuration of VPP on all DUTs

Create base startup configuration of VPP to all DUTs.


${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}.Add Unix Log
\    Run keyword  ${dut}.Add Unix CLI Listen
\    Run keyword  ${dut}.Add Unix Nodaemon
\    Run keyword  ${dut}.Add Unix Coredump
\    Run keyword  ${dut}.Add DPDK Socketmem  1024,1024
\    Run keyword  ${dut}.Add DPDK No Tx Checksum Offload
\    Run keyword  ${dut}.Add DPDK Log Level  debug
\    Run keyword  ${dut}.Add DPDK Uio Driver
\    Run keyword  ${dut}.Add Heapsize  4G
\    Run keyword  ${dut}.Add Statseg size  4G
\    Run keyword  ${dut}.Add Plugin  disable  default
\    Run keyword  ${dut}.Add Plugin  enable  @{plugins_to_enable}
\    Run keyword  ${dut}.Add IP6 Hash Buckets  2000000
\    Run keyword  ${dut}.Add IP6 Heap Size  4G
\    Run keyword  ${dut}.Add IP Heap Size  4G

3.11.3.11. Add worker threads and rxqueues to all DUTs

Setup worker threads and rxqueues in vpp startup configuration on all DUTs. Based on the SMT configuration of DUT if enabled keyword will automatically map also the sibling logical cores. Keyword will automatically set the appropriate test TAGs in format mTnC, where m=logical_core_count and n=physical_core_count.

Arguments: - phy_cores - Number of physical cores to use. Type: integer - rx_queues - Number of RX queues. Type: integer

Example:

| Add worker threads and rxqueues to all DUTs | ${1} | ${1} |


${cpu_count_int}  Convert to Integer  ${phy_cores}
${thr_count_int}  Convert to Integer  ${phy_cores}
${num_mbufs_int}  Convert to Integer  16384
${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    ${if1_status}  ${value}=  Run Keyword And Ignore Error  Variable Should Exist  ${${dut}_if1}
\    @{if_list}=  Run Keyword If  '${if1_status}' == 'PASS'  Create List  ${${dut}_if1}  ELSE  Create List  ${${dut}_if1_1}  ${${dut}_if1_2}
\    ${if2_status}  ${value}=  Run Keyword And Ignore Error  Variable Should Exist  ${${dut}_if2}
\    Run Keyword If  '${if2_status}' == 'PASS'  Append To List  ${if_list}  ${${dut}_if2}  ELSE  Append To List  ${if_list}  ${${dut}_if2_1}  ${${dut}_if2_2}
\    ${numa}=  Get interfaces numa node  ${nodes['${dut}']}  @{if_list}
\    ${smt_used}=  Is SMT enabled  ${nodes['${dut}']['cpuinfo']}
\    ${cpu_main}=  Cpu list per node str  ${nodes['${dut}']}  ${numa}  skip_cnt=${1}  cpu_cnt=${1}
\    ${cpu_wt}=  Cpu list per node str  ${nodes['${dut}']}  ${numa}  skip_cnt=${2}  cpu_cnt=${cpu_count_int}  smt_used=${smt_used}
\    ${thr_count_int}=  Run keyword if  ${smt_used}  Evaluate  int(${cpu_count_int}*2)  ELSE  Set variable  ${thr_count_int}
\    ${rxq_count_int}=  Run keyword if  ${rx_queues}  Set variable  ${rx_queues}  ELSE  Evaluate  int(${thr_count_int}/2)
\    ${rxq_count_int}=  Run keyword if  ${rxq_count_int} == 0  Set variable  ${1}  ELSE  Set variable  ${rxq_count_int}
\    ${num_mbufs_int}=  Evaluate  int(${num_mbufs_int}*${rxq_count_int})
\    Run keyword  ${dut}.Add CPU Main Core  ${cpu_main}
\    Run keyword  ${dut}.Add CPU Corelist Workers  ${cpu_wt}
\    Run keyword  ${dut}.Add DPDK Dev Default RXQ  ${rxq_count_int}
\    Run keyword  ${dut}.Add DPDK Num Mbufs  ${num_mbufs_int}
\    Run keyword if  ${thr_count_int} > 1  Set Tags  MTHREAD  ELSE  Set Tags  STHREAD
\    Set Tags  ${thr_count_int}T${cpu_count_int}C
Set Test Variable  ${smt_used}
Set Test Variable  ${thr_count_int}
Set Test Variable  ${cpu_count_int}
Set Test Variable  ${rxq_count_int}

3.11.3.12. Create Kubernetes VSWITCH startup config on all DUTs

Create base startup configuration of VSWITCH in Kubernetes deploy to all DUTs.

Arguments: - ${jumbo} - Jumbo packet. Type: boolean - ${phy_cores} - Physical cores. Type: integer - ${rxq} - RX queues. Type: integer

Example:

| Create Kubernetes VSWITCH startup config on all DUTs | ${True} | ${1} | ${1}


${cpu_count_int}  Convert to Integer  ${phy_cores}
${thr_count_int}  Convert to Integer  ${phy_cores}
${num_mbufs_int}  Convert to Integer  16384
${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    ${numa}=  Get interfaces numa node  ${nodes['${dut}']}  ${${dut}_if1}  ${${dut}_if2}
\    ${smt_used}=  Is SMT enabled  ${nodes['${dut}']['cpuinfo']}
\    ${if1_pci}=  Get Interface PCI Addr  ${nodes['${dut}']}  ${${dut}_if1}
\    ${if2_pci}=  Get Interface PCI Addr  ${nodes['${dut}']}  ${${dut}_if2}
\    ${thr_count_int}=  Run keyword if  ${smt_used}  Evaluate  int(${cpu_count_int}*2)  ELSE  Set variable  ${thr_count_int}
\    ${rxq_count_int}=  Run keyword if  ${rx_queues}  Set variable  ${rx_queues}  ELSE  Evaluate  int(${thr_count_int}/2)
\    ${rxq_count_int}=  Run keyword if  ${rxq_count_int} == 0  Set variable  ${1}  ELSE  Set variable  ${rxq_count_int}
\    ${num_mbufs_int}=  Evaluate  int(${num_mbufs_int}*${rxq_count_int})
\    ${config}=  Run keyword  Create Kubernetes VSWITCH startup config  node=${nodes['${dut}']}  phy_cores=${phy_cores}  cpu_node=${numa}  jumbo=${jumbo}  rxq_count_int=${rxq_count_int}  num_mbufs_int=${num_mbufs_int}  filename=/tmp/vswitch.conf  if1=${if1_pci}  if2=${if2_pci}
\    Run keyword if  ${thr_count_int} > 1  Set Tags  MTHREAD  ELSE  Set Tags  STHREAD
\    Set Tags  ${thr_count_int}T${cpu_count_int}C
Set Test Variable  ${smt_used}
Set Test Variable  ${thr_count_int}
Set Test Variable  ${cpu_count_int}
Set Test Variable  ${rxq_count_int}

3.11.3.13. Create Kubernetes VNF’${i}’ startup config on all DUTs

Create base startup configuration of VNF in Kubernetes deploy to all DUTs.

${i}
${i_int}=  Convert To Integer  ${i}
${cpu_skip}=  Evaluate  ${vswitch_cpus}+${system_cpus}
${dut1_numa}=  Get interfaces numa node  ${dut1}  ${dut1_if1}  ${dut1_if2}
${dut2_numa}=  Get interfaces numa node  ${dut2}  ${dut2_if1}  ${dut2_if2}
${config}=  Run keyword  Create Kubernetes VNF startup config  node=${dut1}  phy_cores=${vnf_cpus}  cpu_node=${dut1_numa}  cpu_skip=${cpu_skip}  filename=/tmp/vnf${i}.conf  i=${i_int}
${config}=  Run keyword  Create Kubernetes VNF startup config  node=${dut2}  phy_cores=${vnf_cpus}  cpu_node=${dut2_numa}  cpu_skip=${cpu_skip}  filename=/tmp/vnf${i}.conf  i=${i_int}

3.11.3.14. Add no multi seg to all DUTs

Add No Multi Seg to VPP startup configuration to all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Add DPDK No Multi Seg

3.11.3.15. Add DPDK no PCI to all DUTs

Add DPDK no-pci to VPP startup configuration to all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Add DPDK no PCI

3.11.3.16. Add DPDK dev default RXD to all DUTs

Add DPDK num-rx-desc to VPP startup configuration to all DUTs.

Arguments: - rxd - Number of RX descriptors. Type: string

Example:

| Add DPDK dev default RXD to all DUTs | ${rxd} |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Add DPDK Dev Default RXD  ${rxd}

3.11.3.17. Add DPDK dev default TXD to all DUTs

Add DPDK num-tx-desc to VPP startup configuration to all DUTs.

Arguments: - txd - Number of TX descriptors. Type: string

Example:

| Add DPDK dev default TXD to all DUTs | ${txd} |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Add DPDK Dev Default TXD  ${txd}

3.11.3.18. Add DPDK Uio Driver on all DUTs

Add DPDK uio driver to VPP startup configuration on all DUTs.

Arguments: - uio_driver - Required uio driver. Type: string

Example:

| Add DPDK Uio Driver on all DUTs | igb_uio |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Add DPDK Uio Driver  ${uio_driver}

3.11.3.19. Add NAT to all DUTs

Add NAT configuration to all DUTs.


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Add NAT

3.11.3.20. Add cryptodev to all DUTs

Add Cryptodev to VPP startup configuration to all DUTs.

Arguments: - count - Number of QAT devices. Type: integer

Example:

| Add cryptodev to all DUTs | ${4} |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    ${smt_used}=  Is SMT enabled  ${nodes['${dut}']['cpuinfo']}
\    ${thr_count_int}=  Run keyword if  ${smt_used}  Evaluate  int(${count}*2)  ELSE  Set variable  ${count}
\    Run keyword  ${dut}.Add DPDK Cryptodev  ${thr_count_int}

3.11.3.22. Apply startup configuration on all VPP DUTs

Write startup configuration and restart VPP on all DUTs.

Arguments: - restart_vpp - Whether to restart VPP (Optional). Type: boolean

Example:

| Apply startup configuration on all VPP DUTs | ${False} |


${duts}=  Get Matches  ${nodes}  DUT*
: FOR  ${dut}  IN  @{duts}
\    Run keyword  ${dut}.Apply Config  restart_vpp=${restart_vpp}
Update All Interface Data On All Nodes  ${nodes}  skip_tg=${True}

3.11.3.23. Save VPP PIDs

Get PIDs of VPP processes from all DUTs in topology andset it as a test variable. The PIDs are stored as dictionary itemswhere the key is the host and the value is the PID.


${setup_vpp_pids}=  Get VPP PIDs  ${nodes}
${keys}=  Get Dictionary Keys  ${setup_vpp_pids}
: FOR  ${key}  IN  @{keys}
\    ${pid}=  Get From Dictionary  ${setup_vpp_pids}  ${key}
\    Run Keyword If  $pid is None  FAIL  No VPP PID found on node ${key}
\    Run Keyword If  ',' in '${pid}'  FAIL  More then one VPP PID found on node ${key}: ${pid}
Set Test Variable  ${setup_vpp_pids}

3.11.3.24. Verify VPP PID in Teardown

Check if the VPP PIDs on all DUTs are the same at the endof test as they were at the begining. If they are not, only a messageis printed on console and to log. The test will not fail.


${teardown_vpp_pids}=  Get VPP PIDs  ${nodes}
${err_msg}=  Catenate  ${SUITE NAME} - ${TEST NAME}  \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs:  ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids}
${rc}  ${msg}=  Run keyword and ignore error  Dictionaries Should Be Equal  ${setup_vpp_pids}  ${teardown_vpp_pids}
Run Keyword And Return If  '${rc}'=='FAIL'  Log  ${err_msg}  console=yes  level=WARN

3.11.3.25. Set up functional test

Common test setup for functional tests.


Configure all DUTs before test
Save VPP PIDs
Configure all TGs for traffic script
Update All Interface Data On All Nodes  ${nodes}
Reset VAT History On All DUTs  ${nodes}

3.11.3.26. Tear down functional test

Common test teardown for functional tests.


Remove All Added Ports On All DUTs From Topology  ${nodes}
Show Packet Trace on All DUTs  ${nodes}
Show VAT History On All DUTs  ${nodes}
Vpp Show Errors On All DUTs  ${nodes}
Verify VPP PID in Teardown

3.11.3.27. Set up VPP device test

Common test setup for vpp-device tests.


Configure all DUTs before test
Save VPP PIDs
Configure all TGs for traffic script
Update All Interface Data On All Nodes  ${nodes}  skip_tg_udev=${True}
Reset VAT History On All DUTs  ${nodes}

3.11.3.28. Tear down VPP device test

Common test teardown for vpp-device tests.


Remove All Added Ports On All DUTs From Topology  ${nodes}
Show Packet Trace on All DUTs  ${nodes}
Show VAT History On All DUTs  ${nodes}
Vpp Show Errors On All DUTs  ${nodes}
Verify VPP PID in Teardown

3.11.3.29. Tear down LISP functional test

Common test teardown for functional tests with LISP.


Remove All Added Ports On All DUTs From Topology  ${nodes}
Show Packet Trace on All DUTs  ${nodes}
Show VAT History On All DUTs  ${nodes}
Show Vpp Settings  ${nodes['DUT1']}
Show Vpp Settings  ${nodes['DUT2']}
Vpp Show Errors On All DUTs  ${nodes}
Verify VPP PID in Teardown

3.11.3.30. Tear down LISP functional test with QEMU

Common test teardown for functional tests with LISP andQEMU.

Arguments: - vm_node - VM to stop. Type: string

Example:

| Tear down LISP functional test with QEMU | ${vm_node} |


Remove All Added Ports On All DUTs From Topology  ${nodes}
Show Packet Trace on All DUTs  ${nodes}
Show VAT History On All DUTs  ${nodes}
Show Vpp Settings  ${nodes['DUT1']}
Show Vpp Settings  ${nodes['DUT2']}
Vpp Show Errors On All DUTs  ${nodes}
Stop and clear QEMU  ${nodes['DUT1']}  ${vm_node}
Verify VPP PID in Teardown

3.11.3.31. Set up TAP functional test

Common test setup for functional tests with TAP.


Set up functional test
Clean Up Namespaces  ${nodes['DUT1']}

3.11.3.32. Set up functional test with containers

Common test setup for functional tests with containers.

Arguments: - chains: Total number of chains (Optional). Type: integer, default value: ${1} - nodeness: Total number of nodes per chain (Optional). Type: integer, default value: ${1}

_NOTE:_ This KW sets following test case variables: - dcr_uuid - Parent container UUID. - dcr_root - Parent container overlay.

Example:

| Set up functional test with containers | 1 | 1 |


Set Test Variable  @{container_groups}  @{EMPTY}
Set Test Variable  ${container_group}  CNF
Import Library  resources.libraries.python.ContainerUtils.ContainerManager  engine=${container_engine}  WITH NAME  ${container_group}
${dcr_uuid}=  Get Environment Variable  CSIT_DUT1_UUID
${dcr_root}=  Run Keyword  Get Docker Mergeddir  ${nodes['DUT1']}  ${dcr_uuid}
Set Test Variable  ${dcr_uuid}
Set Test Variable  ${dcr_root}
Construct chains of containers on all DUTs  ${chains}  ${nodeness}  nested=${True}
Acquire all '${container_group}' containers
Create all '${container_group}' containers
Configure VPP in all '${container_group}' containers
Start VPP in all '${container_group}' containers
Append To List  ${container_groups}  ${container_group}

3.11.3.33. Tear down TAP functional test

Common test teardown for functional tests with TAP.


Tear down functional test
Clean Up Namespaces  ${nodes['DUT1']}

3.11.3.34. Tear down TAP functional test with Linux bridge

Common test teardown for functional tests with TAP and a Linux bridge.

Arguments: - bid_TAP - Bridge name. Type: string

Example:

| Tear down TAP functional test with Linux bridge | ${bid_TAP} |


Tear down functional test
Linux Del Bridge  ${nodes['DUT1']}  ${bid_TAP}
Clean Up Namespaces  ${nodes['DUT1']}

3.11.3.35. Tear down FDS functional test

Common test teardown for FDS functional tests.

Arguments: - dut1_node - Node Nr.1 where to clean qemu. Type: dictionary - qemu_node1 - VM Nr.1 node info dictionary. Type: string - dut2_node - Node Nr.2 where to clean qemu. Type: dictionary - qemu_node2 - VM Nr.2 node info dictionary. Type: string

Example:

| Tear down FDS functional test | ${dut1_node} | ${qemu_node1}| ${dut2_node} | ${qemu_node2} |


Tear down functional test
Tear down QEMU  ${dut1_node}  ${qemu_node1}  qemu_node1
Tear down QEMU  ${dut2_node}  ${qemu_node2}  qemu_node2

3.11.3.36. Tear down functional test with container

Common test teardown for functional tests which uses containers.


: FOR  ${container_group}  IN  @{container_groups}
\    Destroy all '${container_group}' containers

3.11.3.37. Stop VPP Service on DUT

Stop the VPP service on the specified node.

Arguments: - node - information about a DUT node. Type: dictionary

Example:

| Stop VPP Service on DUT | ${nodes[‘DUT1’]} |


Stop VPP Service  ${node}

3.11.3.38. Start VPP Service on DUT

Start the VPP service on the specified node.

Arguments: - node - information about a DUT node. Type: dictionary

Example:

| Start VPP Service on DUT | ${nodes[‘DUT1’]} |


Start VPP Service  ${node}

3.11.4. interfaces suite

3.11.4.1. VPP reports interfaces through VAT on ‘${node}’

${node}
Execute Script  dump_interfaces.vat  ${node}
Script Should Have Passed

3.11.4.2. Configure MTU on TG based on MTU on DUT

Type of the tg_node must be TG and dut_node must be DUT


Append Nodes  ${tg_node}  ${dut_node}
Compute Path
${tg_port}  ${tg_node}=  First Interface
${dut_port}  ${dut_node}=  Last Interface
${mtu}=  Get Interface MTU  ${dut_node}  ${dut_port}
${eth_mtu}=  Evaluate  ${mtu} - 14 - 4
Set Interface Ethernet MTU  ${tg_node}  ${tg_port}  ${eth_mtu}

3.11.5. memif suite

3.11.5.1. Set up memif interfaces on DUT node

Create two Memif interfaces on given VPP node.

Arguments: - dut_node - DUT node. Type: dictionary - filename1 - Socket filename for 1st Memif interface. Type: string - filename2 - Socket filename for 2nd Memif interface. Type: string - mid - Memif interface ID. Type: integer, default value: ${1} - memif_if1 - Name of the first Memif interface (Optional). Type: string, default value: memif_if1 - memif_if2 - Name of the second Memif interface (Optional). Type: string, default value: memif_if2 - rxq - RX queues; 0 means do not set (Optional). Type: integer, default value: ${1} - txq - TX queues; 0 means do not set (Optional). Type: integer, default value: ${1} - role - Memif role (Optional). Type: string, default value: slave - dcr_uuid - UUID string (including prefix - underscore character) of DUT1 /tmp volume created outside of the DUT1 docker in case of vpp-device test. ${EMPTY} value means that /tmp directory is inside the DUT1 docker. (Optional). Type: string, default value: ${EMPTY}

_NOTE:_ This KW sets following test case variable: - ${${memif_if1}} - 1st Memif interface. - ${${memif_if2}} - 2nd Memif interface.

Example:

| Set up memif interfaces on DUT node | ${nodes[‘DUT1’]} | sock1 | sock2 | 1 | | Set up memif interfaces on DUT node | ${nodes[‘DUT2’]} | sock1 | sock2 | 1 | dut2_memif_if1 | dut2_memif_if2 | 1 | 1 | slave | | ${nodes[‘DUT2’]} | sock1 | sock2 | 1 | rxq=0 | txq=0 | dcr_uuid=_a5730a0a-2ba1-4fe9-91bd-79b9828e968e |


${sid_1}=  Evaluate  (${mid}*2)-1
${sid_2}=  Evaluate  (${mid}*2)
${memif_1}=  Create memif interface  ${dut_node}  ${filename1}${mid}${dcr_uuid}-${sid_1}  ${mid}  ${sid_1}  rxq=${rxq}  txq=${txq}  role=${role}
${memif_2}=  Create memif interface  ${dut_node}  ${filename2}${mid}${dcr_uuid}-${sid_2}  ${mid}  ${sid_2}  rxq=${rxq}  txq=${txq}  role=${role}
Set Interface State  ${dut_node}  ${memif_1}  up
Set Interface State  ${dut_node}  ${memif_2}  up
Set Test Variable  ${${memif_if1}}  ${memif_1}
Set Test Variable  ${${memif_if2}}  ${memif_2}

3.11.5.2. Set up single memif interface on DUT node

Create single Memif interface on given VPP node.

Arguments: - dut_node - DUT node. Type: dictionary - filename - Socket filename for Memif interface. Type: string - mid - Memif interface ID (Optional). Type: integer - sid - Memif socket ID (Optional). Type: integer - memif_if - Name of the Memif interface (Optional). Type: string - rxq - RX queues (Optional). Type: integer - txq - TX queues (Optional). Type: integer - role - Memif role (Optional). Type: string

_NOTE:_ This KW sets following test case variable: - ${${memif_if}} - Memif interface.

Example:

| Set up single memif interface on DUT node | ${nodes[‘DUT1’]} | sock1 | 1 | dut1_memif_if1 | 1 | 1 | slave |


${memif}=  Create memif interface  ${dut_node}  ${filename}${mid}-${sid}  ${mid}  ${sid}  rxq=${rxq}  txq=${txq}  role=${role}
Set Interface State  ${dut_node}  ${memif}  up
Set Test Variable  ${${memif_if}}  ${memif}

3.11.6. testing_path suite

3.11.6.1. Configure path in 2-node circular topology

Compute path for testing on two given nodes in circular topology and set corresponding test case variables.

Arguments: - ${tg_node} - TG node. Type: dictionary - ${dut_node} - DUT node. Type: dictionary - ${tg2_node} - Node where the path ends. Must be the same as TG node parameter in circular topology. Type: dictionary

Return: - No value returned

_NOTE:_ This KW sets following test case variables: - ${tg_node} - TG node. - ${tg_to_dut_if1} - 1st TG interface towards DUT. - ${tg_to_dut_if2} - 2nd TG interface towards DUT. - ${dut_node} - DUT node. - ${dut_to_tg_if1} - 1st DUT interface towards TG. - ${dut_to_tg_if2} - 2nd DUT interface towards TG. - ${tg_to_dut_if1_mac} - ${tg_to_dut_if2_mac} - ${dut_to_tg_if1_mac} - ${dut_to_tg_if2_mac}

Example:

| Given Configure path in 2-node circular topology | ${nodes[‘TG’]} | ${nodes[‘DUT1’]} | ${nodes[‘TG’]} |


Should Be Equal  ${tg_node}  ${tg2_node}
Append Nodes  ${tg_node}  ${dut_node}  ${tg_node}
Compute Path  always_same_link=${FALSE}
${tg_to_dut_if1}  ${tmp}=  First Interface
${tg_to_dut_if2}  ${tmp}=  Last Interface
${dut_to_tg_if1}  ${tmp}=  First Ingress Interface
${dut_to_tg_if2}  ${tmp}=  Last Egress Interface
${tg_to_dut_if1_mac}=  Get interface mac  ${tg_node}  ${tg_to_dut_if1}
${tg_to_dut_if2_mac}=  Get interface mac  ${tg_node}  ${tg_to_dut_if2}
${dut_to_tg_if1_mac}=  Get interface mac  ${dut_node}  ${dut_to_tg_if1}
${dut_to_tg_if2_mac}=  Get interface mac  ${dut_node}  ${dut_to_tg_if2}
Set Test Variable  ${tg_to_dut_if1}
Set Test Variable  ${tg_to_dut_if2}
Set Test Variable  ${dut_to_tg_if1}
Set Test Variable  ${dut_to_tg_if2}
Set Test Variable  ${tg_to_dut_if1_mac}
Set Test Variable  ${tg_to_dut_if2_mac}
Set Test Variable  ${dut_to_tg_if1_mac}
Set Test Variable  ${dut_to_tg_if2_mac}
Set Test Variable  ${tg_node}
Set Test Variable  ${dut_node}

3.11.6.2. Set interfaces in 2-node circular topology up

Set UP state on interfaces in 2-node path on nodes and wait for all interfaces are ready. Requires more than one link between nodes.

Arguments: - No arguments.

Return: - No value returned.

_NOTE:_ This KW uses test variables sets in “Configure path in 2-node circular topology” KW.

Example:

| Given Configure path in 2-node circular topology | ${nodes[‘TG’]} | ${nodes[‘DUT1’]} | ${nodes[‘TG’]} | | And Set interfaces in 2-node circular topology up |


Set Interface State  ${tg_node}  ${tg_to_dut_if1}  up
Set Interface State  ${tg_node}  ${tg_to_dut_if2}  up
Set Interface State  ${dut_node}  ${dut_to_tg_if1}  up
Set Interface State  ${dut_node}  ${dut_to_tg_if2}  up
Vpp Node Interfaces Ready Wait  ${dut_node}

3.11.6.3. Configure path in 3-node circular topology

Compute path for testing on three given nodes in circular topology and set corresponding test case variables.

Arguments: - ${tg_node} - TG node. Type: dictionary - ${dut1_node} - DUT1 node. Type: dictionary - ${dut2_node} - DUT2 node. Type: dictionary - ${tg2_node} - Node where the path ends. Must be the same as TG node parameter in circular topology. Type: dictionary

Return: - No value returned

_NOTE:_ This KW sets following test case variables: - ${tg_node} - TG node. - ${tg_to_dut1} - TG interface towards DUT1. - ${tg_to_dut2} - TG interface towards DUT2. - ${dut1_node} - DUT1 node. - ${dut1_to_tg} - DUT1 interface towards TG. - ${dut1_to_dut2} - DUT1 interface towards DUT2. - ${dut2_node} - DUT2 node. - ${dut2_to_tg} - DUT2 interface towards TG. - ${dut2_to_dut1} - DUT2 interface towards DUT1. - ${tg_to_dut1_mac} - ${tg_to_dut2_mac} - ${dut1_to_tg_mac} - ${dut1_to_dut2_mac} - ${dut2_to_tg_mac} - ${dut2_to_dut1_mac}

Example:

| Given Configure path in 3-node circular topology | ${nodes[‘TG’]} | ${nodes[‘DUT1’]} | ${nodes[‘DUT2’]} | ${nodes[‘TG’]} |


Should Be Equal  ${tg_node}  ${tg2_node}
Append Nodes  ${tg_node}  ${dut1_node}  ${dut2_node}  ${tg_node}
Compute Path
${tg_to_dut1}  ${tmp}=  Next Interface
${dut1_to_tg}  ${tmp}=  Next Interface
${dut1_to_dut2}  ${tmp}=  Next Interface
${dut2_to_dut1}  ${tmp}=  Next Interface
${dut2_to_tg}  ${tmp}=  Next Interface
${tg_to_dut2}  ${tmp}=  Next Interface
${tg_to_dut1_mac}=  Get interface mac  ${tg_node}  ${tg_to_dut1}
${tg_to_dut2_mac}=  Get interface mac  ${tg_node}  ${tg_to_dut2}
${dut1_to_tg_mac}=  Get interface mac  ${dut1_node}  ${dut1_to_tg}
${dut1_to_dut2_mac}=  Get interface mac  ${dut1_node}  ${dut1_to_dut2}
${dut2_to_tg_mac}=  Get interface mac  ${dut2_node}  ${dut2_to_tg}
${dut2_to_dut1_mac}=  Get interface mac  ${dut2_node}  ${dut2_to_dut1}
Set Test Variable  ${tg_to_dut1}
Set Test Variable  ${dut1_to_tg}
Set Test Variable  ${tg_to_dut2}
Set Test Variable  ${dut2_to_tg}
Set Test Variable  ${dut1_to_dut2}
Set Test Variable  ${dut2_to_dut1}
Set Test Variable  ${tg_to_dut1_mac}
Set Test Variable  ${tg_to_dut2_mac}
Set Test Variable  ${dut1_to_tg_mac}
Set Test Variable  ${dut1_to_dut2_mac}
Set Test Variable  ${dut2_to_tg_mac}
Set Test Variable  ${dut2_to_dut1_mac}
Set Test Variable  ${tg_node}
Set Test Variable  ${dut1_node}
Set Test Variable  ${dut2_node}

3.11.6.4. Set interfaces in 3-node circular topology up

Set UP state on interfaces in 3-node path on nodes and wait until all interfaces are ready.

Arguments: - No arguments.

Return: - No value returned.

_NOTE:_ This KW uses test variables sets in “Configure path in 3-node circular topology” KW.

Example:

| Given Configure path in 3-node circular topology | ${nodes[‘TG’]} | ${nodes[‘DUT1’]} | ${nodes[‘TG’]} | | And Set interfaces in 3-node circular topology up |


Set Interface State  ${tg_node}  ${tg_to_dut1}  up
Set Interface State  ${tg_node}  ${tg_to_dut2}  up
Set Interface State  ${dut1_node}  ${dut1_to_tg}  up
Set Interface State  ${dut1_node}  ${dut1_to_dut2}  up
Set Interface State  ${dut2_node}  ${dut2_to_tg}  up
Set Interface State  ${dut2_node}  ${dut2_to_dut1}  up
Vpp Node Interfaces Ready Wait  ${dut1_node}
Vpp Node Interfaces Ready Wait  ${dut2_node}

3.11.6.7. Configure interfaces in path up

Set UP state on interfaces in 2-node or 3-node path on nodes and wait until all interfaces are ready.

Arguments: - No arguments.

Return: - No value returned.

_NOTE:_ This KW uses test variables sets in”Configure path in 2-node circular topology” or”Configure path in 3-node circular topology” KW.

Example:

| Configure interfaces in path up |


${dut2_status}  ${value}=  Run Keyword And Ignore Error  Variable Should Exist  ${dut2}
Run Keyword If  '${dut2_status}' == 'PASS'  Set interfaces in 3-node circular topology up  ELSE  Set interfaces in 2-node circular topology up

3.11.7. traffic suite

3.11.7.1. Send packet and verify headers

Sends packet from IP (with source mac) to IP(with dest mac). There has to be 4 MAC addresses when using2-node + xconnect (one for each eth).

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • src_ip - IP of source interface (TG-if1). Type: string
  • dst_ip - IP of destination interface (TG-if2). Type: string
  • 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_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

(Optional). Type: string - vlan_tx - VLAN (inner) tag on TX side (Optional). Type: integer - vlan_outer_tx - .1AD VLAN (outer) tag on TX side (Optional). Type: integer - encaps_rx - Expected encapsulation on RX side: Dot1q or Dot1ad (Optional). Type: string - vlan_rx - VLAN (inner) tag on RX side (Optional). Type: integer - vlan_outer_rx - .1AD VLAN (outer) tag on RX side (Optional). Type: integer

Return: - No value returned

Example:

| Send packet and verify headers | ${nodes[‘TG’]} | 10.0.0.1 | 32.0.0.1 | eth2 | 08:00:27:ee:fd:b3 | 08:00:27:a2:52:5b | eth3 | 08:00:27:4d:ca:7a | 08:00:27:7d:fd:10 |


${tx_port_name}=  Get interface name  ${tg_node}  ${tx_src_port}
${rx_port_name}=  Get interface name  ${tg_node}  ${rx_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}  --tx_if ${tx_port_name}  --rx_if ${rx_port_name}
${args}=  Run Keyword If  '${encaps_tx}' == '${EMPTY}'  Set Variable  ${args}  ELSE  Catenate  ${args}  --encaps_tx ${encaps_tx}  --vlan_tx ${vlan_tx}
${args}=  Run Keyword If  '${encaps_rx}' == '${EMPTY}'  Set Variable  ${args}  ELSE  Catenate  ${args}  --encaps_rx ${encaps_rx}  --vlan_rx ${vlan_rx}
${args}=  Run Keyword If  '${vlan_outer_tx}' == '${EMPTY}'  Set Variable  ${args}  ELSE  Catenate  ${args}  --vlan_outer_tx ${vlan_outer_tx}
${args}=  Run Keyword If  '${vlan_outer_rx}' == '${EMPTY}'  Set Variable  ${args}  ELSE  Catenate  ${args}  --vlan_outer_rx ${vlan_outer_rx}
Run Traffic Script On Node  send_icmp_check_headers.py  ${tg_node}  ${args}

3.11.7.2. Packet transmission from port to port should fail

Sends packet from ip (with specified mac) to ip(with dest mac). Using keyword : Send packet And Check Headersand subsequently checks the return value.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • src_ip - IP of source interface (TG-if1). Type: string
  • dst_ip - IP of destination interface (TG-if2). Type: string
  • 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_src_mac - MAC address of DUT1-if2. Type: string
  • rx_dst_mac - MAC address of TG-if2. Type: string

Return: - No value returned

Example:

| Packet transmission from port to port should fail | ${nodes[‘TG’]} | 10.0.0.1 | 32.0.0.1 | eth2 | 08:00:27:a2:52:5b | eth3 | 08:00:27:4d:ca:7a | 08:00:27:ee:fd:b3 | 08:00:27:7d:fd:10 |


${tx_port_name}=  Get interface name  ${tg_node}  ${tx_src_port}
${rx_port_name}=  Get interface name  ${tg_node}  ${rx_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}  --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  ${tg_node}  ${args}

3.11.7.3. Send packet and verify ARP request

Send IP packet from tx_port and check if ARP Requestpacket is received on rx_port.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • tx_src_ip - Source IP address of transferred packet (TG-if1).

Type: string - tx_dst_ip - Destination IP address of transferred packet (TG-if2). Type: string - tx_port - Interface from which the IP packet is sent (TG-if1). Type: string - tx_dst_mac - Destination MAC address of IP packet (DUT-if1). Type: string - rx_port - Interface where the IP packet is received (TG-if2). Type: string - rx_src_mac - Source MAC address of ARP packet (DUT-if2). Type: string - rx_arp_src_ip - Source IP address of ARP packet (DUT-if2). Type: string - rx_arp_dst_ip - Destination IP address of ARP packet. Type: string

Return: - No value returned

Example:

| Send Packet And Check ARP Packet | ${nodes[‘TG’]} | 16.0.0.1 | 32.0.0.1 | eth2 | 08:00:27:cc:4f:54 | eth4 | 08:00:27:5b:49:dd | 192.168.2.1 | 192.168.2.2 |


${tx_port_name}=  Get interface name  ${tg_node}  ${tx_port}
${rx_port_name}=  Get interface name  ${tg_node}  ${rx_port}
${args}=  Catenate  --tx_dst_mac ${tx_dst_mac}  --rx_src_mac ${rx_src_mac}  --tx_src_ip ${tx_src_ip}  --tx_dst_ip ${tx_dst_ip}  --tx_if ${tx_port_name}  --rx_if ${rx_port_name}  --rx_arp_src_ip ${rx_arp_src_ip}  --rx_arp_dst_ip ${rx_arp_dst_ip}
Run Traffic Script On Node  send_icmp_check_arp.py  ${tg_node}  ${args}

3.11.7.4. Send TCP or UDP packet and verify received packet

Sends TCP or UDP packet with specified sourceand destination port.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • src_ip - IP of source interface (TG-if1). Type: integer
  • dst_ip - IP of destination interface (TG-if2). Type: integer
  • tx_port - Source interface (TG-if1). Type: string
  • tx_mac - MAC address of source interface (TG-if1). Type: string
  • rx_port - Destionation interface (TG-if1). Type: string
  • rx_mac - MAC address of destination interface (TG-if1). Type: string
  • protocol - Type of protocol. Type: string
  • source_port - Source TCP/UDP port. Type: string or integer
  • destination_port - Destination TCP/UDP port. Type: string or integer

Return: - No value returned

Example:

| Send TCP or UDP packet and verify received packet | ${nodes[‘TG’]} | 16.0.0.1 | 32.0.0.1 | eth2 | 08:00:27:cc:4f:54 | eth4 | 08:00:27:c9:6a:d5 | TCP | 20 80 |


${tx_port_name}=  Get interface name  ${tg_node}  ${tx_port}
${rx_port_name}=  Get interface name  ${tg_node}  ${rx_port}
${args}=  Catenate  --tx_mac ${tx_mac}  --rx_mac ${rx_mac}  --src_ip ${src_ip}  --dst_ip ${dst_ip}  --tx_if ${tx_port_name}  --rx_if ${rx_port_name}  --protocol ${protocol}  --source_port ${source_port}  --destination_port ${destination_port}
Run Traffic Script On Node  send_tcp_udp.py  ${tg_node}  ${args}

3.11.7.5. TCP or UDP packet transmission should fail

Sends TCP or UDP packet with specified sourceand destination port.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • src_ip - IP of source interface (TG-if1). Type: integer
  • dst_ip - IP of destination interface (TG-if2). Type: integer
  • tx_port - Source interface (TG-if1). Type: string
  • tx_mac - MAC address of source interface (TG-if1). Type: string
  • rx_port - Destionation interface (TG-if1). Type: string
  • rx_mac - MAC address of destination interface (TG-if1). Type: string
  • protocol - Type of protocol. Type: string
  • source_port - Source TCP/UDP port. Type: string or integer
  • destination_port - Destination TCP/UDP port. Type: string or integer

Return: - No value returned

Example:

| TCP or UDP packet transmission should fail | ${nodes[‘TG’]} | 16.0.0.1 | 32.0.0.1 | eth2 | 08:00:27:cc:4f:54 | eth4 | 08:00:27:c9:6a:d5 | TCP | 20 | 80 |


${tx_port_name}=  Get interface name  ${tg_node}  ${tx_port}
${rx_port_name}=  Get interface name  ${tg_node}  ${rx_port}
${args}=  Catenate  --tx_mac ${tx_mac}  --rx_mac ${rx_mac}  --src_ip ${src_ip}  --dst_ip ${dst_ip}  --tx_if ${tx_port_name}  --rx_if ${rx_port_name}  --protocol ${protocol}  --source_port ${source_port}  --destination_port ${destination_port}
Run Keyword And Expect Error  TCP/UDP Rx timeout  Run Traffic Script On Node  send_tcp_udp.py  ${tg_node}  ${args}

3.11.7.6. Receive and verify router advertisement packet

Wait until RA packet is received and then verifyspecific fields of received RA packet.

Arguments:

  • node - Node where to check for RA packet. Type: dictionary
  • rx_port - Interface where the packet is received. Type: string
  • src_mac - MAC address of source interface from which the link-localIPv6 address is constructed and checked. Type: string
  • interval - Configured retransmit interval. Optional. Type: integer

Return: - No value returned

Example:

| Receive and verify router advertisement packet | ${nodes[‘DUT1’]} | eth2 | 08:00:27:cc:4f:54 |


${rx_port_name}=  Get interface name  ${node}  ${rx_port}
${args}=  Catenate  --rx_if ${rx_port_name}  --src_mac ${src_mac}  --interval ${interval}
Run Traffic Script On Node  check_ra_packet.py  ${node}  ${args}

3.11.7.7. Send router solicitation and verify response

Send RS packet, wait for response and then verifyspecific fields of received RA packet.

Arguments:

  • tg_node - TG node to send RS packet from. Type: dictionary
  • dut_node - DUT node to send RS packet to. Type: dictionary
  • rx_port - Interface where the packet is sent from. Type: string
  • tx_port - Interface where the packet is sent to. Type: string
  • src_ip - Source IP address of RS packet. Optional. If not provided,link local address will be used. Type: string

Return: - No value returned

Example:

| Send router solicitation and verify response | ${nodes[‘TG’]} | ${nodes[‘DUT1’]} | eth2 | GigabitEthernet0/8/0 | 10::10 |


${src_mac}=  Get Interface Mac  ${tg_node}  ${tx_port}
${dst_mac}=  Get Interface Mac  ${dut_node}  ${rx_port}
${src_int_name}=  Get interface name  ${tg_node}  ${tx_port}
${dst_int_name}=  Get interface name  ${dut_node}  ${rx_port}
${args}=  Catenate  --rx_if ${dst_int_name}  --tx_if ${src_int_name}  --src_mac ${src_mac}  --dst_mac ${dst_mac}  --src_ip ${src_ip}
Run Traffic Script On Node  send_rs_check_ra.py  ${tg_node}  ${args}

3.11.7.8. Send ARP Request

Send ARP Request and check if the ARP Response isreceived.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)<->(if1)DUT

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • tx_port - Interface from which the ARP packet is sent (TG-if1).

Type: string - src_mac - Source MAC address of ARP packet (TG-if1). Type: string - tgt_mac - Target MAC address which is expected in the response (DUT-if1). Type: string - src_ip - Source IP address of ARP packet (TG-if1). Type: string - tgt_ip - Target IP address of ARP packet (DUT-if1). Type: string

Return: - No value returned

Example:

| Send ARP Request | ${nodes[‘TG’]} | eth3 | 08:00:27:cc:4f:54 | 08:00:27:c9:6a:d5 | 10.0.0.100 | 192.168.1.5 |


${args}=  Catenate  --tx_if ${tx_port}  --src_mac ${src_mac}  --dst_mac ${tgt_mac}  --src_ip ${src_ip}  --dst_ip ${tgt_ip}
Run Traffic Script On Node  arp_request.py  ${tg_node}  ${args}

3.11.7.9. ARP request should fail

Send ARP Request and the ARP Response should notbe received.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)<->(if1)DUT

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • tx_port - Interface from which the ARP packet is sent (TG-if1).

Type: string - src_mac - Source MAC address of ARP packet (TG-if1). Type: string - tgt_mac - Target MAC address which is expected in the response (DUT-if1). Type: string - src_ip - Source IP address of ARP packet (TG-if1). Type: string - tgt_ip - Target IP address of ARP packet (DUT-if1). Type: string

Return: - No value returned

Example:

| ARP request should fail | ${nodes[‘TG’]} | eth3 | 08:00:27:cc:4f:54 | 08:00:27:c9:6a:d5 | 10.0.0.100 | 192.168.1.5 |


${args}=  Catenate  --tx_if ${tx_port}  --src_mac ${src_mac}  --dst_mac ${tgt_mac}  --src_ip ${src_ip}  --dst_ip ${tgt_ip}
Run Keyword And Expect Error  ARP reply timeout  Run Traffic Script On Node  arp_request.py  ${tg_node}  ${args}

3.11.7.10. Send packets and verify multipath routing

Send 100 IP ICMP packets traffic and check if it isdivided into two paths.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tg_node - Node to execute scripts on (TG). Type: dictionary
  • src_port - Interface of TG-if1. Type: string
  • dst_port - Interface of TG-if2. Type: string
  • src_ip - IP of source interface (TG-if1). Type: string
  • dst_ip - IP of destination interface (TG-if2). Type: string
  • tx_src_mac - MAC address of TG-if1. Type: string
  • tx_dst_mac - MAC address of DUT-if1. Type: string
  • rx_src_mac - MAC address of DUT-if2. Type: string
  • rx_dst_mac_1 - MAC address of interface for path 1. Type: string
  • rx_dst_mac_2 - MAC address of interface for path 2. Type: string

Return: - No value returned

Example:

| Send Packet And Check Multipath Routing | ${nodes[‘TG’]} | eth2 | eth3 | 16.0.0.1 | 32.0.0.1 | 08:00:27:cc:4f:54 | 08:00:27:c9:6a:d5 | 08:00:27:54:59:f9 | 02:00:00:00:00:02 | 02:00:00:00:00:03 |


${src_port_name}=  Get interface name  ${tg_node}  ${src_port}
${dst_port_name}=  Get interface name  ${tg_node}  ${dst_port}
${args}=  Catenate  --tx_if ${src_port_name}  --rx_if ${dst_port_name}  --src_ip ${src_ip}  --dst_ip ${dst_ip}  --tg_if1_mac ${tx_src_mac}  --dut_if1_mac ${tx_dst_mac}  --dut_if2_mac ${rx_src_mac}  --path_1_mac ${rx_dst_mac_1}  --path_2_mac ${rx_dst_mac_2}
Run Traffic Script On Node  send_icmp_check_multipath.py  ${tg_node}  ${args}

3.11.7.11. Send IPv4 ping packet and verify headers

Send ICMP Echo Request message from source port of sourcenode to destination port of destination node and check the receivedICMP Echo Reply message for correctness inlcuding source anddestination IPv4 and MAC addresses and ttl value. If the destinationnode is TG type the ttl of received ICMP Echo Request message ischecked too and corresponding ICMP Echo Reply message is created.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tx_node - Source node to execute scripts on (mostly TG).

Type: dictionary - tx_port - Source interface of tx_node. Type: string - rx_node - Destinantion node. Type: dictionary - rx_port - Destination interface of rx_node. Type: string - src_ip - IP address of source interface or source remote host. Type: string - dst_ip - IP address of destination interface or destination remote host. Type: string - first_hop_mac - Destination MAC address for the first hop in the path. Type: string - hops - Expected number of hops. Type: string or integer

Return: - No value returned

Example:

| Send IPv4 ping packet and verify headers | ${nodes[‘TG’]} | eth2 | ${nodes[‘DUT1’]} | eth3 | 16.0.0.1 | 32.0.0.1 | 08:00:27:cc:4f:54 | 1 |


${src_mac}=  Get interface MAC  ${tx_node}  ${tx_port}
${dst_mac}=  Get interface MAC  ${rx_node}  ${rx_port}
${is_dst_tg}=  Is TG node  ${rx_node}
${tx_port_name}=  Get interface name  ${tx_node}  ${tx_port}
${rx_port_name}=  Get interface name  ${rx_node}  ${rx_port}
${args}=  Traffic Script Gen Arg  ${rx_port_name}  ${tx_port_name}  ${src_mac}  ${dst_mac}  ${src_ip}  ${dst_ip}
${args}=  Catenate  ${args}  --hops ${hops}  --first_hop_mac ${first_hop_mac}  --is_dst_tg ${is_dst_tg}
Run Traffic Script On Node  ipv4_ping_ttl_check.py  ${tx_node}  ${args}

3.11.7.12. Send IPv6 echo request packet and verify headers

Send ICMPv6 Echo Request message from source port ofsource node to destination port of destination node and checkthe received ICMPv6 Echo Reply message for correctness inlcudingsource and destination IPv4 and MAC addresses and hlim value. Ifthe destination node is TG type the hlim of received ICMP EchoRequest message is checked too and corresponding ICMP Echo Replymessage is created and sent.

Arguments:

_NOTE:_ Arguments are based on topology: TG(if1)->(if1)DUT(if2)->TG(if2)

  • tx_node - Source node to execute scripts on (mostly TG).

Type: dictionary - tx_port - Source interface of tx_node. Type: string - rx_node - Destinantion node. Type: dictionary - rx_port - Destination interface of rx_node. Type: string - src_ip - IPv6 address of source interface or source remote host. Type: string - dst_ip - IPv6 address of destination interface or destination remote host. Type: string - src_nh_mac - Destination MAC address for the first hop in the path in direction from source node. Type: string - hops - Expected number of hops. Type: string or integer - dst_nh_mac - Destination MAC address for the first hop in the path in direction from destination node (Optional). Type: string

Return: - No value returned

Example:

| Send IPv6 echo request packet and verify headers | ${nodes[‘TG’]} | eth2 | ${nodes[‘DUT1’]} | eth3 | 3ffe:5f::1 | 3ffe:5f::2 | 08:00:27:cc:4f:54 | 1 |


${src_mac}=  Get interface MAC  ${tx_node}  ${tx_port}
${dst_mac}=  Get interface MAC  ${rx_node}  ${rx_port}
${is_dst_tg}=  Is TG node  ${rx_node}
${tx_port_name}=  Get interface name  ${tx_node}  ${tx_port}
${rx_port_name}=  Get interface name  ${rx_node}  ${rx_port}
${args}=  Traffic Script Gen Arg  ${rx_port_name}  ${tx_port_name}  ${src_mac}  ${dst_mac}  ${src_ip}  ${dst_ip}
${args}=  Catenate  ${args}  --h_num ${hops}  --src_nh_mac ${src_nh_mac}  --dst_nh_mac ${dst_nh_mac}  --is_dst_tg ${is_dst_tg}
Run Traffic Script On Node  icmpv6_echo_req_resp.py  ${tx_node}  ${args}