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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 """Test variables for ietf-ACL test suite."""
17 def get_variables(test_case, name):
18 """Create and return a dictionary of test variables for the specified
21 :param test_case: Determines which test variables to return.
22 :param name: Name for the classify chain used in test.
26 :return: Dictionary of test variables - settings for Honeycomb's
27 ietf-acl node and packet fields to use in verification.
35 "dst_net": "16.0.1.0",
38 "src_mac": "01:02:03:04:05:06",
39 "dst_mac": "10:20:30:40:50:60"}
41 if test_case.lower() == "l2":
43 "classify_src": "12:23:34:45:56:67",
44 "classify_dst": "89:9A:AB:BC:CD:DE",
45 "classify_src2": "01:02:03:04:56:67",
46 "classify_dst2": "89:9A:AB:BC:50:60",
47 "src_mask": "00:00:00:00:FF:FF",
48 "dst_mask": "FF:FF:FF:FF:00:00",
54 "ietf-access-control-list:eth-acl",
56 "access-list-entries": {"ace": [{
60 classify_vars["classify_src"],
61 "source-mac-address-mask":
62 classify_vars["src_mask"],
63 "destination-mac-address":
64 classify_vars["classify_dst"],
65 "destination-mac-address-mask":
66 classify_vars["dst_mask"]
75 elif test_case.lower() in ("l3_ip4", "l3_ip6", "l4"):
76 raise NotImplementedError
78 raise Exception("Unrecognized test case {0}".format(test_case))
80 variables.update(classify_vars)
81 variables["acl_settings"] = acl_settings