blob: b91610aba277a83c90fe2642dabb7bca86eabfd5 [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 Keishing97e96532016-10-06 12:44:52 -050012
George Keishingbde09152018-06-14 14:53:08 -050013Test Teardown FFDC On Test Case Fail
George Keishing83ada4f2016-08-09 03:15:08 -050014
causten147f5752016-08-11 16:24:45 -050015Force Tags chassisboot
George Keishingeefc07a2016-07-26 03:25:35 -050016
George Keishing0af24412017-03-10 13:33:23 -060017*** Variables ***
18
19# User may pass LOOP_COUNT.
20# By default 2 cycle for CI/CT.
21${LOOP_COUNT} ${2}
22
George Keishing32ed4122017-05-13 03:06:39 -050023# Error strings to check from journald.
George Keishing22e57e12018-04-18 09:39:31 -050024${ERROR_REGEX} SEGV|core-dump
25${STANDBY_REGEX} Startup finished in
26
27# 3 minutes standby boot time.
28${startup_time_threshold} 180
George Keishing32ed4122017-05-13 03:06:39 -050029
Gunnar Mills7c8923f2016-12-12 21:19:52 -060030*** Test Cases ***
George Keishingeefc07a2016-07-26 03:25:35 -050031
George Keishing78ce8dc2018-03-30 11:49:06 -050032Verify Front And Rear LED At Standby
33 [Documentation] Front and Rear LED should be off at standby.
34 [Tags] Verify_Front_And_Rear_LED_At_Standby
35
36 REST Power Off stack_mode=skip quiet=1
37 Verify Identify LED State Off
38
George Keishingc5fef582018-07-18 08:41:28 -050039
George Keishingc3d23432018-08-28 00:36:38 -050040Verify Application Services Running At Standby
41 [Documentation] Check if there are services that have not completed.
42 [Tags] Verify_Application_Services_Running_At_Standby
43
44 # Application services running on the BMC are not tightly coupled.
45 # At standby, there shouldn't be any pending job waiting to complete.
46 # Examples:
47 # Failure o/p:
48 # root@witherspoon:~# systemctl list-jobs --no-pager | cat
49 # JOB UNIT TYPE STATE
50 # 35151 xyz.openbmc_project.ObjectMapper.service start running
51 # 1 jobs listed.
52 #
53 # Success o/p:
54 # root@witherspoon:~# systemctl list-jobs --no-pager | cat
55 # No jobs running.
56
57 REST Power Off stack_mode=skip quiet=1
58 ${stdout} ${stderr} ${rc}= BMC Execute Command
59 ... systemctl list-jobs --no-pager | cat
60 Should Be Equal As Strings ${stdout} No jobs running.
61
62
George Keishing0a46d022017-01-30 08:11:43 -060063Power On Test
64 [Documentation] Power off and on.
65 [Tags] Power_On_Test
George Keishingbde09152018-06-14 14:53:08 -050066 [Setup] Test Setup Execution
67 [Teardown] Test Teardown Execution
George Keishingeefc07a2016-07-26 03:25:35 -050068
George Keishing0af24412017-03-10 13:33:23 -060069 Repeat Keyword ${LOOP_COUNT} times Host Off And On
George Keishing97e96532016-10-06 12:44:52 -050070
George Keishingc5fef582018-07-18 08:41:28 -050071
George Keishing32ed4122017-05-13 03:06:39 -050072Check For Application Failures
73 [Documentation] Parse the journal log and check for failures.
74 [Tags] Check_For_Application_Failures
75
George Keishingc5fef582018-07-18 08:41:28 -050076 Check For Regex In Journald ${ERROR_REGEX} error_check=${0}
George Keishing32ed4122017-05-13 03:06:39 -050077
George Keishing3e53aa02018-07-12 10:07:52 -050078
Michael Tritzcb64a7c2018-02-05 15:25:17 -060079Verify Uptime Average Against Threshold
80 [Documentation] Compare BMC average boot time to a constant threshold.
81 [Tags] Verify_Uptime_Average_Against_Threshold
82
83 OBMC Reboot (off)
George Keishing22e57e12018-04-18 09:39:31 -050084
George Keishing3e53aa02018-07-12 10:07:52 -050085 Wait Until Keyword Succeeds
86 ... 1 min 30 sec Check BMC Uptime Journald
George Keishing22e57e12018-04-18 09:39:31 -050087
Michael Tritzcb64a7c2018-02-05 15:25:17 -060088
George Keishing8a5f1472018-04-04 10:08:47 -050089Test SSH And IPMI Connections
90 [Documentation] Try SSH and IPMI commands to verify each connection.
91 [Tags] Test_SSH_And_IPMI_Connections
92
93 Check If BMC Is Up 3 min 20 sec
94 Wait Until Keyword Succeeds
95 ... 3 min 30 sec Wait for BMC state Ready
96
97 BMC Execute Command true
98 Run IPMI Standard Command chassis status
99
George Keishing97e96532016-10-06 12:44:52 -0500100*** Keywords ***
George Keishing0a46d022017-01-30 08:11:43 -0600101
George Keishingfcc6d782018-01-24 00:44:03 -0600102Test Setup Execution
103 [Documentation] Do test case setup tasks.
104 Start SOL Console Logging
105 Set Auto Reboot ${0}
106
George Keishing2f0f4b32018-01-21 23:25:47 -0600107Test Teardown Execution
George Keishing0a46d022017-01-30 08:11:43 -0600108 [Documentation] Collect FFDC and SOL log.
Gunnar Millseac1af22016-11-14 15:30:09 -0600109 FFDC On Test Case Fail
George Keishing97e96532016-10-06 12:44:52 -0500110 ${sol_log}= Stop SOL Console Logging
111 Log ${sol_log}
George Keishing2f0f4b32018-01-21 23:25:47 -0600112 Set Auto Reboot ${1}
George Keishing0af24412017-03-10 13:33:23 -0600113
114Host Off And On
115 [Documentation] Verify power off and on.
116
117 Initiate Host PowerOff
George Keishing0af24412017-03-10 13:33:23 -0600118
119 Initiate Host Boot
George Keishing766c6232018-02-02 11:42:55 -0600120 Verify OCC State
George Keishing383d29b2017-03-25 11:10:52 -0500121
George Keishing5f2f7f52017-06-30 09:17:53 -0500122 # TODO: Host shutdown race condition.
123 # Wait 30 seconds before Powering Off.
124 Sleep 30s
Michael Tritzcb64a7c2018-02-05 15:25:17 -0600125
George Keishing3e53aa02018-07-12 10:07:52 -0500126
127Check BMC Uptime Journald
128 [Documentation] Check BMC journald uptime entry.
129
130 # Example output:
131 # Startup finished in 10.074s (kernel) + 2min 23.506s (userspace) = 2min 33.581s.
132 ${startup_time} ${stderr} ${rc}= BMC Execute Command
133 ... journalctl --no-pager | egrep '${STANDBY_REGEX}' | tail -1
134 Should Not Be Empty ${startup_time}
135
136 # Example time conversion:
137 # Get the "2min 33.581s" string total time taken to reach standby.
138 # Convert time "2min 33.581s" to unit 153.581.
139 ${startup_time}= Convert Time ${startup_time.split("= ",1)[1].strip(".")}
140
141 Should Be True ${startup_time} < ${startup_time_threshold}
142 ... msg=${startup_time} greater than threshold value of ${startup_time_threshold}.