blob: 07e9f77b7dfd336ee463e8c7aae08616c62bcafd [file] [log] [blame]
Michael Walsh0bbd8602016-11-22 11:31:49 -06001#!/usr/bin/env python
2
3r"""
4This module is the python counterpart to obmc_boot_test.
5"""
6
Michael Walsh0b93fbf2017-03-02 14:42:41 -06007import os
8import imp
9import time
10import glob
11import random
Michael Walsh0ad0f7f2017-05-04 14:39:58 -050012import re
Michael Walsh0b93fbf2017-03-02 14:42:41 -060013import cPickle as pickle
Michael Walshdc80d672017-05-09 12:58:32 -050014import socket
Michael Walsh0b93fbf2017-03-02 14:42:41 -060015
16from robot.utils import DotDict
17from robot.libraries.BuiltIn import BuiltIn
18
Michael Walsh6741f742017-02-20 16:16:38 -060019from boot_data import *
Michael Walshc9116812017-03-10 14:23:06 -060020import gen_print as gp
Michael Walsh0bbd8602016-11-22 11:31:49 -060021import gen_robot_print as grp
Michael Walsh55302292017-01-10 11:43:02 -060022import gen_robot_plug_in as grpi
Michael Walsh6741f742017-02-20 16:16:38 -060023import gen_robot_valid as grv
24import gen_misc as gm
25import gen_cmd as gc
Michael Walshb5839d02017-04-12 16:11:20 -050026import gen_robot_keyword as grk
Michael Walsh55302292017-01-10 11:43:02 -060027import state as st
Michael Walsh0bbd8602016-11-22 11:31:49 -060028
Michael Walsh0b93fbf2017-03-02 14:42:41 -060029base_path = os.path.dirname(os.path.dirname(
30 imp.find_module("gen_robot_print")[1])) +\
Michael Walshc9116812017-03-10 14:23:06 -060031 os.sep
Michael Walsh0b93fbf2017-03-02 14:42:41 -060032sys.path.append(base_path + "extended/")
33import run_keyword as rk
Michael Walsh0bbd8602016-11-22 11:31:49 -060034
Michael Walshe1e26442017-03-06 17:50:07 -060035# Setting master_pid correctly influences the behavior of plug-ins like
36# DB_Logging
37program_pid = os.getpid()
38master_pid = os.environ.get('AUTOBOOT_MASTER_PID', program_pid)
39
Michael Walshb5839d02017-04-12 16:11:20 -050040# Set up boot data structures.
41boot_table = create_boot_table()
42valid_boot_types = create_valid_boot_list(boot_table)
Michael Walsh0b93fbf2017-03-02 14:42:41 -060043
Michael Walsh6741f742017-02-20 16:16:38 -060044boot_lists = read_boot_lists()
45last_ten = []
Michael Walsh6741f742017-02-20 16:16:38 -060046
47state = st.return_default_state()
48cp_setup_called = 0
49next_boot = ""
50base_tool_dir_path = os.path.normpath(os.environ.get(
51 'AUTOBOOT_BASE_TOOL_DIR_PATH', "/tmp")) + os.sep
Michael Walshb5839d02017-04-12 16:11:20 -050052
Michael Walsh6741f742017-02-20 16:16:38 -060053ffdc_dir_path = os.path.normpath(os.environ.get('FFDC_DIR_PATH', '')) + os.sep
Michael Walsh6741f742017-02-20 16:16:38 -060054boot_success = 0
Michael Walsh6741f742017-02-20 16:16:38 -060055status_dir_path = os.environ.get('STATUS_DIR_PATH', "")
56if status_dir_path != "":
57 status_dir_path = os.path.normpath(status_dir_path) + os.sep
Michael Walsh0b93fbf2017-03-02 14:42:41 -060058default_power_on = "REST Power On"
59default_power_off = "REST Power Off"
Michael Walsh6741f742017-02-20 16:16:38 -060060boot_count = 0
Michael Walsh0bbd8602016-11-22 11:31:49 -060061
Michael Walsh85678942017-03-27 14:34:22 -050062LOG_LEVEL = BuiltIn().get_variable_value("${LOG_LEVEL}")
Michael Walshe1974b92017-08-03 13:39:51 -050063ffdc_prefix = ""
Michael Walsh85678942017-03-27 14:34:22 -050064
65
66###############################################################################
Michael Walsh0ad0f7f2017-05-04 14:39:58 -050067def process_host(host,
68 host_var_name=""):
69
70 r"""
71 Process a host by getting the associated host name and IP address and
72 setting them in global variables.
73
74 If the caller does not pass the host_var_name, this function will try to
75 figure out the name of the variable used by the caller for the host parm.
76 Callers are advised to explicitly specify the host_var_name when calling
77 with an exec command. In such cases, the get_arg_name cannot figure out
78 the host variable name.
79
80 This function will then create similar global variable names by
81 removing "_host" and appending "_host_name" or "_ip" to the host variable
82 name.
83
84 Example:
85
86 If a call is made like this:
87 process_host(openbmc_host)
88
89 Global variables openbmc_host_name and openbmc_ip will be set.
90
91 Description of argument(s):
92 host A host name or IP. The name of the variable used should
93 have a suffix of "_host".
94 host_var_name The name of the variable being used as the host parm.
95 """
96
97 if host_var_name == "":
98 host_var_name = gp.get_arg_name(0, 1, stack_frame_ix=2)
99
100 host_name_var_name = re.sub("host", "host_name", host_var_name)
101 ip_var_name = re.sub("host", "ip", host_var_name)
102 cmd_buf = "global " + host_name_var_name + ", " + ip_var_name + " ; " +\
103 host_name_var_name + ", " + ip_var_name + " = gm.get_host_name_ip('" +\
104 host + "')"
105 exec(cmd_buf)
106
107###############################################################################
108
109
110###############################################################################
Michael Walshb5839d02017-04-12 16:11:20 -0500111def process_pgm_parms():
112
113 r"""
114 Process the program parameters by assigning them all to corresponding
115 globals. Also, set some global values that depend on program parameters.
116 """
117
118 # Program parameter processing.
119 # Assign all program parms to python variables which are global to this
120 # module.
121
122 global parm_list
123 parm_list = BuiltIn().get_variable_value("${parm_list}")
124 # The following subset of parms should be processed as integers.
125 int_list = ['max_num_tests', 'boot_pass', 'boot_fail', 'ffdc_only',
126 'boot_fail_threshold', 'quiet', 'test_mode', 'debug']
127 for parm in parm_list:
128 if parm in int_list:
129 sub_cmd = "int(BuiltIn().get_variable_value(\"${" + parm +\
130 "}\", \"0\"))"
131 else:
132 sub_cmd = "BuiltIn().get_variable_value(\"${" + parm + "}\")"
133 cmd_buf = "global " + parm + " ; " + parm + " = " + sub_cmd
134 exec(cmd_buf)
Michael Walsh0ad0f7f2017-05-04 14:39:58 -0500135 if re.match(r".*_host$", parm):
136 cmd_buf = "process_host(" + parm + ", '" + parm + "')"
137 exec(cmd_buf)
138 if re.match(r".*_password$", parm):
139 # Register the value of any parm whose name ends in _password.
140 # This will cause the print functions to replace passwords with
141 # asterisks in the output.
142 cmd_buf = "gp.register_passwords(" + parm + ")"
143 exec(cmd_buf)
Michael Walshb5839d02017-04-12 16:11:20 -0500144
145 global ffdc_dir_path_style
146 global boot_list
147 global boot_stack
148 global boot_results_file_path
149 global boot_results
150 global ffdc_list_file_path
Michael Walshe0cf8d72017-05-17 13:20:46 -0500151 global ffdc_report_list_path
Michael Walsh600876d2017-05-30 17:58:58 -0500152 global ffdc_summary_list_path
Michael Walshb5839d02017-04-12 16:11:20 -0500153
154 if ffdc_dir_path_style == "":
155 ffdc_dir_path_style = int(os.environ.get('FFDC_DIR_PATH_STYLE', '0'))
156
157 # Convert these program parms to lists for easier processing..
158 boot_list = filter(None, boot_list.split(":"))
159 boot_stack = filter(None, boot_stack.split(":"))
160
161 boot_results_file_path = "/tmp/" + openbmc_nickname + ":pid_" +\
162 str(master_pid) + ":boot_results"
163
164 if os.path.isfile(boot_results_file_path):
165 # We've been called before in this run so we'll load the saved
166 # boot_results object.
167 boot_results = pickle.load(open(boot_results_file_path, 'rb'))
168 else:
169 boot_results = boot_results(boot_table, boot_pass, boot_fail)
170
171 ffdc_list_file_path = base_tool_dir_path + openbmc_nickname +\
172 "/FFDC_FILE_LIST"
Michael Walshe0cf8d72017-05-17 13:20:46 -0500173 ffdc_report_list_path = base_tool_dir_path + openbmc_nickname +\
174 "/FFDC_REPORT_FILE_LIST"
Michael Walshb5839d02017-04-12 16:11:20 -0500175
Michael Walsh600876d2017-05-30 17:58:58 -0500176 ffdc_summary_list_path = base_tool_dir_path + openbmc_nickname +\
177 "/FFDC_SUMMARY_FILE_LIST"
178
Michael Walshb5839d02017-04-12 16:11:20 -0500179###############################################################################
180
181
182###############################################################################
Michael Walsh85678942017-03-27 14:34:22 -0500183def initial_plug_in_setup():
184
185 r"""
186 Initialize all plug-in environment variables which do not change for the
187 duration of the program.
188
189 """
190
191 global LOG_LEVEL
192 BuiltIn().set_log_level("NONE")
193
194 BuiltIn().set_global_variable("${master_pid}", master_pid)
195 BuiltIn().set_global_variable("${FFDC_DIR_PATH}", ffdc_dir_path)
196 BuiltIn().set_global_variable("${STATUS_DIR_PATH}", status_dir_path)
197 BuiltIn().set_global_variable("${BASE_TOOL_DIR_PATH}", base_tool_dir_path)
198 BuiltIn().set_global_variable("${FFDC_LIST_FILE_PATH}",
199 ffdc_list_file_path)
Michael Walshe0cf8d72017-05-17 13:20:46 -0500200 BuiltIn().set_global_variable("${FFDC_REPORT_LIST_PATH}",
201 ffdc_report_list_path)
Michael Walsh600876d2017-05-30 17:58:58 -0500202 BuiltIn().set_global_variable("${FFDC_SUMMARY_LIST_PATH}",
203 ffdc_summary_list_path)
Michael Walsh85678942017-03-27 14:34:22 -0500204
205 BuiltIn().set_global_variable("${FFDC_DIR_PATH_STYLE}",
206 ffdc_dir_path_style)
207 BuiltIn().set_global_variable("${FFDC_CHECK}",
208 ffdc_check)
209
210 # For each program parameter, set the corresponding AUTOBOOT_ environment
211 # variable value. Also, set an AUTOBOOT_ environment variable for every
212 # element in additional_values.
213 additional_values = ["program_pid", "master_pid", "ffdc_dir_path",
214 "status_dir_path", "base_tool_dir_path",
Michael Walsh600876d2017-05-30 17:58:58 -0500215 "ffdc_list_file_path", "ffdc_report_list_path",
216 "ffdc_summary_list_path"]
Michael Walsh85678942017-03-27 14:34:22 -0500217
218 plug_in_vars = parm_list + additional_values
219
220 for var_name in plug_in_vars:
221 var_value = BuiltIn().get_variable_value("${" + var_name + "}")
222 var_name = var_name.upper()
223 if var_value is None:
224 var_value = ""
225 os.environ["AUTOBOOT_" + var_name] = str(var_value)
226
227 BuiltIn().set_log_level(LOG_LEVEL)
228
Michael Walsh68a61162017-04-25 11:54:06 -0500229 # Make sure the ffdc list directory exists.
230 ffdc_list_dir_path = os.path.dirname(ffdc_list_file_path) + os.sep
231 if not os.path.exists(ffdc_list_dir_path):
232 os.makedirs(ffdc_list_dir_path)
Michael Walsh85678942017-03-27 14:34:22 -0500233
234###############################################################################
235
Michael Walsh0bbd8602016-11-22 11:31:49 -0600236
237###############################################################################
Michael Walsh0bbd8602016-11-22 11:31:49 -0600238def plug_in_setup():
239
240 r"""
Michael Walsh85678942017-03-27 14:34:22 -0500241 Initialize all changing plug-in environment variables for use by the
242 plug-in programs.
Michael Walsh0bbd8602016-11-22 11:31:49 -0600243 """
244
Michael Walsh85678942017-03-27 14:34:22 -0500245 global LOG_LEVEL
246 global test_really_running
247
248 BuiltIn().set_log_level("NONE")
249
Michael Walsh6741f742017-02-20 16:16:38 -0600250 boot_pass, boot_fail = boot_results.return_total_pass_fail()
Michael Walsh0bbd8602016-11-22 11:31:49 -0600251 if boot_pass > 1:
252 test_really_running = 1
253 else:
254 test_really_running = 0
255
Michael Walsh6741f742017-02-20 16:16:38 -0600256 BuiltIn().set_global_variable("${test_really_running}",
257 test_really_running)
258 BuiltIn().set_global_variable("${boot_type_desc}", next_boot)
Michael Walsh6741f742017-02-20 16:16:38 -0600259 BuiltIn().set_global_variable("${boot_pass}", boot_pass)
260 BuiltIn().set_global_variable("${boot_fail}", boot_fail)
261 BuiltIn().set_global_variable("${boot_success}", boot_success)
262 BuiltIn().set_global_variable("${ffdc_prefix}", ffdc_prefix)
Michael Walsh4c9a6452016-12-13 16:03:11 -0600263
Michael Walsh0bbd8602016-11-22 11:31:49 -0600264 # For each program parameter, set the corresponding AUTOBOOT_ environment
265 # variable value. Also, set an AUTOBOOT_ environment variable for every
266 # element in additional_values.
267 additional_values = ["boot_type_desc", "boot_success", "boot_pass",
Michael Walsh85678942017-03-27 14:34:22 -0500268 "boot_fail", "test_really_running", "ffdc_prefix"]
Michael Walsh0bbd8602016-11-22 11:31:49 -0600269
Michael Walsh85678942017-03-27 14:34:22 -0500270 plug_in_vars = additional_values
Michael Walsh0bbd8602016-11-22 11:31:49 -0600271
272 for var_name in plug_in_vars:
273 var_value = BuiltIn().get_variable_value("${" + var_name + "}")
274 var_name = var_name.upper()
275 if var_value is None:
276 var_value = ""
Michael Walsh6741f742017-02-20 16:16:38 -0600277 os.environ["AUTOBOOT_" + var_name] = str(var_value)
Michael Walsh0bbd8602016-11-22 11:31:49 -0600278
Michael Walsh0bbd8602016-11-22 11:31:49 -0600279 if debug:
Michael Walsh6741f742017-02-20 16:16:38 -0600280 shell_rc, out_buf = \
281 gc.cmd_fnc_u("printenv | egrep AUTOBOOT_ | sort -u")
Michael Walsh0bbd8602016-11-22 11:31:49 -0600282
Michael Walsh85678942017-03-27 14:34:22 -0500283 BuiltIn().set_log_level(LOG_LEVEL)
284
Michael Walsh0bbd8602016-11-22 11:31:49 -0600285###############################################################################
286
287
288###############################################################################
Michael Walshe0cf8d72017-05-17 13:20:46 -0500289def pre_boot_plug_in_setup():
290
291 # Clear the ffdc_list_file_path file. Plug-ins may now write to it.
292 try:
293 os.remove(ffdc_list_file_path)
294 except OSError:
295 pass
296
297 # Clear the ffdc_report_list_path file. Plug-ins may now write to it.
298 try:
299 os.remove(ffdc_report_list_path)
300 except OSError:
301 pass
302
Michael Walsh600876d2017-05-30 17:58:58 -0500303 # Clear the ffdc_summary_list_path file. Plug-ins may now write to it.
304 try:
305 os.remove(ffdc_summary_list_path)
306 except OSError:
307 pass
308
Michael Walshe1974b92017-08-03 13:39:51 -0500309 global ffdc_prefix
310
311 seconds = time.time()
312 loc_time = time.localtime(seconds)
313 time_string = time.strftime("%y%m%d.%H%M%S.", loc_time)
314
315 ffdc_prefix = openbmc_nickname + "." + time_string
316
Michael Walshe0cf8d72017-05-17 13:20:46 -0500317###############################################################################
318
319
320###############################################################################
Michael Walsh6741f742017-02-20 16:16:38 -0600321def setup():
Michael Walsh0bbd8602016-11-22 11:31:49 -0600322
323 r"""
Michael Walsh6741f742017-02-20 16:16:38 -0600324 Do general program setup tasks.
Michael Walsh0bbd8602016-11-22 11:31:49 -0600325 """
326
Michael Walsh6741f742017-02-20 16:16:38 -0600327 global cp_setup_called
Michael Walsh0bbd8602016-11-22 11:31:49 -0600328
Michael Walshb5839d02017-04-12 16:11:20 -0500329 gp.qprintn()
330
Michael Walsh83f4bc72017-04-20 16:49:43 -0500331 robot_pgm_dir_path = os.path.dirname(__file__) + os.sep
332 repo_bin_path = robot_pgm_dir_path.replace("/lib/", "/bin/")
Michael Walshd061c042017-05-23 14:46:57 -0500333 # If we can't find process_plug_in_packages.py, ssh_pw or
334 # validate_plug_ins.py, then we don't have our repo bin in PATH.
335 shell_rc, out_buf = gc.cmd_fnc_u("which process_plug_in_packages.py" +
336 " ssh_pw validate_plug_ins.py", quiet=1,
337 print_output=0, show_err=0)
Michael Walshb5839d02017-04-12 16:11:20 -0500338 if shell_rc != 0:
Michael Walsh83f4bc72017-04-20 16:49:43 -0500339 os.environ['PATH'] = repo_bin_path + ":" + os.environ.get('PATH', "")
340 # Likewise, our repo lib subdir needs to be in sys.path and PYTHONPATH.
341 if robot_pgm_dir_path not in sys.path:
342 sys.path.append(robot_pgm_dir_path)
343 PYTHONPATH = os.environ.get("PYTHONPATH", "")
344 if PYTHONPATH == "":
345 os.environ['PYTHONPATH'] = robot_pgm_dir_path
346 else:
347 os.environ['PYTHONPATH'] = robot_pgm_dir_path + ":" + PYTHONPATH
Michael Walsh6741f742017-02-20 16:16:38 -0600348
349 validate_parms()
350
351 grp.rqprint_pgm_header()
352
Michael Walshfdc5ced2017-08-17 13:15:15 -0500353 grk.run_key("Set BMC Power Policy RESTORE_LAST_STATE")
Michael Walsh11cfc8c2017-03-31 09:40:55 -0500354
Michael Walsh85678942017-03-27 14:34:22 -0500355 initial_plug_in_setup()
356
Michael Walsh6741f742017-02-20 16:16:38 -0600357 plug_in_setup()
358 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
359 call_point='setup')
360 if rc != 0:
361 error_message = "Plug-in setup failed.\n"
362 grp.rprint_error_report(error_message)
363 BuiltIn().fail(error_message)
364 # Setting cp_setup_called lets our Teardown know that it needs to call
365 # the cleanup plug-in call point.
366 cp_setup_called = 1
367
368 # Keyword "FFDC" will fail if TEST_MESSAGE is not set.
369 BuiltIn().set_global_variable("${TEST_MESSAGE}", "${EMPTY}")
Michael Walsh85678942017-03-27 14:34:22 -0500370 # FFDC_LOG_PATH is used by "FFDC" keyword.
371 BuiltIn().set_global_variable("${FFDC_LOG_PATH}", ffdc_dir_path)
Michael Walsh6741f742017-02-20 16:16:38 -0600372
Michael Walshdc80d672017-05-09 12:58:32 -0500373 # Also printed by FFDC.
374 global host_name
375 global host_ip
376 host = socket.gethostname()
377 host_name, host_ip = gm.get_host_name_ip(host)
378
Michael Walshb5839d02017-04-12 16:11:20 -0500379 gp.dprint_var(boot_table, 1)
380 gp.dprint_var(boot_lists)
Michael Walsh0bbd8602016-11-22 11:31:49 -0600381
382###############################################################################
383
384
385###############################################################################
Michael Walsh6741f742017-02-20 16:16:38 -0600386def validate_parms():
Michael Walsh0bbd8602016-11-22 11:31:49 -0600387
388 r"""
Michael Walsh6741f742017-02-20 16:16:38 -0600389 Validate all program parameters.
Michael Walsh0bbd8602016-11-22 11:31:49 -0600390 """
391
Michael Walshb5839d02017-04-12 16:11:20 -0500392 process_pgm_parms()
Michael Walsh0bbd8602016-11-22 11:31:49 -0600393
Michael Walshb5839d02017-04-12 16:11:20 -0500394 gp.qprintn()
395
396 global openbmc_model
Michael Walsh6741f742017-02-20 16:16:38 -0600397 grv.rvalid_value("openbmc_host")
398 grv.rvalid_value("openbmc_username")
399 grv.rvalid_value("openbmc_password")
400 if os_host != "":
401 grv.rvalid_value("os_username")
402 grv.rvalid_value("os_password")
Michael Walsh0bbd8602016-11-22 11:31:49 -0600403
Michael Walsh6741f742017-02-20 16:16:38 -0600404 if pdu_host != "":
405 grv.rvalid_value("pdu_username")
406 grv.rvalid_value("pdu_password")
Michael Walsh85678942017-03-27 14:34:22 -0500407 grv.rvalid_integer("pdu_slot_no")
Michael Walsh6741f742017-02-20 16:16:38 -0600408 if openbmc_serial_host != "":
409 grv.rvalid_integer("openbmc_serial_port")
Michael Walshb5839d02017-04-12 16:11:20 -0500410 if openbmc_model == "":
411 status, ret_values =\
412 grk.run_key_u("Get BMC System Model")
413 openbmc_model = ret_values
414 BuiltIn().set_global_variable("${openbmc_model}", openbmc_model)
Michael Walsh6741f742017-02-20 16:16:38 -0600415 grv.rvalid_value("openbmc_model")
Michael Walshb5839d02017-04-12 16:11:20 -0500416 grv.rvalid_integer("max_num_tests")
Michael Walsh6741f742017-02-20 16:16:38 -0600417 grv.rvalid_integer("boot_pass")
418 grv.rvalid_integer("boot_fail")
419
420 plug_in_packages_list = grpi.rvalidate_plug_ins(plug_in_dir_paths)
421 BuiltIn().set_global_variable("${plug_in_packages_list}",
422 plug_in_packages_list)
423
Michael Walshb5839d02017-04-12 16:11:20 -0500424 grv.rvalid_value("stack_mode", valid_values=['normal', 'skip'])
Michael Walsha20da402017-03-31 16:27:45 -0500425 if len(boot_list) == 0 and len(boot_stack) == 0 and not ffdc_only:
Michael Walsh6741f742017-02-20 16:16:38 -0600426 error_message = "You must provide either a value for either the" +\
427 " boot_list or the boot_stack parm.\n"
428 BuiltIn().fail(gp.sprint_error(error_message))
429
430 valid_boot_list(boot_list, valid_boot_types)
431 valid_boot_list(boot_stack, valid_boot_types)
432
Michael Walsh11cfc8c2017-03-31 09:40:55 -0500433 selected_PDU_boots = list(set(boot_list + boot_stack) &
434 set(boot_lists['PDU_reboot']))
435
436 if len(selected_PDU_boots) > 0 and pdu_host == "":
437 error_message = "You have selected the following boots which" +\
438 " require a PDU host but no value for pdu_host:\n"
439 error_message += gp.sprint_var(selected_PDU_boots)
440 error_message += gp.sprint_var(pdu_host, 2)
441 BuiltIn().fail(gp.sprint_error(error_message))
442
Michael Walsh6741f742017-02-20 16:16:38 -0600443 return
Michael Walsh0bbd8602016-11-22 11:31:49 -0600444
445###############################################################################
446
447
448###############################################################################
Michael Walsh6741f742017-02-20 16:16:38 -0600449def my_get_state():
Michael Walsh0bbd8602016-11-22 11:31:49 -0600450
451 r"""
Michael Walsh6741f742017-02-20 16:16:38 -0600452 Get the system state plus a little bit of wrapping.
Michael Walsh0bbd8602016-11-22 11:31:49 -0600453 """
454
Michael Walsh6741f742017-02-20 16:16:38 -0600455 global state
456
457 req_states = ['epoch_seconds'] + st.default_req_states
458
Michael Walshb5839d02017-04-12 16:11:20 -0500459 gp.qprint_timen("Getting system state.")
Michael Walsh6741f742017-02-20 16:16:38 -0600460 if test_mode:
461 state['epoch_seconds'] = int(time.time())
462 else:
Michael Walshb5839d02017-04-12 16:11:20 -0500463 state = st.get_state(req_states=req_states, quiet=quiet)
464 gp.qprint_var(state)
Michael Walsh341c21e2017-01-17 16:25:20 -0600465
466###############################################################################
467
468
469###############################################################################
Michael Walsh6741f742017-02-20 16:16:38 -0600470def select_boot():
Michael Walsh341c21e2017-01-17 16:25:20 -0600471
472 r"""
473 Select a boot test to be run based on our current state and return the
474 chosen boot type.
475
476 Description of arguments:
Michael Walsh6741f742017-02-20 16:16:38 -0600477 state The state of the machine.
Michael Walsh341c21e2017-01-17 16:25:20 -0600478 """
479
Michael Walsh30dadae2017-02-27 14:25:52 -0600480 global boot_stack
481
Michael Walshb5839d02017-04-12 16:11:20 -0500482 gp.qprint_timen("Selecting a boot test.")
Michael Walsh6741f742017-02-20 16:16:38 -0600483
484 my_get_state()
485
486 stack_popped = 0
487 if len(boot_stack) > 0:
488 stack_popped = 1
Michael Walshb5839d02017-04-12 16:11:20 -0500489 gp.qprint_dashes()
490 gp.qprint_var(boot_stack)
491 gp.qprint_dashes()
492 skip_boot_printed = 0
493 while len(boot_stack) > 0:
494 boot_candidate = boot_stack.pop()
495 if stack_mode == 'normal':
496 break
497 else:
498 if st.compare_states(state, boot_table[boot_candidate]['end']):
499 if not skip_boot_printed:
500 gp.print_var(stack_mode)
501 gp.printn()
502 gp.print_timen("Skipping the following boot tests" +
503 " which are unnecessary since their" +
504 " required end states match the" +
505 " current machine state:")
506 skip_boot_printed = 1
507 gp.print_var(boot_candidate)
508 boot_candidate = ""
509 if boot_candidate == "":
510 gp.qprint_dashes()
511 gp.qprint_var(boot_stack)
512 gp.qprint_dashes()
513 return boot_candidate
Michael Walsh6741f742017-02-20 16:16:38 -0600514 if st.compare_states(state, boot_table[boot_candidate]['start']):
Michael Walshb5839d02017-04-12 16:11:20 -0500515 gp.qprint_timen("The machine state is valid for a '" +
516 boot_candidate + "' boot test.")
517 gp.qprint_dashes()
518 gp.qprint_var(boot_stack)
519 gp.qprint_dashes()
Michael Walsh6741f742017-02-20 16:16:38 -0600520 return boot_candidate
Michael Walsh341c21e2017-01-17 16:25:20 -0600521 else:
Michael Walshb5839d02017-04-12 16:11:20 -0500522 gp.qprint_timen("The machine state does not match the required" +
523 " starting state for a '" + boot_candidate +
524 "' boot test:")
525 gp.print_varx("boot_table[" + boot_candidate + "][start]",
526 boot_table[boot_candidate]['start'], 1)
Michael Walsh6741f742017-02-20 16:16:38 -0600527 boot_stack.append(boot_candidate)
528 popped_boot = boot_candidate
529
530 # Loop through your list selecting a boot_candidates
531 boot_candidates = []
532 for boot_candidate in boot_list:
533 if st.compare_states(state, boot_table[boot_candidate]['start']):
534 if stack_popped:
535 if st.compare_states(boot_table[boot_candidate]['end'],
536 boot_table[popped_boot]['start']):
537 boot_candidates.append(boot_candidate)
538 else:
539 boot_candidates.append(boot_candidate)
540
541 if len(boot_candidates) == 0:
Michael Walshb5839d02017-04-12 16:11:20 -0500542 gp.qprint_timen("The user's boot list contained no boot tests" +
543 " which are valid for the current machine state.")
Michael Walsh6741f742017-02-20 16:16:38 -0600544 boot_candidate = default_power_on
545 if not st.compare_states(state, boot_table[default_power_on]['start']):
546 boot_candidate = default_power_off
547 boot_candidates.append(boot_candidate)
Michael Walshb5839d02017-04-12 16:11:20 -0500548 gp.qprint_timen("Using default '" + boot_candidate +
549 "' boot type to transition to valid state.")
Michael Walsh6741f742017-02-20 16:16:38 -0600550
Michael Walshb5839d02017-04-12 16:11:20 -0500551 gp.dprint_var(boot_candidates)
Michael Walsh6741f742017-02-20 16:16:38 -0600552
553 # Randomly select a boot from the candidate list.
554 boot = random.choice(boot_candidates)
Michael Walsh341c21e2017-01-17 16:25:20 -0600555
556 return boot
Michael Walsh0bbd8602016-11-22 11:31:49 -0600557
558###############################################################################
Michael Walsh55302292017-01-10 11:43:02 -0600559
560
561###############################################################################
Michael Walsh341c21e2017-01-17 16:25:20 -0600562def print_last_boots():
563
564 r"""
565 Print the last ten boots done with their time stamps.
566 """
567
568 # indent 0, 90 chars wide, linefeed, char is "="
Michael Walshb5839d02017-04-12 16:11:20 -0500569 gp.qprint_dashes(0, 90)
570 gp.qprintn("Last 10 boots:\n")
Michael Walsh341c21e2017-01-17 16:25:20 -0600571
572 for boot_entry in last_ten:
573 grp.rqprint(boot_entry)
Michael Walshb5839d02017-04-12 16:11:20 -0500574 gp.qprint_dashes(0, 90)
Michael Walsh341c21e2017-01-17 16:25:20 -0600575
576###############################################################################
577
578
579###############################################################################
Michael Walsh341c21e2017-01-17 16:25:20 -0600580def print_defect_report():
581
582 r"""
583 Print a defect report.
584 """
585
Michael Walsh600876d2017-05-30 17:58:58 -0500586 # Making deliberate choice to NOT run plug_in_setup(). We don't want
587 # ffdc_prefix updated.
588 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
589 call_point='ffdc_report', stop_on_plug_in_failure=0)
590
Michael Walsh341c21e2017-01-17 16:25:20 -0600591 # At some point I'd like to have the 'Call FFDC Methods' return a list
592 # of files it has collected. In that case, the following "ls" command
593 # would no longer be needed. For now, however, glob shows the files
594 # named in FFDC_LIST_FILE_PATH so I will refrain from printing those
595 # out (so we don't see duplicates in the list).
596
Michael Walshe0cf8d72017-05-17 13:20:46 -0500597 # Get additional header data which may have been created by ffdc plug-ins.
598 # Also, delete the individual header files to cleanup.
599 cmd_buf = "file_list=$(cat " + ffdc_report_list_path + " 2>/dev/null)" +\
600 " ; [ ! -z \"${file_list}\" ] && cat ${file_list}" +\
601 " 2>/dev/null ; rm -rf ${file_list} 2>/dev/null || :"
602 shell_rc, more_header_info = gc.cmd_fnc_u(cmd_buf, print_output=0,
603 show_err=0)
604
Michael Walsh600876d2017-05-30 17:58:58 -0500605 # Get additional header data which may have been created by ffdc plug-ins.
606 # Also, delete the individual header files to cleanup.
607 cmd_buf = "file_list=$(cat " + ffdc_summary_list_path + " 2>/dev/null)" +\
608 " ; [ ! -z \"${file_list}\" ] && cat ${file_list}" +\
609 " 2>/dev/null ; rm -rf ${file_list} 2>/dev/null || :"
610 shell_rc, ffdc_summary_info = gc.cmd_fnc_u(cmd_buf, print_output=0,
611 show_err=0)
612
Michael Walsh341c21e2017-01-17 16:25:20 -0600613 LOG_PREFIX = BuiltIn().get_variable_value("${LOG_PREFIX}")
614
Michael Walshe0cf8d72017-05-17 13:20:46 -0500615 output = '\n'.join(sorted(glob.glob(LOG_PREFIX + '*')))
Michael Walsh341c21e2017-01-17 16:25:20 -0600616 try:
Michael Walsh6741f742017-02-20 16:16:38 -0600617 ffdc_list = open(ffdc_list_file_path, 'r')
Michael Walsh341c21e2017-01-17 16:25:20 -0600618 except IOError:
619 ffdc_list = ""
620
Michael Walsh68a61162017-04-25 11:54:06 -0500621 # Open ffdc_file_list for writing. We will write a complete list of
622 # FFDC files to it for possible use by plug-ins like cp_stop_check.
623 ffdc_list_file = open(ffdc_list_file_path, 'w')
624
625 gp.qprintn()
626 # indent=0, width=90, linefeed=1, char="="
627 gp.qprint_dashes(0, 90, 1, "=")
628 gp.qprintn("Copy this data to the defect:\n")
629
Michael Walshe0cf8d72017-05-17 13:20:46 -0500630 if len(more_header_info) > 0:
631 gp.printn(more_header_info)
Michael Walshdc80d672017-05-09 12:58:32 -0500632 gp.qpvars(host_name, host_ip, openbmc_nickname, openbmc_host,
633 openbmc_host_name, openbmc_ip, openbmc_username,
634 openbmc_password, os_host, os_host_name, os_ip, os_username,
635 os_password, pdu_host, pdu_host_name, pdu_ip, pdu_username,
636 pdu_password, pdu_slot_no, openbmc_serial_host,
637 openbmc_serial_host_name, openbmc_serial_ip, openbmc_serial_port)
Michael Walsh68a61162017-04-25 11:54:06 -0500638
639 gp.qprintn()
640
641 print_last_boots()
642 gp.qprintn()
643 gp.qprint_var(state)
644
Michael Walshb5839d02017-04-12 16:11:20 -0500645 gp.qprintn()
646 gp.qprintn("FFDC data files:")
Michael Walsh341c21e2017-01-17 16:25:20 -0600647 if status_file_path != "":
Michael Walshb5839d02017-04-12 16:11:20 -0500648 gp.qprintn(status_file_path)
Michael Walsh68a61162017-04-25 11:54:06 -0500649 ffdc_list_file.write(status_file_path + "\n")
Michael Walsh341c21e2017-01-17 16:25:20 -0600650
Michael Walshb5839d02017-04-12 16:11:20 -0500651 gp.qprintn(output)
652 # gp.qprintn(ffdc_list)
653 gp.qprintn()
Michael Walsh341c21e2017-01-17 16:25:20 -0600654
Michael Walsh600876d2017-05-30 17:58:58 -0500655 if len(ffdc_summary_info) > 0:
656 gp.printn(ffdc_summary_info)
657
Michael Walshb5839d02017-04-12 16:11:20 -0500658 gp.qprint_dashes(0, 90, 1, "=")
Michael Walsh341c21e2017-01-17 16:25:20 -0600659
Michael Walsh68a61162017-04-25 11:54:06 -0500660 ffdc_list_file.write(output + "\n")
661 ffdc_list_file.close()
662
Michael Walsh341c21e2017-01-17 16:25:20 -0600663###############################################################################
Michael Walsh6741f742017-02-20 16:16:38 -0600664
665
666###############################################################################
667def my_ffdc():
668
669 r"""
670 Collect FFDC data.
671 """
672
673 global state
674
675 plug_in_setup()
676 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
Michael Walsh600876d2017-05-30 17:58:58 -0500677 call_point='ffdc', stop_on_plug_in_failure=0)
Michael Walsh6741f742017-02-20 16:16:38 -0600678
679 AUTOBOOT_FFDC_PREFIX = os.environ['AUTOBOOT_FFDC_PREFIX']
Michael Walsh83f4bc72017-04-20 16:49:43 -0500680 status, ret_values = grk.run_key_u("FFDC ffdc_prefix=" +
681 AUTOBOOT_FFDC_PREFIX +
682 " ffdc_function_list=" +
683 ffdc_function_list, ignore=1)
684 if status != 'PASS':
Michael Walsh3328caf2017-03-21 17:04:08 -0500685 gp.print_error("Call to ffdc failed.\n")
Michael Walsh6741f742017-02-20 16:16:38 -0600686
687 my_get_state()
688
689 print_defect_report()
690
691###############################################################################
692
693
694###############################################################################
695def print_test_start_message(boot_keyword):
696
697 r"""
698 Print a message indicating what boot test is about to run.
699
700 Description of arguments:
701 boot_keyword The name of the boot which is to be run
702 (e.g. "BMC Power On").
703 """
704
705 global last_ten
706
707 doing_msg = gp.sprint_timen("Doing \"" + boot_keyword + "\".")
Michael Walshb5839d02017-04-12 16:11:20 -0500708 gp.qprint(doing_msg)
Michael Walsh6741f742017-02-20 16:16:38 -0600709
710 last_ten.append(doing_msg)
711
712 if len(last_ten) > 10:
713 del last_ten[0]
714
715###############################################################################
716
717
718###############################################################################
719def run_boot(boot):
720
721 r"""
722 Run the specified boot.
723
724 Description of arguments:
725 boot The name of the boot test to be performed.
726 """
727
728 global state
729
730 print_test_start_message(boot)
731
732 plug_in_setup()
733 rc, shell_rc, failed_plug_in_name = \
734 grpi.rprocess_plug_in_packages(call_point="pre_boot")
735 if rc != 0:
736 error_message = "Plug-in failed with non-zero return code.\n" +\
737 gp.sprint_var(rc, 1)
738 BuiltIn().fail(gp.sprint_error(error_message))
739
740 if test_mode:
741 # In test mode, we'll pretend the boot worked by assigning its
742 # required end state to the default state value.
Michael Walsh30dadae2017-02-27 14:25:52 -0600743 state = st.strip_anchor_state(boot_table[boot]['end'])
Michael Walsh6741f742017-02-20 16:16:38 -0600744 else:
745 # Assertion: We trust that the state data was made fresh by the
746 # caller.
747
Michael Walshb5839d02017-04-12 16:11:20 -0500748 gp.qprintn()
Michael Walsh6741f742017-02-20 16:16:38 -0600749
750 if boot_table[boot]['method_type'] == "keyword":
Michael Walsh0b93fbf2017-03-02 14:42:41 -0600751 rk.my_run_keywords(boot_table[boot].get('lib_file_path', ''),
Michael Walshb5839d02017-04-12 16:11:20 -0500752 boot_table[boot]['method'],
753 quiet=quiet)
Michael Walsh6741f742017-02-20 16:16:38 -0600754
755 if boot_table[boot]['bmc_reboot']:
756 st.wait_for_comm_cycle(int(state['epoch_seconds']))
Michael Walsh30dadae2017-02-27 14:25:52 -0600757 plug_in_setup()
758 rc, shell_rc, failed_plug_in_name = \
759 grpi.rprocess_plug_in_packages(call_point="post_reboot")
760 if rc != 0:
Michael Walsh0b93fbf2017-03-02 14:42:41 -0600761 error_message = "Plug-in failed with non-zero return code.\n"
762 error_message += gp.sprint_var(rc, 1)
Michael Walsh30dadae2017-02-27 14:25:52 -0600763 BuiltIn().fail(gp.sprint_error(error_message))
Michael Walsh6741f742017-02-20 16:16:38 -0600764 else:
765 match_state = st.anchor_state(state)
766 del match_state['epoch_seconds']
767 # Wait for the state to change in any way.
768 st.wait_state(match_state, wait_time=state_change_timeout,
Michael Walsh600876d2017-05-30 17:58:58 -0500769 interval="10 seconds", invert=1)
Michael Walsh6741f742017-02-20 16:16:38 -0600770
Michael Walshb5839d02017-04-12 16:11:20 -0500771 gp.qprintn()
Michael Walsh6741f742017-02-20 16:16:38 -0600772 if boot_table[boot]['end']['chassis'] == "Off":
773 boot_timeout = power_off_timeout
774 else:
775 boot_timeout = power_on_timeout
776 st.wait_state(boot_table[boot]['end'], wait_time=boot_timeout,
Michael Walsh600876d2017-05-30 17:58:58 -0500777 interval="10 seconds")
Michael Walsh6741f742017-02-20 16:16:38 -0600778
779 plug_in_setup()
780 rc, shell_rc, failed_plug_in_name = \
781 grpi.rprocess_plug_in_packages(call_point="post_boot")
782 if rc != 0:
783 error_message = "Plug-in failed with non-zero return code.\n" +\
784 gp.sprint_var(rc, 1)
785 BuiltIn().fail(gp.sprint_error(error_message))
786
787###############################################################################
788
789
790###############################################################################
791def test_loop_body():
792
793 r"""
794 The main loop body for the loop in main_py.
795
796 Description of arguments:
797 boot_count The iteration number (starts at 1).
798 """
799
800 global boot_count
801 global state
802 global next_boot
803 global boot_success
804
Michael Walshb5839d02017-04-12 16:11:20 -0500805 gp.qprintn()
Michael Walsh6741f742017-02-20 16:16:38 -0600806
807 next_boot = select_boot()
Michael Walshb5839d02017-04-12 16:11:20 -0500808 if next_boot == "":
809 return True
Michael Walsh6741f742017-02-20 16:16:38 -0600810
Michael Walshb5839d02017-04-12 16:11:20 -0500811 boot_count += 1
812 gp.qprint_timen("Starting boot " + str(boot_count) + ".")
Michael Walsh6741f742017-02-20 16:16:38 -0600813
Michael Walshe0cf8d72017-05-17 13:20:46 -0500814 pre_boot_plug_in_setup()
Michael Walsh6741f742017-02-20 16:16:38 -0600815
816 cmd_buf = ["run_boot", next_boot]
817 boot_status, msg = BuiltIn().run_keyword_and_ignore_error(*cmd_buf)
818 if boot_status == "FAIL":
Michael Walshb5839d02017-04-12 16:11:20 -0500819 gp.qprint(msg)
Michael Walsh6741f742017-02-20 16:16:38 -0600820
Michael Walshb5839d02017-04-12 16:11:20 -0500821 gp.qprintn()
Michael Walsh6741f742017-02-20 16:16:38 -0600822 if boot_status == "PASS":
823 boot_success = 1
Michael Walshb5839d02017-04-12 16:11:20 -0500824 gp.qprint_timen("BOOT_SUCCESS: \"" + next_boot + "\" succeeded.")
Michael Walsh6741f742017-02-20 16:16:38 -0600825 else:
826 boot_success = 0
Michael Walshb5839d02017-04-12 16:11:20 -0500827 gp.qprint_timen("BOOT_FAILED: \"" + next_boot + "\" failed.")
Michael Walsh6741f742017-02-20 16:16:38 -0600828
829 boot_results.update(next_boot, boot_status)
830
831 plug_in_setup()
832 # NOTE: A post_test_case call point failure is NOT counted as a boot
833 # failure.
834 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
Michael Walsh600876d2017-05-30 17:58:58 -0500835 call_point='post_test_case', stop_on_plug_in_failure=0)
Michael Walsh6741f742017-02-20 16:16:38 -0600836
837 plug_in_setup()
838 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
839 call_point='ffdc_check', shell_rc=0x00000200,
840 stop_on_plug_in_failure=1, stop_on_non_zero_rc=1)
841 if boot_status != "PASS" or ffdc_check == "All" or shell_rc == 0x00000200:
Michael Walsh83f4bc72017-04-20 16:49:43 -0500842 status, ret_values = grk.run_key_u("my_ffdc", ignore=1)
843 if status != 'PASS':
Michael Walsh3328caf2017-03-21 17:04:08 -0500844 gp.print_error("Call to my_ffdc failed.\n")
Michael Walsh6741f742017-02-20 16:16:38 -0600845
Michael Walshd139f282017-04-04 18:00:23 -0500846 # We need to purge error logs between boots or they build up.
Michael Walshb5839d02017-04-12 16:11:20 -0500847 grk.run_key("Delete Error logs", ignore=1)
Michael Walshd139f282017-04-04 18:00:23 -0500848
Michael Walsh952f9b02017-03-09 13:11:14 -0600849 boot_results.print_report()
Michael Walshb5839d02017-04-12 16:11:20 -0500850 gp.qprint_timen("Finished boot " + str(boot_count) + ".")
Michael Walsh952f9b02017-03-09 13:11:14 -0600851
Michael Walsh6741f742017-02-20 16:16:38 -0600852 plug_in_setup()
853 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
854 call_point='stop_check')
855 if rc != 0:
856 error_message = "Stopping as requested by user.\n"
857 grp.rprint_error_report(error_message)
858 BuiltIn().fail(error_message)
859
Michael Walshd139f282017-04-04 18:00:23 -0500860 # This should help prevent ConnectionErrors.
Michael Walsh0960b382017-06-22 16:23:37 -0500861 grk.run_key_u("Close All Connections")
Michael Walshd139f282017-04-04 18:00:23 -0500862
Michael Walsh6741f742017-02-20 16:16:38 -0600863 return True
864
865###############################################################################
866
867
868###############################################################################
Michael Walsh83f4bc72017-04-20 16:49:43 -0500869def obmc_boot_test_teardown():
Michael Walsh6741f742017-02-20 16:16:38 -0600870
871 r"""
Michael Walshc9116812017-03-10 14:23:06 -0600872 Clean up after the Main keyword.
Michael Walsh6741f742017-02-20 16:16:38 -0600873 """
874
875 if cp_setup_called:
876 plug_in_setup()
877 rc, shell_rc, failed_plug_in_name = grpi.rprocess_plug_in_packages(
Michael Walsh600876d2017-05-30 17:58:58 -0500878 call_point='cleanup', stop_on_plug_in_failure=0)
Michael Walsh6741f742017-02-20 16:16:38 -0600879
Michael Walsh600876d2017-05-30 17:58:58 -0500880 if 'boot_results_file_path' in globals():
881 # Save boot_results object to a file in case it is needed again.
882 gp.qprint_timen("Saving boot_results to the following path.")
883 gp.qprint_var(boot_results_file_path)
884 pickle.dump(boot_results, open(boot_results_file_path, 'wb'),
885 pickle.HIGHEST_PROTOCOL)
Michael Walsh0b93fbf2017-03-02 14:42:41 -0600886
Michael Walsh6741f742017-02-20 16:16:38 -0600887###############################################################################
888
889
890###############################################################################
Michael Walshc9116812017-03-10 14:23:06 -0600891def test_teardown():
892
893 r"""
894 Clean up after this test case.
895 """
896
897 gp.qprintn()
898 cmd_buf = ["Print Error",
899 "A keyword timeout occurred ending this program.\n"]
900 BuiltIn().run_keyword_if_timeout_occurred(*cmd_buf)
901
Michael Walshb5839d02017-04-12 16:11:20 -0500902 grp.rqprint_pgm_footer()
903
Michael Walshc9116812017-03-10 14:23:06 -0600904###############################################################################
905
906
907###############################################################################
Michael Walsh83f4bc72017-04-20 16:49:43 -0500908def obmc_boot_test_py(alt_boot_stack=None):
Michael Walsh6741f742017-02-20 16:16:38 -0600909
910 r"""
911 Do main program processing.
912 """
913
Michael Walshb5839d02017-04-12 16:11:20 -0500914 if alt_boot_stack is not None:
915 BuiltIn().set_global_variable("${boot_stack}", alt_boot_stack)
916
Michael Walsh6741f742017-02-20 16:16:38 -0600917 setup()
918
Michael Walsha20da402017-03-31 16:27:45 -0500919 if ffdc_only:
920 gp.qprint_timen("Caller requested ffdc_only.")
Michael Walshe0cf8d72017-05-17 13:20:46 -0500921 pre_boot_plug_in_setup()
Michael Walsh83f4bc72017-04-20 16:49:43 -0500922 grk.run_key_u("my_ffdc")
Michael Walsh764d2f82017-04-27 16:01:08 -0500923 return
Michael Walsha20da402017-03-31 16:27:45 -0500924
Michael Walsh6741f742017-02-20 16:16:38 -0600925 # Process caller's boot_stack.
926 while (len(boot_stack) > 0):
927 test_loop_body()
928
Michael Walshb5839d02017-04-12 16:11:20 -0500929 gp.qprint_timen("Finished processing stack.")
Michael Walsh30dadae2017-02-27 14:25:52 -0600930
Michael Walsh6741f742017-02-20 16:16:38 -0600931 # Process caller's boot_list.
932 if len(boot_list) > 0:
933 for ix in range(1, max_num_tests + 1):
934 test_loop_body()
935
Michael Walshb5839d02017-04-12 16:11:20 -0500936 gp.qprint_timen("Completed all requested boot tests.")
937
938 boot_pass, boot_fail = boot_results.return_total_pass_fail()
939 if boot_fail > boot_fail_threshold:
940 error_message = "Boot failures exceed the boot failure" +\
941 " threshold:\n" +\
942 gp.sprint_var(boot_fail) +\
943 gp.sprint_var(boot_fail_threshold)
944 BuiltIn().fail(gp.sprint_error(error_message))
Michael Walsh6741f742017-02-20 16:16:38 -0600945
946###############################################################################