blob: 0413e166fb5a72a6419fdcb6e4a959127bed7903 [file] [log] [blame]
Sridevi Ramesh1495bc42020-02-04 03:13:33 -06001*** Settings ***
2
3Documentation Module to test PLDM BIOS commands.
4
5Library Collections
6Library String
7Library ../lib/pldm_utils.py
8Variables ../data/pldm_variables.py
9Resource ../lib/openbmc_ffdc.robot
10
11Test Setup Printn
12Test Teardown FFDC On Test Case Fail
13Suite Teardown PLDM BIOS Suite Cleanup
14
15*** Test Cases ***
16
17Verify GetDateTime
18
19 [Documentation] Verify host date & time.
20 [Tags] Verify_GetDateTime
21
22 # Example output:
23 # YYYY-MM-DD HH:MM:SS - 09-02-2020 16:51:23
24
25 ${pldm_output}= Pldmtool bios GetDateTime
26 @{date_time}= Split String ${pldm_output} ${SPACE}
27 @{time}= Split String ${date_time}[1] :
28
29 # verify date & time.
30 ${current_date_time}= Get Current Date UTC exclude_millis=True
31 Should Contain ${current_date_time} ${date_time[0]}
32 Should Contain ${current_date_time} ${time[0]}
33
34
35Verify SetDateTime
36
37 [Documentation] Verify set date & time for the host.
38 [Tags] Verify_SetDateTime
39
40 # Example output:
41 # SetDateTime: SUCCESS
42
43 ${current_date_time}= Get Current Date UTC exclude_millis=True
44
45 ${date}= Add Time To Date ${current_date_time} 400 days exclude_millis=True
46 ${upgrade_date}= Evaluate re.sub(r'-* *:*', "", '${date}') modules=re
47
48 ${time}= Add Time To Date ${current_date_time} 01:01:00 exclude_millis=True
49 ${upgrade_time}= Evaluate re.sub(r'-* *:*', "", '${time}') modules=re
50
51 # Set date.
52 ${cmd_set_date}= Evaluate $CMD_SETDATETIME % '${upgrade_date}'
53 ${pldm_output}= Pldmtool ${cmd_set_date}
Michael Walsh06de1f72020-02-17 14:28:24 -060054 Valid Value pldm_output['setdatetime'] ['SUCCESS']
Sridevi Ramesh1495bc42020-02-04 03:13:33 -060055
56 # Set time.
57 ${cmd_set_time}= Evaluate $CMD_SETDATETIME % '${upgrade_time}'
58 ${pldm_output}= Pldmtool ${cmd_set_time}
Michael Walsh06de1f72020-02-17 14:28:24 -060059 Valid Value pldm_output['setdatetime'] ['SUCCESS']
Sridevi Ramesh1495bc42020-02-04 03:13:33 -060060
61*** Keywords ***
62
63PLDM BIOS Suite Cleanup
64
65 [Documentation] Perform pldm BIOS suite cleanup.
66
67 ${result}= Get Current Date UTC exclude_millis=True
68 ${current_date_time}= Evaluate re.sub(r'-* *:*', "", '${result}') modules=re
69 ${cmd_set_date_time}= Evaluate $CMD_SETDATETIME % '${current_date_time}'
70 ${pldm_output}= Pldmtool ${cmd_set_date_time}
Michael Walsh06de1f72020-02-17 14:28:24 -060071 Valid Value pldm_output['setdatetime'] ['SUCCESS']