Tolerate failures when setting MTU
[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_interface_vat': 'tap0',
48         'tap_settings': {'host-interface-name': 'tap_test',
49                          'mac': '08:00:27:c0:5d:37',
50                          'id': 1
51                          },
52         'tap_settings_oper': {'host-interface-name': 'tap_test',
53                               'device-name': 'tap0',
54                               'tx-ring-size': 256,
55                               'rx-ring-size': 256,
56                               'mac': '08:00:27:c0:5d:37',
57                               'id': 1
58                               },
59         'tap_settings_vat': {'dev_name': 'tap0',
60                              'tx_ring_sz': 256,
61                              'rx_ring_sz': 256,
62                              'mac': '08:00:27:c0:5d:37',
63                              'id': 1
64                              },
65         # vhost-user interface settings
66         'vhost_interface': 'test_vhost',
67         'vhost_user_client': {'socket': 'soc1',
68                               'role': 'client'
69                               },
70         # Vlan subinterface settings
71         'sub_if_id': sub_if_id,
72         'sub_if_name': sub_if_name,
73         'sub_if_1_settings': {
74             "identifier": sub_if_id,
75             "vlan-type": "_802dot1q",
76             "enabled": "false"
77             },
78         'sub_if_1_tags': [
79             {
80                 "index": "0",
81                 "dot1q-tag": {
82                     "tag-type": "dot1q-types:s-vlan",
83                     "vlan-id": "100"
84                 }
85             },
86             {
87                 "index": "1",
88                 "dot1q-tag": {
89                     "tag-type": "dot1q-types:c-vlan",
90                     "vlan-id": "any"
91                 }
92             }
93             ],
94         'sub_if_1_match': "vlan-tagged-exact-match",
95         'sub_if_1_oper': {
96             "identifier": sub_if_id,
97             "oper-status": "up",
98             "admin-status": "up",
99             "tags": {
100                 "tag": [
101                     {
102                         "index": 1,
103                         "dot1q-tag": {
104                             "tag-type": "dot1q-types:c-vlan",
105                             "vlan-id": "any"
106                         }
107                     },
108                     {
109                         "index": 0,
110                         "dot1q-tag": {
111                             "tag-type": "dot1q-types:s-vlan",
112                             "vlan-id": 100
113                         }
114                     }
115                 ]
116             },
117             "match": {
118                 "vlan-tagged": {
119                     "match-exact-tags": True
120                 }
121             }
122         },
123         'sub_bd_settings': {
124             'bridge-domain': bd_name,
125             'split-horizon-group': '1',
126             'bridged-virtual-interface': 'False'
127         },
128         'tag_rewrite_pop_1': {
129             "pop-tags": "1"
130         },
131
132         'tag_rewrite_pop_1_oper': {
133             "vlan-type": "vpp-vlan:_802dot1ad",
134             "pop-tags": 1
135         },
136
137         'tag_rewrite_pop_1_VAT': {
138             'sub_default': 0,
139             'sub_dot1ad': 0,
140             'sub_exact_match': 1,
141             'sub_inner_vlan_id': 0,
142             'sub_inner_vlan_id_any': 1,
143             'sub_number_of_tags': 2,
144             'sub_outer_vlan_id': 100,
145             'sub_outer_vlan_id_any': 0,
146             'vtr_op': 3,
147             'vtr_push_dot1q': 0,
148             'vtr_tag1': 0,
149             'vtr_tag2': 0
150         }
151     }
152     return variables