Fixed problems introduced by obmc_boot_test.robot merge.
Note: The caller must set PATH and PYTHONPATH so that libraries and resources
can be found. Example:
export PATH=/home/robot/openbmc-test-automation/bin:$PATH
export PYTHONPATH=/home/robot/openbmc-test-automation/lib:$PYTHONPATH
lib/gen_print.py:
- sprint_varx: Failure to support dot_dict.
- sprint_pgm_header:
- Fixed failure to support uid of 0.
- Fixed failure to handle non-existent DISPLAY env variable.
lib/obmc_boot_test.py
- plug_in_setup: Fixed failure to handle non-existent FFDC_DIR_PATH env
variable.
Resolves https://github.com/openbmc/openbmc-test-automation/issues/230
Change-Id: I81a2ac6ad0bc69b24f9e160d38120ffb31c632f1
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index e8f44fe..427aeeb 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -85,10 +85,12 @@
ffdc_prefix += "." + time_string
- ffdc_dir_path = OperatingSystem().get_environment_variable(
- "FFDC_DIR_PATH")
- # Add trailing slash.
- ffdc_dir_path = os.path.normpath(ffdc_dir_path) + os.sep
+ try:
+ ffdc_dir_path = os.environ['FFDC_DIR_PATH']
+ # Add trailing slash.
+ ffdc_dir_path = os.path.normpath(ffdc_dir_path) + os.sep
+ except KeyError:
+ ffdc_dir_path = ""
BuiltIn().set_global_variable("${FFDC_DIR_PATH}", ffdc_dir_path)
# For each program parameter, set the corresponding AUTOBOOT_ environment