blob: ec01d1a30b6532637da4f9275147b2daedc10f30 [file] [log] [blame]
Sridevi Ramesheedcf1a2021-03-17 07:09:32 -05001*** Settings ***
2Documentation Utilities for redfish BIOS attribute operations.
3
Anusha Dathatri0e0e67c2021-06-06 09:38:26 -05004Resource resource.robot
5Resource bmc_redfish_resource.robot
6Resource common_utils.robot
Sridevi Ramesheedcf1a2021-03-17 07:09:32 -05007
8
9*** Keywords ***
10
11Set BIOS Attribute Value And Verify
12
13 [Documentation] Set BIOS attribute handle with attribute value and verify.
Anusha Dathatri99d08922021-05-25 04:19:38 -050014 [Arguments] ${attr_handle} ${attr_val} ${verify}=${True}
15
16 # Description of argument(s):
17 # ${attr_handle} BIOS Attribute handle (e.g. 'vmi_if0_ipv4_method').
18 # @{attr_val} Attribute value for the given attribute handle.
19 # ${verify} Verify the new value.
20
Sridevi Ramesheedcf1a2021-03-17 07:09:32 -050021
22 ${type_int}= Evaluate isinstance($attr_val, int)
23 ${value}= Set Variable If '${type_int}' == '${True}' ${attr_val} '${attr_val}'
24
25 Redfish.Patch ${BIOS_ATTR_SETTINGS_URI} body={"Attributes":{"${attr_handle}": ${value}}}
26 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
27
Anusha Dathatri99d08922021-05-25 04:19:38 -050028 Run Keyword If '${verify}' == '${True}' Verify BIOS Attribute ${attr_handle} ${attr_val}
Sridevi Ramesheedcf1a2021-03-17 07:09:32 -050029
30
31Set Optional BIOS Attribute Values And Verify
32
33 [Documentation] For the given BIOS attribute handle update with optional
34 ... attribute values and verify.
35 [Arguments] ${attr_handle} @{attr_val_list}
36
37 # Description of argument(s):
38 # ${attr_handle} BIOS Attribute handle (e.g. 'vmi_if0_ipv4_method').
39 # @{attr_val_list} List of the attribute values for the given attribute handle.
40 # (e.g. ['IPv4Static', 'IPv4DHCP']).
41
42 FOR ${attr} IN @{attr_val_list}
43 ${new_attr}= Evaluate $attr.replace('"', '')
44 Set BIOS Attribute Value And Verify ${attr_handle} ${new_attr}
45 END
Anusha Dathatri99d08922021-05-25 04:19:38 -050046
47
48Verify BIOS Attribute
49
50 [Documentation] Verify BIOS attribute value.
51 [Arguments] ${attr_handle} ${attr_val}
52
53 # Description of argument(s):
54 # ${attr_handle} BIOS Attribute handle (e.g. 'vmi_if0_ipv4_method').
55 # ${attr_val} The expected value for the given attribute handle.
56
57 ${output}= Redfish.Get Attribute ${BIOS_ATTR_URI} Attributes
58 Should Be Equal ${output['${attr_handle}']} ${attr_val}