Align suite/test teardown/setup
[csit.git] / resources / libraries / robot / shared / default.robot
index 6e26abc..b7e4a75 100644 (file)
 | Library | resources.libraries.python.topology.Topology
 | ...
 | Resource | resources/libraries/robot/shared/container.robot
-| Resource | resources/libraries/robot/vm/qemu.robot
+| Resource | resources/libraries/robot/shared/qemu.robot
+| Resource | resources/libraries/robot/shared/suite_teardown.robot
+| Resource | resources/libraries/robot/shared/test_teardown.robot
 
-*** Keywords ***
-| Configure all DUTs before test
-| | [Documentation] | Setup all DUTs in topology before test execution.
-| | ...
-| | Setup All DUTs | ${nodes}
 
+*** Keywords ***
 | Configure all TGs for traffic script
 | | [Documentation] | Prepare all TGs before traffic scripts execution.
 | | ...
 | | :FOR | ${dut} | IN | @{duts}
 | | | Vpp Show Errors | ${nodes['${dut}']}
 
-| Show VPP trace dump on all DUTs
-| | [Documentation] | 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}']}
-
 | Show Bridge Domain Data On All DUTs
 | | [Documentation] | Show Bridge Domain data on all DUTs.
 | | ...
 | | | Run keyword | ${dut}.Add DPDK Uio Driver
 | | | Run keyword | ${dut}.Add Heapsize | 4G
 | | | Run keyword | ${dut}.Add Statseg size | 4G
+| | | Run keyword | ${dut}.Add Statseg Per Node Counters | on
 | | | 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 | DUT2.Add DPDK SW Cryptodev | ${sw_pmd_type} | ${socket_id}
 | | ... | ${thr_count_int}
 
-| Apply startup configuration on all VPP DUTs
-| | [Documentation] | Write startup configuration and restart VPP on all DUTs.
+| Write startup configuration on all VPP DUTs
+| | [Documentation] | Write VPP startup configuration on all DUTs.
 | | ...
-| | ... | *Arguments:*
-| | ... | - restart_vpp - Whether to restart VPP (Optional). Type: boolean
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Apply startup configuration on all VPP DUTs \| ${False} \|
-| | ...
-| | [Arguments] | ${restart_vpp}=${True}
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | Run keyword | ${dut}.Write Config
+
+| Apply startup configuration on all VPP DUTs
+| | [Documentation] | Write VPP startup configuration and restart VPP on all
+| | ... | DUTs.
 | | ...
 | | ${duts}= | Get Matches | ${nodes} | DUT*
 | | :FOR | ${dut} | IN | @{duts}
-| | | Run keyword | ${dut}.Apply Config | restart_vpp=${restart_vpp}
+| | | Run keyword | ${dut}.Apply Config
+| | Save VPP PIDs
 | | Enable Coredump Limit VPP on All DUTs | ${nodes}
 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
 
 | | :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}
 
 | Verify VPP PID in Teardown
 | Set up functional test
 | | [Documentation] | Common test setup for functional tests.
 | | ...
-| | Configure all DUTs before test
+| | Restart Vpp Service On All Duts | ${nodes}
+| | Verify Vpp On All Duts | ${nodes}
+| | VPP Enable Traces On All Duts | ${nodes}
 | | Save VPP PIDs
 | | Configure all TGs for traffic script
 | | Update All Interface Data On All Nodes | ${nodes}
 # much
 | | [Documentation] | Common test setup for vpp-device tests.
 | | ...
-| | Configure all DUTs before test
+| | Restart Vpp Service On All Duts | ${nodes}
+| | Verify Vpp On All Duts | ${nodes}
+| | VPP Enable Traces On All Duts | ${nodes}
 | | Save VPP PIDs
 | | Configure all TGs for traffic script
 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg_udev=${True}
 | | Reset PAPI History On All DUTs | ${nodes}
 
-| Tear down VPP device test
-# TODO: Generalize this KW if it will not diverge from Functional derivate too
-# much
-| | [Documentation] | 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 PAPI History On All DUTs | ${nodes}
-| | Vpp Show Errors On All DUTs | ${nodes}
-| | Verify VPP PID in Teardown
-
 | Tear down LISP functional test
 | | [Documentation] | Common test teardown for functional tests with LISP.
 | | ...
 | | Vpp Show Errors On All DUTs | ${nodes}
 | | Verify VPP PID in Teardown
 
-| Tear down LISP functional test with QEMU
-| | [Documentation] | Common test teardown for functional tests with LISP and\
-| | ... | QEMU.
-| | ...
-| | Remove All Added Ports On All DUTs From Topology | ${nodes}
-| | Show Packet Trace on All DUTs | ${nodes}
-| | Show PAPI History On All DUTs | ${nodes}
-| | Show Vpp Settings | ${nodes['DUT1']}
-| | Show Vpp Settings | ${nodes['DUT2']}
-| | Vpp Show Errors On All DUTs | ${nodes}
-| | Tear down QEMU
-| | Verify VPP PID in Teardown
-
-| Set up TAP functional test
-| | [Documentation] | Common test setup for functional tests with TAP.
-| | ...
-| | Set up functional test
-| | Clean Up Namespaces | ${nodes['DUT1']}
-
 | Set up functional test with containers
 | | [Documentation]
 | | ... | Common test setup for functional tests with containers.
 | | Start VPP in all '${container_group}' containers
 | | Append To List | ${container_groups} | ${container_group}
 
-| Tear down TAP functional test
-| | [Documentation] | Common test teardown for functional tests with TAP.
-| | ...
-| | Tear down functional test
-| | Clean Up Namespaces | ${nodes['DUT1']}
-
-| Tear down TAP functional test with Linux bridge
-| | [Documentation] | 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} \|
-| | ...
-| | [Arguments] | ${bid_TAP}
-| | ...
-| | Tear down functional test
-| | Linux Del Bridge | ${nodes['DUT1']} | ${bid_TAP}
-| | Clean Up Namespaces | ${nodes['DUT1']}
-
-| Tear down functional test with container
-| | [Documentation]
-| | ... | Common test teardown for functional tests which uses containers.
-| | ...
-| | :FOR | ${container_group} | IN | @{container_groups}
-| | | Destroy all '${container_group}' containers
-
 | Stop VPP Service on DUT
 | | [Documentation] | Stop the VPP service on the specified node.
 | | ...
 | | ...
 | | [Arguments] | ${node}
 | | Stop VPP Service | ${node}
-
-| Start VPP Service on DUT
-| | [Documentation] | 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']} \|
-| | ...
-| | [Arguments] | ${node}
-| | Start VPP Service | ${node}