Skip to content
Open
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
41 changes: 35 additions & 6 deletions lisa/microsoft/testsuites/xdp/xdptools.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import re
from pathlib import PurePath
from typing import Any, Dict
from typing import Any, Dict, Set

from lisa import (
LisaException,
Expand Down Expand Up @@ -35,6 +36,19 @@ def can_install(node: Node) -> bool:
return True


_log = logging.getLogger(__name__)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need this, use node.log


# Upstream xdp-tools tests known to fail on certain distro/kernel combinations.
# These are not LISA or driver regressions; they are upstream test issues.
# test_promiscuous_selfload / test_promiscuous_preload: fail on Ubuntu 24.04+
# (kernel 6.8+) because the upstream test's promiscuous-mode detection logic
# is incompatible with newer kernel behaviour.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provide the doc link here

_KNOWN_UPSTREAM_FAILURES: Set[str] = {
"test_promiscuous_selfload",
"test_promiscuous_preload",
}
Comment on lines +46 to +49
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says these failures are specific to Ubuntu 24.04+ (kernel 6.8+), but the code unconditionally ignores them on all distros/kernels. This risks masking real regressions on other platforms. Consider gating the allowlist by OS/version and/or kernel version (e.g., only apply when running on Ubuntu >= 24.04 or kernel >= 6.8), and otherwise treat these as unexpected failures.

Copilot uses AI. Check for mistakes.


class XdpTool(Tool):
"""
The community xdp tools, it's used to verify XDP by community test cases.
Expand Down Expand Up @@ -71,11 +85,26 @@ def run_full_test(self) -> None:
):
if item["result"] not in ["PASS", "SKIPPED"]:
abnormal_results[item["name"]] = item["result"]
if abnormal_results:
raise LisaException(f"found failed tests: {abnormal_results}")
result.assert_exit_code(
0, "unknown error on xdp tests, please check log for more details."
)

known = {
k: v for k, v in abnormal_results.items() if k in _KNOWN_UPSTREAM_FAILURES
}
unexpected = {
k: v
for k, v in abnormal_results.items()
if k not in _KNOWN_UPSTREAM_FAILURES
}

if known:
_log.warning("ignoring known upstream test failures: %s", known)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use %s use f-format


if unexpected:
raise LisaException(f"found failed tests: {unexpected}")
if not known:
result.assert_exit_code(
0,
"unknown error on xdp tests, please check log for more details.",
)
Comment on lines +101 to +107
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When known is non-empty, the code skips checking result's exit code entirely. That can allow non-test-related failures (e.g., runner crash, bad invocation, missing deps) to pass as long as the parsed test list only contains known failures. A safer approach is to still validate the exit code in the known case—e.g., allow only the specific failure exit code(s) that correspond to test failures, and fail on any other non-zero exit code.

Copilot uses AI. Check for mistakes.

def _initialize(self, *args: Any, **kwargs: Any) -> None:
super()._initialize(*args, **kwargs)
Expand Down
Loading