CSIT-663: Remove unused keywords
[csit.git] / resources / libraries / robot / honeycomb / nat.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 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
16 | Library | resources.libraries.python.honeycomb.NAT.NATKeywords
17 | Library | resources.libraries.python.NAT.NATUtil
18 | Documentation | Keywords used to test Honeycomb NAT node.
19
20 *** Keywords ***
21 | NAT Operational Data From Honeycomb Should Be empty
22 | | [Documentation] | Uses Honeycomb API to retrieve NAT operational data\
23 | | ... | and expects to find only default values.
24 | | ...
25 | | ... | *Arguments:*
26 | | ... | - node - information about a DUT node. Type: dictionary
27 | | ... | - default_settings - NAT default settings. Type: dictionary
28 | | ...
29 | | ... | *Example:*
30 | | ...
31 | | ... | \| NAT Operational Data From Honeycomb Should Be empty \
32 | | ... | \| ${nodes['DUT1']} \| ${default_settings} \|
33 | | [Arguments] | ${node} | ${default_settings}
34 | | ${data}= | Get NAT Oper data | ${node}
35 | | Compare data structures | ${data} | ${default_settings}
36
37 | Honeycomb configures NAT entry
38 | | [Documentation] | Uses Honeycomb API to configure a static NAT entry.
39 | | ...
40 | | ... | *Arguments:*
41 | | ... | - node - information about a DUT node. Type: dictionary
42 | | ... | - data - NAT entry to configure. Type: dictionary
43 | | ... | - instance - NAT instance on VPP node. Type: integer
44 | | ... | - index - Index of NAT entry. Type: integer
45 | | ...
46 | | ... | *Example:*
47 | | ...
48 | | ... | \| Honeycomb configures NAT entry \| ${nodes['DUT1']} \| ${data} \
49 | | ... | \| ${0} \| ${1} \|
50 | | [Arguments] | ${node} | ${data} | ${instance}=0 | ${index}=1
51 | | Configure NAT entries | ${node} | ${data} | ${instance} | ${index}
52
53 | NAT entries from Honeycomb should be
54 | | [Documentation] | Uses Honeycomb API to retrieve NAT operational data\
55 | | ... | and compares against expected settings.
56 | | ...
57 | | ... | *Arguments:*
58 | | ... | - node - information about a DUT node. Type: dictionary
59 | | ... | - settings - NAT entry to expect. Type: dictionary
60 | | ... | - instance - NAT instance on VPP node. Type: integer
61 | | ...
62 | | ... | *Example:*
63 | | ...
64 | | ... | \| NAT entries from Honeycomb should be \| ${nodes['DUT1']} \
65 | | ... | \| ${settings} \| ${0} \|
66 | | [Arguments] | ${node} | ${settings} | ${instance}=0
67 | | ${data}= | Get NAT Oper data | ${node}
68 | | ${data}= | Set Variable
69 | | ... | ${data['nat-instances']['nat-instance'][${instance}]['mapping-table']}
70 | | Compare data structures | ${data} | ${settings}
71
72 | Honeycomb configures NAT on interface
73 | | [Documentation] | Uses Honeycomb API to configure NAT on an interface.
74 | | ...
75 | | ... | *Arguments:*
76 | | ... | - node - information about a DUT node. Type: dictionary
77 | | ... | - interface - name of an interface on the node. Type: string
78 | | ... | - direction - NAT direction parameter, inbound or outbound.\
79 | | ... | Type: string
80 | | ...
81 | | ... | *Example:*
82 | | ...
83 | | ... | \| Honeycomb configures NAT on interface \| ${nodes['DUT1']} \
84 | | ... | \| GigabitEthernet0/8/0 \| outbound \|
85 | | [Arguments] | ${node} | ${interface} | ${direction}
86 | | Configure NAT on interface
87 | | ... | ${node} | ${interface} | ${direction}
88
89 | Honeycomb removes NAT interface configuration
90 | | [Documentation] | Uses Honeycomb API to remove an existing NAT interface\
91 | | ... | configuration.
92 | | ...
93 | | ... | *Arguments:*
94 | | ... | - node - information about a DUT node. Type: dictionary
95 | | ... | - interface - name of an interface on the node. Type: string
96 | | ... | - direction - NAT direction parameter, inbound or outbound.\
97 | | ... | Type: string
98 | | ...
99 | | ... | *Example:*
100 | | ...
101 | | ... | \| Honeycomb removes NAT interface configuration \| ${nodes['DUT1']} \
102 | | ... | \| GigabitEthernet0/8/0 \| outbound \|
103 | | [Arguments] | ${node} | ${interface} | ${direction}
104 | | Configure NAT on interface
105 | | ... | ${node} | ${interface} | ${direction} | ${True}
106
107 | NAT interface Operational Data From Honeycomb Should Be
108 | | [Documentation] | Uses Honeycomb API to retrieve interface operational data\
109 | | ... | and compares the NAT section against expected settings.
110 | | ...
111 | | ... | *Arguments:*
112 | | ... | - node - information about a DUT node. Type: dictionary
113 | | ... | - interface - name of an interface on the node. Type: string
114 | | ... | - direction - NAT direction parameter, inbound or outbound.\
115 | | ... | Type: string
116 | | ...
117 | | ... | *Example:*
118 | | ...
119 | | ... | \| NAT interface Operational Data From Honeycomb Should Be \
120 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| outbound \|
121 | | [Arguments] | ${node} | ${interface} | ${direction}
122 | | ${data}= | Get interface oper data | ${node} | ${interface}
123 | | Variable should exist | ${data['interface-nat:nat']['${direction}']}
124
125 | NAT interface Operational Data From Honeycomb Should Be empty
126 | | [Documentation] | Uses Honeycomb API to retrieve interface operational data\
127 | | ... | and expects to find no data for the given direction.
128 | | ...
129 | | ... | *Arguments:*
130 | | ... | - node - information about a DUT node. Type: dictionary
131 | | ... | - interface - name of an interface on the node. Type: string
132 | | ... | - direction - NAT direction parameter, inbound or outbound.\
133 | | ... | Type: string
134 | | ...
135 | | ... | *Example:*
136 | | ...
137 | | ... | \| NAT interface Operational Data From Honeycomb Should Be empty \
138 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| outbound \|
139 | | [Arguments] | ${node} | ${interface} | ${direction}
140 | | ${data}= | Get interface oper data | ${node} | ${interface}
141 | | Variable should not exist | ${data['interface-nat:nat']['${direction}']}
142
143 | NAT interface Operational Data From VAT Should Be
144 | | [Documentation] | Uses Honeycomb API to retrieve NAT configured interfaces\
145 | | ... | and compares with expected settings.
146 | | ...
147 | | ... | *Arguments:*
148 | | ... | - node - information about a DUT node. Type: dictionary
149 | | ... | - settings - settings to expect. Type: dictionary
150 | | ... | Type: string
151 | | ...
152 | | ... | *Example:*
153 | | ...
154 | | ... | \| NAT interface Operational Data From VAT Should Be \
155 | | ... | \| ${nodes['DUT1']} \| ${settings} \|
156 | | [Arguments] | ${node} | ${settings}
157 | | ${data}= | VPP get NAT interfaces | ${node}
158 | | Compare data structures | ${data} | ${settings}