Sridevi Ramesh | 484e10c | 2019-02-28 06:14:46 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite test various boot types with boot source. |
| 3 | Resource ../../lib/resource.robot |
| 4 | Resource ../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../lib/common_utils.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | |
| 8 | Test Teardown FFDC On Test Case Fail |
| 9 | Test Setup redfish.Login |
| 10 | Test Teardown redfish.Logout |
| 11 | Suite Teardown Suite Teardown Execution |
| 12 | |
| 13 | *** Test Cases *** |
| 14 | |
| 15 | Verify BMC Redfish Boot Types With BootSource As Once |
| 16 | [Documentation] Verify BMC Redfish Boot Types With BootSource As Once. |
| 17 | [Tags] Verify_BMC_Redfish_Boot_Types_With_BootSource_As_Once |
| 18 | [Template] Set And Verify BootSource And BootType |
| 19 | |
| 20 | #BootSourceEnableType BootTargetType |
| 21 | Once Hdd |
| 22 | Once Pxe |
| 23 | Once Diags |
| 24 | Once Cd |
| 25 | Once BiosSetup |
| 26 | |
| 27 | Verify BMC Redfish Boot Types With BootSource As Continuous |
| 28 | [Documentation] Verify BMC Redfish Boot Types With BootSource As Continuous. |
| 29 | [Tags] Verify_BMC_Redfish_Boot_Types_With_BootSource_As_Continuous |
| 30 | [Template] Set And Verify BootSource And BootType |
| 31 | |
| 32 | #BootSourceEnable BootTargetType |
| 33 | Continuous Hdd |
| 34 | Continuous Pxe |
| 35 | Continuous Diags |
| 36 | Continuous Cd |
| 37 | Continuous BiosSetup |
| 38 | |
| 39 | *** Keywords *** |
| 40 | |
| 41 | Set And Verify BootSource And BootType |
| 42 | [Documentation] Set And Verify BootSource And BootType. |
| 43 | [Arguments] ${override_enabled} ${override_target} |
| 44 | |
| 45 | # Description of argument(s): |
| 46 | # override_enabled Boot source enable type. |
| 47 | # ('Once', 'Continuous', 'Disabled'). |
| 48 | # override_target Boot target type. |
| 49 | # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None'). |
| 50 | |
| 51 | # Example: |
| 52 | # "Boot": { |
| 53 | # "BootSourceOverrideEnabled": "Disabled", |
| 54 | # "BootSourceOverrideMode": "Legacy", |
| 55 | # "BootSourceOverrideTarget": "None", |
| 56 | # "BootSourceOverrideTarget@Redfish.AllowableValues": [ |
| 57 | # "None", |
| 58 | # "Pxe", |
| 59 | # "Hdd", |
| 60 | # "Cd", |
| 61 | # "Diags", |
| 62 | # "BiosSetup"]} |
| 63 | |
| 64 | ${data}= Create Dictionary BootSourceOverrideEnabled=${override_enabled} |
| 65 | ... BootSourceOverrideTarget=${override_target} |
| 66 | ${payload}= Create Dictionary Boot=${data} |
| 67 | |
| 68 | ${resp}= redfish.patch Systems/system body=&{payload} |
| 69 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
| 70 | |
| 71 | ${resp}= redfish.Get /redfish/v1/Systems/system |
| 72 | Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideEnabled"]} |
| 73 | ... ${override_enabled} |
| 74 | Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideTarget"]} |
| 75 | ... ${override_target} |
| 76 | |
| 77 | |
| 78 | Suite Teardown Execution |
| 79 | [Documentation] Do the post suite teardown. |
| 80 | |
| 81 | Set And Verify BootSource And BootType Disabled None |