diff --git a/conftest.py b/conftest.py index d6a595b8..3aedc2ba 100644 --- a/conftest.py +++ b/conftest.py @@ -267,7 +267,7 @@ def local_sr_on_hostB1(hostB1): def existing_shared_sr(host): sr = host.pool.first_shared_sr() assert sr is not None, "A shared SR on the pool is required" - return sr + yield sr @pytest.fixture(scope='session') def sr_disk(pytestconfig, host): diff --git a/tests/uefi_sb/test_uefistored_sb.py b/tests/uefi_sb/test_uefistored_sb.py index 60e5df8c..059cfdf8 100644 --- a/tests/uefi_sb/test_uefistored_sb.py +++ b/tests/uefi_sb/test_uefistored_sb.py @@ -4,9 +4,9 @@ from lib.commands import SSHCommandFailed from lib.common import wait_for -from .utils import test_key_exchanges, boot_and_check_no_sb_errors, boot_and_check_sb_failed, \ +from .utils import _test_key_exchanges, boot_and_check_no_sb_errors, boot_and_check_sb_failed, \ boot_and_check_sb_succeeded, generate_keys, revert_vm_state, sign_efi_bins, VM_SECURE_BOOT_FAILED, \ - test_uefi_var_migrate + _test_uefi_var_migrate # These tests check the behaviour of XAPI and uefistored as they are in XCP-ng 8.2 # For XCP-ng 8.3 or later, see test_varstored_sb.py @@ -217,7 +217,7 @@ def setup_and_cleanup(self, uefi_vm_and_snapshot): def test_key_exchanges(self, uefi_vm): vm = uefi_vm - test_key_exchanges(vm) + _test_key_exchanges(vm) @pytest.mark.small_vm @pytest.mark.usefixtures("host_less_than_8_3", "existing_shared_sr") @@ -230,4 +230,4 @@ def setup_and_cleanup(self, uefi_vm_and_snapshot): revert_vm_state(vm, snapshot) def test_uefi_var_migrate(self, host, hostA2, uefi_vm): - test_uefi_var_migrate(uefi_vm, host, hostA2) + _test_uefi_var_migrate(uefi_vm, host, hostA2) diff --git a/tests/uefi_sb/test_varstored_sb.py b/tests/uefi_sb/test_varstored_sb.py index d610f040..fc83e43b 100644 --- a/tests/uefi_sb/test_varstored_sb.py +++ b/tests/uefi_sb/test_varstored_sb.py @@ -1,8 +1,8 @@ import logging import pytest -from .utils import test_key_exchanges, boot_and_check_no_sb_errors, boot_and_check_sb_failed, \ - boot_and_check_sb_succeeded, generate_keys, revert_vm_state, sign_efi_bins, test_uefi_var_migrate +from .utils import _test_key_exchanges, boot_and_check_no_sb_errors, boot_and_check_sb_failed, \ + boot_and_check_sb_succeeded, generate_keys, revert_vm_state, sign_efi_bins, _test_uefi_var_migrate # These tests check the behaviour of XAPI and varstored as they are in XCP-ng 8.3 # For XCP-ng 8.2, see test_uefistored_sb.py @@ -152,7 +152,7 @@ def test_key_exchanges(self, uefi_vm): vm = uefi_vm vm.set_uefi_setup_mode() - test_key_exchanges(vm) + _test_key_exchanges(vm) @pytest.mark.small_vm @pytest.mark.usefixtures("host_at_least_8_3", "existing_shared_sr") @@ -164,4 +164,4 @@ def setup_and_cleanup(self, uefi_vm_and_snapshot): revert_vm_state(vm, snapshot) def test_uefi_var_migrate(self, host, hostA2, uefi_vm): - test_uefi_var_migrate(uefi_vm, host, hostA2) + _test_uefi_var_migrate(uefi_vm, host, hostA2) diff --git a/tests/uefi_sb/utils.py b/tests/uefi_sb/utils.py index 7ff10fba..4ffb783f 100644 --- a/tests/uefi_sb/utils.py +++ b/tests/uefi_sb/utils.py @@ -84,7 +84,7 @@ def sign_efi_bins(vm, db): if shutdown: vm.shutdown(verify=True) -def test_key_exchanges(vm): +def _test_key_exchanges(vm): PK = EFIAuth('PK') null_PK = EFIAuth('PK', is_null=True) new_PK = EFIAuth('PK') @@ -174,7 +174,7 @@ def check_vm_cert_md5sum(vm, key, reference_file): reference_md5 = get_md5sum_from_auth(reference_file) assert hashlib.md5(res.stdout).hexdigest() == reference_md5 -def test_uefi_var_migrate(vm, source_host, dest_host): +def _test_uefi_var_migrate(vm, source_host, dest_host): shared_sr = source_host.pool.first_shared_sr() vm.clear_uefi_variables() pool_auths = generate_keys(as_dict=True)