Tolerate failures when setting MTU
[csit.git] / resources / test_data / honeycomb / policer_variables.py
1 # Copyright (c) 2017 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 Policer test suite."""
15
16
17 def get_variables():
18     """Create and return a dictionary of test variables for the specified
19     test case.
20
21     :returns: Dictionary of test variables - settings for Honeycomb's Policer.
22     :rtype: dict
23     """
24     policer_data = {
25         "policer_data": {
26             "name": "policy1",
27             "cir": 450,
28             "cb": 50000,
29             "rate-type": "kbps",
30             "round-type": "closest",
31             "type": "1r2c",
32             "conform-action": {
33                 "meter-action-type": "meter-action-transmit"
34             },
35             "exceed-action": {
36                 "meter-action-type": "meter-action-drop"
37             }
38         },
39         "policer_data_oper": {
40             "name": "policy1",
41             "cir": 450,
42             "cb": 50000,
43             "rate-type": "kbps",
44             "round-type": "closest",
45             "type": "1r2c",
46             "conform-action": {
47                 "meter-action-type": "policer:meter-action-transmit"
48             },
49             "exceed-action": {
50                 "meter-action-type": "policer:meter-action-drop"
51             }
52         },
53         "policer_data_2": {
54             "name": "policy1",
55             "cir": 900,
56             "cb": 50000,
57             "rate-type": "kbps",
58             "round-type": "closest",
59             "type": "1r2c",
60             "conform-action": {
61                 "meter-action-type": "meter-action-transmit"
62             },
63             "exceed-action": {
64                 "meter-action-type": "meter-action-drop"
65             }
66         },
67         "policer_data_oper_2": {
68             "name": "policy1",
69             "cir": 900,
70             "cb": 50000,
71             "rate-type": "kbps",
72             "round-type": "closest",
73             "type": "1r2c",
74             "conform-action": {
75                 "meter-action-type": "policer:meter-action-transmit"
76             },
77             "exceed-action": {
78                 "meter-action-type": "policer:meter-action-drop"
79             }
80         },
81         "policer_data_3": {
82             "name": "policy1",
83             "cir": 100,
84             "eir": 150,
85             "cb": 200,
86             "eb": 300,
87             "rate-type": "pps",
88             "round-type": "closest",
89             "type": "2r3c-2698",
90             "conform-action": {
91                 "meter-action-type": "meter-action-transmit"
92             },
93             "exceed-action": {
94                 "meter-action-type": "meter-action-mark-dscp",
95                 "dscp": "AF22"
96             },
97             "violate-action": {
98                 "meter-action-type": "meter-action-drop"
99             },
100             "color-aware": True
101             },
102         "policer_data_oper_3": {
103             "name": "policy1",
104             "cir": 100,
105             "eir": 150,
106             "cb": 200,
107             "eb": 300,
108             "rate-type": "pps",
109             "round-type": "closest",
110             "type": "2r3c-2698",
111             "conform-action": {
112                 "meter-action-type": "policer:meter-action-transmit"
113             },
114             "exceed-action": {
115                 "meter-action-type": "policer:meter-action-mark-dscp",
116             },
117             "violate-action": {
118                 "meter-action-type": "policer:meter-action-drop"
119             },
120             "color-aware": True
121         },
122
123         "acl_tables": {
124             # settings for policer tables
125             "hc_acl_table": {
126                 "name": "table0",
127                 "nbuckets": 2,
128                 "memory_size": 1048576,
129                 "skip_n_vectors": 12,
130                 "miss_next": "permit",
131                 "mask": "00:00:00:00:00:00:00:00:00:00:00:00:ff:ff:ff:ff"
132             },
133             # setting for acl sessions
134             "hc_acl_session": {
135                 "match": "00:00:00:00:00:00:00:00:00:00:00:00:C0:A8:7A:01",
136                 "policer_hit_next": "policy1",
137                 "color_classfier": "exceed-color",
138             },
139             "hc_acl_session2": {
140                 "match": "00:00:00:00:00:00:00:00:00:00:00:00:C0:A8:7A:02",
141                 "policer_hit_next": "policy1",
142                 "color_classfier": "exceed-color",
143             },
144         },
145     }
146     return policer_data