Skip to content

Commit

Permalink
Add dualtor stanalone and swithover faulty ycable test to PR test (#1…
Browse files Browse the repository at this point in the history
…5519)

What is the motivation for this PR?
Elastictest performs well in distribute running PR test in multiple KVMs, which support us to add more test scripts to PR checker.
But some traffic test using ptfadapter can't be tested on KVM platform, we need to skip traffic test if needed

How did you do it?
Add dualtor stanalone and swithover faulty ycable test to PR test

How did you verify/test it?
  • Loading branch information
xwjiang-ms authored Nov 13, 2024
1 parent f3d2014 commit e3e1c66
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .azure-pipelines/pr_test_scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ dualtor:
- arp/test_arp_dualtor.py
- arp/test_arp_extended.py
- dualtor/test_ipinip.py
- dualtor/test_standalone_tunnel_route.py
- dualtor/test_switchover_failure.py
- dualtor/test_switchover_faulty_ycable.py
- dualtor/test_tor_ecn.py
- dualtor/test_tunnel_memory_leak.py
- dualtor_io/test_heartbeat_failure.py
Expand Down
11 changes: 5 additions & 6 deletions tests/common/dualtor/tunnel_traffic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def __init__(self, standby_tor, active_tor=None, existing=True, inner_packet=Non
self.listen_ports = sorted(self._get_t1_ptf_port_indexes(standby_tor, tbinfo))
self.ptfadapter = ptfadapter
self.packet_count = packet_count
self.asic_type = standby_tor.facts["asic_type"]

standby_tor_cfg_facts = self.standby_tor.config_facts(
host=self.standby_tor.hostname, source="running"
Expand Down Expand Up @@ -292,17 +293,15 @@ def __enter__(self):
def __exit__(self, *exc_info):
if exc_info[0]:
return
if self.asic_type == "vs":
logging.info("Skipping traffic check on VS platform.")
return
try:
result = testutils.verify_packet_any_port(
port_index, rec_pkt = testutils.verify_packet_any_port(
ptfadapter,
self.exp_pkt,
ports=self.listen_ports
)
if isinstance(result, tuple):
port_index, rec_pkt = result
elif isinstance(result, bool):
logging.info("Using dummy testutils to skip traffic test.")
return
except AssertionError as detail:
logging.debug("Error occurred in polling for tunnel traffic", exc_info=True)
if "Did not receive expected packet on any of ports" in str(detail):
Expand Down
12 changes: 12 additions & 0 deletions tests/dualtor/test_switchover_faulty_ycable.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
]


@pytest.fixture(autouse=True)
def ignore_expected_loganalyzer_exceptions(duthosts, rand_one_dut_hostname, loganalyzer):
# Ignore in KVM test
KVMIgnoreRegex = [
".*Could not establish the active side for Y cable port.*",
]
duthost = duthosts[rand_one_dut_hostname]
if loganalyzer: # Skip if loganalyzer is disabled
if duthost.facts["asic_type"] == "vs":
loganalyzer[duthost.hostname].ignore_regex.extend(KVMIgnoreRegex)


@pytest.fixture(scope="module")
def simulated_faulty_side(rand_unselected_dut):
return rand_unselected_dut
Expand Down

0 comments on commit e3e1c66

Please sign in to comment.