diff options
author | Tom Rini <trini@konsulko.com> | 2020-04-30 15:11:06 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-04-30 15:11:06 -0400 |
commit | 78021b63373de32335bd204471d6cb7c7e18bc52 (patch) | |
tree | 2595e84a2a15ad82f99c298259ff3c2b4b31c0d9 /test/py/tests/test_efi_secboot | |
parent | 9f0a6df3a57469061582c6b27fc869829681beca (diff) | |
parent | f9f5f92bc54b035223e447bc5740544efd0569d9 (diff) |
Merge tag 'efi-2020-07-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-07-rc2
This pull request contains bug fixes needed due to the merged changes for
EFI secure boot.
Patches are supplied to identify EFI system partitions.
Diffstat (limited to 'test/py/tests/test_efi_secboot')
-rw-r--r-- | test/py/tests/test_efi_secboot/conftest.py | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/test/py/tests/test_efi_secboot/conftest.py b/test/py/tests/test_efi_secboot/conftest.py index e542fef6e8..5d99b8b718 100644 --- a/test/py/tests/test_efi_secboot/conftest.py +++ b/test/py/tests/test_efi_secboot/conftest.py @@ -43,7 +43,8 @@ def efi_boot_env(request, u_boot_config): HELLO_PATH = u_boot_config.build_dir + '/lib/efi_loader/helloworld.efi' try: - non_root = tool_is_in_path('udisksctl') + mnt_point = u_boot_config.persistent_data_dir + '/mnt_efisecure' + check_call('mkdir -p {}'.format(mnt_point), shell=True) # create a disk/partition check_call('dd if=/dev/zero of=%s bs=1MiB count=%d' @@ -57,25 +58,11 @@ def efi_boot_env(request, u_boot_config): check_call('dd if=%s.tmp of=%s bs=1MiB seek=1 count=%d conv=notrunc' % (image_path, image_path, 1), shell=True) check_call('rm %s.tmp' % image_path, shell=True) - if non_root: - out_data = check_output('udisksctl loop-setup -f %s -o %d' - % (image_path, 1048576), shell=True).decode() - m = re.search('(?<= as )(.*)\.', out_data) - loop_dev = m.group(1) - # print 'loop device is: %s' % loop_dev - out_data = check_output('udisksctl info -b %s' - % loop_dev, shell=True).decode() - m = re.search('MountPoints:[ \t]+(.*)', out_data) - mnt_point = m.group(1) - else: - loop_dev = check_output('sudo losetup -o 1MiB --sizelimit %dMiB --show -f %s | tr -d "\n"' + loop_dev = check_output('sudo losetup -o 1MiB --sizelimit %dMiB --show -f %s | tr -d "\n"' % (part_size, image_path), shell=True).decode() - mnt_point = '/mnt' - check_output('sudo mount -t %s -o umask=000 %s %s' + check_output('sudo mount -t %s -o umask=000 %s %s' % (fs_type, loop_dev, mnt_point), shell=True) - # print 'mount point is: %s' % mnt_point - # suffix # *.key: RSA private key in PEM # *.crt: X509 certificate (self-signed) in PEM @@ -134,13 +121,8 @@ def efi_boot_env(request, u_boot_config): % (mnt_point, EFITOOLS_PATH, EFITOOLS_PATH), shell=True) - if non_root: - check_call('udisksctl unmount -b %s' % loop_dev, shell=True) - # not needed - # check_call('udisksctl loop-delete -b %s' % loop_dev, shell=True) - else: - check_call('sudo umount %s' % loop_dev, shell=True) - check_call('sudo losetup -d %s' % loop_dev, shell=True) + check_call('sudo umount %s' % loop_dev, shell=True) + check_call('sudo losetup -d %s' % loop_dev, shell=True) except CalledProcessError as e: pytest.skip('Setup failed: %s' % e.cmd) |