Project

General

Profile

Actions

action #17622

closed

Unwanted login prompt occurence in script_output() output

Added by thehejik about 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Support
Target version:
-
Start date:
2017-03-09
Due date:
% Done:

0%

Estimated time:

Description

By testing CaaSP we have very often problems with unwanted login prompt occurrence in a serial output (VIRTIO_CONSOLE not used).
Problem is when we are using a variable filled by script_output() function and then we parse the output of the script/command (stored in variable) for eg. by a regexp or xpath.

You can see the issue for example at:
https://openqa.suse.de/tests/806271#step/create_autoyast/6
https://openqa.suse.de/tests/790734#step/journal_check/8

Example of the borken serial output:

# wait_serial expected: 'SCRIPT_FINISHEDv0ljj-\\d+-'
# Result:

Welcome to SUSE Container as a Service Platform 1.0 Alpha2 (x86_64) - Kernel 4.4.47-1-default (ttyS0).    
SSH host key: SHA256:WBi4YrbTzezxp05B4ibLDA0zpZOSGijoqyLCo7yh8N8 
SSH host key: SHA256:sf4tcMJKKe+O+NqjAR6PI7QbKEW2FC0Hv1NUj7MnFzw 
SSH host key: SHA256:rnkrqIo9z2uoITEyWVJkWQWqtKbjyzQQebg0c0Pgg7g 
SSH host key: SHA256:FeJnlhhj2qTIiOUA74UlGv0y/bJaj0QKUh5FXTJz97A 
eth0: 10.0.2.15 fec0::d444:d784:1972:eff5

linux-m0wl login: Feb 28 10:23:40 linux-m0wl wickedd[1038]: ni_process_reap: process 1503 has not exited yet; now doing a blocking waitpid()

SCRIPT_FINISHEDv0ljj-0-

But the correct output should be just:

# wait_serial expected: 'SCRIPT_FINISHEDv0ljj-\\d+-'
# Result:

Feb 28 10:23:40 linux-m0wl wickedd[1038]: ni_process_reap: process 1503 has not exited yet; now doing a blocking waitpid()

SCRIPT_FINISHEDv0ljj-0-

Possible workaround for eg. first-login.pm "systemctl stop serial-getty@ttyS0.service" (didn't test it yet)

Actions #1

Updated by okurz about 7 years ago

  • Category changed from 132 to Support
  • Status changed from New to In Progress
  • Assignee set to okurz

I see possible reasons for this to fail and therefore potential points for improvement

  • product bug for console messages to appear on serial terminal when the system was not configured to do this
  • the system is configured to write messages on the first serial dev
  • regex of script_output output check is too fragile

just see my recently merged test contribution https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/2520 which is about the same problem: The output of script_output was checked with $foo eq $bar which is unsafe because the output grabbed from serial port can very well have more content than just the expected string.

That is also the reason why script_run and derived methods use the "unique" string to check if this patterns appears anywhere between all other output on the serial port.

There is the other possibility to separate the terminals, one for system log output, the other one for the api calls. virtio_console is going in that direction, too.

Solved?

Actions #2

Updated by thehejik about 7 years ago

okurz wrote:

I see possible reasons for this to fail and therefore potential points for improvement

  • product bug for console messages to appear on serial terminal when the system was not configured to do this
  • the system is configured to write messages on the first serial dev
  • regex of script_output output check is too fragile

just see my recently merged test contribution https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/2520 which is about the same problem: The output of script_output was checked with $foo eq $bar which is unsafe because the output grabbed from serial port can very well have more content than just the expected string.

That is also the reason why script_run and derived methods use the "unique" string to check if this patterns appears anywhere between all other output on the serial port.

There is the other possibility to separate the terminals, one for system log output, the other one for the api calls. virtio_console is going in that direction, too.

Solved?

Thanks, I'll let know here in case of new occurrence.

Actions #3

Updated by okurz about 7 years ago

  • Status changed from In Progress to Resolved
Actions #4

Updated by thehejik about 7 years ago

  • Status changed from Resolved to Feedback

Unfortunately the problem still present https://openqa.suse.de/tests/819361#step/create_autoyast/6 (3 days ago)

Is the new version of os-autoinst deployed on o.s.d?

Actions #5

Updated by okurz about 7 years ago

  • Status changed from Feedback to Resolved

new version of os-autoinst was deployed, https://openqa.suse.de/tests/839223 shows pass

Actions

Also available in: Atom PDF