Skip to content

Commit

Permalink
[dash]: Add test cases for DASH ACL (#7848)
Browse files Browse the repository at this point in the history
* [dash]: Add test cases for DASH ACL
  • Loading branch information
Pterosaur authored Dec 4, 2023
1 parent 0245a4f commit d7371c5
Show file tree
Hide file tree
Showing 15 changed files with 851 additions and 133 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
per-file-ignores =
# line too long
tests/macsec/macsec_helper.py: E501
tests/dash/*.py: F405
4 changes: 3 additions & 1 deletion tests/dash/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from constants import ENI, VM_VNI, VNET1_VNI, VNET2_VNI, REMOTE_CA_IP, LOCAL_CA_IP, REMOTE_ENI_MAC,\
LOCAL_ENI_MAC, REMOTE_CA_PREFIX, LOOPBACK_IP, DUT_MAC, LOCAL_PA_IP, LOCAL_PTF_INTF, LOCAL_PTF_MAC,\
REMOTE_PA_IP, REMOTE_PTF_INTF, REMOTE_PTF_MAC, REMOTE_PA_PREFIX, VNET1_NAME, VNET2_NAME, ROUTING_ACTION, \
ROUTING_ACTION_TYPE, LOOKUP_OVERLAY_IP
ROUTING_ACTION_TYPE, LOOKUP_OVERLAY_IP, ACL_GROUP, ACL_STAGE
from dash_utils import render_template_to_host, apply_swssconfig_file
from gnmi_utils import generate_gnmi_cert, apply_gnmi_cert, recover_gnmi_cert, apply_gnmi_file

Expand Down Expand Up @@ -112,6 +112,8 @@ def dash_config_info(duthost, config_facts, minigraph_facts):
REMOTE_ENI_MAC: "F9:22:83:99:22:A2",
LOCAL_ENI_MAC: "F4:93:9F:EF:C4:7E",
REMOTE_CA_PREFIX: "20.2.2.0/24",
ACL_GROUP: "group1",
ACL_STAGE: 5
}
loopback_intf_ip = ip_interface(list(list(config_facts["LOOPBACK_INTERFACE"].values())[0].keys())[0])
dash_info[LOOPBACK_IP] = str(loopback_intf_ip.ip)
Expand Down
13 changes: 13 additions & 0 deletions tests/dash/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@
ROUTING_ACTION = "routing_action"
ROUTING_ACTION_TYPE = "routing_action_type"
LOOKUP_OVERLAY_IP = "lookup_overlay_ip"
# For ACL
ACL_GROUP = "acl_group"
ACL_STAGE = "acl_stage"
ACL_RULE = "acl_rule"
IP_VERSION = "ip_version"
ACL_PRIORITY = "priority"
ACL_ACTION = "action"
ACL_TERMINATING = "terminating"
ACL_SRC_ADDR = "src_addr"
ACL_DST_ADDR = "dst_addr"
ACL_SRC_PORT = "src_port"
ACL_DST_PORT = "dst_port"
ACL_PROTOCOL = "protocol"
Loading

0 comments on commit d7371c5

Please sign in to comment.