blob: 695ecf1ba9699e1242c317a007d363b06d0ca79d [file] [log] [blame]
Sathyajith M S7ead7dd2019-09-12 04:39:08 -05001*** Settings ***
2Documentation Test Non-maskable interrupt functionality.
3
Sathyajith M S3075ff32019-11-12 04:01:09 -06004Resource ../lib/bmc_redfish_resource.robot
5Resource ../lib/boot_utils.robot
6Resource ../lib/openbmc_ffdc.robot
7Resource ../lib/secureboot/secureboot.robot
8Resource ../lib/state_manager.robot
9Library ../lib/bmc_ssh_utils.py
10Library ../syslib/utils_os.py
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050011
12Test Teardown FFDC On Test Case Fail
13Suite Teardown Redfish.Logout
14
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050015
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050016*** Test Cases ***
17
18Trigger NMI When OPAL/Host OS Is Not Up
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050019 [Documentation] Verify return error code from Redfish
20 ... while injecting NMI when HOST OS is not up.
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050021 [Tags] Trigger_NMI_When_OPAL/Host_OS_Is_Not_Up
22
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050023 Redfish Power Off
24 Trigger NMI
25
26
27Trigger NMI When OPAL/Host OS Is Running And Secureboot Is Disabled
28 [Documentation] Verify valid return status code from Redfish
29 ... while injecting NMI, when HOST OS is running and
30 ... secureboot is disabled.
31 [Tags] Trigger_NMI_When_OPAL/Host_OS_Is_Running_And_Secureboot_Is_Disabled
32 [Setup] Test Setup Execution ${0}
33
34 Trigger NMI valid_status_codes=[${HTTP_OK}]
35 # NMI Post Crash Dump Verification
36 Wait Until Keyword Succeeds 10 min 1 min Is Host Rebooted
37 Is OS Booted
38 Wait Until Keyword Succeeds 1 min 10 sec Verify Crash Dump Directory
39
40
41*** Keywords ***
42
43Test Setup Execution
44 [Documentation] Test setup execution.
45 [Arguments] ${secure_boot_mode}=${1}
46
47 # Description of argument(s):
48 # secure_boot_mode Secure boot -> Enable-1 or Disable-0.
49
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050050 Redfish Power Off stack_mode=skip
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050051 Set Auto Reboot ${1}
52 # Set and verify secure boot policy as disabled.
53 Set And Verify TPM Policy ${secure_boot_mode}
54 Redfish Power On
55 # Delete any pre-existing dump files.
56 OS Execute Command rm -rf /var/crash/*
57 ${os_release_info}= Get OS Release Info
58 # Start crash dump utility on OS.
59 ${cmd}= Set Variable If
60 ... '${os_release_info['id']}' == 'ubuntu' kdump-config show kdumpctl start
61 OS Execute Command ${cmd} print_out=1
62
63
64Trigger NMI
65 [Documentation] Inject non-maskable interrupt Redfish URI.
66 [Arguments] ${valid_status_codes}=[${HTTP_INTERNAL_SERVER_ERROR}]
67
68 # Description of argument(s):
69 # valid_status_codes A list of status codes that the
70 # caller considers acceptable.
71 # See lib/redfish_plus.py for details.
72
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050073 Redfish.Login
74 Redfish.Post ${SYSTEM_BASE_URI}Actions/ComputerSystem.Reset
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050075 ... body={"ResetType": "Nmi"} valid_status_codes=${valid_status_codes}
76
77Verify Crash Dump Directory
78 [Documentation] Verify that the crash dump directory is not empty.
79
80 # As per the requirement, there should be a crash dump file
81 # after successful NMI injection.
82 ${output} ${stderr} ${rc}=
83 ... OS Execute Command ls -ltr /var/crash/* print_out=1