diff --git a/jobs.py b/jobs.py index 31ba22b32..c4bd391e2 100755 --- a/jobs.py +++ b/jobs.py @@ -401,7 +401,7 @@ "pci-passthrough": { "description": "Testing PCI passthrough functionalities", "requirements": [ - "A XCP-ng host >= 8.3 with a PGPU and a PCI to passthrough.", + "A XCP-ng host >= 8.3 with a PGPU to passthrough.", "The host will be rebooted by the tests." ], "nb_pools": 1, diff --git a/tests/pci_passthrough/conftest.py b/tests/pci_passthrough/conftest.py index 03809e239..390d82ded 100644 --- a/tests/pci_passthrough/conftest.py +++ b/tests/pci_passthrough/conftest.py @@ -3,28 +3,6 @@ from lib.common import safe_split -@pytest.fixture(scope="session") -def enabled_pci_uuid(host): - pci_uuids = safe_split(host.xe("pci-list", {"host-uuid": host.uuid, "dependencies": ""}, minimal=True), ',') - - pci_uuid = None - for uuid in pci_uuids: - dom0_access = host.xe("pci-get-dom0-access-status", {"uuid": uuid}) - if dom0_access == "enabled": - pci_uuid = uuid - break - - if pci_uuid is None: - pytest.skip("This test requires a PCI to hide from dom0") - - yield pci_uuid - - # Put PCI back in initial state - if host.xe("pci-get-dom0-access-status", {"uuid": pci_uuid}) != "enabled": - host.xe("pci-enable-dom0-access", {"uuid": pci_uuid}) - if host.xe("pci-get-dom0-access-status", {"uuid": pci_uuid}) != "enabled": - host.reboot(verify=True) - @pytest.fixture(scope="session") def enabled_pgpu_uuid(host): pgpu_uuids = safe_split(host.xe("pgpu-list", {"host-uuid": host.uuid}, minimal=True), ',') @@ -48,3 +26,8 @@ def enabled_pgpu_uuid(host): host.xe("pci-enable-dom0-access", {"uuid": pci_uuid}) if host.xe("pci-get-dom0-access-status", {"uuid": pci_uuid}) != "enabled": host.reboot(verify=True) + +@pytest.fixture(scope="session") +def enabled_pci_uuid(host, enabled_pgpu_uuid): + pci_uuid = host.xe("pgpu-param-get", {"uuid": enabled_pgpu_uuid, "param-name": "pci-uuid"}) + return pci_uuid