Skip to content

Commit

Permalink
squash me: PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Reis <[email protected]>
  • Loading branch information
benjamreis committed Dec 5, 2024
1 parent b404ec3 commit 572127f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions tests/uefi_sb/test_uefistored_sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)
8 changes: 4 additions & 4 deletions tests/uefi_sb/test_varstored_sb.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)
4 changes: 2 additions & 2 deletions tests/uefi_sb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 572127f

Please sign in to comment.