Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not run test_mellanox-modules-compat on hosts with Mellanox card #266

Merged
merged 1 commit into from
Dec 10, 2024
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
7 changes: 7 additions & 0 deletions tests/packages/mlx/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ def host_without_mlx_compat_loaded(host_with_saved_yum_state):
if mlx_compat_loaded:
logging.info("test is done so reload mlx_compat")
host.ssh(['modprobe', '-v', 'mlx_compat'])

@pytest.fixture(scope="package")
def host_without_mlx_card(host):
if host.ssh_with_result(["lspci", "|", "grep", "Mellanox"]).returncode == 0:
# Skip test to not mess with mellanox card
pytest.skip("This test can't be run on a host with a mellanox card")
yield host
3 changes: 3 additions & 0 deletions tests/packages/mlx/test_mellanox-modules-compat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

# Requirements:
# From --hosts parameter:
# - host(A1): any master host of a pool, with access to XCP-ng RPM repositories.
Expand All @@ -8,6 +10,7 @@ def load_unload_mlx_module(host):
host.ssh(['modprobe', '-v', MLX4_MODULE])
host.ssh(['modprobe', '-r', '-v', MLX4_MODULE])

@pytest.mark.usefixtures("host_without_mlx_card")
def test_install_mlx_modules_alt(host_without_mlx_compat_loaded):
host = host_without_mlx_compat_loaded

Expand Down
Loading