1*** Settings *** 2 3Documentation Module to test IPMI SEL Time functionality. 4... Pre-requisite Condition : Client Machine and BMC should be in 5... Same TimeZone (example : UST) 6... 7... IPMI Raw command variables are defined under 8... ../data/ipmi_raw_command_table.py 9... 10... Test the Set/Get SEL Time functionality and compare the result against 11... BMC Native command (date). 12... 13... Set the Time Sync Mode from NTP to Manual to Set SEL Time. 14... Time Sync Mode change performed via REDFISH URI. 15... Performs the change in Time Sync Mode with Test Setup and Teardown Execution 16... with default NETWORK_TIMEOUT provided under ../lib/resource.robot. 17... 18... NETWORK_RESTART_TIME added for Set SEL Time and Add SEL Entry as the corresponding 19... command takes approx 5 seconds for the operation to reflect. 20... 21... Current SEL time identified via BMC Native command (date) and perform SEL Time operations. 22... 23... Script Verifies SEL Time for various scenarios such as, 24... Get current time from BMC and add future year and compare against BMC native command (date), 25... Gets BMC Current Time and Adds 15 minutes and compare against BMC native command (date), 26... Gets BMC Current Time and subtracts 1 day and compare against BMC native command (date), 27... Add SEL Entry for all the above scenarios and compare against BMC native command (date). 28 29Resource ../lib/ipmi_client.robot 30Resource ../lib/openbmc_ffdc.robot 31Library DateTime 32Library Collections 33Library String 34Library ../lib/ipmi_utils.py 35Variables ../data/ipmi_raw_cmd_table.py 36 37Test Setup Test Setup Execution 38Test Teardown Test Teardown Execution 39 40Test Tags IPMI_SEL_Time 41 42*** Variables *** 43 44${NETWORK_RESTART_TIME} 5s 45@{time_difference_list} +8760:153:25 -87600:453:120 +175200:40:15 -43800:10:05 +20:35:12 -8760:00:00 46 47# Based on 13th byte of add SEL entry command as per IPMI spec 48# event_dir and event_type variable value needs to be given. 49${sel_no_entry_msg} SEL has no entries 50${event_type} Lower Non-critical going low 51${event_dir} Asserted 52# number_of_times_sel_entry_added this variable is used in Verify Multiple Set SEL Time With Multiple Add SEL Entry 53# test case. Need to give how many sel should be added with multiple date and time. 54${number_of_times_sel_entry_added} 6 55 56*** Test Cases *** 57 58Verify Default Get SEL Time 59 [Documentation] Verify IPMI Get SEL Time. 60 [Tags] Verify_Default_Get_SEL_Time 61 62 # Gets the current SEL time via Get SEL Time Command. 63 ${resp}= Get SEL Time Command 64 Should Not Be Empty ${resp} 65 66 67Verify Set SEL Time On NTP Mode 68 [Documentation] IPMI Set SEL Time without NTP 69 [Tags] Verify_Set_SEL_Time_On_NTP_Mode 70 71 # Get current time from BMC and add future year (here, 5years). 72 ${sel_date}= Get Specific Sel Date 5 73 74 # Gives Hexa decimal raw command data request with the prefix of 0x. 75 ${sel_date_raw}= Converting Date to HexaDecimal ${sel_date} 76 77 ${Set_sel_time}= Run Keyword and Expect Error *${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][2]}* 78 ... Run IPMI Command ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][0]} ${sel_date_raw} 79 Should Contain ${Set_sel_time} ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][1]} 80 81 82Verify SEL Set Time For Specific Time 83 [Documentation] Verify IPMI Set SEL Time. 84 [Tags] Verify_SEL_Set_Time_For_Specific_Time 85 86 # Get current time from BMC and add future year (here, 5years). 87 ${sel_date}= Get Specific Sel Date 5 88 89 # Gives Hexa decimal raw command data request with the prefix of 0x. 90 ${sel_date_raw}= Converting Date to HexaDecimal ${sel_date} 91 92 # Set SEL Entry command. 93 Set SEL Time Entry Via Raw Command ${sel_date_raw} 94 95 # Get SEL Time command. 96 ${get_sel_time}= Check Current Date Time Via IPMI 97 98 # Identify Time difference and find the difference is less than 6 seconds. 99 # Command execution may happen at the end of millisecond so considered 6 seconds as difference. 100 ${time_difference}= Get Time Difference ${get_sel_time} ${sel_date} 101 Should Be True 0<=${time_difference}<=5 102 ... msg=Set SEL Time Not Working 103 104 # Get BMC time (native) and compare with set sel time given. 105 ${bmc_time}= Get Current Date from BMC 106 107 ${difference}= Get Time Difference ${bmc_time} ${sel_date} 108 Should Be True 0<=${difference}<=6 109 110 111Verify Set SEL Time With Future Date And Time 112 [Documentation] Verify IPMI Get SEL Time by adding 15 minutes from current time. 113 [Tags] Verify_Set_SEL_Time_With_Future_Date_And_Time 114 115 # Gets BMC Current Time and Adds 15 minutes and sets the SEL Time. 116 ${sel_time} ${set_sel_time}= Identify SEL Time +06:15:00 117 118 # Set SEL Time via IPMI command. 119 Set SEL Time Via IPMI ${sel_time} 120 121 # Get SEL Time Command. 122 ${get_sel_time}= Check Current Date Time Via IPMI 123 124 # Difference of time between set sel time and get time. 125 ${difference}= Get Time Difference ${get_sel_time} ${set_sel_time} 126 Should Be True 0<=${difference}<=2 127 128 # Difference of time between BMC Date and Get SEL Time. 129 ${bmc_time}= Get Current Date from BMC 130 ${difference}= Get Time Difference ${bmc_time} ${get_sel_time} 131 Should Be True 0<=${difference}<=2 132 133 134Verify Set SEL Time With Past Date And Time 135 [Documentation] Verify IPMI Get SEL Time for yime delay of 1 day from current dat and time. 136 [Tags] Verify_Set_SEL_Time_With_Past_Date_And_Time 137 138 # Gets BMC current time and subtracts 1 day and sets the SEL Time. 139 ${sel_time} ${set_sel_time}= Identify SEL Time -24:00:00 140 141 ${status}= Run Keyword And Return Status Should Not Contain ${sel_time} 1969 142 ... msg=Date cannot be less than 1970. 143 144 IF '${status}' == '${TRUE}' 145 # Set SEL Time via IPMI command. 146 Set SEL Time Via IPMI ${sel_time} 147 # Get SEL Time Command. 148 ${get_sel_time}= Check Current Date Time Via IPMI 149 # Difference of time between set sel time and get time. 150 ${difference}= Get Time Difference ${get_sel_time} ${set_sel_time} 151 Should Be True 0<=${difference}<=2 152 # Difference of time between BMC Date and Get SEL Time. 153 ${bmc_time}= Get Current Date from BMC 154 ${difference}= Get Time Difference ${bmc_time} ${get_sel_time} 155 Should Be True 0<=${difference}<=2 156 ELSE 157 FAIL SEL Time cannot set Date less than 1970 158 END 159 160 161Verify SEL Set Time For Invalid Data Request 162 [Documentation] Verify IPMI Get SEL Time for invalid data request 163 [Tags] Verify_SEL_Set_Time_For_Invalid_Data_Request 164 165 # Gets BMC current date via date command. 166 ${current_date}= Get Current Date from BMC 167 168 # Gives hexa decimal Raw command data request with the prefix of 0x. 169 ${sel_date_raw}= Converting Date to HexaDecimal ${current_date} 170 171 # Set Invalid SEL Time with one extra request byte. 172 ${Set_seltime_invalid}= Run Keyword and Expect Error *${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][4]}* 173 ... Run IPMI Command ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][0]} ${sel_date_raw} 0x00 174 Should Contain ${Set_seltime_invalid} ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][3]} 175 176 177Verify SEL Set Time For Incomplete Data Request 178 [Documentation] Verify IPMI Get SEL Time for invalid data with one byte less request data. 179 [Tags] Verify_SEL_Set_Time_For_Incomplete_Data_Request 180 181 # Gets BMC current date via date command. 182 ${current_date}= Get Current Date from BMC 183 184 # Gives hexa decimal raw command data request with the prefix of 0x. 185 ${sel_date_raw}= Converting Date to HexaDecimal ${current_date} 186 187 # For data request less than expected byes, remove last byte. 188 ${sel_date_raw}= Split String ${sel_date_raw} 189 Remove From List ${sel_date_raw} -1 190 ${sel_date_raw}= Evaluate " ".join(${sel_date_raw}) 191 192 # Set incomplete SEL Time with one less request byte. 193 ${Set_seltime_incomplete}= 194 ... Run Keyword and Expect Error *${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][4]}* 195 ... Run IPMI Command ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][0]} ${sel_date_raw} 196 Should Contain ${Set_seltime_incomplete} ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][3]} 197 198 199Verify SEL Time In SEL Entry 200 [Documentation] Verify Configured SEL Time reflects in newly added SEL Entry. 201 [Tags] Verify_SEL_Time_In_SEL_Entry 202 203 Clear The SEL 204 205 # change to manual, get current time and add future year (here, 5years). 206 ${sel_date}= Get Specific Sel Date 5 207 208 # Gives hexa decimal raw command data request with the prefix of 0x. 209 ${sel_date_raw}= Converting Date to HexaDecimal ${sel_date} 210 211 # Set SEL Entry Command. 212 Set SEL Time Entry Via Raw Command ${sel_date_raw} 213 214 # Get SEL Time Command. 215 ${get_sel_time}= Check Current Date Time Via IPMI 216 217 # Identify Time difference and find the difference is less than 6 seconds. 218 # Command execution may happen at the end of millisecond so considered 6 seconds as difference. 219 ${time_difference}= Get Time Difference ${get_sel_time} ${sel_date} 220 Should Be True 0<=${time_difference}<=5 221 ... msg=Set SEL Time Not Working 222 223 # Get BMC time (native) and compare with set sel time given. 224 ${bmc_time}= Get Current Date from BMC 225 226 ${difference}= Get Time Difference ${bmc_time} ${sel_date} 227 Should Be True 0<=${difference}<=6 228 229 # Get any Sensor available from Sensor list. 230 ${sensor_name}= Fetch One Threshold Sensor From Sensor List 231 232 # Get Sensor ID from SDR Get "sensor". 233 ${sensor_data1}= Fetch Sensor Details From SDR ${sensor_name} Sensor ID 234 ${sensor_number}= Get Bytes From SDR Sensor ${sensor_data1} 235 236 # Get Sensor Type from SDR Get "sensor". 237 ${sensor_data2}= Fetch Sensor Details From SDR ${sensor_name} Sensor Type (Threshold) 238 ${sensor_type_id}= Get Bytes From SDR Sensor ${sensor_data2} 239 240 # Add SEL Entry. 241 ${sel_create_resp}= Create SEL ${sensor_type_id} ${sensor_number} 242 243 # Finds the last added sel entry. 244 ${resp}= Verify SEL Added ${sensor_name} 245 246 # Fetches the date of the last added SEL Entry. 247 ${sel_entry_date}= Fetch Added SEL Date ${resp} 248 249 # Identify and find the time difference is less than 60 seconds. 250 # Finding the sensor details and execution may take up to a minute. 251 # Compare date and time of Set SEL with sel entry. 252 ${d}= Get Time Difference ${sel_entry_date} ${sel_date} 253 Should Be True 0<=${d}<=60 254 255 256Verify SEL Time In SEL Entry For Future Date and Time 257 [Documentation] Verify configured SEL Time (Future Date & Time) in added SEL Entry. 258 [Tags] Verify_SEL_Time_In_SEL_Entry_For_Future_Date_and_Time 259 260 Clear The SEL 261 262 # Gets BMC Current Time and Adds 15 minutes and sets the SEL Time. 263 ${sel_time} ${set_sel_time}= Identify SEL Time +06:15:00 264 265 # Set SEL Time via IPMI command. 266 Set SEL Time Via IPMI ${sel_time} 267 268 # Get SEL Time Command. 269 ${get_sel_time}= Check Current Date Time Via IPMI 270 271 # Difference of time between set sel time and get time. 272 ${difference}= Get Time Difference ${get_sel_time} ${set_sel_time} 273 Should Be True 0<=${difference}<=2 274 275 # Difference of time between BMC Date and Get SEL Time. 276 ${bmc_time}= Get Current Date from BMC 277 ${difference}= Get Time Difference ${bmc_time} ${get_sel_time} 278 Should Be True 0<=${difference}<=2 279 280 # Get any Sensor available from Sensor list. 281 ${sensor_name}= Fetch One Threshold Sensor From Sensor List 282 283 # Get Sensor ID from SDR Get "sensor". 284 ${sensor_data1}= Fetch Sensor Details From SDR ${sensor_name} Sensor ID 285 ${sensor_number}= Get Bytes From SDR Sensor ${sensor_data1} 286 287 # Get Sensor Type from SDR Get "sensor". 288 ${sensor_data2}= Fetch Sensor Details From SDR ${sensor_name} Sensor Type (Threshold) 289 ${sensor_type_id}= Get Bytes From SDR Sensor ${sensor_data2} 290 291 # Add SEL Entry. 292 ${sel_create_resp}= Create SEL ${sensor_type_id} ${sensor_number} 293 294 # Finds the last added sel entry. 295 ${resp}= Verify SEL Added ${sensor_name} 296 297 # Fetches the date of the last added SEL Entry. 298 ${sel_entry_date}= Fetch Added SEL Date ${resp} 299 300 # Identify and find the time difference is less than 60 seconds. 301 # Finding the sensor details and execution may take up to a minute. 302 # Compare date and time of Set SEL with sel entry. 303 ${d}= Get Time Difference ${sel_entry_date} ${set_sel_time} 304 Should Be True 0<=${d}<=60 305 306 307Verify SEL Time In SEL Entry For Past Date And Time 308 [Documentation] Verify configured SEL Time (Past Date & Time) in added SEL Entry. 309 [Tags] Verify_SEL_Time_In_SEL_Entry_For_Past_Date_And_Time 310 311 Clear The SEL 312 313 # Gets BMC Current Time and subtracts 1 day and sets the SEL Time. 314 ${sel_time} ${set_sel_time}= Identify SEL Time -24:00:00 315 316 ${status}= Run Keyword And Return Status Should Not Contain ${sel_time} 1969 317 ... msg=Date cannot be less than 1970 318 319 IF '${status}' == '${TRUE}' 320 # Set SEL Time via IPMI command. 321 Set SEL Time Via IPMI ${sel_time} 322 # Get SEL Time Command. 323 ${get_sel_time}= Check Current Date Time Via IPMI 324 # Difference of time between set sel time and get time. 325 ${difference}= Get Time Difference ${get_sel_time} ${set_sel_time} 326 Should Be True 0<=${difference}<=2 327 # Difference of time between BMC Date and Get SEL Time. 328 ${bmc_time}= Get Current Date from BMC 329 ${difference}= Get Time Difference ${bmc_time} ${get_sel_time} 330 Should Be True 0<=${difference}<=2 331 332 # Get any Sensor available from Sensor list. 333 ${sensor_name}= Fetch One Threshold Sensor From Sensor List 334 # Get Sensor ID from SDR Get "sensor". 335 ${sensor_data1}= Fetch Sensor Details From SDR ${sensor_name} Sensor ID 336 ${sensor_number}= Get Bytes From SDR Sensor ${sensor_data1} 337 338 # Get Sensor Type from SDR Get "sensor". 339 ${sensor_data2}= Fetch Sensor Details From SDR ${sensor_name} Sensor Type (Threshold) 340 ${sensor_type_id}= Get Bytes From SDR Sensor ${sensor_data2} 341 342 # Add SEL Entry. 343 ${sel_create_resp}= Create SEL ${sensor_type_id} ${sensor_number} 344 345 # Finds the last added sel entry. 346 ${resp}= Verify SEL Added ${sensor_name} 347 348 # Fetches the date of the last added SEL Entry. 349 ${sel_entry_date}= Fetch Added SEL Date ${resp} 350 351 # Identify and find the time difference is less than 60 seconds. 352 # Finding the sensor details and execution may take up to a minute. 353 # Compare date and time of Set SEL with sel entry. 354 ${d}= Get Time Difference ${sel_entry_date} ${set_sel_time} 355 Should Be True 0<=${d}<=60 356 ELSE 357 FAIL SEL Time cannot set Date less than 1970. 358 END 359 360 361Verify Multiple Set SEL Time With Multiple Add SEL Entry 362 [Documentation] Verify SEL time in multiple addition Of SEL entry. 363 [Tags] Verify_Multiple_Set_SEL_Time_With_Multiple_Add_SEL_Entry 364 365 FOR ${i} IN RANGE ${number_of_times_sel_entry_added} 366 367 ${sel_time} ${set_sel_time}= Identify SEL Time ${time_difference_list[${i}]} 368 369 # Set SEL Time via IPMI command. 370 Set SEL Time Via IPMI ${sel_time} 371 372 # Clear the SEL. 373 Clear The SEL 374 375 # Get any Sensor available from Sensor list. 376 ${sensor_name}= Fetch One Threshold Sensor From Sensor List 377 378 # Get Sensor ID from SDR Get "sensor" and Identify Sensor ID. 379 ${sensor_data1}= Fetch Sensor Details From SDR ${sensor_name} Sensor ID 380 ${sensor_number}= Get Bytes From SDR Sensor ${sensor_data1} 381 382 # Get Sensor Type from SDR Get "sensor" and identify Sensor Type. 383 ${sensor_data2}= Fetch Sensor Details From SDR ${sensor_name} Sensor Type (Threshold) 384 ${sensor_type_id}= Get Bytes From SDR Sensor ${sensor_data2} 385 386 # Add SEL Entry. 387 ${sel_create_resp}= Create SEL ${sensor_type_id} ${sensor_number} 388 389 # Finds the last added sel entry. 390 ${resp}= Verify SEL Added ${sensor_name} 391 392 # Fetches the date of the last added SEL Entry. 393 ${sel_entry_date}= Fetch Added SEL Date ${resp} 394 395 # Identify and find the time difference is less than 60 seconds. 396 # Finding the sensor details and execution may take up to a minute. 397 # Compare date and time of Set SEL with sel entry. 398 ${d}= Get Time Difference ${sel_entry_date} ${set_sel_time} 399 Should Be True ${d}<=60 400 401 END 402 403 404*** Keywords *** 405 406Time Sync Mode Change Through Redfish 407 [Documentation] Export IP, token and change the time sync to manual. 408 [Arguments] ${value} 409 410 # Description of argument(s): 411 # ${value} Can be either ${FALSE} or ${TRUE}. 412 413 # May be changed to WebView. 414 415 # Changing Time Sync Mode to Manual. 416 Change Time Sync Mode Via Redfish ${value} 417 418 419Change Time Sync Mode Via Redfish 420 [Documentation] To change the time sync mode via Redfish. 421 [Arguments] ${value} 422 423 # Description of argument(s): 424 # ${value} Can be either ${FALSE} or ${TRUE} 425 426 # Creates request body for Redfish url. 427 ${mode}= Create Dictionary ProtocolEnabled=${value} 428 ${data}= Create Dictionary NTP=${mode} 429 430 # Patches the obtained body to the given url. 431 Redfish.patch ${REDFISH_NW_PROTOCOL_URI} body=&{data} 432 ... valid_status_codes=[${HTTP_NO_CONTENT}] 433 434 Sleep ${NETWORK_RESTART_TIME} 435 436 437Get SEL Time Command 438 [Documentation] Get SEL Time command. 439 440 # The response will be 8 byte timestamp in hexadecimal. 441 # example: If current date and time is "Wed May 4 18:55:00 UTC 2022", 442 # then, ${get_sel_time} will be "07 cc 72 62". 443 ${get_sel_time}= Run IPMI Command 444 ... ${IPMI_RAW_CMD['SEL_entry']['Get_SEL_Time'][0]} 445 446 RETURN ${get_sel_time} 447 448 449Set SEL Time Entry Via Raw Command 450 [Documentation] Set SEL Time command. 451 [Arguments] ${sel_date_raw} 452 453 # Description of argument(s): 454 # ${sel_date_raw} Time to set in hexadecimal bytes. 455 # Example: 456 # If date is 1st January 2022 12:30:00 PM, 457 # the hexadecimal timestamp is, 61D04948. 458 # then the request bytes are, 459 # ${sel_date_raw} 0x48 0x49 0xd0 0x61 460 461 Run IPMI Command ${IPMI_RAW_CMD['SEL_entry']['Set_SEL_Time'][0]} ${sel_date_raw} 462 Sleep ${NETWORK_RESTART_TIME} 463 464 465Clear The SEL 466 [Documentation] Clear SEL Command. 467 468 # Clear the SEL. 469 ${out}= Run IPMI Standard Command sel clear 470 Should Contain ${out} Clearing SEL 471 Sleep 2s 472 473 474Verify SEL Added 475 [Documentation] Verify Added SEL. 476 [Arguments] ${sensor_name} 477 478 # Description of argument(s): 479 # sensor_name Name of the sensor. 480 481 ${resp}= Run IPMI Standard Command sel elist 482 Should Not Contain ${resp} ${sel_no_entry_msg} 483 ${get_sel_entry}= Get Lines Containing String ${resp} ${sensor_name} 484 ${sel_entry}= Get Lines Containing String ${get_sel_entry} ${event_type} 485 Should Contain ${sel_entry} ${event_dir} msg=Add SEL Entry failed. 486 487 RETURN ${sel_entry} 488 489 490Check Current Date Time Via IPMI 491 [Documentation] Verify Current Date and Time Via IPMI user command. 492 493 ${resp}= Run IPMI Standard Command sel time get 494 RETURN ${resp} 495 496 497Get Specific Sel Date 498 [Documentation] Gets initial time and adds year to the current date and returns future date. 499 [Arguments] ${year} 500 501 # Description of argument(s): 502 # ${year} Can be any number of years (say 5 year). 503 504 ${current_date}= Get Current Date from BMC 505 506 # Converting given years to days by multiplying with 365days and adding the days to current date. 507 ${days}= Evaluate 365*${year}+1 508 ${date}= Add Time To Date 509 ... ${current_date} ${days}d result_format=%m/%d/%Y %H:%M:%S date_format=%m/%d/%Y %H:%M:%S 510 511 RETURN ${date} 512 513 514Converting Date to HexaDecimal 515 [Documentation] Converting the date into hexa decimal values. 516 [Arguments] ${date} 517 518 # Description of argument(s): 519 # ${date} Can be any date in format %m/%d/%Y %H:%M:%S. 520 521 ${epoch_date}= Convert Date ${date} epoch exclude_millis=yes date_format=%m/%d/%Y %H:%M:%S 522 ${date}= Convert To Hex ${epoch_date} lowercase=yes 523 524 # function calls from utils.py. 525 # Length of the date byte should be 8 so that each bytes are separated. 526 ${date}= Zfill Data ${date} 8 527 # To split every two characters to form one byte each. 528 ${date}= Split String With Index ${date} 2 529 # Prefix every list index value with 0x. 530 ${date}= Prefix Bytes ${date} 531 532 # Reverse the bytes and join the list to form request Time stamp data. 533 Reverse List ${date} 534 ${date}= Evaluate " ".join(${date}) 535 536 RETURN ${date} 537 538 539Get Time Difference 540 [Documentation] Converting the date into hexa decimal values. 541 [Arguments] ${date1} ${date2} 542 543 # Description of argument(s): 544 # ${date1} Can be any date in format %m/%d/%Y %H:%M:%S. 545 # ${date2} Can be any date in format %m/%d/%Y %H:%M:%S. 546 547 ${epoch_date1}= Convert Date ${date1} epoch exclude_millis=yes date_format=%m/%d/%Y %H:%M:%S 548 ${epoch_date2}= Convert Date ${date2} epoch exclude_millis=yes date_format=%m/%d/%Y %H:%M:%S 549 550 ${diff}= Evaluate int(${epoch_date1}) - int(${epoch_date2}) 551 552 RETURN ${diff} 553 554 555Identify SEL Time 556 [Documentation] Modify SEL Time From BMC For Set Sel Time Command. 557 [Arguments] ${time} 558 559 # Description of argument(s): 560 # time Can be any number of hours or minutes in format %H:%M:%S. 561 562 # Gets BMC current date via date command. 563 ${current_date}= Get Current Date from BMC 564 565 ${modifying_date_status}= Run Keyword And Return Status Should Contain ${time} + 566 567 ${date_time}= Set Variable If 568 ... ${modifying_date_status} == True ${time.split("+")[-1]} 569 ... ${modifying_date_status} == False ${time.split("-")[-1]} 570 571 ${datetime} = Set Variable If ${modifying_date_status} == True 572 ... Add Time To Date 573 ... ${current_date} ${date_time} result_format=%m/%d/%Y %H:%M:%S date_format=%m/%d/%Y %H:%M:%S 574 ... ELSE IF ${modifying_date_status} == False 575 ... Subtract Time From Date 576 ... ${current_date} ${date_time} result_format=%m/%d/%Y %H:%M:%S date_format=%m/%d/%Y %H:%M:%S 577 578 #Set SEL Time. 579 ${quoted_date}= Fetch Date ${datetime} 580 581 RETURN ${quoted_date} ${datetime} 582 583 584Set SEL Time Via IPMI 585 [Documentation] Set SEL Time for given date using IPMI. 586 [Arguments] ${date_time} 587 588 # Description of argument(s): 589 # ${date_time} Can be any date in format %m/%d/%Y %H:%M:%S. 590 591 ${resp}= Run IPMI Standard Command sel time set "${date_time}" 592 Should Not Contain ${resp} Unspecified error 593 594 595Test Setup Execution 596 [Documentation] Test Setup Execution. 597 598 Redfish.Login 599 # Change timesync mode to manual with timeout as per resource.robot. 600 Time Sync Mode Change Through Redfish ${FALSE} 601 Sleep ${NETWORK_TIMEOUT} 602 Printn 603 604 605Test Teardown Execution 606 [Documentation] For execution of Test teardown. 607 608 Clear The SEL 609 610 # Change TimeSync mode to NTP with Timeout as per default resource.robot. 611 Time Sync Mode Change Through Redfish ${TRUE} 612 Sleep ${NETWORK_TIMEOUT} 613 Redfish.Logout 614 FFDC On Test Case Fail 615