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 | | ${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}
51 | Send and receive ICMP Packet should failed
52 | | [Documentation] | Send ICMPv4/ICMPv6 echo request from source interface to
53 | | ... | destination interface and expect failure with
54 | | ... | ICMP echo Rx timeout error message.
56 | | ... | *Arguments:*
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
66 | | ... | - No value returned
70 | | ... | _NOTE:_ Default IP is IPv4
72 | | ... | \| Send and receive ICMP Packet \| ${nodes['TG']} \
73 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
75 | | [Arguments] | ${tg_node} | ${src_int} | ${dst_int} |
76 | | ... | ${src_ip}=192.168.100.1 | ${dst_ip}=192.168.100.2
77 | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int}
78 | | ${dst_mac}= | Get Interface Mac | ${tg_node} | ${dst_int}
79 | | ${args}= | Traffic Script Gen Arg | ${dst_int} | ${src_int} | ${src_mac}
80 | | | ... | ${dst_mac} | ${src_ip} | ${dst_ip}
81 | | Run Keyword And Expect Error | ICMP echo Rx timeout |
82 | | ... | Run Traffic Script On Node | send_ip_icmp.py | ${tg_node} | ${args}
84 | Send and receive ICMPv4 bidirectionally
85 | | [Documentation] | Send ICMPv4 echo request from both directions,
86 | | ... | from interface1 to interface2 and
87 | | ... | from interface2 to interface1.
89 | | ... | *Arguments:*
91 | | ... | - tg_node - TG node. Type: dictionary
92 | | ... | - src_int - Source interface. Type: string
93 | | ... | - dst_int - Destination interface. Type: string
94 | | ... | - src_ip - Source IP address (Optional). Type: string
95 | | ... | - dst_ip - Destination IP address (Optional). Type: string
99 | | ... | - No value returned
103 | | ... | \| Send and receive ICMPv4 bidirectionally \| ${nodes['TG']} \
104 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
106 | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=192.168.100.1 |
107 | | ... | ${dst_ip}=192.168.100.2
108 | | Send and receive ICMP Packet | ${tg_node} | ${int1} | ${int2} |
109 | | ... | ${src_ip} | ${dst_ip}
110 | | Send and receive ICMP Packet | ${tg_node} | ${int2} | ${int1} |
111 | | ... | ${dst_ip} | ${src_ip}
113 | Send and receive ICMPv6 bidirectionally
114 | | [Documentation] | Send ICMPv6 echo request from both directions,
115 | | ... | from interface1 to interface2 and
116 | | ... | from interface2 to interface1.
118 | | ... | *Arguments:*
120 | | ... | - tg_node - TG node. Type: dictionary
121 | | ... | - src_int - Source interface. Type: string
122 | | ... | - dst_int - Destination interface. Type: string
123 | | ... | - src_ip - Source IP address (Optional). Type: string
124 | | ... | - dst_ip - Destination IP address (Optional). Type: string
128 | | ... | - No value returned
132 | | ... | \| Send and receive ICMPv6 bidirectionally \| ${nodes['TG']} \
133 | | ... | \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \|
135 | | [Arguments] | ${tg_node} | ${int1} | ${int2} | ${src_ip}=3ffe:63::1 |
136 | | ... | ${dst_ip}=3ffe:63::2
137 | | Send and receive ICMP Packet | ${tg_node} | ${int1} | ${int2} |
138 | | ... | ${src_ip} | ${dst_ip}
139 | | Send and receive ICMP Packet | ${tg_node} | ${int2} | ${int1} |
140 | | ... | ${dst_ip} | ${src_ip}