CSIT-235: Switched Port Analyzer mirroring (SPAN) - IPv4
[csit.git] / resources / libraries / robot / telemetry / span.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
14 *** Settings ***
15 | Library | resources.libraries.python.TrafficScriptExecutor
16 | Library | resources.libraries.python.topology.Topology
17 | Documentation | SPAN traffic keywords
18
19 *** Keywords ***
20 | Send Packet And Check Received Copies
21 | | [Documentation] | Sends an ARP or ICMP packet from TG to DUT using one\
22 | | ... | link, then receive a copy of both the sent packet and the DUT's reply\
23 | | ... | on the second link.
24 | | ...
25 | | ... | *Arguments:*
26 | | ...
27 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
28 | | ... | - tx_src_port - First interface on TG. Type: string
29 | | ... | - tx_src_mac - MAC address of the first interface on TG. Type: string
30 | | ... | - tx_dst_mac - MAC address of the first interface on DUT. Type: string
31 | | ... | - rx_port - Second interface on TG. Type: string
32 | | ... | - src_ip - Packet source IP address. Type: string
33 | | ... | - dst_ip - Packet destination IP address. Type: string
34 | | ... | - ptype - Type of payload, ARP or ICMP. Type: string
35 | | ...
36 | | ... | *Return:*
37 | | ... | - No value returned
38 | | ...
39 | | ... | *Example:*
40 | | ...
41 | | ... | \| Send Packet And Check Received Copies \| ${nodes['TG']} \| eth1 \
42 | | ... | \| 8:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
43 | | ... | \| eth3 \| 192.168.0.2 \| 192.168.0.3 \| ARP \|
44 | | ...
45 | | [Arguments] | ${tg_node} | ${tx_src_port}
46 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port}
47 | | ... | ${src_ip} | ${dst_ip} | ${ptype}
48 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
49 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
50 | | ${args}= | Catenate
51 | | ... | --tg_src_mac ${tx_src_mac} --dut_if1_mac ${tx_dst_mac}
52 | | ... | --src_ip ${src_ip} --dst_ip ${dst_ip}
53 | | ... | --tx_if ${tx_port_name} --rx_if | ${rx_port_name}
54 | | ... | --ptype ${ptype}
55 | | Run Traffic Script On Node | span_check.py | ${tg_node} |
56 | | ... | ${args}