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 14, 2024
1 parent 77ab2fd commit 37bc17e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/console/snapper_zypp.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 <[email protected]>

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();
record_info("Snapshot IDs", "Before: $before_snapshot_id, After: $after_snapshot_id");
assert_equals($after_snapshot_id, $before_snapshot_id + 2, "Snapshot ID did not increment as expected");
}

sub run {
select_serial_terminal;
run_zypper_cmd("in htop");
run_zypper_cmd("rm htop");
run_zypper_cmd("dup");
}

1;


0 comments on commit 37bc17e

Please sign in to comment.