blob: 52707af1054ba2ded8c450b029640556f3fa8391 [file] [log] [blame]
George Keishingeefc07a2016-07-26 03:25:35 -05001*** Settings ***
George Keishing0a46d022017-01-30 08:11:43 -06002Documentation Test power on for HW CI.
George Keishingeefc07a2016-07-26 03:25:35 -05003
George Keishing22e57e12018-04-18 09:39:31 -05004Library DateTime
5
George Keishingd55a4be2016-08-26 03:28:17 -05006Resource ../lib/openbmc_ffdc.robot
George Keishing97e96532016-10-06 12:44:52 -05007Resource ../lib/utils.robot
George Keishing0a46d022017-01-30 08:11:43 -06008Resource ../lib/state_manager.robot
George Keishing766c6232018-02-02 11:42:55 -06009Resource ../lib/open_power_utils.robot
Michael Tritz96ed2772018-01-17 15:38:38 -060010Resource ../lib/ipmi_client.robot
George Keishing78ce8dc2018-03-30 11:49:06 -050011Resource ../lib/boot_utils.robot
George Keishing82462bf2018-09-20 23:48:43 -050012Resource ../lib/remote_logging_utils.robot
George Keishing97e96532016-10-06 12:44:52 -050013
George Keishing3c004dc2018-10-10 07:16:47 -050014Suite Setup Set REST Logging Policy ${True}
George Keishingbde09152018-06-14 14:53:08 -050015Test Teardown FFDC On Test Case Fail
George Keishing3c004dc2018-10-10 07:16:47 -050016Suite Teardown Set REST Logging Policy ${False}
George Keishing83ada4f2016-08-09 03:15:08 -050017
causten147f5752016-08-11 16:24:45 -050018Force Tags chassisboot
George Keishingeefc07a2016-07-26 03:25:35 -050019
George Keishing0af24412017-03-10 13:33:23 -060020*** Variables ***
21
22# User may pass LOOP_COUNT.
23# By default 2 cycle for CI/CT.
24${LOOP_COUNT} ${2}
25
George Keishing32ed4122017-05-13 03:06:39 -050026# Error strings to check from journald.
George Keishingf7cfa172018-11-29 05:28:31 -060027${ERROR_REGEX} SEGV|core-dump|FAILURE
George Keishing22e57e12018-04-18 09:39:31 -050028${STANDBY_REGEX} Startup finished in
29
30# 3 minutes standby boot time.
31${startup_time_threshold} 180
George Keishing32ed4122017-05-13 03:06:39 -050032
Gunnar Mills7c8923f2016-12-12 21:19:52 -060033*** Test Cases ***
George Keishingeefc07a2016-07-26 03:25:35 -050034
George Keishing82462bf2018-09-20 23:48:43 -050035Test Remote Logging Configuration
36 [Documentation] Configure remote log server and verify configuration.
37 [Tags] Test_Remote_Logging_Configuration
38
39 # Dummy IP and port to update /etc/rsyslog.d/server.conf
40 Configure Remote Log Server With Parameters
41 ... remote_host=10.10.10.10 remote_port=514
42
43 Verify Rsyslog Config On BMC remote_host=10.10.10.10 remote_port=514
44
45 # Reset to default configuration.
46 Configure Remote Log Server With Parameters
47 ... remote_host=${EMPTY} remote_port=0
48
49
George Keishing78ce8dc2018-03-30 11:49:06 -050050Verify Front And Rear LED At Standby
51 [Documentation] Front and Rear LED should be off at standby.
52 [Tags] Verify_Front_And_Rear_LED_At_Standby
53
54 REST Power Off stack_mode=skip quiet=1
55 Verify Identify LED State Off
56
George Keishingc5fef582018-07-18 08:41:28 -050057
George Keishingc3d23432018-08-28 00:36:38 -050058Verify Application Services Running At Standby
59 [Documentation] Check if there are services that have not completed.
60 [Tags] Verify_Application_Services_Running_At_Standby
61
62 # Application services running on the BMC are not tightly coupled.
63 # At standby, there shouldn't be any pending job waiting to complete.
64 # Examples:
65 # Failure o/p:
66 # root@witherspoon:~# systemctl list-jobs --no-pager | cat
67 # JOB UNIT TYPE STATE
68 # 35151 xyz.openbmc_project.ObjectMapper.service start running
69 # 1 jobs listed.
70 #
71 # Success o/p:
72 # root@witherspoon:~# systemctl list-jobs --no-pager | cat
73 # No jobs running.
74
75 REST Power Off stack_mode=skip quiet=1
76 ${stdout} ${stderr} ${rc}= BMC Execute Command
77 ... systemctl list-jobs --no-pager | cat
78 Should Be Equal As Strings ${stdout} No jobs running.
79
80
George Keishing0a46d022017-01-30 08:11:43 -060081Power On Test
82 [Documentation] Power off and on.
83 [Tags] Power_On_Test
George Keishingbde09152018-06-14 14:53:08 -050084 [Setup] Test Setup Execution
85 [Teardown] Test Teardown Execution
George Keishingeefc07a2016-07-26 03:25:35 -050086
George Keishing0af24412017-03-10 13:33:23 -060087 Repeat Keyword ${LOOP_COUNT} times Host Off And On
George Keishing97e96532016-10-06 12:44:52 -050088
George Keishingc5fef582018-07-18 08:41:28 -050089
George Keishing32ed4122017-05-13 03:06:39 -050090Check For Application Failures
91 [Documentation] Parse the journal log and check for failures.
92 [Tags] Check_For_Application_Failures
93
George Keishingb4adfc72018-10-26 09:39:32 -050094 Check For Regex In Journald ${ERROR_REGEX} error_check=${0} boot=-b
George Keishing32ed4122017-05-13 03:06:39 -050095
George Keishing3e53aa02018-07-12 10:07:52 -050096
Michael Tritzcb64a7c2018-02-05 15:25:17 -060097Verify Uptime Average Against Threshold
98 [Documentation] Compare BMC average boot time to a constant threshold.
99 [Tags] Verify_Uptime_Average_Against_Threshold
100
101 OBMC Reboot (off)
George Keishing22e57e12018-04-18 09:39:31 -0500102
George Keishing3e53aa02018-07-12 10:07:52 -0500103 Wait Until Keyword Succeeds
104 ... 1 min 30 sec Check BMC Uptime Journald
George Keishing22e57e12018-04-18 09:39:31 -0500105
Michael Tritzcb64a7c2018-02-05 15:25:17 -0600106
George Keishing8a5f1472018-04-04 10:08:47 -0500107Test SSH And IPMI Connections
108 [Documentation] Try SSH and IPMI commands to verify each connection.
109 [Tags] Test_SSH_And_IPMI_Connections
110
111 Check If BMC Is Up 3 min 20 sec
112 Wait Until Keyword Succeeds
113 ... 3 min 30 sec Wait for BMC state Ready
114
115 BMC Execute Command true
116 Run IPMI Standard Command chassis status
117
George Keishing97e96532016-10-06 12:44:52 -0500118*** Keywords ***
George Keishing0a46d022017-01-30 08:11:43 -0600119
George Keishingfcc6d782018-01-24 00:44:03 -0600120Test Setup Execution
121 [Documentation] Do test case setup tasks.
122 Start SOL Console Logging
123 Set Auto Reboot ${0}
124
George Keishing2f0f4b32018-01-21 23:25:47 -0600125Test Teardown Execution
George Keishing0a46d022017-01-30 08:11:43 -0600126 [Documentation] Collect FFDC and SOL log.
Gunnar Millseac1af22016-11-14 15:30:09 -0600127 FFDC On Test Case Fail
George Keishing97e96532016-10-06 12:44:52 -0500128 ${sol_log}= Stop SOL Console Logging
129 Log ${sol_log}
George Keishing2f0f4b32018-01-21 23:25:47 -0600130 Set Auto Reboot ${1}
George Keishing0af24412017-03-10 13:33:23 -0600131
132Host Off And On
133 [Documentation] Verify power off and on.
134
135 Initiate Host PowerOff
George Keishing0af24412017-03-10 13:33:23 -0600136
137 Initiate Host Boot
George Keishing766c6232018-02-02 11:42:55 -0600138 Verify OCC State
George Keishing383d29b2017-03-25 11:10:52 -0500139
George Keishing5f2f7f52017-06-30 09:17:53 -0500140 # TODO: Host shutdown race condition.
141 # Wait 30 seconds before Powering Off.
142 Sleep 30s
Michael Tritzcb64a7c2018-02-05 15:25:17 -0600143
George Keishing3e53aa02018-07-12 10:07:52 -0500144
145Check BMC Uptime Journald
146 [Documentation] Check BMC journald uptime entry.
147
148 # Example output:
149 # Startup finished in 10.074s (kernel) + 2min 23.506s (userspace) = 2min 33.581s.
150 ${startup_time} ${stderr} ${rc}= BMC Execute Command
151 ... journalctl --no-pager | egrep '${STANDBY_REGEX}' | tail -1
152 Should Not Be Empty ${startup_time}
153
154 # Example time conversion:
155 # Get the "2min 33.581s" string total time taken to reach standby.
156 # Convert time "2min 33.581s" to unit 153.581.
157 ${startup_time}= Convert Time ${startup_time.split("= ",1)[1].strip(".")}
158
159 Should Be True ${startup_time} < ${startup_time_threshold}
160 ... msg=${startup_time} greater than threshold value of ${startup_time_threshold}.