[EXTERNAL] RE: Host related testcases in openbmc-test-automation

George Keishing gkeishin at in.ibm.com
Tue Aug 11 02:45:25 AEST 2020


Hi Jayashree,

	The current the test infrastructure is over SSH  to Host / remote
server to login to OS partition, execute commands, only if the partition is
accessible from the test server where the test code is executed.

Reading from your note, it sounded like the OS partition is not configured
over network and can't be access from test server but through BMC only? is
that correct assumption ?

To connect a session to BMC SSH and then invoke obmc-console-client and
then try to login on a spawn session looks like job for interactive shell,
however, this may not really work well.

Having said that, you can look at this
http://robotframework.org/SSHLibrary/SSHLibrary.html#Write   to do
interactive shell
http://robotframework.org/SSHLibrary/SSHLibrary.html#Interactive%20shells

We got a bit older code over telnet interactive shell
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/serial_connection/serial_console_client.robot#L12
   see if that example helps as well.



On another note, assuming, you want to make sure the OS is booted good and
need a check point or look up reference data,  probably, you can
check  /var/log/obmc-console.log from the test code and look for the OS
console message.

Nevertheless, if you don't provide the host credential/ or off the network,
the BMC + host state would certainly give confidence that the Host OS
partition start booting, which the test is doing so when powered on via
test code by checking the states bellow.

CurrentBMCState     : xyz.openbmc_project.State.BMC.BMCState.Ready
CurrentPowerState   : xyz.openbmc_project.State.Chassis.PowerState.On
CurrentHostState    : xyz.openbmc_project.State.Host.HostState.Running
BootProgress        :
xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart
OperatingSystemState:
xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete

Thanks and Regards,
   George Keishing





From:	Jayashree D <jayashree-d at hcl.com>
To:	George Keishing <gkeishin at in.ibm.com>
Cc:	"openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Date:	10-08-2020 10:51 AM
Subject:	[EXTERNAL] RE:  Host related testcases in
            openbmc-test-automation
Sent by:	"openbmc" <openbmc-bounces
            +gkeishin=in.ibm.com at lists.ozlabs.org>



Hi George,

In obmc-console feature, after login to BMC we will run
“obmc-console-client” and will give “ENTER” to connect the host by giving
username and password.

root at tiogapass:~# obmc-console-client
# BMC Execute Command
# ENTER
CentOS Linux 8 (Core)
Kernel 5.2.9-91_fbk10_3371_ge007350ae172 on an x86_64

localhost login:
# Host Username
Password:
# Host Password

[root at localhost ~]#


We can run obmc-console-client using BMC Execute Command, then ENTER should
be given and OS Username and password.
Is there any way to run the above commands “ENTER” in automation scripts
after obmc-console-client?

Regards,
Jayashree

From: Jayashree D
Sent: Thursday, August 6, 2020 8:20 PM
To: George Keishing <gkeishin at in.ibm.com>
Cc: openbmc at lists.ozlabs.org
Subject: RE: Host related testcases in openbmc-test-automation

Thanks George, I will look into this keywords.

From: George Keishing <gkeishin at in.ibm.com>
Sent: Thursday, August 6, 2020 6:12 PM
To: Jayashree D <jayashree-d at hcl.com>
Cc: openbmc at lists.ozlabs.org
Subject: Re: Host related testcases in openbmc-test-automation

[CAUTION: This Email is from outside the Organization. Unless you trust the
sender, Don’t click links or open attachments as it may be a Phishing
email, which can steal your Information and compromise your Computer.]


Jayashree,

See if this info helps to get you started what you are looking for.

1. OBMC-CONSOLE - To connect the host via BMC, we are using
obmc-console-client to login the host and check the host conections.

Most of the test code uses the login BMC/host, check connect via
REST/SSH/Ping to do the check on connection

You can look at this keyword used:
Example:

-login to BMC and execute : BMC Execute Command
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/bmc_ssh_utils.py#L12

https://github.com/openbmc/openbmc-test-automation/blob/master/redfish/extended/test_basic_ci.robot#L74

https://github.com/openbmc/openbmc-test-automation/blob/master/redfish/extended/test_basic_ci.robot#L96

https://github.com/openbmc/openbmc-test-automation/blob/master/redfish/managers/test_certificate.robot#L413

etc...

or simply use something like this:
SSHLibrary.Open connection ${bmc_ip}
SSHLibrary.Login ${openbmc_username} ${openbmc_password}

-login to Host and execute: Login To OS Host / OS Execute Command
https://github.com/openbmc/openbmc-test-automation/blob/master/syslib/utils_os.robot#L38

https://github.com/openbmc/openbmc-test-automation/blob/master/lib/bmc_ssh_utils.py#L70

etc.

- obmc-console-client: Start SOL Console Logging / Stop SOL Console Logging
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/common_utils.robot#L386

https://github.com/openbmc/openbmc-test-automation/blob/master/lib/common_utils.robot#L342


you can grep/serach around tests / redfish dir, you ll see where and how
they are used in the test suite


The test boot keywords to power on /off/ reboot etc are here,
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/boot_utils.robot

you'll notice those are used in test to drive the boot and the best part is
if you key in these test parameter from robot command line
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/resource.robot#L45


it will ensure, to login and check if the Host is up and running as part of
the boot keyword



2. HOST LOGGER - To handle and store host's console output data, such as
boot logs.

You can use the above SOL keyword to collect the data for Host boot logs
You can as well use IPMI SOL capabilities
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/ipmi_client.robot#L188

https://github.com/openbmc/openbmc-test-automation/blob/master/lib/ipmi_client.robot#L204


FFDC collects those data as well :
https://github.com/openbmc/openbmc-test-automation/blob/master/lib/openbmc_ffdc.robot#L39






Thanks and Regards,
George Keishing



Inactive hide details for Jayashree D ---06-08-2020 04:08:09 PM---Hi All, I
need to test the below features in openbmc-test-autJayashree D
---06-08-2020 04:08:09 PM---Hi All, I need to test the below features in
openbmc-test-automation.

From: Jayashree D <jayashree-d at hcl.com>
To: "openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Date: 06-08-2020 04:08 PM
Subject: [EXTERNAL] Host related testcases in openbmc-test-automation
Sent by: "openbmc" <openbmc-bounces+gkeishin=in.ibm.com at lists.ozlabs.org>




Hi All,

I need to test the below features in openbmc-test-automation.
Is there any related testcases to verify those features?

1. OBMC-CONSOLE - To connect the host via BMC, we are using
obmc-console-client to login the host and check the host conections.
(https://github.com/openbmc/obmc-console)

2. HOST LOGGER - To handle and store host's console output data, such as
boot logs.
(https://github.com/openbmc/phosphor-hostlogger)


Regards,
Jayashree


::DISCLAIMER::

The contents of this e-mail and any attachment(s) are confidential and
intended for the named recipient(s) only. E-mail transmission is not
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or may contain
viruses in transmission. The e mail and its contents (with or without
referred errors) shall therefore not attach any liability on the originator
or HCL or its affiliates. Views or opinions, if any, presented in this
email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and / or
publication of this message without the prior written consent of authorized
representative of HCL is strictly prohibited. If you have received this
email in error please delete it and notify the sender immediately. Before
opening any email and/or attachments, please check them for viruses and
other defects.









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20200810/a97502ae/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20200810/a97502ae/attachment.gif>


More information about the openbmc mailing list