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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 """Test variables for NAT test suite."""
16 from resources.libraries.python.topology import Topology
19 def get_variables(node, interface):
20 """Create and return a dictionary of test variables.
22 :param node: Honeycomb node.
23 :param interface: Name, link name or sw_if_index of an interface.
25 :type interface: str or int
27 :returns: Dictionary of test variables - settings for Honeycomb's
28 NAT node and expected operational data.
31 sw_if_index = Topology.convert_interface_reference(
32 node, interface, "sw_if_index")
45 "internal-src-address": "192.168.0.1/32",
46 "external-src-address": "192.168.1.1/32"
53 "internal-src-address": "192.168.0.2/32",
54 "external-src-address": "192.168.1.2/32"
62 "internal-src-address": "192.168.0.1/32",
63 "external-src-address": "192.168.1.1/32"
68 "internal-src-address": "192.168.0.2/32",
69 "external-src-address": "192.168.1.2/32"
74 "local_address": "192.168.0.1",
75 "remote_address": "192.168.1.1",
80 "local_address": "192.168.0.1",
81 "remote_address": "192.168.1.1",
85 "local_address": "192.168.0.2",
86 "remote_address": "192.168.1.2",
91 "nat_interface_vat_in": [
92 {"sw_if_index": str(sw_if_index),
95 "nat_interface_vat_out": [
96 {"sw_if_index": str(sw_if_index),