Sathyajith M S | 7ead7dd | 2019-09-12 04:39:08 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Non-maskable interrupt functionality. |
| 3 | |
Sathyajith M S | 3075ff3 | 2019-11-12 04:01:09 -0600 | [diff] [blame] | 4 | Resource ../lib/bmc_redfish_resource.robot |
| 5 | Resource ../lib/boot_utils.robot |
| 6 | Resource ../lib/openbmc_ffdc.robot |
| 7 | Resource ../lib/secureboot/secureboot.robot |
| 8 | Resource ../lib/state_manager.robot |
| 9 | Library ../lib/bmc_ssh_utils.py |
| 10 | Library ../syslib/utils_os.py |
Sathyajith M S | 7ead7dd | 2019-09-12 04:39:08 -0500 | [diff] [blame] | 11 | |
| 12 | Test Teardown FFDC On Test Case Fail |
| 13 | Suite Teardown Redfish.Logout |
| 14 | |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 15 | |
Sathyajith M S | 7ead7dd | 2019-09-12 04:39:08 -0500 | [diff] [blame] | 16 | *** Test Cases *** |
| 17 | |
| 18 | Trigger NMI When OPAL/Host OS Is Not Up |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 19 | [Documentation] Verify return error code from Redfish |
| 20 | ... while injecting NMI when HOST OS is not up. |
Sathyajith M S | 7ead7dd | 2019-09-12 04:39:08 -0500 | [diff] [blame] | 21 | [Tags] Trigger_NMI_When_OPAL/Host_OS_Is_Not_Up |
| 22 | |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 23 | Redfish Power Off |
| 24 | Trigger NMI |
| 25 | |
| 26 | |
| 27 | Trigger 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}] |
Sathyajith M S | 4898c50 | 2019-11-20 01:51:03 -0600 | [diff] [blame] | 35 | Verify Crash Dump Directory After NMI Inject |
| 36 | |
| 37 | |
| 38 | *** Keywords *** |
| 39 | |
| 40 | Verify Crash Dump Directory After NMI Inject |
| 41 | [Documentation] Verification of crash dump directory after NMI inject. |
| 42 | |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 43 | Wait Until Keyword Succeeds 10 min 1 min Is Host Rebooted |
| 44 | Is OS Booted |
| 45 | Wait Until Keyword Succeeds 1 min 10 sec Verify Crash Dump Directory |
| 46 | |
| 47 | |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 48 | Test Setup Execution |
| 49 | [Documentation] Test setup execution. |
| 50 | [Arguments] ${secure_boot_mode}=${1} |
| 51 | |
| 52 | # Description of argument(s): |
| 53 | # secure_boot_mode Secure boot -> Enable-1 or Disable-0. |
| 54 | |
Sathyajith M S | 7ead7dd | 2019-09-12 04:39:08 -0500 | [diff] [blame] | 55 | Redfish Power Off stack_mode=skip |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 56 | Set Auto Reboot ${1} |
| 57 | # Set and verify secure boot policy as disabled. |
| 58 | Set And Verify TPM Policy ${secure_boot_mode} |
| 59 | Redfish Power On |
| 60 | # Delete any pre-existing dump files. |
| 61 | OS Execute Command rm -rf /var/crash/* |
| 62 | ${os_release_info}= Get OS Release Info |
| 63 | # Start crash dump utility on OS. |
| 64 | ${cmd}= Set Variable If |
| 65 | ... '${os_release_info['id']}' == 'ubuntu' kdump-config show kdumpctl start |
| 66 | OS Execute Command ${cmd} print_out=1 |
| 67 | |
| 68 | |
| 69 | Trigger NMI |
| 70 | [Documentation] Inject non-maskable interrupt Redfish URI. |
| 71 | [Arguments] ${valid_status_codes}=[${HTTP_INTERNAL_SERVER_ERROR}] |
| 72 | |
| 73 | # Description of argument(s): |
| 74 | # valid_status_codes A list of status codes that the |
| 75 | # caller considers acceptable. |
| 76 | # See lib/redfish_plus.py for details. |
| 77 | |
Sathyajith M S | 7ead7dd | 2019-09-12 04:39:08 -0500 | [diff] [blame] | 78 | Redfish.Login |
| 79 | Redfish.Post ${SYSTEM_BASE_URI}Actions/ComputerSystem.Reset |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 80 | ... body={"ResetType": "Nmi"} valid_status_codes=${valid_status_codes} |
| 81 | |
Sathyajith M S | 4898c50 | 2019-11-20 01:51:03 -0600 | [diff] [blame] | 82 | |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 83 | Verify Crash Dump Directory |
| 84 | [Documentation] Verify that the crash dump directory is not empty. |
| 85 | |
| 86 | # As per the requirement, there should be a crash dump file |
| 87 | # after successful NMI injection. |
Sathyajith M S | 4898c50 | 2019-11-20 01:51:03 -0600 | [diff] [blame] | 88 | |
Sathyajith M S | beee32c | 2019-09-30 05:22:21 -0500 | [diff] [blame] | 89 | ${output} ${stderr} ${rc}= |
| 90 | ... OS Execute Command ls -ltr /var/crash/* print_out=1 |