initial CSIT-DMM test scripts
[csit.git] / resources / libraries / robot / dmm / dmm_utils.robot
1 # Copyright (c) 2018 Huawei Technologies Co.,Ltd.
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.NodePath
16 | Documentation | *Utilities for the path computing, pcap reading*
17 | ...
18 | ... | Utilities for the path computing, pcap file reading and also the port
19 | ... | selection.
20
21 *** Keywords ***
22 | Path for 2-node testing is set
23 | | [Documentation] | Compute the path for the 2 node testing.
24 | | ...
25 | | ... | *Arguments:*
26 | | ... | - dut1_node - DUT1 node. Type: dictionary
27 | | ... | - dut2_node - DUT2 node. Type: dictionary
28 | | ...
29 | | ... | *Return:*
30 | | ... | - No value returned.
31 | | ...
32 | | ... | *Example:*
33 | | ...
34 | | ... | \| Path for 2-node testing is set \| ${nodes['DUT1']} \
35 | | ... | \| ${nodes['DUT2'] \|
36 | | ...
37 | | [Arguments] | ${dut1_node} | ${dut2_node}
38 | | Append Nodes | ${dut1_node} | ${dut2_node}
39 | | Compute Path
40
41 | Pick out the port used to execute test
42 | | [Documentation] | Pick out the port used to execute the test.
43 | | ...
44 | | ... | *Arguments:*
45 | | ... | - No arguments.
46 | | ...
47 | | ... | *Return:*
48 | | ... | - No value returned.
49 | | ...
50 | | ... | *Example:*
51 | | ...
52 | | ... | \| Pick out the port used to execute test \|
53 | | ...
54 | | ${tg_port} | ${tg_node}= | First Interface
55 | | ${dut1_port} | ${dut1_node}= | Next Interface
56 | | ${dut2_port} | ${dut2_node}= | Last Interface
57 | | Set Suite Variable | ${tg_node}
58 | | Set Suite Variable | ${dut1_node}
59 | | Set Suite Variable | ${dut2_node}
60 | | Set Suite Variable | ${tg_port}
61 | | Set Suite Variable | ${dut1_port}
62 | | Set Suite Variable | ${dut2_port}
63