8d6bf311d06dfd6921cda8491171e2778e320449
[csit.git] / resources / libraries / robot / lisp / lisp_static_mapping.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 | Lisp State mapping suite keywords
16 | Resource | resources/libraries/robot/interfaces.robot
17 | Library  | resources.libraries.python.NodePath
18 | Library  | resources.libraries.python.LispSetup.LispLocatorSet
19 | Library  | resources.libraries.python.LispSetup.LispLocator
20 | Library  | resources.libraries.python.LispSetup.LispLocalEid
21 | Library  | resources.libraries.python.LispSetup.LispRemoteMapping
22 | Library  | resources.libraries.python.LispSetup.LispSetup
23 | Library  | resources.libraries.python.LispUtil
24
25 *** Keywords ***
26 | Set up Lisp topology
27 | | [Documentation] | Set up Lisp static remote mapping topology.
28 | | ...
29 | | ... | *Arguments:*
30 | | ... | - ${dut1_node} - DUT1 node. Type: dictionary
31 | | ... | - ${dut1_int_name} - DUT1 node interface name. Type: string
32 | | ... | - ${dut1_int_index} - DUT1 node interface index. Type: integer
33 | | ... | - ${dut2_node} - DUT2 node. Type: dictionary
34 | | ... | - ${dut2_int_name} - DUT2 node interface name. Type: string
35 | | ... | - ${dut2_int_index} - DUT2 node interface index. Type: integer
36 | | ... | - ${locator_set} - Locator set values. Type: dict
37 | | ... | - ${dut1_eid} - Dut1 node eid address. Type: dict
38 | | ... | - ${dut2_eid} - Dut2 node eid address. Type: dict
39 | | ... | - ${dut1_static_mapping} - Dut1 static mapping address. Type: dict
40 | | ... | - ${dut2_static_mapping} - Dut2 static mapping address. Type: dict
41 | | ...
42 | | ... | *Return:*
43 | | ... | - No value returned
44 | | ...
45 | | ... | *Example:*
46 | | ... | \| Set up Lisp topology \| ${dut1_node} \| ${interface_name} \
47 | | ... | \| None \| ${dut2_node} \| ${interface_name} \| None \
48 | | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \
49 | | ... | \| ${dut1_static_mapping} \| ${dut2_static_mapping} \|
50 | | ...
51 | | [Arguments] | ${dut1_node} | ${dut1_int_name} | ${dut1_int_index}
52 | | ...         | ${dut2_node} | ${dut2_int_name} | ${dut2_int_index}
53 | | ...         | ${locator_set} | ${dut1_eid} | ${dut2_eid}
54 | | ...         | ${dut1_static_mapping} | ${dut2_static_mapping}
55 | | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None
56 | |                    | ... | Get Interface Sw Index | ${dut1_node}
57 | |                    | ...                          | ${dut1_int_name}
58 | |                    | ... | ELSE | Set Variable | ${dut1_int_index}
59 | | ${dut2_int_index}= | Run Keyword If | ${dut2_int_index} is None
60 | |                    | ... | Get Interface Sw Index | ${dut2_node}
61 | |                    | ...                          | ${dut2_int_name}
62 | |                    | ... | ELSE | Set Variable | ${dut2_int_index}
63 | | Vpp lisp state | ${dut1_node} | enable
64 | | Vpp Add Lisp Locator Set | ${dut1_node} | ${locator_set['locator_name']}
65 | | Vpp Add Lisp Locator | ${dut1_node} | ${locator_set['locator_name']}
66 | | ...                  | ${dut1_int_index} | ${locator_set['priority']}
67 | | ...                  | ${locator_set['weight']}
68 | | Vpp Add Lisp Local Eid | ${dut1_node} | ${dut1_eid['locator_name']} | ${dut1_eid['eid']}
69 | | ...                    | ${dut1_eid['prefix']}
70 | | Vpp Add Lisp Remote Mapping | ${dut1_node} | ${dut1_static_mapping['vni']}
71 | | ...                         | ${dut1_static_mapping['deid']}
72 | | ...                         | ${dut1_static_mapping['prefix']}
73 | | ...                         | ${dut1_static_mapping['seid']}
74 | | ...                         | ${dut1_static_mapping['prefix']}
75 | | ...                         | ${dut1_static_mapping['rloc']}
76 | | Vpp Lisp State | ${dut2_node} | enable
77 | | Vpp Add Lisp Locator Set | ${dut2_node} | ${locator_set['locator_name']}
78 | | Vpp Add Lisp Locator | ${dut2_node} | ${locator_set['locator_name']}
79 | | ...                  | ${dut2_int_index} | ${locator_set['priority']}
80 | | ...                  | ${locator_set['weight']}
81 | | Vpp Add Lisp Local Eid | ${dut2_node} | ${dut2_eid['locator_name']} | ${dut2_eid['eid']}
82 | | ...                    | ${dut2_eid['prefix']}
83 | | Vpp Add Lisp Remote Mapping | ${dut2_node} | ${dut2_static_mapping['vni']}
84 | | ...                         | ${dut2_static_mapping['deid']}
85 | | ...                         | ${dut2_static_mapping['prefix']}
86 | | ...                         | ${dut2_static_mapping['seid']}
87 | | ...                         | ${dut2_static_mapping['prefix']}
88 | | ...                         | ${dut2_static_mapping['rloc']}