Skip to content

Commit

Permalink
Merge pull request #21075 from cedvid/snapper-zypp2
Browse files Browse the repository at this point in the history
Fix snapshot ID capture in snapper_zypp test
  • Loading branch information
cedvid authored Feb 6, 2025
2 parents 777b3fe + 8e0a1b4 commit 322ad2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/console/snapper_zypp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ use version_utils 'is_sle';
use Test::Assert 'assert_equals';

sub get_snapshot_id {
my $snapshot_id = is_sle("<=12-SP5") ? '$3' : '$1';
return script_output("snapper ls | awk 'END {print $snapshot_id}'");
# Temporarily silence messages on the console to avoid unwanted output
script_run("dmesg --console-off");
my $snapshot_id = is_sle("<=12-SP5") ? script_output("snapper ls | awk 'END {print \$3}'") : script_output("snapper ls --disable-used-space --columns number | tail -n1");
script_run("dmesg --console-on");
return $snapshot_id;
}

sub run_zypper_cmd {
Expand Down

0 comments on commit 322ad2d

Please sign in to comment.