-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lock package feature for migration
- Loading branch information
Showing
3 changed files
with
90 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2017 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: check locked package after lock package test applied | ||
# Maintainer: Wei Jiang <wjiang@suse.com> | ||
|
||
use base "consoletest"; | ||
use strict; | ||
use testapi; | ||
|
||
sub run() { | ||
select_console 'root-console'; | ||
|
||
# List each active package lock and check its version and release info | ||
for my $pkg (@$lock_package::locked_pkg_info) { | ||
assert_script_run "zypper ll | grep $pkg->{name}"; | ||
assert_script_run "rpm -q $pkg->{name} | grep $pkg->{fullname}"; | ||
} | ||
} | ||
|
||
sub test_flags { | ||
return {fatal => 1}; | ||
} | ||
|
||
1; | ||
# vim: set sw=4 et: |
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,40 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2017 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: lock package test mainly used for migration testsuite - poo#17206 | ||
# Maintainer: Wei Jiang <wjiang@suse.com> | ||
|
||
package lock_package; | ||
use base "consoletest"; | ||
use strict; | ||
use testapi; | ||
|
||
our $locked_pkg_info = []; | ||
|
||
sub run() { | ||
select_console 'root-console'; | ||
|
||
# Packages to be locked is comma-separated | ||
my @pkgs = split(/,/, get_var('LOCK_PACKAGE')); | ||
for my $pkg (@pkgs) { | ||
# Save each package's name, version and release info to variable | ||
my $fullname = script_output "rpm -q $pkg"; | ||
push $locked_pkg_info, {name => $pkg, fullname => $fullname}; | ||
|
||
# Add a lock for each package | ||
assert_script_run "zypper al $pkg"; | ||
} | ||
} | ||
|
||
sub test_flags { | ||
return {fatal => 1}; | ||
} | ||
|
||
1; | ||
# vim: set sw=4 et: |