From 68dde408d38cd4ae8b24093c6e2230716af2cfff Mon Sep 17 00:00:00 2001 From: dann frazier Date: Sun, 7 Jan 2024 09:43:19 -0700 Subject: [PATCH] Update autopkgtests to not require a shell when Secure Boot is enforced - Drop the boot-to-shell tests for images w/ Secure Boot active - Update run_cmd_check_secure_boot() to not expect shell interaction --- debian/tests/shell.py | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/debian/tests/shell.py b/debian/tests/shell.py index 8b94b59df1..8bced2896c 100755 --- a/debian/tests/shell.py +++ b/debian/tests/shell.py @@ -120,34 +120,19 @@ class BootToShellTest(unittest.TestCase): while True: i = child.expect( [ - 'Press .* or any other key to continue', - 'Shell> ', - "FS0:\\\\> ", 'grub> ', - 'Command Error Status: Access Denied', + 'BdsDxe: failed to start .*: Security Violation', ], timeout=TEST_TIMEOUT, ) if i == 0: - child.sendline('\x1b') - continue - if i == 1: - child.sendline('fs0:\r') - continue - if i == 2: - if state == State.PRE_EXEC: - child.sendline(f'\\efi\\boot\\boot{efiarch}.efi\r') - state = State.POST_EXEC - elif state == State.POST_EXEC: - child.sendline('reset -s\r') - continue - if i == 3: child.sendline('halt\r') verified = True continue - if i == 4: + if i == 1: + child.close() verified = False - continue + break except pexpect.EOF: child.close() if child.exitstatus != 0: @@ -216,21 +201,6 @@ class BootToShellTest(unittest.TestCase): ) self.run_cmd_check_shell(q.command) - def test_ovmf_4m_ms(self): - q = Qemu.QemuCommand( - QemuEfiMachine.OVMF_Q35, - variant=QemuEfiVariant.MS, - flash_size=QemuEfiFlashSize.SIZE_4MB, - ) - self.run_cmd_check_shell(q.command) - - def test_ovmf_snakeoil(self): - q = Qemu.QemuCommand( - QemuEfiMachine.OVMF_Q35, - variant=QemuEfiVariant.SNAKEOIL, - ) - self.run_cmd_check_shell(q.command) - @unittest.skipUnless(DPKG_ARCH == 'amd64', "amd64-only") def test_ovmf_4m_ms_secure_boot_signed(self): q = Qemu.QemuCommand( -- 2.43.0