Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tests/acl/templates/acltb_v6_test_rules.j2
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,36 @@
"destination-ip-address": "fc02:1000:0:1::7/128"
}
}
},
"38": {
"actions": {
"config": {
"forwarding-action": "ACCEPT"
}
},
"config": {
"sequence-id": 38
},
"ip": {
"config": {
"destination-ip-address": "2064:100:0::C0A8:0000:1/128"
}
}
},
"39": {
"actions": {
"config": {
"forwarding-action": "DROP"
}
},
"config": {
"sequence-id": 39
},
"ip": {
"config": {
"destination-ip-address": "2064:100:0::C0A8:0000:9/128"
}
}
}
}
}
Expand Down
30 changes: 30 additions & 0 deletions tests/acl/templates/acltb_v6_test_rules_part_2.j2
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,36 @@
"destination-ip-address": "fc02:1000:0:1::7/128"
}
}
},
"38": {
"actions": {
"config": {
"forwarding-action": "ACCEPT"
}
},
"config": {
"sequence-id": 38
},
"ip": {
"config": {
"destination-ip-address": "2064:100:0::C0A8:0000:1/128"
}
}
},
"39": {
"actions": {
"config": {
"forwarding-action": "DROP"
}
},
"config": {
"sequence-id": 39
},
"ip": {
"config": {
"destination-ip-address": "2064:100:0::C0A8:0000:9/128"
}
}
}
}
}
Expand Down
37 changes: 36 additions & 1 deletion tests/acl/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from tests.common.platform.interface_utils import check_all_interface_information
from tests.common.utilities import get_iface_ip
from tests.common.utilities import is_ipv4_address
from tests.common.utilities import is_ipv6_only_topology

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -79,6 +80,21 @@
"ipv6": "20c0:a800::9"
}

# Below T1 V6 topo IPs are announced to DUT by annouce_route.py
# IPv4 addrs are placeholders only
DOWNSTREAM_DST_IP_V6_TOPO = {
"ipv4": "192.168.0.253",
"ipv6": "2064:100:0::C0A8:0000:14"
}
DOWNSTREAM_IP_TO_ALLOW_V6_TOPO = {
"ipv4": "192.168.0.252",
"ipv6": "2064:100:0::C0A8:0000:1"
}
DOWNSTREAM_IP_TO_BLOCK_V6_TOPO = {
"ipv4": "192.168.0.251",
"ipv6": "2064:100:0::C0A8:0000:9"
}

# Below M0_L3 IPs are announced to DUT by annouce_route.py, it point to neighbor mx
DOWNSTREAM_DST_IP_M0_L3 = {
"ipv4": "192.168.1.65",
Expand Down Expand Up @@ -309,6 +325,15 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_unselected_dut, tbinfo, ptf
DOWNSTREAM_DST_IP = DOWNSTREAM_DST_IP_M0_L3
DOWNSTREAM_IP_TO_ALLOW = DOWNSTREAM_IP_TO_ALLOW_M0_L3
DOWNSTREAM_IP_TO_BLOCK = DOWNSTREAM_IP_TO_BLOCK_M0_L3
elif is_ipv6_only_topology(tbinfo):
if tbinfo['topo']['type'] in ['t0']:
DOWNSTREAM_DST_IP = DOWNSTREAM_DST_IP_VLAN
DOWNSTREAM_IP_TO_ALLOW = DOWNSTREAM_IP_TO_ALLOW_VLAN
DOWNSTREAM_IP_TO_BLOCK = DOWNSTREAM_IP_TO_BLOCK_VLAN
else:
DOWNSTREAM_DST_IP = DOWNSTREAM_DST_IP_V6_TOPO
DOWNSTREAM_IP_TO_ALLOW = DOWNSTREAM_IP_TO_ALLOW_V6_TOPO
DOWNSTREAM_IP_TO_BLOCK = DOWNSTREAM_IP_TO_BLOCK_V6_TOPO
elif tbinfo['topo']['type'] in ['t0']:
try:
vlan_config = tbinfo['topo']['properties']['topology']['DUT']['vlan_configs']['default_vlan_config']
Expand Down Expand Up @@ -898,7 +923,7 @@ def check_rule_counters(self, duthost):
return True

logger.info('Wait all rule counters are ready')
return wait_until(60, 2, 0, self.check_rule_counters_internal, duthost)
return wait_until(120, 2, 0, self.check_rule_counters_internal, duthost)

def check_rule_counters_internal(self, duthost):
for asic_id in duthost.get_frontend_asic_ids():
Expand Down Expand Up @@ -1100,6 +1125,11 @@ def test_dest_ip_match_forwarded(self, setup, direction, ptfadapter,
rule_id = 33 if vlan_name == "Vlan1000" else 2
logging.info("topo: {} vlan_config: {} vlan_name: {} rule_id: {} ".format(
setup["topo"], setup["vlan_config"], vlan_name, rule_id))
elif "-v6-" in setup["topo_name"]:
if setup["topo"] in ['t0']:
rule_id = 34
else:
rule_id = 38
else:
rule_id = 2
else:
Expand Down Expand Up @@ -1128,6 +1158,11 @@ def test_dest_ip_match_dropped(self, setup, direction, ptfadapter,
rule_id = 32 if vlan_name == "Vlan1000" else 15
logging.info("topo: {} vlan_config: {} vlan_name: {} rule_id: {} ".format(
setup["topo"], setup["vlan_config"], vlan_name, rule_id))
elif "-v6-" in setup["topo_name"]:
if setup["topo"] in ['t0']:
rule_id = 35
else:
rule_id = 39
else:
rule_id = 15
else:
Expand Down
Loading