CSIT-562 HC Test: Persistence suite rework, part1
[csit.git] / resources / libraries / robot / snat.robot
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:
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.SNATUtil
16 | Library | resources.libraries.python.NAT.NATUtil
17 | Documentation | Keywords for SNAT feature in VPP.
18
19 *** Keywords ***
20 | Set inside and outside interfaces
21 | | [Documentation] | Set inside and outside interfaces for SNAT.
22 | | ...
23 | | ... | *Arguments:*
24 | | ... | - node - DUT node to set SNAT interfaces on. Type: dictionary
25 | | ... | - int_in - Inside interface. Type: string
26 | | ... | - int_out - Outside interface. Type: string
27 | | ...
28 | | ... | *Example:*
29 | | ...
30 | | ... | \| Set inside and outside interfaces \| ${nodes['DUT1']} \
31 | | ... | \| FortyGigabitEtherneta/0/0 \| FortyGigabitEtherneta/0/1 \|
32 | | ...
33 | | [Arguments] | ${node} | ${int_in} | ${int_out}
34 | | ...
35 | | ${int_in_name}= | Set variable | ${node['interfaces']['${int_in}']['name']}
36 | | ${int_out_name}= | Set variable | ${node['interfaces']['${int_out}']['name']}
37 | | Set SNAT Interfaces | ${node} | ${int_in_name} | ${int_out_name}
38
39 | Set deterministic mode for SNAT
40 | | [Documentation] | Set deterministic behaviour of SNAT.
41 | | ...
42 | | ... | *Arguments:*
43 | | ... | - node - DUT node to set deterministic mode for SNAT on.
44 | | ... | Type: dictionary
45 | | ... | - ip_in - Inside IP. Type: string
46 | | ... | - subnet_in - Inside IP subnet. Type: string
47 | | ... | - ip_out - Outside IP. Type: string
48 | | ... | - subnet_out - Outside IP subnet. Type: string
49 | | ...
50 | | ... | *Example:*
51 | | ...
52 | | ... | \| Set deterministic mode for SNAT \| ${nodes['DUT1']} \
53 | | ... | \| 100.0.0.0 \| 12 \| 12.1.1.0 \| 24 \|
54 | | ...
55 | | [Arguments] | ${node} | ${ip_in} | ${subnet_in} | ${ip_out} | ${subnet_out}
56 | | ...
57 | | Set SNAT deterministic | ${node} | ${ip_in} | ${subnet_in} | ${ip_out}
58 | | ... | ${subnet_out}
59
60 | Set workers for SNAT
61 | | [Documentation] | Set workers for SNAT.
62 | | ...
63 | | ... | *Arguments:*
64 | | ... | - node - DUT node to set SNAT workers on. Type: dictionary
65 | | ... | - lcores - list of cores, format: range e.g. 1-5 or list of ranges \
66 | | ... | e.g.: 1-5,18-22. Type: string
67 | | ...
68 | | ... | *Example:*
69 | | ...
70 | | ... | \| Set workers for SNAT \| ${nodes['DUT1']} \| 12-23,36-47 \|
71 | | ...
72 | | [Arguments] | ${node} | ${lcores}
73 | | ...
74 | | Set SNAT workers | ${node} | ${lcores}
75
76 | Show SNAT verbose
77 | | [Documentation] | Get the SNAT settings on the node.
78 | | ...
79 | | ... | *Arguments:*
80 | | ... | - node - DUT node to show SNAT. Type: dictionary
81 | | ...
82 | | ... | *Example:*
83 | | ...
84 | | ... | \| Show SNAT verbose \| ${nodes['DUT1']} \|
85 | | ...
86 | | [Arguments] | ${node}
87 | | ...
88 | | Show SNAT | ${node}
89
90 | Get SNAT deterministic forward
91 | | [Documentation] | Show forward IP address and port(s).
92 | | ...
93 | | ... | *Arguments:*
94 | | ... | - node - DUT node to get SNAT deterministic forward on.
95 | | ... | Type: dictionary
96 | | ... | - ip - IP address. Type: string
97 | | ...
98 | | ... | *Example:*
99 | | ...
100 | | ... | \| Get SNAT deterministic forward \| ${nodes['DUT1']} \| 10.0.0.2 \|
101 | | ...
102 | | [Arguments] | ${node} | ${ip}
103 | | ...
104 | | Show SNAT deterministic forward | ${node} | ${ip}
105
106 | Get SNAT deterministic reverse
107 | | [Documentation] | Show reverse IP address.
108 | | ...
109 | | ... | *Arguments:*
110 | | ... | - node - DUT node to get SNAT deterministic reverse on.
111 | | ... | Type: dictionary
112 | | ... | - ip - IP address. Type: string
113 | | ... | - port - Port. Type: string or integer
114 | | ...
115 | | ... | *Example:*
116 | | ...
117 | | ... | \| Get SNAT deterministic reverse \| ${nodes['DUT1']} \| 10.0.0.2 \
118 | | ... | \| 1025 \|
119 | | ...
120 | | [Arguments] | ${node} | ${ip} | ${port}
121 | | ...
122 | | Show SNAT deterministic reverse | ${node} | ${ip} | ${port}
123
124 | Get NAT interfaces
125 | | [Documentation] | Get list of interfaces configured with NAT from VPP node.
126 | | ...
127 | | ... | *Arguments:*
128 | | ... | - node - DUT node to get SNAT interfaces on. Type: dictionary
129 | | ...
130 | | ... | *Example:*
131 | | ...
132 | | ... | \| Get NAT interfaces \| ${nodes['DUT1']} \|
133 | | ...
134 | | [Arguments] | ${node}
135 | | ...
136 | | VPP get NAT interfaces | ${node}
137
138 | Get NAT static mappings
139 | | [Documentation] | Get NAT static mappings from VPP node.
140 | | ...
141 | | ... | *Arguments:*
142 | | ... | - node - DUT node to get SNAT static mappings on. Type: dictionary
143 | | ...
144 | | ... | *Example:*
145 | | ...
146 | | ... | \| Get NAT static mappings \| ${nodes['DUT1']} \|
147 | | ...
148 | | [Arguments] | ${node}
149 | | ...
150 | | VPP get NAT static mappings | ${node}