Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package os-autoinst for openSUSE:Factory checked in at 2026-05-27 16:15:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/os-autoinst (Old) and /work/SRC/openSUSE:Factory/.os-autoinst.new.1937 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-autoinst" Wed May 27 16:15:27 2026 rev:597 rq:1355234 version:5.1779461317.d4fb5bd Changes: -------- --- /work/SRC/openSUSE:Factory/os-autoinst/os-autoinst.changes 2026-05-09 13:00:24.934568694 +0200 +++ /work/SRC/openSUSE:Factory/.os-autoinst.new.1937/os-autoinst.changes 2026-05-27 16:16:41.524248275 +0200 @@ -1,0 +2,12 @@ +Fri May 22 14:48:46 UTC 2026 - [email protected] + +- Update to version 5.1779461317.d4fb5bd: + * refactor: Use Feature::Compat::Try consistently + * perf: use sourcing for efficient pretty serial marker activation + * fix: Fix condition for devel/deps packages + * fix: Fix condition for Lua support + * ci: Build packages for SLE 15 SP7 instead of SP6 which reached EOL + * ci: Remove package builds for Leap 15.6 as it reached EOL + * feat: use efficient OA_NO_MARKER skip flag for pretty serial markers + +------------------------------------------------------------------- Old: ---- os-autoinst-5.1778246511.7a6bac3.obscpio New: ---- os-autoinst-5.1779461317.d4fb5bd.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ os-autoinst-devel-test.spec ++++++ --- /var/tmp/diff_new_pack.wdq1w9/_old 2026-05-27 16:16:44.056352474 +0200 +++ /var/tmp/diff_new_pack.wdq1w9/_new 2026-05-27 16:16:44.060352638 +0200 @@ -18,7 +18,7 @@ %define short_name os-autoinst-devel Name: %{short_name}-test -Version: 5.1778246511.7a6bac3 +Version: 5.1779461317.d4fb5bd Release: 0 Summary: Test package for %{short_name} License: GPL-2.0-or-later ++++++ os-autoinst-openvswitch-test.spec ++++++ --- /var/tmp/diff_new_pack.wdq1w9/_old 2026-05-27 16:16:44.100354285 +0200 +++ /var/tmp/diff_new_pack.wdq1w9/_new 2026-05-27 16:16:44.100354285 +0200 @@ -19,7 +19,7 @@ %define name_ext -test %define short_name os-autoinst-openvswitch Name: %{short_name}%{?name_ext} -Version: 5.1778246511.7a6bac3 +Version: 5.1779461317.d4fb5bd Release: 0 Summary: test package for %{short_name} License: GPL-2.0-or-later ++++++ os-autoinst-test.spec ++++++ --- /var/tmp/diff_new_pack.wdq1w9/_old 2026-05-27 16:16:44.128355437 +0200 +++ /var/tmp/diff_new_pack.wdq1w9/_new 2026-05-27 16:16:44.132355601 +0200 @@ -19,7 +19,7 @@ %define name_ext -test %define short_name os-autoinst Name: %{short_name}%{?name_ext} -Version: 5.1778246511.7a6bac3 +Version: 5.1779461317.d4fb5bd Release: 0 Summary: test package for os-autoinst License: GPL-2.0-or-later ++++++ os-autoinst.spec ++++++ --- /var/tmp/diff_new_pack.wdq1w9/_old 2026-05-27 16:16:44.164356918 +0200 +++ /var/tmp/diff_new_pack.wdq1w9/_new 2026-05-27 16:16:44.164356918 +0200 @@ -17,7 +17,7 @@ Name: os-autoinst -Version: 5.1778246511.7a6bac3 +Version: 5.1779461317.d4fb5bd Release: 0 Summary: OS-level test automation License: GPL-2.0-or-later @@ -27,12 +27,12 @@ %{perl_requires} %define opencv_require pkgconfig(opencv4) # exclude additional sub packages that would pull in a lot of extra dependencies on SLE -%if 0%{?suse_version} && !0%{?is_opensuse} -%bcond_with devel_package -%bcond_with deps_package -%else +%if 0%{?is_opensuse} && 0%{?suse_version} >= 1600 %bcond_without devel_package %bcond_without deps_package +%else +%bcond_with devel_package +%bcond_with deps_package %endif # The following line is generated from dependencies.yaml %define build_base_requires %opencv_require gcc-c++ perl(Pod::Html) pkg-config pkgconfig(fftw3) pkgconfig(libpng) pkgconfig(sndfile) pkgconfig(theoraenc) @@ -73,7 +73,7 @@ %else %bcond_with python_support %endif -%if 0%{?is_opensuse} && (0%{?suse_version} >= 1600 || 0%{?sle_version} >= 150600) +%if 0%{?is_opensuse} && 0%{?suse_version} >= 1600 %bcond_without lua_support %else %bcond_with lua_support @@ -268,6 +268,8 @@ # https://progress.opensuse.org/issues/194359 # https://progress.opensuse.org/issues/199940 rm -f t/28-signalblocker.t +# https://progress.opensuse.org/issues/200949 +rm -f t/26-video_stream.t %endif %build ++++++ os-autoinst-5.1778246511.7a6bac3.obscpio -> os-autoinst-5.1779461317.d4fb5bd.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/.github/workflows/openqa_fullstack.yml new/os-autoinst-5.1779461317.d4fb5bd/.github/workflows/openqa_fullstack.yml --- old/os-autoinst-5.1778246511.7a6bac3/.github/workflows/openqa_fullstack.yml 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/.github/workflows/openqa_fullstack.yml 2026-05-22 16:48:37.000000000 +0200 @@ -12,9 +12,7 @@ env: # Set to 1 to temporarily ignore warnings PERL_TEST_WARNINGS_ONLY_REPORT_WARNINGS: 0 - # Default user in the used container image from - # https://github.com/os-autoinst/openQA/blob/master/container/devel%3AopenQA%3Aci/base/Dockerfile - NORMAL_USER: squamata + TEST_USER: testuser jobs: fullstack: @@ -22,22 +20,20 @@ contents: read runs-on: ubuntu-latest container: - image: registry.opensuse.org/devel/openqa/ci/containers/base:latest - # See https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user - options: --user root + image: registry.opensuse.org/devel/openqa/containers/opensuse/openqa_devel:latest steps: - uses: actions/checkout@v6 + - name: Create additional user to avoid initdb error "cannot be run as root" + run: useradd "$TEST_USER" - name: Make project folder user-writable - run: chown -R $NORMAL_USER ../../os-autoinst + run: chown -R $TEST_USER ../../os-autoinst - name: Clone openQA - run: >- - sudo -u $NORMAL_USER - git clone --depth 1 https://github.com/os-autoinst/openQA.git ../openQA - - name: Install dependencies - run: (cd ../openQA; bash -x tools/ci/build_cache.sh; sudo npm install) + run: sudo -u "$TEST_USER" git clone --depth 1 https://github.com/os-autoinst/openQA.git ../openQA + - name: Install node modules + run: sudo -u "$TEST_USER" make -C ../openQA node_modules - name: Build os-autoinst - run: sudo -u $NORMAL_USER make symlinks + run: sudo -u "$TEST_USER" make symlinks - name: Run unit tests - run: sudo -u $NORMAL_USER make -C ../openQA test-fullstack + run: sudo -u "$TEST_USER" make -C ../openQA test-fullstack env: STABILITY_TEST: ${{ github.event.inputs.stability_test }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/.obs/workflows.yml new/os-autoinst-5.1779461317.d4fb5bd/.obs/workflows.yml --- old/os-autoinst-5.1778246511.7a6bac3/.obs/workflows.yml 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/.obs/workflows.yml 2026-05-22 16:48:37.000000000 +0200 @@ -9,9 +9,9 @@ - configure_repositories: project: devel:openQA:GitHub repositories: - - name: SLE_15_SP6_Backports + - name: SLE_15_SP7_Backports paths: - - target_project: openSUSE:Backports:SLE-15-SP6:Update + - target_project: openSUSE:Backports:SLE-15-SP7:Update target_repository: standard architectures: - x86_64 @@ -20,11 +20,6 @@ - target_project: openSUSE:Factory target_repository: snapshot architectures: [ x86_64 ] - - name: openSUSE_Leap_15.6 - paths: - - target_project: devel:openQA:Leap:15.6 - target_repository: openSUSE_Leap_15.6 - architectures: [ x86_64 ] - name: '16.0' paths: - target_project: devel:openQA:Leap:16.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/basetest.pm new/os-autoinst-5.1779461317.d4fb5bd/basetest.pm --- old/os-autoinst-5.1778246511.7a6bac3/basetest.pm 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/basetest.pm 2026-05-22 16:48:37.000000000 +0200 @@ -437,7 +437,7 @@ # take screenshot for documentation (screenshot does not represent fail itself) $self->take_screenshot() unless (testapi::is_serial_terminal); - my $pretty = testapi::get_var('PRETTY_SERIAL_MARKER') || testapi::get_var('HIDE_MARKER_EVALUATION'); + my $pretty = $testapi::distri ? $testapi::distri->get_pretty_serial_marker() : (testapi::get_var('PRETTY_SERIAL_MARKER') || testapi::get_var('HIDE_MARKER_EVALUATION')); my $internal = $args{internal_marker}; my $output_string = $string; my $captured_val; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/commands.pm new/os-autoinst-5.1779461317.d4fb5bd/commands.pm --- old/os-autoinst-5.1778246511.7a6bac3/commands.pm 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/commands.pm 2026-05-22 16:48:37.000000000 +0200 @@ -282,7 +282,7 @@ app->log->info("cmdsrv: daemon reachable under http://*:$port/$bmwqemu::vars{JOBTOKEN}/"); try { $daemon->run } catch ($e) { - print "cmdsrv: failed to run daemon $e\n"; # uncoverable statement + print "cmdsrv: failed to run daemon on port $port: $e\n"; # uncoverable statement _exit(1); # uncoverable statement } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/dist/rpm/os-autoinst.spec new/os-autoinst-5.1779461317.d4fb5bd/dist/rpm/os-autoinst.spec --- old/os-autoinst-5.1778246511.7a6bac3/dist/rpm/os-autoinst.spec 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/dist/rpm/os-autoinst.spec 2026-05-22 16:48:37.000000000 +0200 @@ -27,12 +27,12 @@ %{perl_requires} %define opencv_require pkgconfig(opencv4) # exclude additional sub packages that would pull in a lot of extra dependencies on SLE -%if 0%{?suse_version} && !0%{?is_opensuse} -%bcond_with devel_package -%bcond_with deps_package -%else +%if 0%{?is_opensuse} && 0%{?suse_version} >= 1600 %bcond_without devel_package %bcond_without deps_package +%else +%bcond_with devel_package +%bcond_with deps_package %endif # The following line is generated from dependencies.yaml %define build_base_requires %opencv_require gcc-c++ perl(Pod::Html) pkg-config pkgconfig(fftw3) pkgconfig(libpng) pkgconfig(sndfile) pkgconfig(theoraenc) @@ -73,7 +73,7 @@ %else %bcond_with python_support %endif -%if 0%{?is_opensuse} && (0%{?suse_version} >= 1600 || 0%{?sle_version} >= 150600) +%if 0%{?is_opensuse} && 0%{?suse_version} >= 1600 %bcond_without lua_support %else %bcond_with lua_support @@ -268,6 +268,8 @@ # https://progress.opensuse.org/issues/194359 # https://progress.opensuse.org/issues/199940 rm -f t/28-signalblocker.t +# https://progress.opensuse.org/issues/200949 +rm -f t/26-video_stream.t %endif %build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/distribution.pm new/os-autoinst-5.1779461317.d4fb5bd/distribution.pm --- old/os-autoinst-5.1778246511.7a6bac3/distribution.pm 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/distribution.pm 2026-05-22 16:48:37.000000000 +0200 @@ -4,6 +4,7 @@ package distribution; use Mojo::Base -strict, -signatures; +use Mojo::Util 'scope_guard'; use testapi (); use log 'fctwarn'; @@ -16,6 +17,8 @@ $self->{autoinst_failures} = []; $self->{_serial_marker_level} = {}; $self->{_serial_marker_hook_installed} = {}; + $self->{_serial_marker_hook_persistent} = {}; + $self->{_pretty_serial_marker} = undef; =head2 serial_term_prompt @@ -153,6 +156,14 @@ if $cmd =~ qr/(?<!\\)&$/; my $level = $self->_detect_serial_marker_capability(); + my $skip_pretty = 0; + # Automatically protect against manual serial redirections corrupting pretty markers + if ($level > 1 && $cmd =~ m{(?:>|>>|\btee)\s+(?:-a\s+)?/dev/\Q$testapi::serialdev\E\b}) { + bmwqemu::diag('Temporarily disabling PRETTY_SERIAL_MARKER to prevent corruption with serial terminal redirection'); + bmwqemu::diag("Manual redirection to /dev/$testapi::serialdev is deprecated and might conflict with advanced serial markers. Use script_output() or use script_run() without the quiet parameter instead."); + $level = 1; + $skip_pretty = 1; + } my ($str, $wait_pattern); if ($level == 3) { testapi::query_isotovideo('backend_clear_serial_buffer', {}); @@ -168,15 +179,16 @@ } else { my $marker = "; echo $str-\$?-" . ($args{output} ? "Comment: $args{output}" : ''); + my $final_cmd = $skip_pretty ? "OA_NO_MARKER=1; $cmd" : $cmd; if (testapi::is_serial_terminal) { - testapi::type_string "$cmd", max_interval => $args{max_interval}; + testapi::type_string "$final_cmd", max_interval => $args{max_interval}; testapi::type_string $marker, max_interval => $args{max_interval}; - testapi::wait_serial($cmd . $marker, no_regex => 1, quiet => $args{quiet}, buffer_size => (length $cmd) + 128, internal_marker => 1) - or _handle_cmd_typing_error($cmd, \%args); + testapi::wait_serial($final_cmd . $marker, no_regex => 1, quiet => $args{quiet}, buffer_size => (length $final_cmd) + 128, internal_marker => 1) + or _handle_cmd_typing_error($final_cmd, \%args); testapi::type_string "\n", max_interval => $args{max_interval}; } else { - testapi::type_string "$cmd", max_interval => $args{max_interval}; + testapi::type_string "$final_cmd", max_interval => $args{max_interval}; testapi::type_string "$marker > /dev/$testapi::serialdev\n", max_interval => $args{max_interval}; } } @@ -438,21 +450,25 @@ sub install_serial_marker_hook ($self, $level) { return if $level < 2; - my $pc; my $dev = "/dev/$testapi::serialdev"; + my $func; if ($level == 3) { - $pc = "PROMPT_COMMAND='ret=\$?; cmd=\$(fc -ln -1 2>/dev/null); printf \"OA:DONE-%04x-%d-%s\\nOA:START\\n\" \$RANDOM \$ret \"\${cmd#\${cmd%%[![:space:]]*}}\" > $dev'"; + $func = qq{__oa_prompt() { r=\$?; if [ -n "\$OA_NO_MARKER" ]; then unset OA_NO_MARKER; else c=\$(fc -ln -1 2>/dev/null); printf "OA:DONE-%04x-%d-%s\\nOA:START\\n" \$RANDOM \$r "\${c#\${c%%[![:space:]]*}}" > $dev; fi; }}; } else { - $pc = "PROMPT_COMMAND='if [ -n \"\$__OA_MARK\" ]; then echo \"\${__OA_MARK}-\$?-\" > $dev; unset __OA_MARK; fi; echo \"OA:START\" > $dev'"; + $func = qq{__oa_prompt() { r=\$?; if [ -n "\$OA_NO_MARKER" ]; then unset OA_NO_MARKER; elif [ -n "\$__OA_MARK" ]; then echo "\${__OA_MARK}-\$r-" > $dev; unset __OA_MARK; fi; echo "OA:START" > $dev; }}; } - testapi::type_string "$pc\n"; - my $marker_match = 'OA:START'; - my $hook_cmd = "for f in ~/.bashrc ~/.profile; do grep -q '$marker_match' \"\$f\" 2>/dev/null || cat <<'EOF' >> \"\$f\"\n$pc\nEOF\ndone\n"; - testapi::type_string $hook_cmd; + my $pc = 'PROMPT_COMMAND=__oa_prompt'; + + # Consolidate installation and persistence into a single typed line to minimize VNC overhead. + # We append to both ~/.bashrc and ~/.profile to cover both interactive and login shells. + # Sourcing ~/.bashrc then activates the hook in the current session. + testapi::type_string "grep -q __oa_prompt ~/.bashrc 2>/dev/null || { echo '$func; $pc' | tee -a ~/.bashrc ~/.profile >/dev/null; }; . ~/.bashrc\n"; + my $console = testapi::current_console(); return undef unless defined $console; $self->{_serial_marker_hook_installed}->{$console} = 1; + $self->{_serial_marker_hook_persistent}->{$console} = 1; } =head2 reset_serial_marker @@ -496,6 +512,65 @@ delete $self->{_serial_marker_hook_installed}->{$console}; } +=head2 get_pretty_serial_marker + + get_pretty_serial_marker() + +Return the current C<PRETTY_SERIAL_MARKER> state. Falls back to the test variable. + +=cut + +sub get_pretty_serial_marker ($self) { + return $self->{_pretty_serial_marker} // testapi::get_var('PRETTY_SERIAL_MARKER'); +} + +=head2 set_pretty_serial_marker + + set_pretty_serial_marker($value) + +Set C<PRETTY_SERIAL_MARKER> to C<$value> and reset the cached marker state. + +=cut + +sub set_pretty_serial_marker ($self, $value) { + my $old_value = $self->get_pretty_serial_marker(); + return if defined $old_value && $old_value eq $value; + + bmwqemu::log_call(value => $value); + $self->{_pretty_serial_marker} = $value; + + # If we are turning it OFF, we MUST tell the SUT to stop sending markers + # to avoid polluting the fallback mode. + testapi::type_string "unset PROMPT_COMMAND\n" if !$value; + + $self->reset_serial_marker(); +} + +=head2 pretty_serial_marker_guard + + pretty_serial_marker_guard($value) + +Return a RAII guard to temporarily set C<PRETTY_SERIAL_MARKER> to C<$value>. +Restores the original value when the guard goes out of scope. + +Example: + sub run ($self) { + # Disable pretty markers for this module + $self->{marker_guard} = $testapi::distri->pretty_serial_marker_guard(0); + ... + } + +=cut + +sub pretty_serial_marker_guard ($self, $value) { + my $old_value = $self->get_pretty_serial_marker(); + $self->set_pretty_serial_marker($value); + + return scope_guard(sub { + $self->set_pretty_serial_marker($old_value); + }); +} + =head2 _detect_serial_marker_capability _detect_serial_marker_capability() @@ -519,7 +594,7 @@ } my $level = 1; - my $pretty = testapi::get_var('PRETTY_SERIAL_MARKER'); + my $pretty = $self->get_pretty_serial_marker(); my $serial_term = testapi::is_serial_terminal(); return $self->{_serial_marker_level}->{$console} = $level if !$pretty || $serial_term; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/ppmclibs/tinycv_ast2100.cc new/os-autoinst-5.1779461317.d4fb5bd/ppmclibs/tinycv_ast2100.cc --- old/os-autoinst-5.1778246511.7a6bac3/ppmclibs/tinycv_ast2100.cc 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/ppmclibs/tinycv_ast2100.cc 2026-05-22 16:48:37.000000000 +0200 @@ -294,7 +294,7 @@ 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; -static void idctqtab(unsigned char* qin, PREC* qout, double scale) +static void idctqtab(unsigned char* qin, PREC* qout, float scale) { int i, j; @@ -354,9 +354,9 @@ dec_makehuff(&hu_dc_uv, hufftbl_dc_uv); dec_makehuff(&hu_ac_uv, hufftbl_ac_uv); - idctqtab(quant_y, qt[0], 1.); - idctqtab(quant_uv, qt[1], 1.); - idctqtab(quant_uv, qt[2], 1.); + idctqtab(quant_y, qt[0], 1.f); + idctqtab(quant_uv, qt[1], 1.f); + idctqtab(quant_uv, qt[2], 1.f); int subsamp = data[2] << 8 | data[3]; if (subsamp != 444 || data[0] != 11 || data[1] != 11) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/script/os-autoinst-testmodules-strict new/os-autoinst-5.1779461317.d4fb5bd/script/os-autoinst-testmodules-strict --- old/os-autoinst-5.1778246511.7a6bac3/script/os-autoinst-testmodules-strict 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/script/os-autoinst-testmodules-strict 2026-05-22 16:48:37.000000000 +0200 @@ -53,7 +53,7 @@ use List::Util qw(max); use Mojo::File qw(path); use PPI; -use Syntax::Keyword::Try; +use Feature::Compat::Try; sub usage ($r) { require Pod::Usage; Pod::Usage::pod2usage($r) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/t/03-testapi.t new/os-autoinst-5.1779461317.d4fb5bd/t/03-testapi.t --- old/os-autoinst-5.1778246511.7a6bac3/t/03-testapi.t 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/t/03-testapi.t 2026-05-22 16:48:37.000000000 +0200 @@ -26,6 +26,8 @@ require bmwqemu; require tinycv; +$bmwqemu::vars{WORKER_HOSTNAME} = 'localhost'; + ok(looks_like_number($OpenQA::Isotovideo::Interface::version), 'isotovideo version set (variable is considered part of test API)'); my $cmds; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/t/05-distribution.t new/os-autoinst-5.1779461317.d4fb5bd/t/05-distribution.t --- old/os-autoinst-5.1778246511.7a6bac3/t/05-distribution.t 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/t/05-distribution.t 2026-05-22 16:48:37.000000000 +0200 @@ -148,7 +148,7 @@ $d->invalidate_serial_marker_hook('test-console'); is $d->_detect_serial_marker_capability(), 2, 'Returns cached level 2'; - like $typed, qr/PROMPT_COMMAND=/, 'Calls install_serial_marker_hook (types PROMPT_COMMAND)'; + like $typed, qr/grep -q __oa_prompt.*\. ~\/\.bashrc/, 'Calls install_serial_marker_hook (types consolidated setup with sourcing)'; ok $d->{_serial_marker_hook_installed}->{'test-console'}, 'Hook marked as installed'; }; @@ -175,8 +175,7 @@ }); $d->script_run('foo'); - like $typed_string, qr/PROMPT_COMMAND=.*OA:DONE/, 'Initial install'; - like $typed_string, qr/\.bashrc/, 'Persistence added'; + like $typed_string, qr/grep -q __oa_prompt.*__oa_prompt\(\).*OA:DONE.*\. ~\/\.bashrc/s, 'Initial install'; $typed_string = ''; # Simulate console selection (e.g. after reboot/login) @@ -192,7 +191,7 @@ $d->reset_serial_marker('test-console'); $typed_string = ''; $d->script_run('baz'); - like $typed_string, qr/PROMPT_COMMAND=.*OA:DONE/, 'Re-detect and re-install after resetting the serial marker'; + like $typed_string, qr/grep -q __oa_prompt.*__oa_prompt\(\).*OA:DONE.*\. ~\/\.bashrc/s, 'Re-detect and re-install after resetting the serial marker'; like $typed_string, qr/baz\n/, 'Command typed after re-installation'; # Case 3: select_console triggers reset @@ -208,48 +207,30 @@ subtest 'sut_marker' => sub { my $d = distribution->new; - is $d->sut_marker('ls -la /tmp'), 'OA:ls -11/tmp', 'sut_marker for normal command'; - is $d->sut_marker(' ls '), 'OA:ls2ls', 'sut_marker trims and handles short command'; - is $d->sut_marker('a'), 'OA:a1a', 'sut_marker for very short command'; + my @test_cases = ( + {cmd => 'ls -la /tmp', expected => 'OA:ls -11/tmp', msg => 'normal command'}, + {cmd => ' ls ', expected => 'OA:ls2ls', msg => 'trims and handles short command'}, + {cmd => 'a', expected => 'OA:a1a', msg => 'very short command'}, + ); + for my $case (@test_cases) { + is $d->sut_marker($case->{cmd}), $case->{expected}, "sut_marker: $case->{msg}"; + } }; subtest 'set expected serial and autoinst failures' => sub { my $d = distribution->new; - # Define the expected failures data my @failures = ( {type => 'Soft', message => '%s Failure Message 1', pattern => 'Test Pattern1'}, {type => 'Hard', message => '%s Failure Message 2', pattern => 'Test Pattern2'}, ); - # Subroutine to generate failure data with formatted messages - my sub _generate_failures ($type, %details) { - return [ - map { - { - message => sprintf($details{message}, $type), - pattern => qr/$details{pattern}/ - } - } @failures - ]; + + for my $f (@failures) { + my $expected = [{message => sprintf($f->{message}, $f->{type}), pattern => qr/$f->{pattern}/}]; + $d->set_expected_serial_failures($expected); + is_deeply $d->{serial_failures}, $expected, "set_expected_serial_failures: $f->{type}"; + $d->set_expected_autoinst_failures($expected); + is_deeply $d->{autoinst_failures}, $expected, "set_expected_autoinst_failures: $f->{type}"; } - my %soft_failure = ( - message => "$failures[0]->{message}", - pattern => "$failures[0]->{pattern}" - ); - # Set and test Soft failures - $d->set_expected_serial_failures(_generate_failures('Soft', %soft_failure)); - is_deeply($d->{serial_failures}, _generate_failures('Soft', %soft_failure), 'Expected Soft serial_failures matched'); - $d->set_expected_autoinst_failures(_generate_failures('Soft', %soft_failure)); - is_deeply($d->{autoinst_failures}, _generate_failures('Soft', %soft_failure), 'Expected Soft autoinst_failures matched'); - - my %hard_failure = ( - message => "$failures[1]->{message}", - pattern => "$failures[1]->{pattern}" - ); - # Set and test Hard failures - $d->set_expected_serial_failures(_generate_failures('Hard', %hard_failure)); - is_deeply($d->{serial_failures}, _generate_failures('Hard', %hard_failure), 'Expected Hard serial_failures matched'); - $d->set_expected_autoinst_failures(_generate_failures('Hard', %hard_failure)); - is_deeply($d->{autoinst_failures}, _generate_failures('Hard', %hard_failure), 'Expected Hard autoinst_failures matched'); }; subtest 'disable_key_repeat' => sub { @@ -261,6 +242,130 @@ like "@called", qr/kbdrate/, 'disable_key_repeat calls kbdrate'; }; +subtest 'pretty_serial_marker_helpers' => sub { + my $d = distribution->new; + my $mock_testapi = Test::MockModule->new('testapi'); + my $mock_bmwqemu = Test::MockModule->new('bmwqemu'); + my %vars; + $mock_testapi->redefine(get_var => sub { $vars{$_[0]} }); + $mock_testapi->redefine(set_var => sub { $vars{$_[0]} = $_[1] }); + $mock_testapi->redefine(current_console => sub { 'test-console' }); + my $typed = ''; + $mock_testapi->redefine(type_string => sub { $typed .= $_[0] }); + my $log_called = 0; + $mock_bmwqemu->redefine(log_call => sub { $log_called++ }); + + # set_pretty_serial_marker + $d->{_serial_marker_level}->{'test-console'} = 3; + $vars{PRETTY_SERIAL_MARKER} = 1; + $d->set_pretty_serial_marker(1); + is $d->get_pretty_serial_marker(), 1, 'get_pretty_serial_marker returns 1'; + is $vars{PRETTY_SERIAL_MARKER}, 1, 'PRETTY_SERIAL_MARKER var still 1'; + is $log_called, 0, 'no log_call if state matches fallback'; + + $d->set_pretty_serial_marker(0); + is $d->get_pretty_serial_marker(), 0, 'get_pretty_serial_marker returns 0 after override'; + is $vars{PRETTY_SERIAL_MARKER}, 1, 'PRETTY_SERIAL_MARKER var UNCHANGED (no pollution)'; + is $log_called, 1, 'log_call invoked when state changes'; + ok !exists $d->{_serial_marker_level}->{'test-console'}, 'marker level reset'; + $log_called = 0; + + $d->set_pretty_serial_marker(0); + is $log_called, 0, 'no-op if value is the same'; + + $typed = ''; + $d->{_pretty_serial_marker} = 1; # Force state change for test + $d->set_pretty_serial_marker(0); + like $typed, qr/unset PROMPT_COMMAND/, 'unset PROMPT_COMMAND typed when turning off'; + + # pretty_serial_marker_guard + $vars{PRETTY_SERIAL_MARKER} = 1; + $d->{_pretty_serial_marker} = undef; + { + my $guard = $d->pretty_serial_marker_guard(0); + is $d->get_pretty_serial_marker(), 0, 'Value changed by guard'; + is $vars{PRETTY_SERIAL_MARKER}, 1, 'Global var remains unchanged'; + } + is $d->get_pretty_serial_marker(), 1, 'Value restored after guard scope'; +}; + +subtest 'serial_marker_hook_persistence' => sub { + my $d = distribution->new; + my $mock_testapi = Test::MockModule->new('testapi'); + $mock_testapi->redefine(current_console => sub { 'test-console' }); + my $typed = ''; + $mock_testapi->redefine(type_string => sub { $typed .= $_[0] }); + + # First install + $d->install_serial_marker_hook(3); + like $typed, qr/grep -q __oa_prompt.*\. ~\/\.bashrc/, 'Types consolidated setup with persistence and sourcing'; + ok $d->{_serial_marker_hook_persistent}->{'test-console'}, 'Persistence marked'; + + # Invalidate hook but keep persistence + $d->invalidate_serial_marker_hook('test-console'); + $typed = ''; + $d->install_serial_marker_hook(3); + like $typed, qr/\. ~\/\.bashrc/, 'Types setup again (with sourcing) when invalidated'; +}; + +subtest 'serial_terminal_redirection_guard' => sub { + my $d = distribution->new; + my $mock_testapi = Test::MockModule->new('testapi'); + my $mock_bmwqemu = Test::MockModule->new('bmwqemu'); + my %vars = (PRETTY_SERIAL_MARKER => 1); + $mock_testapi->redefine(get_var => sub { $vars{$_[0]} }); + $mock_testapi->redefine(set_var => sub { $vars{$_[0]} = $_[1] }); + $mock_testapi->redefine(current_console => sub { 'test-console' }); + $mock_testapi->redefine(is_serial_terminal => sub { 1 }); + $mock_testapi->redefine(backend_get_wait_still_screen_on_here_doc_input => sub { 0 }); + my $typed = ''; + my $diag_msg = ''; + $mock_testapi->redefine(type_string => sub { $typed .= $_[0] }); + $mock_testapi->redefine(query_isotovideo => sub { }); + $mock_bmwqemu->redefine(diag => sub { $diag_msg .= $_[0] }); + $mock_bmwqemu->redefine(log_call => sub { }); + $mock_testapi->redefine(wait_serial => sub { + my ($regexp) = @_; + return 'BASH:4.4:' if ref($regexp) eq 'Regexp' && 'BASH:4.4:' =~ $regexp; + return 'FC:OK:' if ref($regexp) eq 'Regexp' && 'FC:OK:' =~ $regexp; + return 'OA:DONE-abcd-0-'; + }); + + my @cases = ( + {cmd => 'foo', guard => 0, msg => 'normal command without serial redirection does not trigger the guard'}, + {cmd => 'foo | tee /dev/ttyS0', guard => 1, msg => 'piping to the serial terminal triggers the guard'}, + {cmd => 'bar > /dev/ttyS0', guard => 1, msg => 'redirection to the serial terminal triggers the guard'}, + {cmd => 'baz >> /dev/ttyS0', guard => 1, msg => 'appending to the serial terminal triggers the guard'}, + ); + + for my $case (@cases) { + $typed = ''; + $diag_msg = ''; + $vars{PRETTY_SERIAL_MARKER} = 1; + $d->{_serial_marker_level}->{'test-console'} = 3; + $testapi::serialdev = 'ttyS0'; + $d->{serial_term_prompt} = '# '; + + $d->script_run($case->{cmd}); + if ($case->{guard}) { + like $typed, qr/OA_NO_MARKER=1; /, $case->{msg}; + like $diag_msg, qr/Manual redirection to \/dev\/ttyS0 is deprecated/, 'deprecation warning shown'; + } + else { + unlike $typed, qr/OA_NO_MARKER=1; /, $case->{msg}; + unlike $diag_msg, qr/Manual redirection to \/dev\/ttyS0 is deprecated/, 'no deprecation warning for normal command'; + } + is $vars{PRETTY_SERIAL_MARKER}, 1, "PRETTY_SERIAL_MARKER is active again after '$case->{cmd}'"; + } + + $typed = ''; + delete $d->{_serial_marker_hook_installed}->{'test-console'}; + delete $d->{_serial_marker_hook_persistent}->{'test-console'}; + $d->{_serial_marker_level}->{'test-console'} = 3; + $d->install_serial_marker_hook(3); + like $typed, qr/__oa_prompt\(\) \{ r=\$\?; if \[ -n "\$OA_NO_MARKER" \]/, '__oa_prompt must capture the exit status r=$? as the absolute first statement to prevent internal conditional checks from overwriting it'; +}; + done_testing; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1778246511.7a6bac3/t/48-testmodules-style.t new/os-autoinst-5.1779461317.d4fb5bd/t/48-testmodules-style.t --- old/os-autoinst-5.1778246511.7a6bac3/t/48-testmodules-style.t 2026-05-08 15:21:51.000000000 +0200 +++ new/os-autoinst-5.1779461317.d4fb5bd/t/48-testmodules-style.t 2026-05-22 16:48:37.000000000 +0200 @@ -6,7 +6,7 @@ use Test::Output qw(combined_like); use FindBin '$Bin'; use YAML::PP qw(Load); -use Syntax::Keyword::Try; +use Feature::Compat::Try; my $script = "$Bin/../script/os-autoinst-testmodules-strict"; require $script; ++++++ os-autoinst.obsinfo ++++++ --- /var/tmp/diff_new_pack.wdq1w9/_old 2026-05-27 16:16:46.632458484 +0200 +++ /var/tmp/diff_new_pack.wdq1w9/_new 2026-05-27 16:16:46.664459801 +0200 @@ -1,5 +1,5 @@ name: os-autoinst -version: 5.1778246511.7a6bac3 -mtime: 1778246511 -commit: 7a6bac3eb8024fccd38b53dd3d0b62e80822ac7b +version: 5.1779461317.d4fb5bd +mtime: 1779461317 +commit: d4fb5bd6be9cbcbe42e5a9a8cc901be05aa6c17e
