Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Certificate utilities keywords. |
| 3 | |
| 4 | Library OperatingSystem |
| 5 | Resource rest_client.robot |
Sandhya Somashekar | 839a0c2 | 2019-01-31 05:05:43 -0600 | [diff] [blame] | 6 | Resource resource.robot |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 7 | |
George Keishing | 2dc2864 | 2022-07-19 13:43:54 -0500 | [diff] [blame] | 8 | *** Variables *** |
| 9 | |
| 10 | # Default wait sync time for certificate install and restart services. |
| 11 | ${wait_time} 30 |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 12 | |
| 13 | *** Keywords *** |
| 14 | |
| 15 | Install Certificate File On BMC |
Rahul Maheshwari | 6a849ad | 2020-02-26 03:31:19 -0600 | [diff] [blame] | 16 | [Documentation] Install certificate file in BMC using POST operation. |
| 17 | [Arguments] ${uri} ${status}=ok &{kwargs} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 18 | |
| 19 | # Description of argument(s): |
Rahul Maheshwari | 6a849ad | 2020-02-26 03:31:19 -0600 | [diff] [blame] | 20 | # uri URI for installing certificate file via Redfish |
| 21 | # e.g. "/redfish/v1/AccountService/LDAP/Certificates". |
| 22 | # status Expected status of certificate installation via Redfish |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 23 | # e.g. error, ok. |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 24 | # kwargs A dictionary of keys/values to be passed directly to |
Rahul Maheshwari | 6a849ad | 2020-02-26 03:31:19 -0600 | [diff] [blame] | 25 | # POST Request. |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 26 | |
Rahul Maheshwari | 6a849ad | 2020-02-26 03:31:19 -0600 | [diff] [blame] | 27 | Initialize OpenBMC |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 28 | |
| 29 | ${headers}= Create Dictionary Content-Type=application/octet-stream |
Sridevi Ramesh | eadeef0 | 2019-01-17 08:56:18 -0600 | [diff] [blame] | 30 | ... X-Auth-Token=${XAUTH_TOKEN} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 31 | Set To Dictionary ${kwargs} headers ${headers} |
| 32 | |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 33 | ${resp}= POST On Session openbmc ${uri} &{kwargs} expected_status=any |
| 34 | ${cert_id}= Set Variable If '${resp.status_code}' == '${HTTP_OK}' ${resp.json()["Id"]} -1 |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 35 | |
| 36 | Run Keyword If '${status}' == 'ok' |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 37 | ... Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 38 | ... ELSE IF '${status}' == 'error' |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 39 | ... Should Be Equal As Strings ${resp.status_code} ${HTTP_INTERNAL_SERVER_ERROR} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 40 | |
| 41 | Delete All Sessions |
| 42 | |
Rahul Maheshwari | 6a849ad | 2020-02-26 03:31:19 -0600 | [diff] [blame] | 43 | [Return] ${cert_id} |
| 44 | |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 45 | |
| 46 | Get Certificate Content From BMC Via Openssl |
| 47 | [Documentation] Get certificate content from BMC via openssl. |
| 48 | |
| 49 | Check If Openssl Tool Exist |
| 50 | |
| 51 | ${openssl_cmd}= Catenate |
Anusha Dathatri | d334bdf | 2020-06-10 04:19:07 -0500 | [diff] [blame] | 52 | ... timeout 10 openssl s_client -connect ${OPENBMC_HOST}:${HTTPS_PORT} -showcerts |
Rahul Maheshwari | 2a848cf | 2019-05-31 09:46:22 -0500 | [diff] [blame] | 53 | ${output}= Run ${openssl_cmd} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 54 | |
| 55 | ${result}= Fetch From Left |
| 56 | ... ${output} -----END CERTIFICATE----- |
| 57 | ${result}= Fetch From Right ${result} -----BEGIN CERTIFICATE----- |
| 58 | [Return] ${result} |
| 59 | |
| 60 | |
Rahul Maheshwari | 081eadb | 2018-10-26 03:11:10 -0500 | [diff] [blame] | 61 | Get Certificate File Content From BMC |
| 62 | [Documentation] Get required certificate file content from BMC. |
| 63 | [Arguments] ${cert_type}=Client |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 64 | |
Rahul Maheshwari | 081eadb | 2018-10-26 03:11:10 -0500 | [diff] [blame] | 65 | # Description of argument(s): |
| 66 | # cert_type Certificate type (e.g. "Client" or "CA"). |
| 67 | |
| 68 | ${certificate} ${stderr} ${rc}= Run Keyword If '${cert_type}' == 'Client' |
| 69 | ... BMC Execute Command cat /etc/nslcd/certs/cert.pem |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 70 | |
| 71 | [Return] ${certificate} |
| 72 | |
| 73 | |
| 74 | Generate Certificate File Via Openssl |
| 75 | [Documentation] Create certificate file via openssl with required content |
| 76 | ... and returns its path. |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 77 | [Arguments] ${cert_format} ${time}=365 ${cert_dir_name}=certificate_dir |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 78 | |
| 79 | # Description of argument(s): |
| 80 | # cert_format Certificate file format |
| 81 | # e.g. Valid_Certificate_Empty_Privatekey. |
| 82 | # time Number of days to certify the certificate for. |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 83 | # cert_dir_name The name of the sub-directory where the certificate |
| 84 | # is stored. |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 85 | |
| 86 | Check If Openssl Tool Exist |
| 87 | |
| 88 | ${openssl_cmd}= Catenate openssl req -x509 -sha256 -newkey rsa:2048 |
| 89 | ... ${SPACE}-nodes -days ${time} |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 90 | ... ${SPACE}-keyout ${cert_dir_name}/cert.pem -out ${cert_dir_name}/cert.pem |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 91 | ... ${SPACE}-subj "/O=XYZ Corporation /CN=www.xyz.com" |
| 92 | |
| 93 | ${rc} ${output}= Run And Return RC and Output ${openssl_cmd} |
| 94 | Should Be Equal ${rc} ${0} msg=${output} |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 95 | OperatingSystem.File Should Exist |
| 96 | ... ${EXECDIR}${/}${cert_dir_name}${/}cert.pem |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 97 | |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 98 | ${file_content}= OperatingSystem.Get File |
| 99 | ... ${EXECDIR}${/}${cert_dir_name}${/}cert.pem |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 100 | ${result}= Fetch From Left ${file_content} -----END CERTIFICATE----- |
| 101 | ${cert_content}= Fetch From Right ${result} -----BEGIN CERTIFICATE----- |
| 102 | |
| 103 | ${result}= Fetch From Left ${file_content} -----END PRIVATE KEY----- |
| 104 | ${private_key_content}= Fetch From Right ${result} -----BEGIN PRIVATE KEY----- |
| 105 | |
| 106 | ${cert_data}= |
| 107 | ... Run Keyword if '${cert_format}' == 'Valid Certificate Valid Privatekey' |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 108 | ... OperatingSystem.Get File ${EXECDIR}${/}${cert_dir_name}${/}cert.pem |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 109 | ... ELSE IF '${cert_format}' == 'Empty Certificate Valid Privatekey' |
| 110 | ... Remove String ${file_content} ${cert_content} |
| 111 | ... ELSE IF '${cert_format}' == 'Valid Certificate Empty Privatekey' |
| 112 | ... Remove String ${file_content} ${private_key_content} |
| 113 | ... ELSE IF '${cert_format}' == 'Empty Certificate Empty Privatekey' |
| 114 | ... Remove String ${file_content} ${cert_content} ${private_key_content} |
Anusha Dathatri | bc85564 | 2020-06-17 05:21:14 -0500 | [diff] [blame] | 115 | ... ELSE IF '${cert_format}' == 'Expired Certificate' or '${cert_format}' == 'Not Yet Valid Certificate' |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 116 | ... OperatingSystem.Get File ${EXECDIR}${/}${cert_dir_name}${/}cert.pem |
Rahul Maheshwari | 081eadb | 2018-10-26 03:11:10 -0500 | [diff] [blame] | 117 | ... ELSE IF '${cert_format}' == 'Valid Certificate' |
| 118 | ... Remove String ${file_content} ${private_key_content} |
| 119 | ... -----BEGIN PRIVATE KEY----- -----END PRIVATE KEY----- |
| 120 | ... ELSE IF '${cert_format}' == 'Empty Certificate' |
| 121 | ... Remove String ${file_content} ${cert_content} |
| 122 | ... ${private_key_content} -----BEGIN PRIVATE KEY----- |
| 123 | ... -----END PRIVATE KEY----- |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 124 | |
| 125 | ${random_name}= Generate Random String 8 |
| 126 | ${cert_name}= Catenate SEPARATOR= ${random_name} .pem |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 127 | Create File ${cert_dir_name}/${cert_name} ${cert_data} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 128 | |
Rahul Maheshwari | 665bc61 | 2018-10-24 04:57:53 -0500 | [diff] [blame] | 129 | [Return] ${EXECDIR}${/}${cert_dir_name}${/}${cert_name} |
Rahul Maheshwari | 984791c | 2018-09-21 00:49:37 -0500 | [diff] [blame] | 130 | |
| 131 | |
| 132 | Get Certificate Content From File |
| 133 | [Documentation] Get certificate content from certificate file. |
| 134 | [Arguments] ${cert_file_path} |
| 135 | |
| 136 | # Description of argument(s): |
| 137 | # cert_file_path Downloaded certificate file path. |
| 138 | |
| 139 | ${file_content}= OperatingSystem.Get File ${cert_file_path} |
| 140 | ${result}= Fetch From Left ${file_content} -----END CERTIFICATE----- |
| 141 | ${result}= Fetch From Right ${result} -----BEGIN CERTIFICATE----- |
| 142 | [Return] ${result} |
| 143 | |
| 144 | |
| 145 | Check If Openssl Tool Exist |
| 146 | [Documentation] Check if openssl tool installed or not. |
| 147 | |
| 148 | ${rc} ${output}= Run And Return RC and Output which openssl |
| 149 | Should Not Be Empty ${output} msg=Openssl tool not installed. |
| 150 | |
Rahul Maheshwari | a6ae3c3 | 2019-09-05 08:52:01 -0500 | [diff] [blame] | 151 | |
| 152 | Verify Certificate Visible Via OpenSSL |
| 153 | [Documentation] Checks if given certificate is visible via openssl's showcert command. |
| 154 | [Arguments] ${cert_file_path} |
| 155 | |
| 156 | # Description of argument(s): |
| 157 | # cert_file_path Certificate file path. |
| 158 | |
| 159 | ${cert_file_content}= OperatingSystem.Get File ${cert_file_path} |
| 160 | ${openssl_cert_content}= Get Certificate Content From BMC Via Openssl |
| 161 | Should Contain ${cert_file_content} ${openssl_cert_content} |
| 162 | |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 163 | |
| 164 | Delete All CA Certificate Via Redfish |
| 165 | [Documentation] Delete all CA certificate via Redfish. |
| 166 | ${cert_list}= Redfish_Utils.Get Member List /redfish/v1/Managers/bmc/Truststore/Certificates |
| 167 | FOR ${cert} IN @{cert_list} |
| 168 | Redfish.Delete ${cert} valid_status_codes=[${HTTP_NO_CONTENT}] |
George Keishing | 3188893 | 2022-07-19 23:05:50 -0500 | [diff] [blame] | 169 | Log To Console Wait Time started in seconds ${wait_time} |
| 170 | Sleep ${wait_time}s |
manashsarma | b9feda7 | 2020-10-05 10:40:12 -0500 | [diff] [blame] | 171 | END |
manashsarma | e07858a | 2020-10-16 06:09:46 -0500 | [diff] [blame] | 172 | |
| 173 | |
| 174 | Delete Certificate Via BMC CLI |
| 175 | [Documentation] Delete certificate via BMC CLI. |
| 176 | [Arguments] ${cert_type} |
| 177 | |
| 178 | # Description of argument(s): |
| 179 | # cert_type Certificate type (e.g. "Client" or "CA"). |
| 180 | |
| 181 | ${certificate_file_path} ${certificate_service} ${certificate_uri}= |
| 182 | ... Run Keyword If '${cert_type}' == 'Client' |
| 183 | ... Set Variable /etc/nslcd/certs/cert.pem phosphor-certificate-manager@nslcd.service |
| 184 | ... ${REDFISH_LDAP_CERTIFICATE_URI} |
| 185 | ... ELSE IF '${cert_type}' == 'CA' |
| 186 | ... Set Variable ${ROOT_CA_FILE_PATH} phosphor-certificate-manager@authority.service |
| 187 | ... ${REDFISH_CA_CERTIFICATE_URI} |
| 188 | |
| 189 | ${file_status} ${stderr} ${rc}= BMC Execute Command |
| 190 | ... [ -f ${certificate_file_path} ] && echo "Found" || echo "Not Found" |
| 191 | |
| 192 | Return From Keyword If "${file_status}" != "Found" |
| 193 | BMC Execute Command rm ${certificate_file_path} |
| 194 | BMC Execute Command systemctl restart ${certificate_service} |
| 195 | BMC Execute Command systemctl daemon-reload |
| 196 | Wait Until Keyword Succeeds 1 min 10 sec Redfish.Get ${certificate_uri}/1 |
| 197 | ... valid_status_codes=[${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR}] |
Ashwini Chandrappa | 6b20ffa | 2021-08-04 03:18:37 -0500 | [diff] [blame] | 198 | |
| 199 | |
| 200 | Replace Certificate Via Redfish |
| 201 | [Documentation] Test 'replace certificate' operation in the BMC via Redfish. |
| 202 | [Arguments] ${cert_type} ${cert_format} ${expected_status} |
| 203 | |
| 204 | # Description of argument(s): |
| 205 | # cert_type Certificate type (e.g. "Server" or "Client"). |
| 206 | # cert_format Certificate file format |
| 207 | # (e.g. Valid_Certificate_Valid_Privatekey). |
| 208 | # expected_status Expected status of certificate replace Redfish |
| 209 | # request (i.e. "ok" or "error"). |
| 210 | |
| 211 | # Install certificate before replacing client or CA certificate. |
| 212 | ${cert_id}= Run Keyword If '${cert_type}' == 'Client' |
| 213 | ... Install And Verify Certificate Via Redfish ${cert_type} Valid Certificate Valid Privatekey ok |
| 214 | ... ELSE IF '${cert_type}' == 'CA' |
| 215 | ... Install And Verify Certificate Via Redfish ${cert_type} Valid Certificate ok |
| 216 | |
| 217 | ${cert_file_path}= Generate Certificate File Via Openssl ${cert_format} |
| 218 | |
| 219 | ${bytes}= OperatingSystem.Get Binary File ${cert_file_path} |
| 220 | ${file_data}= Decode Bytes To String ${bytes} UTF-8 |
| 221 | |
| 222 | Run Keyword If '${cert_format}' == 'Expired Certificate' |
| 223 | ... Modify BMC Date future |
| 224 | ... ELSE IF '${cert_format}' == 'Not Yet Valid Certificate' |
| 225 | ... Modify BMC Date old |
| 226 | |
| 227 | |
| 228 | ${certificate_uri}= Set Variable If |
| 229 | ... '${cert_type}' == 'Server' ${REDFISH_HTTPS_CERTIFICATE_URI}/1 |
| 230 | ... '${cert_type}' == 'Client' ${REDFISH_LDAP_CERTIFICATE_URI}/1 |
| 231 | ... '${cert_type}' == 'CA' ${REDFISH_CA_CERTIFICATE_URI}/${cert_id} |
| 232 | |
| 233 | ${certificate_dict}= Create Dictionary @odata.id=${certificate_uri} |
| 234 | ${payload}= Create Dictionary CertificateString=${file_data} |
| 235 | ... CertificateType=PEM CertificateUri=${certificate_dict} |
| 236 | |
| 237 | ${expected_resp}= Set Variable If '${expected_status}' == 'ok' ${HTTP_OK} |
| 238 | ... '${expected_status}' == 'error' ${HTTP_NOT_FOUND}, ${HTTP_INTERNAL_SERVER_ERROR} |
| 239 | ${resp}= redfish.Post /redfish/v1/CertificateService/Actions/CertificateService.ReplaceCertificate |
| 240 | ... body=${payload} valid_status_codes=[${expected_resp}] |
| 241 | |
| 242 | ${cert_file_content}= OperatingSystem.Get File ${cert_file_path} |
| 243 | ${bmc_cert_content}= redfish_utils.Get Attribute ${certificate_uri} CertificateString |
| 244 | |
| 245 | Run Keyword If '${expected_status}' == 'ok' |
| 246 | ... Should Contain ${cert_file_content} ${bmc_cert_content} |
| 247 | ... ELSE |
| 248 | ... Should Not Contain ${cert_file_content} ${bmc_cert_content} |
Rahul Maheshwari | f689bb6 | 2022-04-22 05:00:32 -0500 | [diff] [blame] | 249 | |
| 250 | |
| 251 | Install And Verify Certificate Via Redfish |
| 252 | [Documentation] Install and verify certificate using Redfish. |
| 253 | [Arguments] ${cert_type} ${cert_format} ${expected_status} ${delete_cert}=${True} |
| 254 | |
| 255 | # Description of argument(s): |
| 256 | # cert_type Certificate type (e.g. "Client" or "CA"). |
| 257 | # cert_format Certificate file format |
| 258 | # (e.g. "Valid_Certificate_Valid_Privatekey"). |
| 259 | # expected_status Expected status of certificate replace Redfish |
| 260 | # request (i.e. "ok" or "error"). |
| 261 | # delete_cert Certificate will be deleted before installing if this True. |
| 262 | |
| 263 | Run Keyword If '${cert_type}' == 'CA' and '${delete_cert}' == '${True}' |
| 264 | ... Delete All CA Certificate Via Redfish |
| 265 | ... ELSE IF '${cert_type}' == 'Client' and '${delete_cert}' == '${True}' |
| 266 | ... Delete Certificate Via BMC CLI ${cert_type} |
| 267 | |
| 268 | ${cert_file_path}= Generate Certificate File Via Openssl ${cert_format} |
| 269 | ${bytes}= OperatingSystem.Get Binary File ${cert_file_path} |
| 270 | ${file_data}= Decode Bytes To String ${bytes} UTF-8 |
| 271 | |
| 272 | ${certificate_uri}= Set Variable If |
| 273 | ... '${cert_type}' == 'Client' ${REDFISH_LDAP_CERTIFICATE_URI} |
| 274 | ... '${cert_type}' == 'CA' ${REDFISH_CA_CERTIFICATE_URI} |
| 275 | |
| 276 | Run Keyword If '${cert_format}' == 'Expired Certificate' Modify BMC Date future |
| 277 | ... ELSE IF '${cert_format}' == 'Not Yet Valid Certificate' Modify BMC Date old |
| 278 | |
| 279 | ${cert_id}= Install Certificate File On BMC ${certificate_uri} ${expected_status} data=${file_data} |
| 280 | Logging Installed certificate id: ${cert_id} |
| 281 | |
| 282 | # Adding delay after certificate installation. |
George Keishing | 2dc2864 | 2022-07-19 13:43:54 -0500 | [diff] [blame] | 283 | # Lesser wait timing causes bmcweb to restart quickly and breaks the web services. |
| 284 | Log To Console Wait Time started in seconds ${wait_time} |
| 285 | Sleep ${wait_time}s |
Rahul Maheshwari | f689bb6 | 2022-04-22 05:00:32 -0500 | [diff] [blame] | 286 | |
| 287 | ${cert_file_content}= OperatingSystem.Get File ${cert_file_path} |
| 288 | ${bmc_cert_content}= Run Keyword If '${expected_status}' == 'ok' redfish_utils.Get Attribute |
| 289 | ... ${certificate_uri}/${cert_id} CertificateString |
| 290 | |
| 291 | Run Keyword If '${expected_status}' == 'ok' Should Contain ${cert_file_content} ${bmc_cert_content} |
| 292 | [Return] ${cert_id} |
Rahul Maheshwari | a4f334f | 2022-05-13 04:59:42 -0500 | [diff] [blame] | 293 | |
| 294 | |
| 295 | Modify BMC Date |
| 296 | [Documentation] Modify date in BMC. |
| 297 | [Arguments] ${date_set_type}=current |
| 298 | |
| 299 | # Description of argument(s): |
| 300 | # date_set_type Set BMC date to a current, future, old date by 375 days. |
| 301 | # current - Sets date to local system date. |
| 302 | # future - Sets to a future date from current date. |
| 303 | # old - Sets to a old date from current date. |
| 304 | |
| 305 | Redfish Power Off stack_mode=skip |
| 306 | ${current_date_time}= Get Current Date |
| 307 | ${new_time}= Run Keyword If '${date_set_type}' == 'current' Set Variable ${current_date_time} |
| 308 | ... ELSE IF '${date_set_type}' == 'future' |
| 309 | ... Add Time To Date ${current_date_time} 375 days |
| 310 | ... ELSE IF '${date_set_type}' == 'old' |
| 311 | ... Subtract Time From Date ${current_date_time} 375 days |
| 312 | |
| 313 | # Enable manual mode. |
| 314 | Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} |
| 315 | ... body={'NTP':{'ProtocolEnabled': ${False}}} |
| 316 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
George Keishing | da8c768 | 2022-07-07 15:39:19 -0500 | [diff] [blame] | 317 | |
| 318 | # NTP network takes few seconds to restart. |
| 319 | Wait Until Keyword Succeeds 30 sec 10 sec |
| 320 | ... Redfish.Patch ${REDFISH_BASE_URI}Managers/bmc body={'DateTime': '${new_time}'} |
Rahul Maheshwari | a4f334f | 2022-05-13 04:59:42 -0500 | [diff] [blame] | 321 | ... valid_status_codes=[${HTTP_OK}] |