2016-09-20 18:41:12 +00:00
|
|
|
package packagetest;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
use base 'Exporter';
|
|
|
|
use Exporter;
|
|
|
|
|
|
|
|
use testapi;
|
|
|
|
our @EXPORT = qw/prepare_test_packages verify_installed_packages verify_updated_packages/;
|
|
|
|
|
|
|
|
# enable the openqa test package repositories and install the main
|
2023-12-30 19:21:27 +00:00
|
|
|
# test packages, remove acpica-tools and install the fake one
|
2016-09-20 18:41:12 +00:00
|
|
|
sub prepare_test_packages {
|
2023-12-30 19:21:27 +00:00
|
|
|
# remove acpica-tools if installed (we don't use assert
|
2016-09-20 18:41:12 +00:00
|
|
|
# here in case it's not)
|
2023-12-30 19:21:27 +00:00
|
|
|
script_run 'dnf -y remove acpica-tools', 180;
|
2016-09-20 18:41:12 +00:00
|
|
|
# grab the test repo definitions
|
2023-04-30 18:25:39 +00:00
|
|
|
assert_script_run 'curl -o /etc/yum.repos.d/openqa-testrepo-1.repo https://git.resf.org/testing/openqa-testrepos/raw/branch/main/openqa-testrepo-1.repo';
|
2016-09-20 18:41:12 +00:00
|
|
|
# install the test packages from repo1
|
2023-12-30 19:21:27 +00:00
|
|
|
assert_script_run 'dnf -y --disablerepo=* --enablerepo=openqa-testrepo-1 install acpica-tools';
|
2018-03-29 02:42:31 +00:00
|
|
|
if (get_var("DESKTOP") eq 'kde' && get_var("TEST") eq 'desktop_update_graphical') {
|
|
|
|
# kick pkcon so our special update will definitely get installed
|
|
|
|
assert_script_run 'pkcon refresh force';
|
|
|
|
}
|
2016-09-20 18:41:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# check our test packages installed correctly (this is a test that dnf
|
|
|
|
# actually does what it claims)
|
|
|
|
sub verify_installed_packages {
|
2023-12-30 19:21:27 +00:00
|
|
|
validate_script_output 'rpm -q acpica-tools', sub { $_ =~ m/^acpica-tools-1-1.noarch$/ };
|
|
|
|
assert_script_run 'rpm -V acpica-tools';
|
2016-09-20 18:41:12 +00:00
|
|
|
}
|
|
|
|
|
2023-12-30 19:21:27 +00:00
|
|
|
# check updating the test packages and the fake acpica-tools work
|
2016-09-20 18:41:12 +00:00
|
|
|
# as expected
|
|
|
|
sub verify_updated_packages {
|
2023-12-30 19:21:27 +00:00
|
|
|
# we don't know what version of acpica-tools we'll actually
|
2016-09-20 18:41:12 +00:00
|
|
|
# get, so just check it's *not* the fake one
|
2023-12-30 19:21:27 +00:00
|
|
|
validate_script_output 'rpm -q acpica-tools', sub { $_ !~ m/^acpica-tools-1-1.noarch$/ };
|
|
|
|
assert_script_run 'rpm -V acpica-tools';
|
2016-09-20 18:41:12 +00:00
|
|
|
}
|