Multiple changes to support functions.
lib/dvt/obmc_call_points.robot
- Deleting this file. I don't really see a need for it.
lib/gen_print.py
- I added code to convert local copy of GEN_PRINT_DEBUG to int.
lib/gen_robot_print.py
- I added code to convert local copy of GEN_ROBOT_PRINT_DEBUG to int.
- I added import of DotDict and collections. I added code to define shortcuts
for debug and quiet versions (e.g. rdpvars, rqpvars).
bin/process_plug_in_packages.py
- Change from using dissuing to dpissuing to coincide with changes in
gen_robot_print.py
- Shift 'Starting plug-in' output 1 char to the right to align better with
time stamp output.
lib/rest_client.robot
- I added support for a quiet parm to the following keywords:
- OpenBMC Get Request
- OpenBMC Post Request
- Read Attribute
- Call Method
- I cleaned up excessive spaces (e.g. 4 where 2 will do).
- I changed " =" to "=" for consistency (e.g. "${data} =" to "${data}=").
lib/utils.robot
- I cleaned up some lines exceeding 79 chars.
- I cleaned up excessive spaces (e.g. 4 where 2 will do).
- I changed " =" to "=" for consistency (e.g. "${data} =" to "${data}=").
- I added support for a quiet parm to the following keywords:
- Get Boot Progress
- Check OS
- Wait for OS
- Get BMC State
- Get Power State
- This quiet parm may contribute to resolving the following issue:
https://github.com/openbmc/openbmc-test-automation/issues/162
- I added support for a wait parm to "Initiate Power On". It defaults to ${1}
to preserve traditional behavior. I have calls to this keyword that only
want it to "Initiate Power On" and that's it. No waiting for anything.
- I added support for print_string parm to Check OS.
- I improved the error output for "Check OS".
- I improved the output for "Wait for OS"
lib/dvt/obmc_driver_vars.txt
- Changed all "IPL" to "BOOT". "IPL" is an IBM term. This file only used by
obmc_boot_test.robot so change is safe.
Change-Id: I9a410b17b5ec4ffb0c8998cb6b8763c41cfd2655
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/bin/process_plug_in_packages.py b/bin/process_plug_in_packages.py
index f1bf3d9..5ba66be 100755
--- a/bin/process_plug_in_packages.py
+++ b/bin/process_plug_in_packages.py
@@ -233,9 +233,9 @@
# Get some stats on the file.
cmd_buf = "stat -c '%n %s %z' " + plug_in_pgm_path
- dissuing(cmd_buf)
+ dpissuing(cmd_buf)
sub_proc = subprocess.Popen(cmd_buf, shell=True, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.STDOUT)
out_buf, err_buf = sub_proc.communicate()
shell_rc = sub_proc.returncode
if shell_rc != 0:
@@ -246,15 +246,15 @@
print(out_buf)
return rc, shell_rc, failed_plug_in_name
- print("------------------------------------------------ Starting plug-in" +
- " ------------------------------------------------")
+ print("------------------------------------------------- Starting plug-" +
+ "in -----------------------------------------------")
print(out_buf)
cmd_buf = "PATH=" + plug_in_dir_path + ":${PATH} ; " + cp_prefix +\
call_point
- issuing(cmd_buf)
+ pissuing(cmd_buf)
sub_proc = subprocess.Popen(cmd_buf, shell=True, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.STDOUT)
out_buf, err_buf = sub_proc.communicate()
shell_rc = sub_proc.returncode
if shell_rc != 0 and shell_rc != int(caller_shell_rc, 16):
@@ -306,10 +306,10 @@
mch_class)
qpvar(plug_in_packages_list)
-
qprint("\n")
caller_shell_rc = shell_rc
+ shell_rc = 0
failed_plug_in_name = ""
ret_code = 0
diff --git a/lib/dvt/obmc_call_points.robot b/lib/dvt/obmc_call_points.robot
deleted file mode 100644
index 1d8db7c..0000000
--- a/lib/dvt/obmc_call_points.robot
+++ /dev/null
@@ -1,36 +0,0 @@
-*** Settings ***
-Documentation This module contains keywords within tests/obmc_boot_test that
-... are points at which to call plug-ins.
-
-Resource obmc_driver_vars.txt
-
-*** Keywords ***
-Call Point Setup
- [Documentation] Call any plugins that have a cp_setup program
- [Teardown] Log to Console **Plugin** end call point: cp_setup${\n}
-
- Log to Console ${\n}**Plugin** start call point: cp_setup
-
-Call Point Pre Boot
- [Documentation] Call any plugins that have a cp_pre_boot program
- [Teardown] Log to Console **Plugin** end call point: cp_pre_boot${\n}
-
- Log to Console ${\n}**Plugin** start call point: cp_pre_boot
-
-Call Point Post Boot
- [Documentation] Call any plugins that have a cp_post_boot program
- [Teardown] Log to Console **Plugin** end call point: cp_post_boot${\n}
-
- Log to Console ${\n}**Plugin** start call point: cp_post_boot
-
-Call Point FFDC
- [Documentation] Call any plugins that have a cp_ffdc program
- [Teardown] Log to Console **Plugin** end call point: cp_ffdc${\n}
-
- Log to Console ${\n}**Plugin** start call point: cp_ffdc
-
-Call Point Stop Check
- [Documentation] Call any plugins that have a cp_stop_check program
- [Teardown] Log to Console **Plugin** end call point: cp_stop_check${\n}
-
- Log to Console ${\n}**Plugin** start call point: cp_stop_check
diff --git a/lib/dvt/obmc_driver_vars.txt b/lib/dvt/obmc_driver_vars.txt
index 41bc6eb..0ce4bee 100644
--- a/lib/dvt/obmc_driver_vars.txt
+++ b/lib/dvt/obmc_driver_vars.txt
@@ -5,31 +5,24 @@
# Alias of the master connection to the BMC
${master_alias} master
-# The count of the IPL we're currently doing - used in the FOR loop
-${IPL_COUNT} ${0}
+# The count of the boot we're currently doing - used in the FOR loop.
+${BOOT_COUNT} ${0}
-# The total number of IPLs we plan on doing
-${IPL_TOTAL} ${3}
+# The status of the last boots that finished
+${BOOT_STATUS} ${EMPTY}
-# The total number of IPLs that have passed and failed
-${IPL_PASSED} ${0}
-${IPL_FAILED} ${0}
-
-# The status of the last IPL that finished
-${IPL_STATUS} ${EMPTY}
-
-# A list of the last 10 IPLs that have been performed (see Log Last Ten)
+# A list of the last 10 boots that have been performed (see Log Last Ten)
@{LAST_TEN}
-# A list of keywords of valid IPLs that can be performed
+# A list of keywords of valid boots that can be performed
@{VALID_POWER_ON} BMC Power On
@{VALID_POWER_OFF} BMC Power Off
#@{VALID_ACCYCLE}
#@{VALID_REBOOT}
-# The master list of all IPLs possible, for reference. (Currently not in use).
-@{MASTER_IPL_LIST} BMC Power On BMC Power Off
+# The master list of all boots possible, for reference. (Currently not in use).
+@{MASTER_BOOT_LIST} BMC Power On BMC Power Off
-# The list of available IPLs - Modifying this will limit what IPLs can be done.
+# The list of available boots - Modifying this will limit what boots can be done.
# This list is also used by: Setup Run Table, Log Run Table
-@{AVAIL_IPLS} BMC Power On BMC Power Off
+@{AVAIL_BOOTS} BMC Power On BMC Power Off
diff --git a/lib/gen_print.py b/lib/gen_print.py
index 996a289..6b405d7 100755
--- a/lib/gen_print.py
+++ b/lib/gen_print.py
@@ -17,11 +17,10 @@
import logging
import collections
-running_from_robot = 1
try:
from robot.utils import DotDict
except ImportError:
- running_from_robot = 0
+ pass
import gen_arg as ga
@@ -70,7 +69,7 @@
try:
# The user can set environment variable "GEN_PRINT_DEBUG" to get debug
# output from this module.
- gen_print_debug = os.environ['GEN_PRINT_DEBUG']
+ gen_print_debug = int(os.environ['GEN_PRINT_DEBUG'])
except KeyError:
gen_print_debug = 0
@@ -527,10 +526,11 @@
if type(var_value) in (dict, collections.OrderedDict):
type_is_dict = 1
except AttributeError:
- type_is_dict = 0
- if running_from_robot:
- if type(var_value) is DotDict:
- type_is_dict = 1
+ try:
+ if type(var_value) is DotDict:
+ type_is_dict = 1
+ except NameError:
+ pass
if type_is_dict:
for key, value in var_value.iteritems():
ix += 1
diff --git a/lib/gen_robot_print.py b/lib/gen_robot_print.py
index 8fdd7d0..7c48912 100755
--- a/lib/gen_robot_print.py
+++ b/lib/gen_robot_print.py
@@ -8,6 +8,11 @@
import re
import os
+try:
+ from robot.utils import DotDict as my_ord_dict
+except ImportError:
+ from collections import OrderedDict as my_ord_dict
+
import gen_print as gp
from robot.libraries.BuiltIn import BuiltIn
@@ -17,7 +22,7 @@
try:
# The user can set environment variable "GEN_ROBOT_PRINT_DEBUG" to get
# debug output from this module.
- gen_robot_print_debug = os.environ['GEN_ROBOT_PRINT_DEBUG']
+ gen_robot_print_debug = int(os.environ['GEN_ROBOT_PRINT_DEBUG'])
except KeyError:
gen_robot_print_debug = 0
@@ -180,6 +185,9 @@
buffer += sprint_vars(str(indent), str(loc_col1_width), *parm_list)
buffer += "\n"
+ # Setting global program_pid.
+ BuiltIn().set_global_variable("${program_pid}", os.getpid())
+
return buffer
###############################################################################
@@ -309,6 +317,14 @@
'print_issuing_keyword', 'print_vars', 'print_auto_vars'
]
func_names = gp.func_names + robot_func_names
+
+func_names = list(my_ord_dict.fromkeys(func_names))
+
+if gen_robot_print_debug:
+ rprintn()
+ BuiltIn().log_to_console(gp.sprint_var(func_names), no_newline=True)
+ rprintn()
+
for func_name in func_names:
# The print_var function's job is to figure out the name of arg 1 and
# then call print_varx. This is not currently supported for robot
@@ -332,6 +348,7 @@
pgm_definition_string = '\n'.join(func_def)
if gen_robot_print_debug:
+ rprintn()
rprintn(pgm_definition_string)
exec(pgm_definition_string)
@@ -375,17 +392,20 @@
rprintn(pgm_definition_string)
exec(pgm_definition_string)
- # Create abbreviated aliases (e.g. rpvarx is an alias for rprint_varx).
+ prefixes = ["", "q", "d"]
alias = re.sub("print_", "p", func_name)
- cmd_buf = robot_prefix + alias + " = " + robot_prefix + func_name
- if gen_robot_print_debug:
- rprintn(cmd_buf)
- exec(cmd_buf)
+ for prefix2 in prefixes:
+ cmd_buf = robot_prefix + prefix2 + alias + " = " + robot_prefix +\
+ prefix2 + func_name
+ if gen_robot_print_debug:
+ rprintn(cmd_buf)
+ exec(cmd_buf)
# Define an alias. rpvar is just a special case of rpvars where the args
# list contains only one element.
cmd_buf = "rpvar = rpvars"
if gen_robot_print_debug:
+ rprintn()
rprintn(cmd_buf)
exec(cmd_buf)
diff --git a/lib/rest_client.robot b/lib/rest_client.robot
index eb1a28a..6bbe21a 100644
--- a/lib/rest_client.robot
+++ b/lib/rest_client.robot
@@ -57,26 +57,31 @@
${HTTP_HTTP_VERSION_NOT_SUPPORTED} 505
${HTTP_INSUFFICIENT_STORAGE} 507
${HTTP_NOT_EXTENDED} 510
+# Assign default value to QUIET for programs which may not define it.
+${QUIET} ${0}
*** Keywords ***
OpenBMC Get Request
- [Arguments] ${uri} ${timeout}=10 &{kwargs}
+ [Arguments] ${uri} ${timeout}=10 ${quiet}=${QUIET} &{kwargs}
${base_uri}= Catenate SEPARATOR= ${DBUS_PREFIX} ${uri}
- Log Request method=Get base_uri=${base_uri} args=&{kwargs}
+ Run Keyword If '${quiet}' == '${0}' Log Request method=Get
+ ... base_uri=${base_uri} args=&{kwargs}
Initialize OpenBMC ${timeout}
- ${ret}= Get Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
- Log Response ${ret}
+ ${ret}= Get Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
+ Run Keyword If '${quiet}' == '${0}' Log Response ${ret}
[Return] ${ret}
OpenBMC Post Request
- [Arguments] ${uri} ${timeout}=10 &{kwargs}
+ [Arguments] ${uri} ${timeout}=10 ${quiet}=${QUIET} &{kwargs}
+
${base_uri}= Catenate SEPARATOR= ${DBUS_PREFIX} ${uri}
${headers}= Create Dictionary Content-Type=application/json
set to dictionary ${kwargs} headers ${headers}
- Log Request method=Post base_uri=${base_uri} args=&{kwargs}
+ Run Keyword If '${quiet}' == '${0}' Log Request method=Post
+ ... base_uri=${base_uri} args=&{kwargs}
Initialize OpenBMC ${timeout}
- ${ret}= Post Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
- Log Response ${ret}
+ ${ret}= Post Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
+ Run Keyword If '${quiet}' == '${0}' Log Response ${ret}
[Return] ${ret}
OpenBMC Put Request
@@ -86,7 +91,7 @@
set to dictionary ${kwargs} headers ${headers}
Log Request method=Put base_uri=${base_uri} args=&{kwargs}
Initialize OpenBMC ${timeout}
- ${ret}= Put Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
+ ${ret}= Put Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Log Response ${ret}
[Return] ${ret}
@@ -95,28 +100,29 @@
${base_uri}= Catenate SEPARATOR= ${DBUS_PREFIX} ${uri}
Log Request method=Delete base_uri=${base_uri} args=&{kwargs}
Initialize OpenBMC ${timeout}
- ${ret}= Put Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
+ ${ret}= Put Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
Log Response ${ret}
[Return] ${ret}
Initialize OpenBMC
[Arguments] ${timeout}=10
- Create Session openbmc ${AUTH_URI} timeout=${timeout} max_retries=3
- ${headers}= Create Dictionary Content-Type=application/json
- @{credentials} = Create List ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
- ${data} = create dictionary data=@{credentials}
- ${resp} = Post Request openbmc /login data=${data} headers=${headers}
+ Create Session openbmc ${AUTH_URI} timeout=${timeout} max_retries=3
+ ${headers}= Create Dictionary Content-Type=application/json
+ @{credentials}= Create List ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
+ ${data}= create dictionary data=@{credentials}
+ ${resp}= Post Request openbmc /login data=${data} headers=${headers}
should be equal as strings ${resp.status_code} ${HTTP_OK}
Log Request
[Arguments] &{kwargs}
- ${msg}= Catenate SEPARATOR= URI: ${AUTH_URI} ${kwargs["base_uri"]} , method:
- ... ${kwargs["method"]} , args: ${kwargs["args"]}
+ ${msg}= Catenate SEPARATOR= URI: ${AUTH_URI} ${kwargs["base_uri"]}
+ ... , method: ${kwargs["method"]} , args: ${kwargs["args"]}
Logging ${msg} console=True
Log Response
[Arguments] ${resp}
- ${msg}= Catenate SEPARATOR= Response code: ${resp.status_code} , Content: ${resp.content}
+ ${msg}= Catenate SEPARATOR= Response code: ${resp.status_code}
+ ... , Content: ${resp.content}
Logging ${msg} console=True
Logging
@@ -124,27 +130,31 @@
Log ${msg} console=True
Read Attribute
- [arguments] ${uri} ${attr} ${timeout}=10
- ${resp} = OpenBMC Get Request ${uri}/attr/${attr} timeout=${timeout}
+ [arguments] ${uri} ${attr} ${timeout}=10 ${quiet}=${QUIET}
+ ${resp}= OpenBMC Get Request ${uri}/attr/${attr} timeout=${timeout}
+ ... quiet=${quiet}
${content}= To Json ${resp.content}
[return] ${content["data"]}
Write Attribute
[Arguments] ${uri} ${attr} ${timeout}=10 &{kwargs}
${base_uri}= Catenate SEPARATOR= ${DBUS_PREFIX} ${uri}
- ${resp} = openbmc put request ${base_uri}/attr/${attr} timeout=${timeout} &{kwargs}
+ ${resp}= openbmc put request ${base_uri}/attr/${attr}
+ ... timeout=${timeout} &{kwargs}
should be equal as strings ${resp.status_code} ${HTTP_OK}
- ${json} = to json ${resp.content}
+ ${json}= to json ${resp.content}
Read Properties
[arguments] ${uri} ${timeout}=10
- ${resp} = OpenBMC Get Request ${uri} timeout=${timeout}
+ ${resp}= OpenBMC Get Request ${uri} timeout=${timeout}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${content}= To Json ${resp.content}
[return] ${content["data"]}
Call Method
- [arguments] ${uri} ${method} ${timeout}=10 &{kwargs}
+ [arguments] ${uri} ${method} ${timeout}=10 ${quiet}=${QUIET} &{kwargs}
+
${base_uri}= Catenate SEPARATOR= ${DBUS_PREFIX} ${uri}
- ${resp} = openbmc post request ${base_uri}/action/${method} timeout=${timeout} &{kwargs}
+ ${resp}= OpenBmc Post Request ${base_uri}/action/${method}
+ ... timeout=${timeout} quiet=${quiet} &{kwargs}
[return] ${resp}
diff --git a/lib/utils.robot b/lib/utils.robot
index 5590e9b..82fcdbd 100644
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -5,12 +5,19 @@
Library DateTime
Library Process
Library OperatingSystem
+Library gen_print.py
+Library gen_robot_print.py
*** Variables ***
${SYSTEM_SHUTDOWN_TIME} ${5}
-${dbuscmdBase} = dbus-send --system --print-reply --dest=org.openbmc.settings.Host
-${dbuscmdGet} = /org/openbmc/settings/host0 org.freedesktop.DBus.Properties.Get
-${dbuscmdString} = string:"org.openbmc.settings.Host" string:
+${dbuscmdBase}
+... dbus-send --system --print-reply --dest=org.openbmc.settings.Host
+${dbuscmdGet}
+... /org/openbmc/settings/host0 org.freedesktop.DBus.Properties.Get
+${dbuscmdString}= string:"org.openbmc.settings.Host" string:
+
+# Assign default value to QUIET for programs which may not define it.
+${QUIET} ${0}
*** Keywords ***
Wait For Host To Ping
@@ -26,12 +33,15 @@
Ping Host
[Arguments] ${host}
Should Not Be Empty ${host} msg=No host provided
- ${RC} ${output} = Run and return RC and Output ping -c 4 ${host}
+ ${RC} ${output}= Run and return RC and Output ping -c 4 ${host}
Log RC: ${RC}\nOutput:\n${output}
Should be equal ${RC} ${0}
Get Boot Progress
- ${state} = Read Attribute /org/openbmc/sensors/host/BootProgress value
+ [Arguments] ${quiet}=${QUIET}
+
+ ${state}= Read Attribute /org/openbmc/sensors/host/BootProgress
+ ... value quiet=${quiet}
[return] ${state}
Is Power On
@@ -45,26 +55,33 @@
Initiate Power On
[Documentation] Initiates the power on and waits until the Is Power On
... keyword returns that the power state has switched to on.
+ [Arguments] ${wait}=${1}
+
@{arglist}= Create List
${args}= Create Dictionary data=@{arglist}
- ${resp}= Call Method /org/openbmc/control/chassis0/ powerOn data=${args}
+ ${resp}= Call Method /org/openbmc/control/chassis0/ powerOn
+ ... data=${args}
should be equal as strings ${resp.status_code} ${HTTP_OK}
- Wait Until Keyword Succeeds 3 min 10 sec Is Power On
+ # Does caller want to wait for power on status?
+ Run Keyword If '${wait}' == '${0}' Return From Keyword
+ Wait Until Keyword Succeeds 3 min 10 sec Is Power On
Initiate Power Off
[Documentation] Initiates the power off and waits until the Is Power Off
... keyword returns that the power state has switched to off.
@{arglist}= Create List
${args}= Create Dictionary data=@{arglist}
- ${resp}= Call Method /org/openbmc/control/chassis0/ powerOff data=${args}
+ ${resp}= Call Method /org/openbmc/control/chassis0/ powerOff
+ ... data=${args}
should be equal as strings ${resp.status_code} ${HTTP_OK}
- Wait Until Keyword Succeeds 1 min 10 sec Is Power Off
+ Wait Until Keyword Succeeds 1 min 10 sec Is Power Off
Trigger Warm Reset
log to console "Triggering warm reset"
- ${data} = create dictionary data=@{EMPTY}
- ${resp} = openbmc post request /org/openbmc/control/bmc0/action/warmReset data=${data}
+ ${data}= create dictionary data=@{EMPTY}
+ ${resp}= openbmc post request /org/openbmc/control/bmc0/action/warmReset
+ ... data=${data}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${session_active}= Check If warmReset is Initiated
Run Keyword If '${session_active}' == '${True}'
@@ -78,35 +95,55 @@
... OS is up by running an SSH command.
[Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME}
- ... ${os_password}=${OS_PASSWORD}
+ ... ${os_password}=${OS_PASSWORD} ${quiet}=${QUIET}
+ ... ${print_string}=${EMPTY}
[Teardown] Close Connection
# os_host The DNS name/IP of the OS host associated with our BMC.
# os_username The username to be used to sign on to the OS host.
# os_password The password to be used to sign on to the OS host.
+ # quiet Indicates whether this keyword should write to console.
+ # print_string A string to be printed before checking the OS.
+
+ rprint ${print_string}
# Attempt to ping the OS. Store the return code to check later.
${ping_rc}= Run Keyword and Return Status Ping Host ${os_host}
Open connection ${os_host}
- Login ${os_username} ${os_password}
+ ${status} ${msg}= Run Keyword And Ignore Error Login ${os_username}
+ ... ${os_password}
+ ${err_msg1}= Sprint Error ${msg}
+ ${err_msg}= Catenate SEPARATOR= \n ${err_msg1}
+ Run Keyword If '${status}' == 'FAIL' Fail msg=${err_msg}
${output} ${stderr} ${rc}= Execute Command uptime return_stderr=True
... return_rc=True
- # If the return code returned by "Execute Command" is non-zero, this keyword
- # will fail.
- Should Be Equal ${rc} ${0}
+ ${temp_msg}= Catenate Could not execute a command on the operating
+ ... system.\n
+ ${err_msg1}= Sprint Error ${temp_msg}
+ ${err_msg}= Catenate SEPARATOR= \n ${err_msg1}
+
+ # If the return code returned by "Execute Command" is non-zero, this
+ # keyword will fail.
+ Should Be Equal ${rc} ${0} msg=${err_msg}
# We will likewise fail if there is any stderr data.
Should Be Empty ${stderr}
- # We will likewise fail if the OS did not ping, as we could SSH but not ping
- Should Be Equal As Strings ${ping_rc} ${TRUE}
+ ${temp_msg}= Set Variable Could not ping the operating system.\n
+ ${err_msg1}= Sprint Error ${temp_msg}
+ ${err_msg}= Catenate SEPARATOR= \n ${err_msg1}
+ # We will likewise fail if the OS did not ping, as we could SSH but not
+ # ping
+ Should Be Equal As Strings ${ping_rc} ${TRUE} msg=${err_msg}
Wait for OS
[Documentation] Waits for the host OS to come up via calls to "Check OS".
[Arguments] ${os_host}=${OS_HOST} ${os_username}=${OS_USERNAME}
... ${os_password}=${OS_PASSWORD} ${timeout}=${OS_WAIT_TIMEOUT}
+ ... ${quiet}=${0}
+ [Teardown] rprintn
# os_host The DNS name or IP of the OS host associated with our
# BMC.
@@ -114,29 +151,44 @@
# os_password The password to be used to sign on to the OS host.
# timeout The timeout in seconds indicating how long you're
# willing to wait for the OS to respond.
+ # quiet Indicates whether this keyword should write to console.
# The interval to be used between calls to "Check OS".
${interval}= Set Variable 5
+ ${message}= Catenate Checking every ${interval} seconds for up to
+ ... ${timeout} seconds for the operating system to communicate.
+ rqprint_timen ${message}
+
Wait Until Keyword Succeeds ${timeout} sec ${interval} Check OS
... ${os_host} ${os_username} ${os_password}
+ ... print_string=\#
+
+ rqprintn
+
+ rqprint_timen The operating system is now communicating.
Get BMC State
[Documentation] Returns the state of the BMC as a string. (i.e: BMC_READY)
+ [Arguments] ${quiet}=${QUIET}
+
@{arglist}= Create List
${args}= Create Dictionary data=@{arglist}
${resp}= Call Method /org/openbmc/managers/System/ getSystemState
- ... data=${args}
+ ... data=${args} quiet=${quiet}
Should be equal as strings ${resp.status_code} ${HTTP_OK}
${content}= to json ${resp.content}
[return] ${content["data"]}
Get Power State
[Documentation] Returns the power state as an integer. Either 0 or 1.
+ [Arguments] ${quiet}=${QUIET}
+
@{arglist}= Create List
${args}= Create Dictionary data=@{arglist}
+
${resp}= Call Method /org/openbmc/control/chassis0/ getPowerState
- ... data=${args}
+ ... data=${args} quiet=${quiet}
Should be equal as strings ${resp.status_code} ${HTTP_OK}
${content}= to json ${resp.content}
[return] ${content["data"]}
@@ -146,7 +198,7 @@
... equivalent to ipmitool sel clear.
@{arglist}= Create List
${args}= Create Dictionary data=@{arglist}
- ${resp}= Call Method /org/openbmc/records/events/ clear data=${args}
+ ${resp}= Call Method /org/openbmc/records/events/ clear data=${args}
should be equal as strings ${resp.status_code} ${HTTP_OK}
Copy PNOR to BMC
@@ -160,7 +212,8 @@
[arguments] ${pnor_image}
@{arglist}= Create List ${pnor_image}
${args}= Create Dictionary data=@{arglist}
- ${resp}= Call Method /org/openbmc/control/flash/bios/ update data=${args}
+ ${resp}= Call Method /org/openbmc/control/flash/bios/ update
+ ... data=${args}
should be equal as strings ${resp.status_code} ${HTTP_OK}
Wait Until Keyword Succeeds 2 min 10 sec Is PNOR Flashing
@@ -188,12 +241,12 @@
should be equal as strings ${state} HOST_BOOTED
Verify Ping and REST Authentication
- ${l_ping} = Run Keyword And Return Status
+ ${l_ping}= Run Keyword And Return Status
... Ping Host ${OPENBMC_HOST}
Run Keyword If '${l_ping}' == '${False}'
... Fail msg=Ping Failed
- ${l_rest} = Run Keyword And Return Status
+ ${l_rest}= Run Keyword And Return Status
... Initialize OpenBMC
Run Keyword If '${l_rest}' == '${False}'
... Fail msg=REST Authentication Failed
@@ -203,7 +256,6 @@
${system} ${stderr}= Execute Command hostname return_stderr=True
Should Be Empty ${stderr}
-
Check If BMC is Up
[Documentation] Wait for Host to be online. Checks every X seconds
... interval for Y minutes and fails if timed out.
@@ -231,8 +283,8 @@
Initialize DBUS cmd
[Documentation] Initialize dbus string with property string to extract
[arguments] ${boot_property}
- ${cmd} = Catenate ${dbuscmdBase} ${dbuscmdGet} ${dbuscmdString}
- ${cmd} = Catenate ${cmd}${boot_property}
+ ${cmd}= Catenate ${dbuscmdBase} ${dbuscmdGet} ${dbuscmdString}
+ ${cmd}= Catenate ${cmd}${boot_property}
Set Global Variable ${dbuscmd} ${cmd}
@@ -266,7 +318,7 @@
Open Connection And Log In
- ${pid} ${stderr} =
+ ${pid} ${stderr}=
... Execute Command
... ls ${file_path}-${LOG_TIME}_* | cut -d'_' -f 2
... return_stderr=True
@@ -356,4 +408,3 @@
Execute Command rm ${file_path}-${LOG_TIME}
[Return] ${journal_log}
-