4 Vhosts setup test
[csit.git] / resources / libraries / robot / l2_traffic.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 | Documentation | Keywords for send and receive different types of traffic through L2 network.
16 | Library | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.TrafficScriptExecutor
18
19 *** Keywords ***
20 | Send and receive ICMP Packet
21 | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to
22 | | ...             | destination interface.
23 | | ...
24 | | ... | *Arguments:*
25 | | ...
26 | | ... | - {tg_node} - TG node. Type: dictionary
27 | | ... | - {src_int} - Source interface. Type: string
28 | | ... | - {dst_int} - Destination interface. Type: string
29 | | ... | - {src_ip} - Source IP address (Optional). Type: string
30 | | ... | - {dst_ip} - Destination IP address (Optional). Type: string
31 | | ...
32 | | ... | *Return:*
33 | | ...
34 | | ... | - No value returned
35 | | ...
36 | | ... | *Example:*
37 | | ...
38 | | ... | _NOTE:_ Default IP is IPv4
39 | | ...
40 | | ... | \| Send and receive ICMP Packet \| ${nodes['TG']} \
41 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
42 | | ...
43 | | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} |
44 | | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2
45 | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int}
46 | | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int}
47 | | ${args}= | Traffic Script Gen Arg | ${dst_int} | ${src_int} | ${src_mac}
48 | |          | ...                    | ${dst_mac} | ${src_ip} | ${dst_ip}
49 | | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
50
51 | Send and receive ICMPv4 bidirectionally
52 | | [Documentation] | Send ICMPv4 echo request from both directions,
53 | | ...             | from interface1 to interface2 and
54 | | ...             | from interface2 to interface1.
55 | | ...
56 | | ... | *Arguments:*
57 | | ...
58 | | ... | - {tg_node} - TG node. Type: dictionary
59 | | ... | - {src_int} - Source interface. Type: string
60 | | ... | - {dst_int} - Destination interface. Type: string
61 | | ... | - {src_ip} - Source IP address (Optional). Type: string
62 | | ... | - {dst_ip} - Destination IP address (Optional). Type: string
63 | | ...
64 | | ... | *Return:*
65 | | ...
66 | | ... | - No value returned
67 | | ...
68 | | ... | *Example:*
69 | | ...
70 | | ... | \| Send and receive ICMPv4 bidirectionally \| ${nodes['TG']} \
71 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
72 | | ...
73 | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 |
74 | | ... | ${dst_ip}=192.168.100.2
75 | | Send and receive ICMP Packet | ${tg_node} | ${int1} | ${int2} |
76 | | ... | ${src_ip} | ${dst_ip}
77 | | Send and receive ICMP Packet | ${tg_node} | ${int2} | ${int1} |
78 | | ... | ${dst_ip} | ${src_ip}
79
80 | Send and receive ICMPv6 bidirectionally
81 | | [Documentation] | Send ICMPv6 echo request from both directions,
82 | | ...             | from interface1 to interface2 and
83 | | ...             | from interface2 to interface1.
84 | | ...
85 | | ... | *Arguments:*
86 | | ...
87 | | ... | - {tg_node} - TG node. Type: dictionary
88 | | ... | - {src_int} - Source interface. Type: string
89 | | ... | - {dst_int} - Destination interface. Type: string
90 | | ... | - {src_ip} - Source IP address (Optional). Type: string
91 | | ... | - {dst_ip} - Destination IP address (Optional). Type: string
92 | | ...
93 | | ... | *Return:*
94 | | ...
95 | | ... | - No value returned
96 | | ...
97 | | ... | *Example:*
98 | | ...
99 | | ... | \| Send and receive ICMPv6 bidirectionally \| ${nodes['TG']} \
100 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
101 | | ...
102 | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 |
103 | | ... | ${dst_ip}=3ffe:63::2
104 | | Send and receive ICMP Packet | ${tg_node} | ${int1} | ${int2} |
105 | | ... | ${src_ip} | ${dst_ip}
106 | | Send and receive ICMP Packet | ${tg_node} | ${int2} | ${int1} |
107 | | ... | ${dst_ip} | ${src_ip}