c2b897d6a02cd4cf2dbaa8eb41a4ad1a2ab474ea
[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 | Library | resources.libraries.python.VatExecutor
17
18 *** Keywords ***
19 | VPP reports interfaces through VAT on '${node}'
20 | | Execute Script | dump_interfaces.vat | ${node}
21 | | Script Should Have Passed
22
23 | Configure MTU on TG based on MTU on DUT
24 | | [Documentation] | Type of the tg_node must be TG and dut_node must be DUT
25 | | [Arguments] | ${tg_node} | ${dut_node}
26 | | Append Nodes | ${tg_node} | ${dut_node}
27 | | Compute Path
28 | | ${tg_port} | ${tg_node}= | First Interface
29 | | ${dut_port} | ${dut_node}= | Last Interface
30 | | # get physical layer MTU (max. size of Ethernet frame)
31 | | ${mtu}= | Get Interface MTU | ${dut_node} | ${dut_port}
32 | | # Ethernet MTU is physical layer MTU minus size of Ethernet header and FCS
33 | | ${eth_mtu}= | Evaluate | ${mtu} - 14 - 4
34 | | Set Interface Ethernet MTU | ${tg_node} | ${tg_port} | ${eth_mtu}
35