CSIT-427: Honeycomb ietf-ACL tests - L3
[csit.git] / resources / test_data / honeycomb / persistence.py
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 """Test variables for Honeycomb persistence test suite."""
15
16
17 def get_variables(interface):
18     """Creates and returns dictionary of test variables.
19
20     :param interface: name of super-interface for the tested sub-interface
21     :type interface: str
22     :return: dictionary of test variables
23     :rtype: dict
24     """
25     # basic settings
26     bd_name = 'bd_persist'
27     sub_if_id = 1
28     sub_if_name = interface + '.' + str(sub_if_id)
29
30     variables = {
31         # VxLan settings
32         'vx_interface': 'vx_tunnel_test',
33         'vxlan_settings': {'src': '192.168.0.2',
34                            'dst': '192.168.0.3',
35                            "vni": 88,
36                            'encap-vrf-id': 0},
37         # bridge domain settings
38         'bd_name': bd_name,
39         'bd_settings': {'flood': True,
40                         'forward': True,
41                         'learn': True,
42                         'unknown-unicast-flood': True,
43                         'arp-termination': True
44                         },
45         # tap interface settings
46         'tap_interface': 'tap_test',
47         'tap_settings': {'tap-name': 'tap_test',
48                          'mac': '08:00:27:c0:5d:37',
49                          'device-instance': 1
50                          },
51         # vhost-user interface settings
52         'vhost_interface': 'test_vhost',
53         'vhost_user_server': {'socket': 'soc1',
54                               'role': 'server'
55                               },
56         # Vlan subinterface settings
57         'sub_if_id': sub_if_id,
58         'sub_if_name': sub_if_name,
59         'sub_if_1_settings': {
60             "identifier": sub_if_id,
61             "vlan-type": "802dot1q",
62             "enabled": "false"
63             },
64         'sub_if_1_tags': [
65             {
66                 "index": "0",
67                 "dot1q-tag": {
68                     "tag-type": "dot1q-types:s-vlan",
69                     "vlan-id": "100"
70                 }
71             },
72             {
73                 "index": "1",
74                 "dot1q-tag": {
75                     "tag-type": "dot1q-types:c-vlan",
76                     "vlan-id": "any"
77                 }
78             }
79             ],
80         'sub_if_1_match': "vlan-tagged-exact-match",
81         'sub_if_1_oper': {
82             "identifier": sub_if_id,
83             "oper-status": "up",
84             "admin-status": "up",
85             "tags": {
86                 "tag": [
87                     {
88                         "index": 1,
89                         "dot1q-tag": {
90                             "tag-type": "dot1q-types:c-vlan",
91                             "vlan-id": "any"
92                         }
93                     },
94                     {
95                         "index": 0,
96                         "dot1q-tag": {
97                             "tag-type": "dot1q-types:s-vlan",
98                             "vlan-id": "100"
99                         }
100                     }
101                 ]
102             },
103             "match": {
104                 "vlan-tagged": {
105                     "match-exact-tags": False
106                 }
107             }
108         },
109         'sub_bd_settings': {
110             'bridge-domain': bd_name,
111             'split-horizon-group': '1',
112             'bridged-virtual-interface': 'False'
113         },
114         'tag_rewrite_pop_1': {
115             "pop-tags": "1"
116         },
117
118         'tag_rewrite_pop_1_oper': {
119             "vlan-type": "vpp-vlan:802dot1ad",
120             "pop-tags": 1
121         },
122
123         'tag_rewrite_pop_1_VAT': {
124             'sub_default': 0,
125             'sub_dot1ad': 0,
126             'sub_exact_match': 0,
127             'sub_inner_vlan_id': 0,
128             'sub_inner_vlan_id_any': 1,
129             'sub_number_of_tags': 2,
130             'sub_outer_vlan_id': 100,
131             'sub_outer_vlan_id_any': 0,
132             'vtr_op': 3,
133             'vtr_push_dot1q': 0,
134             'vtr_tag1': 0,
135             'vtr_tag2': 0
136         }
137     }
138     return variables