-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SUSE's openQA tests | ||
# | ||
# 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; | ||
|
||
|