Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using root-ssh console with GENERAL_HW_SOL_CMD #14175

Merged
merged 1 commit into from Feb 8, 2022

Conversation

asdil12
Copy link
Member

@asdil12 asdil12 commented Feb 4, 2022

This is to allow using a real usb-uart serial adapter for hardware raspberry pi tests.

Previously root-ssh would only work with sshserial console
which is an ssh connection and a fifo file emulating a serial dev.

Now a root-ssh console can be used with an SOL or (USB-)Serial
connection.

The advantage here is that we get the complete boot log of the SUT.

Ticket: https://progress.opensuse.org/issues/105852
VR: http://10.163.27.222/tests/75

image

@asdil12 asdil12 requested a review from ggardet February 4, 2022 16:42
@asdil12 asdil12 added the WIP Work in progress label Feb 4, 2022
@ggardet
Copy link
Collaborator

ggardet commented Feb 7, 2022

I am not sure root-ssh is a good name if it is for a serial connection.
Also, I already used: GENERAL_HW_SOL_CMD = get_sol_over_SSH.sh and GENERAL_HW_SOL_CMD = get_sol_ttyUSB0.sh successfully in the past, so, I am not sure what problem you are trying to solve. Maybe it was used for some serial connection only?

@asdil12
Copy link
Member Author

asdil12 commented Feb 7, 2022

The issue I currently have is that the test fails if I set GENERAL_HW_SOL_CMD because then the root-ssh console is not created. But I want to use that console. The test modules are referring to it and it is also the only thing that makes sence.

Why I want to set GENERAL_HW_SOL_CMD at all? Because otherwise there would be no way to tell what happened if the system doesn't come up far enough to bring up network and listen on ssh.
I want the current root-ssh console but still have serial log. And the root-ssh console seems to work fine with a real serial console instead of sshserial as a return channel. I don't want to change the name as this would make the test modules much more complicated which would defeat the purpose. Also the root-ssh is still using ssh. Just not for the serial device (if GENERAL_HW_SOL_CMD is set).

Without this change if I set GENERAL_HW_SOL_CMD, the test would fail in prepare_firstboot at the select_console('root-ssh') with this error:

# Test died: Can't call method "select" on an undefined value at /usr/lib/os-autoinst/backend/baseclass.pm line 597, <$fh> line 50.
 at /usr/lib/os-autoinst/testapi.pm line 1762.
	testapi::select_console("root-ssh") called at sle/tests/jeos/prepare_firstboot.pm line 37
	prepare_firstboot::run(prepare_firstboot=HASH(0xaaab002b9120)) called at /usr/lib/os-autoinst/basetest.pm line 360
	eval {...} called at /usr/lib/os-autoinst/basetest.pm line 354
	basetest::runtest(prepare_firstboot=HASH(0xaaab002b9120)) called at /usr/lib/os-autoinst/autotest.pm line 372
	eval {...} called at /usr/lib/os-autoinst/autotest.pm line 372
	autotest::runalltests() called at /usr/lib/os-autoinst/autotest.pm line 242
	eval {...} called at /usr/lib/os-autoinst/autotest.pm line 242
	autotest::run_all() called at /usr/lib/os-autoinst/autotest.pm line 296
	autotest::__ANON__(Mojo::IOLoop::ReadWriteProcess=HASH(0xaaab0302e6c0)) called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 326
	eval {...} called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 326
	Mojo::IOLoop::ReadWriteProcess::_fork(Mojo::IOLoop::ReadWriteProcess=HASH(0xaaab0302e6c0), CODE(0xaaab021fe130)) called at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/IOLoop/ReadWriteProcess.pm line 488
	Mojo::IOLoop::ReadWriteProcess::start(Mojo::IOLoop::ReadWriteProcess=HASH(0xaaab0302e6c0)) called at /usr/lib/os-autoinst/autotest.pm line 298
	autotest::start_process() called at /usr/bin/isotovideo line 261

@asdil12 asdil12 removed the WIP Work in progress label Feb 7, 2022
@asdil12
Copy link
Member Author

asdil12 commented Feb 7, 2022

But I just realized that I can use root-ssh with the sshserial device and still set GENERAL_HW_SOL_CMD for the boot log.
I will update the PR after some testing.

@ggardet
Copy link
Collaborator

ggardet commented Feb 8, 2022

Could you update the commit message and PR accordingly with your latest push, please?

The presence of GENERAL_HW_SOL_CMD (for logging boot log to serial0.txt)
is not reason not to create the root-ssh console which has it's own
sshserial backchannel.

Also allow using any tty device and not just the hardcoded ttyUSB0.

Ticket: https://progress.opensuse.org/issues/105852
@asdil12
Copy link
Member Author

asdil12 commented Feb 8, 2022

done.

Config in workers.ini might look something like this:

GENERAL_HW_SOL_CMD = get_sol_dev.sh
GENERAL_HW_SOL_ARGS = serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.1:1.0-port0

Copy link
Collaborator

@ggardet ggardet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@asdil12 asdil12 merged commit c2fba99 into os-autoinst:master Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants