330cc79b2300f593f678263026805279822f728b
[csit.git] / resources / libraries / robot / interfaces.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13 *** Settings ***
14 | Library | resources.libraries.python.InterfaceUtil
15 | Library | resources.libraries.python.NodePath
16 | Resource | resources/libraries/robot/vat/interfaces.robot
17
18 *** Keywords ***
19 | VPP reports interfaces on | [Arguments] | ${node}
20 | | VPP reports interfaces through VAT on | ${node}
21 #| | VPP reports interfaces through ODL on | ${node}
22 #| | VPP reports interfaces through DEBUGCLI on | ${node}
23
24 | Setup MTU on TG based on MTU on DUT
25 | | [Documentation] | Type of the tg_node must be TG and dut_node must be DUT
26 | | [Arguments] | ${tg_node} | ${dut_node}
27 | | Append Nodes | ${tg_node} | ${dut_node}
28 | | Compute Path
29 | | ${tg_port} | ${tg_node}= | First Interface
30 | | ${dut_port} | ${dut_node}= | Last Interface
31 | | # get physical layer MTU (max. size of Ethernet frame)
32 | | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port}
33 | | # Ethernet MTU is physical layer MTU minus size of Ethernet header and FCS
34 | | ${eth_mtu}= | Evaluate | ${mtu} - 14 - 4
35 | | Set Interface Ethernet MTU | ${tg_node} | ${tg_port} | ${eth_mtu}
36
37 | Interfaces on all VPP nodes in the path are up
38 | | [Documentation] | Wait until all interfaces of the given VPP node
39 | | ...             | with admin-up state are in link-up state.
40 | | ...
41 | | ... | *Arguments:*
42 | | ... | - @{node_list} - DUT nodes. Type: list
43 | | ...
44 | | ... | *Return:*
45 | | ... | - No value returned
46 | | ...
47 | | ... | *Example:*
48 | | ...
49 | | ... | \| Interfaces on all VPP nodes in the path are up \
50 | | ... | \| ${nodes['DUT1']} \| ${nodes['DUT2']} \|
51 | | [Arguments] | @{node_list}
52 | | :FOR | ${node} | IN | @{node_list}
53 | |      | VPP Node Interfaces Ready Wait | ${node}