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