forked from os-autoinst/os-autoinst-distri-opensuse
-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
44 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
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
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,42 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
# Summary: Simple 'snapper-zypp-plugin' test | ||
# 1. Ensure 'snapper-zypp-plugin' is installed | ||
# 2. Get latest snapshot id number | ||
# 3. Install/remove package | ||
# 4. Ensure id number incremented by 2 (pre/post snapshots were created) | ||
# 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(); | ||
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; | ||
my $package = "htop"; | ||
|
||
assert_script_run("rpm -q snapper-zypp-plugin"); | ||
run_zypper_cmd("in $package"); | ||
run_zypper_cmd("rm $package"); | ||
} | ||
|
||
1; |