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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
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
20 | Send and receive ICMP Packet
21 | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to
22 | | ... | destination interface.
24 | | ... | *Arguments:*
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
34 | | ... | - No value returned
38 | | ... | _NOTE:_ Default IP is IPv4
40 | | ... | \| Send and receive ICMP Packet \| ${nodes['TG']} \
41 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
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 | | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int}
48 | | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int}
49 | | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} | ${src_mac}
50 | | | ... | ${dst_mac} | ${src_ip} | ${dst_ip}
51 | | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
53 | Send and receive ICMP Packet should failed
54 | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to
55 | | ... | destination interface and expect failure with
56 | | ... | ICMP echo Rx timeout error message.
58 | | ... | *Arguments:*
60 | | ... | - tg_node - TG node. Type: dictionary
61 | | ... | - src_int - Source interface. Type: string
62 | | ... | - dst_int - Destination interface. Type: string
63 | | ... | - src_ip - Source IP address (Optional). Type: string
64 | | ... | - dst_ip - Destination IP address (Optional). Type: string
68 | | ... | - No value returned
72 | | ... | _NOTE:_ Default IP is IPv4
74 | | ... | \| Send and receive ICMP Packet \| ${nodes['TG']} \
75 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
77 | | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} |
78 | | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2
79 | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int}
80 | | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int}
81 | | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int}
82 | | ${dst_int_name}= | Get interface name | ${tg_node} | ${dst_int}
83 | | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name} | ${src_mac}
84 | | | ... | ${dst_mac} | ${src_ip} | ${dst_ip}
85 | | Run Keyword And Expect Error | ICMP echo Rx timeout |
86 | | ... | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
88 | Send and receive ICMPv4 bidirectionally
89 | | [Documentation] | Send ICMPv4 echo request from both directions,
90 | | ... | from interface1 to interface2 and
91 | | ... | from interface2 to interface1.
93 | | ... | *Arguments:*
95 | | ... | - tg_node - TG node. Type: dictionary
96 | | ... | - src_int - Source interface. Type: string
97 | | ... | - dst_int - Destination interface. Type: string
98 | | ... | - src_ip - Source IP address (Optional). Type: string
99 | | ... | - dst_ip - Destination IP address (Optional). Type: string
103 | | ... | - No value returned
107 | | ... | \| Send and receive ICMPv4 bidirectionally \| ${nodes['TG']} \
108 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
110 | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 |
111 | | ... | ${dst_ip}=192.168.100.2
112 | | Send and receive ICMP Packet | ${tg_node} | ${int1} | ${int2} |
113 | | ... | ${src_ip} | ${dst_ip}
114 | | Send and receive ICMP Packet | ${tg_node} | ${int2} | ${int1} |
115 | | ... | ${dst_ip} | ${src_ip}
117 | Send and receive ICMPv6 bidirectionally
118 | | [Documentation] | Send ICMPv6 echo request from both directions,
119 | | ... | from interface1 to interface2 and
120 | | ... | from interface2 to interface1.
122 | | ... | *Arguments:*
124 | | ... | - tg_node - TG node. Type: dictionary
125 | | ... | - src_int - Source interface. Type: string
126 | | ... | - dst_int - Destination interface. Type: string
127 | | ... | - src_ip - Source IP address (Optional). Type: string
128 | | ... | - dst_ip - Destination IP address (Optional). Type: string
132 | | ... | - No value returned
136 | | ... | \| Send and receive ICMPv6 bidirectionally \| ${nodes['TG']} \
137 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
139 | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 |
140 | | ... | ${dst_ip}=3ffe:63::2
141 | | Send and receive ICMP Packet | ${tg_node} | ${int1} | ${int2} |
142 | | ... | ${src_ip} | ${dst_ip}
143 | | Send and receive ICMP Packet | ${tg_node} | ${int2} | ${int1} |
144 | | ... | ${dst_ip} | ${src_ip}