Skip to content

Commit

Permalink
Select serial console to get full CLI cmd output for debug
Browse files Browse the repository at this point in the history
Select serial console to get full CLI cmd output for debug for service check,
and update complicated script on SUT to simple perl script. The purpose is 'the
entire command line and the output to stdout and stderr should be made available
for debugging purposes'.
  • Loading branch information
lemon-suse committed May 24, 2022
1 parent 23a5435 commit 391b053
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/service_check.pm
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Check service before migration, zypper install service package, enable, start an
=cut
sub install_services {
my ($service) = @_;
opensusebasetest::select_serial_terminal() if (get_var('SEL_SERIAL_CONSOLE'));
# turn off lmod shell debug information
assert_script_run('echo export LMOD_SH_DBG_ON=1 >> /etc/bash.bashrc.local');
# turn off screen saver
Expand Down
3 changes: 2 additions & 1 deletion lib/services/hpcpackage_remain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ sub install_pkg {
my $version = get_var('HDDVERSION');
# Install all 'library wrappers' (packages matching -hpc, not having a version number with '_' after their name)
record_soft_failure('bsc#1194917', "openQA test fails : nothing provides 'gcc9' needed by the to be installed gnu9-compilers-hpc-devel-1.4-3.14.3.noarch");
my @pkginstall = split('\n', script_output q[zypper search -r SLE-Module-HPC] . $version . q[-Pool -r SLE-Module-HPC] . $version . q[-Updates | cut -d '|' -f 2 | sed -e 's/ *//g' | grep -E '.*-hpc.*' | grep -vE 'system|module|suse' | grep -vE 'gnu9|gnu10|gnu11' | grep -vE '.*_[[:digit:]]+_[[:digit:]]+.*gnu|.*_[[:digit:]]+_[[:digit:]]+.*-hpc' | grep -vE '.*-static$' | grep -vE '.*hpc-macros.*'], proceed_on_failure => 1, timeout => 180);
my $module_list_p = script_output q[zypper search -r SLE-Module-HPC] . $version . q[-Pool -r SLE-Module-HPC] . $version . q[-Updates | cut -d '|' -f 2 | sed -e 's/ *//g' | grep -E '.*-hpc.*' | grep -vE 'system|module|suse' | grep -vE 'gnu9|gnu10|gnu11' | grep -vE '.*_[[:digit:]]+_[[:digit:]]+.*gnu|.*_[[:digit:]]+_[[:digit:]]+.*-hpc' | grep -vE '.*-static$' | grep -vE '.*hpc-macros.*'], proceed_on_failure => 1, timeout => 180;
my @pkginstall = split('\n', $module_list_p);
# on x86 zypper will print out the Shell debug information, we need exclude it.
@pkginstall = grep { !/LMOD_SH_DBG_ON/ } @pkginstall;
zypper_call("in " . join(' ', @pkginstall), timeout => 1800);
Expand Down
7 changes: 6 additions & 1 deletion tests/installation/install_service.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ use main_common 'is_desktop';

sub run {

select_console 'root-console';
if (get_var('SEL_SERIAL_CONSOLE')) {
opensusebasetest::select_serial_terminal();
}
else {
select_console 'root-console';
}

install_services($default_services)
if is_sle
Expand Down

0 comments on commit 391b053

Please sign in to comment.