VAT-to-PAPI: NATUtil
[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 | Show NAT verbose
60 | | [Documentation] | Get the NAT settings on the node.
61 | | ...
62 | | ... | *Arguments:*
63 | | ... | - node - DUT node to show NAT. Type: dictionary
64 | | ...
65 | | ... | *Example:*
66 | | ...
67 | | ... | \| Show NAT verbose \| ${nodes['DUT1']} \|
68 | | ...
69 | | [Arguments] | ${node}
70 | | ...
71 | | Show NAT | ${node}