X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fshared%2Finterfaces.robot;h=55d0a3d844ac2a28787903df5ed4771f46f91679;hb=a0a1bdba6245c685898bab5007de28452bbd2d27;hp=ae2aa7b9a84c22aaa1514485fed75e2aff9db659;hpb=484cb0bddf8ad75129ac20b955a72f36f4241ad2;p=csit.git diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot index ae2aa7b9a8..55d0a3d844 100644 --- a/resources/libraries/robot/shared/interfaces.robot +++ b/resources/libraries/robot/shared/interfaces.robot @@ -162,10 +162,16 @@ | | ... | ${${dut}_if2_vf0} | | ${dut_eth_vf_if1}= | VPP Create AVF Interface | ${nodes['${dut}']} | | ... | ${if1_pci} | ${rxq_count_int} +| | ${dut_eth_vf_if1_mac}= | Get Interface MAC | ${nodes['${dut}']} +| | ... | ${dut_eth_vf_if1} | | ${dut_eth_vf_if2}= | VPP Create AVF Interface | ${nodes['${dut}']} | | ... | ${if2_pci} | ${rxq_count_int} +| | ${dut_eth_vf_if2_mac}= | Get Interface MAC | ${nodes['${dut}']} +| | ... | ${dut_eth_vf_if2} | | Set Test Variable | ${${dut_str}_if1} | ${dut_eth_vf_if1} | | Set Test Variable | ${${dut_str}_if2} | ${dut_eth_vf_if2} +| | Set Test Variable | ${${dut_str}_if1_mac} | ${dut_eth_vf_if1_mac} +| | Set Test Variable | ${${dut_str}_if2_mac} | ${dut_eth_vf_if2_mac} | Initialize AVF interfaces | | [Documentation] @@ -246,14 +252,14 @@ | | ... | | ${dut_str}= | Convert To Lowercase | ${dut} | | :FOR | ${id} | IN RANGE | 1 | ${count} + 1 -| | | ${if1_vlan}= | Run Keyword If | ${${dut_str}_vlan1} -| | | ... | Set Variable | ${${dut_str}_vlan1} -| | | ... | ELSE -| | | ... | Evaluate | ${100} + ${id} - ${1} -| | | ${if2_vlan}= | Run Keyword If | ${${dut_str}_vlan2} -| | | ... | Set Variable | ${${dut_str}_vlan2} -| | | ... | ELSE -| | | ... | Evaluate | ${200} + ${id} - ${1} +| | | ${if1_vlan}= | Get Variable Value | \${${dut_str}_vlan1} +| | | ${default}= | Evaluate | ${100} + ${id} - ${1} +| | | ${if1_vlan}= | Set Variable If | '${if1_vlan}' == '${NONE}' +| | | ... | ${default} | ${if1_vlan} +| | | ${if2_vlan}= | Get Variable Value | \${${dut_str}_vlan2} +| | | ${default}= | Evaluate | ${200} + ${id} - ${1} +| | | ${if2_vlan}= | Set Variable If | '${if2_vlan}' == '${NONE}' +| | | ... | ${default} | ${if2_vlan} | | | ${if1_name} | ${if1_index}= | Run Keyword If | | | ... | ${create} or ${id} == ${1} | | | ... | Create Vlan Subinterface @@ -370,3 +376,38 @@ | | :FOR | ${dut} | IN | @{duts} | | | Initialize layer ip4vxlan on node | ${dut} | count=${count} | | Set Test Variable | ${prev_layer} | ip4vxlan + +| Configure vhost interfaces +| | [Documentation] +| | ... | Create two Vhost-User interfaces on defined VPP node. +| | ... +| | ... | *Arguments:* +| | ... | - ${dut_node} - DUT node. Type: dictionary +| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string +| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string +| | ... | - ${vhost_if1} - Name of the first Vhost-User interface (Optional). +| | ... | Type: string +| | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional). +| | ... | Type: string +| | ... +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - ${${vhost_if1}} - First Vhost-User interface. +| | ... | - ${${vhost_if2}} - Second Vhost-User interface. +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Configure vhost interfaces \ +| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| +| | ... | \| Configure vhost interfaces \ +| | ... | \| ${nodes['DUT2']} \| /tmp/sock1 \| /tmp/sock2 \| dut2_vhost_if1 \ +| | ... | \| dut2_vhost_if2 \| +| | ... +| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1 +| | ... | ${vhost_if2}=vhost_if2 +| | ... +| | ${vhost_1}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock1} +| | ${vhost_2}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock2} +| | Set Interface State | ${dut_node} | ${vhost_1} | up +| | Set Interface State | ${dut_node} | ${vhost_2} | up +| | Set Test Variable | ${${vhost_if1}} | ${vhost_1} +| | Set Test Variable | ${${vhost_if2}} | ${vhost_2}