CSIT-768: Refactor Python container libraries
[csit.git] / resources / test_data / honeycomb / span.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 SPAN port mirroring test suite."""
15
16
17 def get_variables(interface1, interface2, interface3):
18     """Create and return a dictionary of test variables.
19
20     :param interface1: Name of an interface.
21     :param interface2: Name of an interface.
22     :param interface3: Name of an interface.
23     :type interface1: string
24     :type interface2: string
25     :type interface3: string
26
27     :returns: Dictionary of test variables - settings for Honeycomb's
28     SPAN port mirroring suite.
29     :rtype: dict
30     """
31     variables = {
32         "interface1": interface1,
33         "interface2": interface2,
34         "interface3": interface3,
35
36         # Interface 2 - ingress
37         "settings_receive": {
38             "state": "receive",
39             "iface-ref": interface2,
40         },
41
42         # Interface 2 - egress
43         "settings_transmit": {
44             "state": "transmit",
45             "iface-ref": interface2,
46         },
47
48         # Interface 2 - ingress/egress
49         "settings_both": {
50             "state": "both",
51             "iface-ref": interface2,
52         },
53
54         # Interface 3 - ingress/egress
55         "settings_if2": {
56             "state": "both",
57             "iface-ref": interface3,
58         },
59
60         # IP addresses for traffic test
61         "tg_to_dut_if1_ip": "192.168.1.1",
62         "dut_to_tg_if1_ip": "192.168.1.2",
63         "tg_to_dut_if2_ip": "192.168.2.1",
64         "dut_to_tg_if2_ip": "192.168.2.2",
65         "prefix": 24,
66     }
67     return variables