Skip to content

Commit

Permalink
WIP Add snapper-zypp-plugin test
Browse files Browse the repository at this point in the history
  • Loading branch information
cedvid committed Nov 13, 2024
1 parent 77ab2fd commit 9eb1184
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/console/snapper_zypp.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SUSE's openQA tests

Check failure on line 1 in tests/console/snapper_zypp.pm

View workflow job for this annotation

GitHub Actions / CI: Running static tests with perl v5.32

File tests/console/snapper_zypp.pm needs tidying
#
# Copyright SUSE LLC
# SPDX-License-Identifier: FSFAP
# Summary: Simple 'snapper-zypp-plugin' test
# Maintainer: QE Core <qe-core@suse.de>

use base "consoletest";
use strict;
use warnings;
use testapi;
use serial_terminal 'select_serial_terminal';
use utils;
use Test::Assert 'assert_equals';

sub get_snapshot_id {
return script_output("snapper ls | awk 'END {print $1}'");
}

sub run_zypper_cmd {
my $zypper_cmd = shift;
my $before_snapshot_id = get_snapshot_id();
zypper_call($zypper_cmd);
my $after_snapshot_id = get_snapshot_id();
assert_equals($after_snapshot_id, $before_snapshot_id + 2, "Snapshot ID did not increment as expected");
record_info("Snapshot IDs", "Before: $before_snapshot_id, After: $after_snapshot_id");
}

sub run {
select_serial_terminal;
run_zypper_cmd("in tree");
}

1;


0 comments on commit 9eb1184

Please sign in to comment.