blob: 956b59639af427840b26ad13e324fd5c5361fa72 [file] [log] [blame]
George Keishing76a484a2019-03-20 14:22:32 -05001*** Settings ***
2Documentation Test for HW CI.
3
4Library DateTime
5
6Resource ../../lib/utils.robot
7Resource ../../lib/ipmi_client.robot
8Resource ../../lib/boot_utils.robot
9Resource ../../lib/openbmc_ffdc.robot
10Resource ../../lib/bmc_redfish_resource.robot
11
George Keishing2997a282020-06-16 00:42:08 -050012Test Setup Test Setup Execution
George Keishing76a484a2019-03-20 14:22:32 -050013Test Teardown FFDC On Test Case Fail
14
Sridevi Ramesh208e2582025-09-07 01:43:30 -050015Test Tags Basic_CI
16
George Keishing76a484a2019-03-20 14:22:32 -050017*** Variables ***
18
19# Error strings to check from journald.
Jian Zhangc79341b2023-03-10 18:03:52 +080020${ERROR_REGEX} SEGV|core-dump|FAILURE|Failed to start|Found ordering cycle
George Keishing76a484a2019-03-20 14:22:32 -050021${STANDBY_REGEX} Startup finished in
22
George Keishing140351f2022-03-10 08:10:01 -060023${SKIP_ERROR} ${EMPTY}
24
George Keishing76a484a2019-03-20 14:22:32 -050025# 3 minutes standby boot time.
26${startup_time_threshold} 180
27
28*** Test Cases ***
29
30Verify Application Services Running At Standby
31 [Documentation] Check if there are services that have not completed.
32 [Tags] Verify_Application_Services_Running_At_Standby
33
34 # Application services running on the BMC are not tightly coupled.
35 # At standby, there shouldn't be any pending job waiting to complete.
36 # Examples:
37 # Failure o/p:
38 # root@witherspoon:~# systemctl list-jobs --no-pager | cat
39 # JOB UNIT TYPE STATE
40 # 35151 xyz.openbmc_project.ObjectMapper.service start running
41 # 1 jobs listed.
42 #
43 # Success o/p:
44 # root@witherspoon:~# systemctl list-jobs --no-pager | cat
45 # No jobs running.
46
47 Redfish Hard Power Off
48 ${stdout} ${stderr} ${rc}= BMC Execute Command
49 ... systemctl list-jobs --no-pager | cat
50 Should Be Equal As Strings ${stdout} No jobs running.
51
52
53Verify Front And Rear LED At Standby
54 [Documentation] Front and Rear LED should be off at standby.
55 [Tags] Verify_Front_And_Rear_LED_At_Standby
56
57 Redfish Power Off stack_mode=skip quiet=1
58 Verify Identify LED State ${0}
59
60
61Check For Application Failures
62 [Documentation] Parse the journal log and check for failures.
63 [Tags] Check_For_Application_Failures
64
George Keishing140351f2022-03-10 08:10:01 -060065 Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b filter_string=${SKIP_ERROR}
George Keishing76a484a2019-03-20 14:22:32 -050066
67
68Verify Uptime Average Against Threshold
69 [Documentation] Compare BMC average boot time to a constant threshold.
70 [Tags] Verify_Uptime_Average_Against_Threshold
71
72 Redfish OBMC Reboot (off)
73
74 Wait Until Keyword Succeeds
75 ... 1 min 30 sec Check BMC Uptime Journald
76
77
78Test SSH And IPMI Connections
79 [Documentation] Try SSH and IPMI commands to verify each connection.
80 [Tags] Test_SSH_And_IPMI_Connections
81
82 BMC Execute Command true
83 Run IPMI Standard Command chassis status
84
85
86*** Keywords ***
87
George Keishing2997a282020-06-16 00:42:08 -050088Test Setup Execution
89 [Documentation] Do test case setup tasks.
90
91 Printn
92 Redfish.Login
93
94
George Keishing76a484a2019-03-20 14:22:32 -050095Check BMC Uptime Journald
96 [Documentation] Check BMC journald uptime entry.
97
98 # Example output:
99 # Startup finished in 10.074s (kernel) + 2min 23.506s (userspace) = 2min 33.581s.
100 ${startup_time} ${stderr} ${rc}= BMC Execute Command
101 ... journalctl --no-pager | egrep '${STANDBY_REGEX}' | tail -1
102 Should Not Be Empty ${startup_time}
103
104 # Example time conversion:
105 # Get the "2min 33.581s" string total time taken to reach standby.
106 # Convert time "2min 33.581s" to unit 153.581.
107 ${startup_time}= Convert Time ${startup_time.split("= ",1)[1].strip(".")}
108
109 Should Be True ${startup_time} < ${startup_time_threshold}
110 ... msg=${startup_time} greater than threshold value of ${startup_time_threshold}.