1 # Copyright (c) 2017 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 | Library | resources.libraries.python.NodePath
16 | Documentation | *Utilities for the path computing, pcap reading*
18 | ... | Utilities for the path computing, pcap file reading and also the port
22 | Path for 2-node testing is set
23 | | [Documentation] | Compute the path for the 2 node testing.
25 | | ... | *Arguments:*
26 | | ... | - tg_node - TG node. Type: dictionary
27 | | ... | - dut_node - DUT node. Type: dictionary
30 | | ... | - No value returned.
34 | | ... | \| Path for 2-node testing is set \| ${nodes['TG']} \
35 | | ... | \| ${nodes['DUT1'] \|
37 | | [Arguments] | ${tg_node} | ${dut_node}
38 | | Append Nodes | ${tg_node} | ${dut_node}
41 | Pick out the port used to execute test
42 | | [Documentation] | Pick out the port used to execute the test.
44 | | ... | *Arguments:*
45 | | ... | - No arguments.
48 | | ... | - No value returned.
52 | | ... | \| Pick out the port used to execute test \|
54 | | ${tg_port} | ${tg_node}= | First Interface
55 | | ${dut_port} | ${dut_node}= | Last Interface
56 | | set suite variable | ${tg_node}
57 | | set suite variable | ${dut_node}
58 | | set suite variable | ${tg_port}
59 | | set suite variable | ${dut_port}
62 | | [Documentation] | Get the pcap file detailed data.
64 | | ... | *Arguments:*
65 | | ... | - file_prefix - file prefix. Type: dictionary
68 | | ... | - packet_num, dest_ip, is_ipv4 - a tuple of packet_num
69 | | ... | dest_ip, is_ipv4. Type: tuple(int, str, bool)
73 | | ... | \| Get the pcap data \| ${tc01_file_prefix} \|
75 | | [Arguments] | ${file_prefix}
76 | | ${packet_num} | ${dest_ip} | ${is_ipv4}= | Get Pcap Info
77 | | ... | ${file_prefix}
78 | | set suite variable | ${packet_num}
79 | | set suite variable | ${dest_ip}
80 | | set suite variable | ${is_ipv4}