Project

General

Profile

Actions

action #102311

closed

[sle][security][sle15sp4] enhance the test code to enable secureboot in bootloader_setup.pm

Added by rfan1 over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Enhancement to existing tests
Target version:
-
Start date:
2021-11-12
Due date:
% Done:

100%

Estimated time:
10.00 h
Difficulty:

Description

##Description:
In bootloader_setup.pm module, there is a function to disable secureboot in tianocore.
Current logic is only disabling the secureboot, I need re-enable it in ima/evm test cases. the operations are 80% same as this function, so will try to revise this code

sub tianocore_disable_secureboot {
    my $basetest = shift;

    assert_screen 'grub2';
    send_key 'c';
    sleep 2;
    enter_cmd "exit";
    assert_screen 'tianocore-mainmenu';
    # Select 'Boot manager' entry
    send_key_until_needlematch('tianocore-devicemanager', 'down', 5, 5);
    send_key 'ret';
    send_key_until_needlematch('tianocore-devicemanager-sb-conf', 'down', 5, 5);
    send_key 'ret';
    send_key_until_needlematch('tianocore-devicemanager-sb-conf-attempt-sb', 'down', 5, 5);
    send_key 'spc';
    assert_screen 'tianocore-devicemanager-sb-conf-changed';
    send_key 'ret';
    assert_screen 'tianocore-devicemanager-sb-conf-attempt-sb';
    send_key 'f10';
    assert_screen 'tianocore-bootmanager-save-changes';
    send_key 'Y';
    send_key_until_needlematch 'tianocore-devicemanager', 'esc';
    send_key_until_needlematch 'tianocore-mainmenu-reset', 'down';
    send_key 'ret';
    send_key 'ret' if check_screen('tianocore-secureboot-not-enabled', 20);
    $basetest->wait_grub;
}

##Expect result

We can re-enable the secureboot without changing much code.

Actions

Also available in: Atom PDF