action #29637
closed[tools][kernel] test suddenly print login words -> script_output used wrong
100%
Description
Observation¶
openQA test in scenario sle-15-Installer-DVD-ppc64le-xfstests_run_for_btrfs@ppc64le fails in
xfstests_prepare_env
Reproducible¶
Seems like a random issue.
Expected result¶
Last good: Build [368.3]https://openqa.suse.de/tests/1293242
Don't suddenly print login words. Actually it's only stay several seconds before show this login words.
Further details¶
Always latest result in this scenario: latest
Updated by yosun about 7 years ago
Also happened in aarch test
https://openqa.suse.de/tests/1334743#
Updated by yosun about 7 years ago
- Related to action #30850: [sle][functional]test fails in execute_test_run -> script_output used wrong added
Updated by okurz about 7 years ago
- Related to deleted (action #30850: [sle][functional]test fails in execute_test_run -> script_output used wrong)
Updated by okurz about 7 years ago
- Has duplicate action #30850: [sle][functional]test fails in execute_test_run -> script_output used wrong added
Updated by okurz about 7 years ago
- Subject changed from [tools][kernel] test suddenly print login words to [tools][kernel] test suddenly print login words -> script_output used wrong
See #30613. If possible work with bash variables within the SUT, e.g. assert_script_run('test_log=$(ls /var/log/qa/ctcs2/); tar cjf /tmp/$test_log.tar.bz2 -C /var/log/qa/ctcs2 $test_log');
but as we need the logfile to upload later I could not find a complete solution now.
yosun wrote:
I think the line "eth0 xxxx" is a minor issue, the point I can't understand is why SUT alway randomly logout and print login information.
I can explain. The code currently is like this:
my $test_log = script_output("ls /var/log/qa/ctcs2/");
my $tarball = "/tmp/$test_log.tar.bz2";
assert_script_run("tar cjf /tmp/$test_log.tar.bz2 -C /var/log/qa/ctcs2 $test_log");
With the first line you "assume" you would get only the output of ls /var/log/qa/ctcs2/
but instead you get everything what is there at this time on the serial output, e.g. the whole "Welcome to SUSE Linux Enterprise …". And all this content is stored in the variable $test_log
which is then appended in the string "/tmp/$test_log…". Instead of writing just "/tmp/process_stress-2018-…" it writes instead the full content of the variable $test_log
at this point, e.g. "/tmp/Welcome to … … … process_stress-2018…". This is not what you want :)
A not-complete workaround would be to call my $dummy = wait_serial('', 0);
to catch all (useless) content on the serial device into a dummy variable before you execute the next step. But it can still happen that any process in the background is writing something on the serial output confusing your scripts. So you have the following possibilities:
- Rewrite the code to avoid
script_output
at all and rely only on bash variables within the SUT so no return of variables back to the worker - Cleanup whatever you get back from
script_output
before passing it back into a variable, e.g. how https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/btrfs_test.pm#L26 is doing it - Help to fix script_output in the backend: #30613
Updated by yosun about 7 years ago
What a nice explanation for my confuse part! :)
I didn't realize what is inside of $test_log, I'll think about solutions. Thank you for your patient.
Updated by okurz about 7 years ago
This is an autogenerated message for openQA integration by the openqa_review script:
This bug is still referenced in a failing openQA test: xfstests_run_for_btrfs@aarch64
https://openqa.suse.de/tests/1458725
Updated by sebchlad almost 7 years ago
- Priority changed from Normal to High
- Target version set to Milestone 15
Prio: +1
Updated by sebchlad almost 7 years ago
- Target version changed from Milestone 15 to 448
Updated by okurz almost 7 years ago
- Related to action #30613: [functional][y][hard] script_output might include extra serial output added
Updated by yosun almost 7 years ago
- % Done changed from 0 to 50
I pick the solution that not use script_output to assign parameters. e.g. my $para=script_output(foo). Find other API for workaround.
Fixed qa_test_* related test in following PR:
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/5076
TODO:
As xfstests change module recently, and it use another set of script which also contain lot of script_output. I'll give another PR for that.
Updated by yosun over 6 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
I made some workaround to replace as much as script_output code to other api in execute_test_run and xfstests run scirpt, but some script_output still can't replace by others api. I think I can close this issue for testcase part, and leave remains for tools team in poo#30613.