blob: 8d8f7f776ccbb26721a6835fc9f0240c1963ea6a [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
George Keishinga28061a2023-12-15 14:46:54 +053010Library ../lib/os_utilities.robot
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050011
12Test Teardown FFDC On Test Case Fail
13Suite Teardown Redfish.Logout
14
Sridevi Ramesh89666172025-09-28 04:15:29 -050015Test Tags Test_NMI_Interface
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050016
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050017*** Test Cases ***
18
19Trigger NMI When OPAL/Host OS Is Not Up
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050020 [Documentation] Verify return error code from Redfish
21 ... while injecting NMI when HOST OS is not up.
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050022 [Tags] Trigger_NMI_When_OPAL/Host_OS_Is_Not_Up
23
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050024 Redfish Power Off
25 Trigger NMI
26
27
28Trigger NMI When OPAL/Host OS Is Running And Secureboot Is Disabled
29 [Documentation] Verify valid return status code from Redfish
30 ... while injecting NMI, when HOST OS is running and
31 ... secureboot is disabled.
32 [Tags] Trigger_NMI_When_OPAL/Host_OS_Is_Running_And_Secureboot_Is_Disabled
33 [Setup] Test Setup Execution ${0}
34
35 Trigger NMI valid_status_codes=[${HTTP_OK}]
Sathyajith M S4898c502019-11-20 01:51:03 -060036 Verify Crash Dump Directory After NMI Inject
37
38
39*** Keywords ***
40
41Verify Crash Dump Directory After NMI Inject
42 [Documentation] Verification of crash dump directory after NMI inject.
43
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050044 Wait Until Keyword Succeeds 10 min 1 min Is Host Rebooted
45 Is OS Booted
46 Wait Until Keyword Succeeds 1 min 10 sec Verify Crash Dump Directory
47
48
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050049Test Setup Execution
50 [Documentation] Test setup execution.
51 [Arguments] ${secure_boot_mode}=${1}
52
53 # Description of argument(s):
54 # secure_boot_mode Secure boot -> Enable-1 or Disable-0.
55
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050056 Redfish Power Off stack_mode=skip
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050057 Set Auto Reboot ${1}
58 # Set and verify secure boot policy as disabled.
59 Set And Verify TPM Policy ${secure_boot_mode}
60 Redfish Power On
61 # Delete any pre-existing dump files.
62 OS Execute Command rm -rf /var/crash/*
George Keishing405d5372023-08-10 20:56:05 +053063 ${os_release_info}= utils.Get OS Release Info
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050064 # Start crash dump utility on OS.
65 ${cmd}= Set Variable If
66 ... '${os_release_info['id']}' == 'ubuntu' kdump-config show kdumpctl start
67 OS Execute Command ${cmd} print_out=1
68
69
70Trigger NMI
71 [Documentation] Inject non-maskable interrupt Redfish URI.
72 [Arguments] ${valid_status_codes}=[${HTTP_INTERNAL_SERVER_ERROR}]
73
74 # Description of argument(s):
75 # valid_status_codes A list of status codes that the
76 # caller considers acceptable.
77 # See lib/redfish_plus.py for details.
78
Sathyajith M S7ead7dd2019-09-12 04:39:08 -050079 Redfish.Login
80 Redfish.Post ${SYSTEM_BASE_URI}Actions/ComputerSystem.Reset
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050081 ... body={"ResetType": "Nmi"} valid_status_codes=${valid_status_codes}
82
Sathyajith M S4898c502019-11-20 01:51:03 -060083
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050084Verify Crash Dump Directory
85 [Documentation] Verify that the crash dump directory is not empty.
86
87 # As per the requirement, there should be a crash dump file
88 # after successful NMI injection.
Sathyajith M S4898c502019-11-20 01:51:03 -060089
Sathyajith M Sbeee32c2019-09-30 05:22:21 -050090 ${output} ${stderr} ${rc}=
91 ... OS Execute Command ls -ltr /var/crash/* print_out=1