Add Honeycomb persistence tests
[csit.git] / tests / suites / honeycomb / resources / 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     # Vlan subinterface basic settings
26     sub_interface_id = 10
27     sub_interface_name = interface + '.' + str(sub_interface_id)
28
29     variables = {
30         # VxLan settings
31         'vx_interface': 'vx_tunnel_test',
32         'vxlan_settings': {'src': '192.168.0.2',
33                            'dst': '192.168.0.3',
34                            "vni": 88,
35                            'encap-vrf-id': 0},
36         # bridge domain settings
37         'bd_name': 'bd_persist',
38         'bd_settings': {'flood': True,
39                         'forward': True,
40                         'learn': True,
41                         'unknown-unicast-flood': True,
42                         'arp-termination': True
43                         },
44         # tap interface settings
45         'tap_interface': 'tap_test',
46         'tap_settings': {'tap-name': 'tap_test',
47                          'mac': '08:00:27:c0:5d:37',
48                          'device-instance': 1
49                          },
50         # vhost-user interface settings
51         'vhost_interface': 'test_vhost',
52         'vhost_user_server': {'socket': 'soc1',
53                               'role': 'server'
54                               },
55         # Vlan subinterface settings
56         'sub_interface_id': sub_interface_id,
57         'sub_interface_name': sub_interface_name,
58         'sub_interface_base_settings': {'name': sub_interface_name,
59                                         'type': 'v3po:sub-interface'
60                                         },
61         'sub_interface_settings': {
62             'super-interface': interface,
63             'identifier': sub_interface_id,
64             'vlan-type': '802dot1ad',
65             'number-of-tags': 2,
66             'outer-id': 22,
67             'inner-id': 33,
68             'match-any-outer-id': False,
69             'match-any-inner-id': False,
70             'exact-match': True,
71             'default-subif': True
72         }
73     }
74     return variables

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.