blob: a6d325a89943ca328e4ab5cfa341968b9fbd6754 [file] [log] [blame]
Sridevi Ramesh484e10c2019-02-28 06:14:46 -06001*** Settings ***
2Documentation This suite test various boot types with boot source.
3Resource ../../lib/resource.robot
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/common_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
Anusha Dathatri02a0bb32019-04-05 00:50:38 -05007Resource ../../lib/ipmi_client.robot
Sridevi Ramesh484e10c2019-02-28 06:14:46 -06008
George Keishingac3b0952019-03-11 06:02:28 -05009Test Setup Test Setup Execution
10Test Teardown Test Teardown Execution
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060011Suite Teardown Suite Teardown Execution
12
Anusha Dathatri02a0bb32019-04-05 00:50:38 -050013*** Variables ***
14# Maps for correlating redfish data values to IPMI data values.
15# The redfish values are obtained with Redfish.Get or Redfish.Get Properties.
16# The corresponding IPMI values are obtained with the "chassis bootparam get
17# 5" IPMI command.
18
19# This dictionary maps the redfish 'BootSourceOverrideEnabled' value to the
20# corresponding IPMI output value.
21&{redfish_ipmi_enabled_map} Once=Options apply to only next boot
22... Continuous=Options apply to all future boots
23... Disabled=Options apply to all future boots
24
25# This dictionary maps the redfish 'BootSourceOverrideTarget' value to the
26# corresponding IPMI output value.
27&{redfish_ipmi_target_map} Hdd=Force Boot from default Hard-Drive
28... Pxe=Force PXE
29... Diags=Force Boot from default Hard-Drive, request Safe-Mode
30... Cd=Force Boot from CD/DVD
31... BiosSetup=Force Boot into BIOS Setup
32... None=No override
33
Sridevi Ramesh484e10c2019-02-28 06:14:46 -060034*** Test Cases ***
35
36Verify BMC Redfish Boot Types With BootSource As Once
37 [Documentation] Verify BMC Redfish Boot Types With BootSource As Once.
38 [Tags] Verify_BMC_Redfish_Boot_Types_With_BootSource_As_Once
39 [Template] Set And Verify BootSource And BootType
40
41 #BootSourceEnableType BootTargetType
42 Once Hdd
43 Once Pxe
44 Once Diags
45 Once Cd
46 Once BiosSetup
47
48Verify BMC Redfish Boot Types With BootSource As Continuous
49 [Documentation] Verify BMC Redfish Boot Types With BootSource As Continuous.
50 [Tags] Verify_BMC_Redfish_Boot_Types_With_BootSource_As_Continuous
51 [Template] Set And Verify BootSource And BootType
52
53 #BootSourceEnable BootTargetType
54 Continuous Hdd
55 Continuous Pxe
56 Continuous Diags
57 Continuous Cd
58 Continuous BiosSetup
59
60*** Keywords ***
61
62Set And Verify BootSource And BootType
63 [Documentation] Set And Verify BootSource And BootType.
64 [Arguments] ${override_enabled} ${override_target}
65
66 # Description of argument(s):
67 # override_enabled Boot source enable type.
68 # ('Once', 'Continuous', 'Disabled').
69 # override_target Boot target type.
70 # ('Pxe', 'Cd', 'Hdd', 'Diags', 'BiosSetup', 'None').
71
72 # Example:
73 # "Boot": {
74 # "BootSourceOverrideEnabled": "Disabled",
75 # "BootSourceOverrideMode": "Legacy",
76 # "BootSourceOverrideTarget": "None",
77 # "BootSourceOverrideTarget@Redfish.AllowableValues": [
78 # "None",
79 # "Pxe",
80 # "Hdd",
81 # "Cd",
82 # "Diags",
83 # "BiosSetup"]}
84
Anusha Dathatri02a0bb32019-04-05 00:50:38 -050085 # The values set using Redfish are verified via IPMI using the command:
86 # chassis bootparam get 5
87 # Option 5 returns the boot parameters.
88 #
89 # Sample output:
90 # Boot parameter version: 1
91 # Boot parameter 5 is valid/unlocked
92 # Boot parameter data: c000000000
93 # Boot Flags :
94 # - Boot Flag Valid
95 # - Options apply to all future boots
96 # - BIOS PC Compatible (legacy) boot
97 # - Boot Device Selector : No override
98 # - Console Redirection control : System Default
99 # - BIOS verbosity : Console redirection occurs per BIOS configuration
100 # setting (default)
101 # - BIOS Mux Control Override : BIOS uses recommended setting of the mux at
102 # the end of POST
103
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600104 ${data}= Create Dictionary BootSourceOverrideEnabled=${override_enabled}
105 ... BootSourceOverrideTarget=${override_target}
106 ${payload}= Create Dictionary Boot=${data}
107
George Keishing01644e62019-03-26 04:10:17 -0500108 Redfish.Patch /redfish/v1/Systems/system body=&{payload}
George Keishing036693c2019-07-12 06:22:57 -0500109 ... valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}]
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600110
George Keishingac3b0952019-03-11 06:02:28 -0500111 ${resp}= Redfish.Get /redfish/v1/Systems/system
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600112 Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideEnabled"]}
113 ... ${override_enabled}
114 Should Be Equal As Strings ${resp.dict["Boot"]["BootSourceOverrideTarget"]}
115 ... ${override_target}
Anusha Dathatri02a0bb32019-04-05 00:50:38 -0500116 ${output}= Run IPMI Standard Command chassis bootparam get 5
117 Should Contain ${output} ${redfish_ipmi_enabled_map['${override_enabled}']}
118 Should Contain ${output} ${redfish_ipmi_target_map['${override_target}']}
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600119
120Suite Teardown Execution
121 [Documentation] Do the post suite teardown.
122
George Keishing01644e62019-03-26 04:10:17 -0500123 Redfish.Login
Sridevi Ramesh484e10c2019-02-28 06:14:46 -0600124 Set And Verify BootSource And BootType Disabled None
George Keishing01644e62019-03-26 04:10:17 -0500125 Redfish.Logout
George Keishingac3b0952019-03-11 06:02:28 -0500126
127
128Test Setup Execution
129 [Documentation] Do test case setup tasks.
130
131 Redfish.Login
132
133
134Test Teardown Execution
135 [Documentation] Do the post test teardown.
136
137 FFDC On Test Case Fail
138 Redfish.Logout