diff options
author | Peter Mikus <pmikus@cisco.com> | 2017-06-06 07:15:29 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2017-07-04 04:54:16 +0000 |
commit | d166ae0881c29dfd05ed61b9a12156f17981bb6d (patch) | |
tree | a4d0c939dc99d55d12ba85fedffb33fef9475be2 /resources/libraries/robot | |
parent | 036e5a85bab081bfa94b8c025c06aee0addb94cb (diff) |
CSIT-651 Add keywords and template for memif
Add keywords and template for memif
Change-Id: I8bd5cfe345260750a74930c8ef55690be5f2dd5e
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/robot')
5 files changed, 140 insertions, 1 deletions
diff --git a/resources/libraries/robot/performance/performance_configuration.robot b/resources/libraries/robot/performance/performance_configuration.robot index 17b8c68545..f905f0cf3e 100644 --- a/resources/libraries/robot/performance/performance_configuration.robot +++ b/resources/libraries/robot/performance/performance_configuration.robot @@ -1595,3 +1595,48 @@ | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2} | | Configure deterministic mode for SNAT | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30 + +| Initialize L2 xconnect for '${nr}' memif pairs in 3-node circular topology +| | [Documentation] +| | ... | Create pairs of Memif interfaces on all defined VPP nodes. Cross +| | ... | connect each Memif interface with one physical interface or virtual +| | ... | interface to create a chain accross DUT node. +| | ... +| | ... | *Arguments:* +| | ... | _None_ +| | ... +| | ... | *Note:* +| | ... | Socket paths for Memif are defined in following format: +| | ... | - /tmp/memif-${number}-1 +| | ... | - /tmp/memif-${number}-2 +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize L2 xconnect for 1 Memif in 3-node circular topology \| +| | ... +| | Set Interface State | ${dut1} | ${dut1_if1} | up +| | Set Interface State | ${dut1} | ${dut1_if2} | up +| | Set Interface State | ${dut2} | ${dut2_if1} | up +| | Set Interface State | ${dut2} | ${dut2_if2} | up +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | ${sock1}= | Set Variable | /tmp/memif-${number}-1 +| | | ${sock2}= | Set Variable | /tmp/memif-${number}-2 +| | | ${prev_index}= | Evaluate | ${number}-1 +| | | Set up memif interfaces on DUT node | ${dut1} +| | | ... | ${sock1} | ${sock2} | ${number} | dut1-memif-${number}-if1 +| | | ... | dut1-memif-${number}-if2 +| | | ${dut1_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut1_if1} +| | | ... | ${dut1-memif-${prev_index}-if2} +| | | Configure L2XC | ${dut1} | ${dut1_xconnect_if1} +| | | ... | ${dut1-memif-${number}-if1} +| | | Set up memif interfaces on DUT node | ${dut2} +| | | ... | ${sock1} | ${sock2} | ${number} | dut2-memif-${number}-if1 +| | | ... | dut2-memif-${number}-if2 +| | | ${dut2_xconnect_if1}= | Set Variable If | ${number}==1 | ${dut2_if1} +| | | ... | ${dut2-memif-${prev_index}-if2} +| | | Configure L2XC | ${dut2} | ${dut2_xconnect_if1} +| | | ... | ${dut2-memif-${number}-if1} +| | | Run Keyword If | ${number}==${nr} | Configure L2XC +| | | ... | ${dut1} | ${dut1-memif-${number}-if2} | ${dut1_if2} +| | | Run Keyword If | ${number}==${nr} | Configure L2XC +| | | ... | ${dut2} | ${dut2-memif-${number}-if2} | ${dut2_if2} diff --git a/resources/libraries/robot/performance/performance_setup.robot b/resources/libraries/robot/performance/performance_setup.robot index a2aaa52bc8..de50fd3254 100644 --- a/resources/libraries/robot/performance/performance_setup.robot +++ b/resources/libraries/robot/performance/performance_setup.robot @@ -378,12 +378,26 @@ | | ... | | Teardown traffic generator | ${tg} +| Tear down 3-node performance topology with LXC +| | [Documentation] +| | ... | Suite teardown phase with traffic generator teardown and LXC destroy. +| | ... +| | Teardown traffic generator | ${tg} +| | Destroy '${lxc_count}' LXC containers on all DUT nodes + | Tear down 2-node performance topology | | [Documentation] | | ... | Suite teardown phase with traffic generator teardown. | | ... | | Teardown traffic generator | ${tg} +| Tear down 2-node performance topology with LXC +| | [Documentation] +| | ... | Suite teardown phase with traffic generator teardown and LXC destroy. +| | ... +| | Teardown traffic generator | ${tg} +| | Destroy '${lxc_count}' LXC containers on all DUT nodes + # Tests setups | Set up performance test diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index 544aaeb343..6c9f3a5930 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -23,6 +23,8 @@ | Resource | resources/libraries/robot/shared/default.robot | Resource | resources/libraries/robot/shared/interfaces.robot | Resource | resources/libraries/robot/shared/counters.robot +| Resource | resources/libraries/robot/shared/lxc.robot +| Resource | resources/libraries/robot/shared/memif.robot | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot | Resource | resources/libraries/robot/l2/l2_xconnect.robot | Resource | resources/libraries/robot/ip/ip4.robot diff --git a/resources/libraries/robot/shared/lxc.robot b/resources/libraries/robot/shared/lxc.robot index 83bd5c1837..52d81dd3e4 100644 --- a/resources/libraries/robot/shared/lxc.robot +++ b/resources/libraries/robot/shared/lxc.robot @@ -227,7 +227,6 @@ | | Run keyword | ${lxc_name}_conf.Add unix exec | "/tmp/running.exec" | | Run keyword | ${lxc_name}_conf.Add CPU main core | "0" | | Run keyword | ${lxc_name}_conf.Add CPU corelist workers | ${lxc_cpus} -| | Run keyword | ${lxc_name}_conf.Add plugin disable | "dpdk_plugin.so" | | Run Keyword | ${lxc_name}_conf.Apply config LXC | ${lxc_name} | Create startup configuration of VPP on '${nr}' LXC containers on '${dut}' node diff --git a/resources/libraries/robot/shared/memif.robot b/resources/libraries/robot/shared/memif.robot new file mode 100644 index 0000000000..2ce2ea2e8c --- /dev/null +++ b/resources/libraries/robot/shared/memif.robot @@ -0,0 +1,79 @@ +# Copyright (c) 2017 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: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +| Library | resources.libraries.python.Memif +| Documentation | Memif interface keyword library. + +*** Keywords *** +| Set up memif interfaces on DUT node +| | [Documentation] | Create two Memif interfaces on given VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - DUT node. Type: dictionary +| | ... | - ${sock1} - Socket path for first Memif interface. Type: string +| | ... | - ${sock2} - Socket path for second Memif interface. Type: string +| | ... | - ${number} - Memif interface key. Type: integer +| | ... | - ${memif_if1} - Name of the first Memif interface (Optional). +| | ... | Type: string +| | ... | - ${memif_if2} - Name of the second Memif interface (Optional). +| | ... | Type: string +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - ${${memif_if1}} - First Memif interface. +| | ... | - ${${memif_if2}} - Second Memif interface. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Set up memif interfaces on DUT node \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| 1 \| +| | ... | \| Set up memif interfaces on DUT node \ +| | ... | \| ${nodes['DUT2']} \| /tmp/sock1 \| /tmp/sock2 \| 1 \ +| | ... | \| dut2_memif_if1 \| dut2_memif_if2 \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${number}=${1} +| | ... | ${memif_if2}=memif_if1 | ${memif_if1}=memif_if2 +| | ${key_1}= | Evaluate | (${number}*2)-1 +| | ${key_2}= | Evaluate | (${number}*2) +| | ${memif_1}= | Create memif interface | ${dut_node} | ${sock1} | ${key_1} +| | ${memif_2}= | Create memif interface | ${dut_node} | ${sock2} | ${key_2} +| | 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} + +| Create memif VPP configuration on '${nr}' LXC containers on '${dut}' node +| | [Documentation] | Create memif configuration of VPP on multiple LXC +| | ... | container on DUT node. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create memif VPP configuration on 1 LXC containers on DUT1 node \| +| | ... +| | :FOR | ${number} | IN RANGE | 1 | ${nr}+1 +| | | Run Keyword | ${dut}_${lxc_base_name}_${number}.Create VPP cfg in container +| | | ... | memif_create_lxc.vat | socket1=memif-${number}-1 +| | | ... | socket2=memif-${number}-2 + +| Create memif VPP configuration on '${nr}' LXC containers on all DUT nodes +| | [Documentation] | Create memif configuration of VPP on multiple LXC +| | ... | container on all DUT nodes. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Create memif VPP configuration on 1 LXC containers on all \ +| | ... | DUT nodes \| +| | ... +| | ${duts}= | Get Matches | ${nodes} | DUT* +| | :FOR | ${dut} | IN | @{duts} +| | | Create memif VPP configuration on '${nr}' LXC containers on '${dut}' node |