summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-01-15 00:59:14 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-01-17 02:22:39 +0100
commit46387084f6d0e09207354daed3fe2531035d638d (patch)
tree3c9eced401f93afe20f9e4778e32694ae70c6795
parentbd9042d1252f276d1d57fb172c2cb3e1b6847c10 (diff)
downloadurpmi-46387084f6d0e09207354daed3fe2531035d638d.tar
urpmi-46387084f6d0e09207354daed3fe2531035d638d.tar.gz
urpmi-46387084f6d0e09207354daed3fe2531035d638d.tar.bz2
urpmi-46387084f6d0e09207354daed3fe2531035d638d.tar.xz
urpmi-46387084f6d0e09207354daed3fe2531035d638d.zip
fix testsuite errors on CentOs (NVR vs NVRA)
where rpmquery default to outputing NVRA (vs NVR on Mageia) reuse check_installed_fullnames() where needed instead of introducing %{NVR}
-rw-r--r--NEWS1
-rw-r--r--t/helper.pm2
-rw-r--r--t/superuser--arch_to_noarch.t2
-rw-r--r--t/superuser--http.t4
-rw-r--r--t/superuser--media_info_dir.t2
-rw-r--r--t/superuser--priority-upgrade.t8
-rw-r--r--t/superuser--provide-and-no-obsolete.t2
-rw-r--r--t/superuser--rpmnew.t6
8 files changed, 14 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index 8b924835..3048433c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
- cpan_testers:
o actually needs perl >= 5.10 for //= operator
o fix failing scriptlets test with rpm < 4.13.0
+ o fix testsuite errors on CentOs (NVR vs NVRA)
o skip tests if we have no supported downloader
o testsuite needs rpmtools
diff --git a/t/helper.pm b/t/helper.pm
index 8cfdb35d..fb211359 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -140,7 +140,7 @@ sub system_should_fail {
sub check_installed_fullnames {
my (@names) = @_;
- is(`rpm -qa --root $::pwd/root | sort`, join('', map { "$_\n" } sort(@names)));
+ is(`rpm -qa --qf '%{NVR}\\n' --root $::pwd/root | sort`, join('', map { "$_\n" } sort(@names)));
}
sub check_installed_names {
diff --git a/t/superuser--arch_to_noarch.t b/t/superuser--arch_to_noarch.t
index 1b3869dc..71c56b97 100644
--- a/t/superuser--arch_to_noarch.t
+++ b/t/superuser--arch_to_noarch.t
@@ -13,5 +13,5 @@ foreach my $nb (1 .. 4) {
my $medium_name = "${name}_$nb";
urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
urpmi("$name");
- is(`rpm -qa --root $::pwd/root`, "$name-$nb-1\n");
+ check_installed_fullnames("$name-$nb-1");
}
diff --git a/t/superuser--http.t b/t/superuser--http.t
index 297e7c69..1477bc8c 100644
--- a/t/superuser--http.t
+++ b/t/superuser--http.t
@@ -23,7 +23,7 @@ sub test {
urpmi_addmedia("$medium_name $url/media/$medium_name");
urpmi($name);
- is(`rpm -qa --root $::pwd/root`, "$name-1-1\n");
+ check_installed_fullnames("$name-1-1");
urpme($name);
urpmi_removemedia($medium_name);
}
@@ -50,7 +50,7 @@ sub test_exotic_medium_name {
is(run_urpm_cmd('urpmq --sourcerpm various'), "various: various-1-1.src.rpm\n");
urpmi($name);
- is(`rpm -qa --root $::pwd/root`, "$name-1-1\n");
+ check_installed_fullnames("$name-1-1");
urpme($name);
urpmi_removemedia("'$medium_name'");
diff --git a/t/superuser--media_info_dir.t b/t/superuser--media_info_dir.t
index dee55001..a71fc277 100644
--- a/t/superuser--media_info_dir.t
+++ b/t/superuser--media_info_dir.t
@@ -17,7 +17,7 @@ sub various {
foreach my $medium_name ('various', 'various_nohdlist', 'various nohdlist', 'various_no_subdir') {
urpmi_addmedia("'$medium_name' '$::pwd/media/$medium_name'");
urpmi($name);
- is(`rpm -qa --root $::pwd/root`, "$name-1-1\n");
+ check_installed_fullnames("$name-1-1");
urpme($name);
urpmi_removemedia("'$medium_name'");
}
diff --git a/t/superuser--priority-upgrade.t b/t/superuser--priority-upgrade.t
index 9bf9387b..26252f00 100644
--- a/t/superuser--priority-upgrade.t
+++ b/t/superuser--priority-upgrade.t
@@ -62,7 +62,7 @@ sub test {
urpmi($pkgs_v1);
my @pkgs_v1 = split(' ', $pkgs_v1);
- is(`rpm -qa --root $::pwd/root | sort`, join('', map { "$_-1-1\n" } @pkgs_v1));
+ check_installed_fullnames(map { "$_-1-1" } @pkgs_v1);
unlink "$::pwd/media/$name";
symlink "$name-2", "$::pwd/media/$name";
@@ -77,10 +77,10 @@ sub test {
my @pkgs_v2 = split(' ', $pkgs_v2);
my @l = (
- (map { "$_-2-1\n" } @pkgs_v2),
- (map { "$_-1-1\n" } difference2(\@pkgs_v1, \@pkgs_v2)),
+ (map { "$_-2-1" } @pkgs_v2),
+ (map { "$_-1-1" } difference2(\@pkgs_v1, \@pkgs_v2)),
);
- is(`rpm -qa --root $::pwd/root | sort`, join('', sort @l));
+ check_installed_fullnames(sort @l);
system_('rm -rf root');
}
diff --git a/t/superuser--provide-and-no-obsolete.t b/t/superuser--provide-and-no-obsolete.t
index e2a40590..9e338127 100644
--- a/t/superuser--provide-and-no-obsolete.t
+++ b/t/superuser--provide-and-no-obsolete.t
@@ -28,7 +28,7 @@ test(sub { urpmi('--auto-select --auto'); check_installed_fullnames("a-2-1"); ur
sub test {
my ($f) = @_;
system_("rpm --root $::pwd/root -i media/$medium_name/a-1-*.rpm");
- is(`rpm -qa --root $::pwd/root`, "a-1-1\n");
+ check_installed_fullnames("a-1-1");
$f->();
check_nothing_installed();
diff --git a/t/superuser--rpmnew.t b/t/superuser--rpmnew.t
index 80a492c7..cb6e3e31 100644
--- a/t/superuser--rpmnew.t
+++ b/t/superuser--rpmnew.t
@@ -92,15 +92,15 @@ sub test {
my ($cmd, $v1, $v2, $v3) = @_;
system_("$cmd media/$medium_name/a-1-*.rpm");
- is(`rpm -qa --root $::pwd/root`, "a-1-1\n");
+ check_installed_fullnames("a-1-1");
check_content('a-1', @$v1);
system_("$cmd media/$medium_name/a-2-*.rpm");
- is(`rpm -qa --root $::pwd/root`, "a-2-1\n");
+ check_installed_fullnames("a-2-1");
check_content('a-2', @$v2);
system_("$cmd media/$medium_name/a-3-*.rpm");
- is(`rpm -qa --root $::pwd/root`, "a-3-1\n");
+ check_installed_fullnames("a-3-1");
check_content('a-3', @$v3);
system_("rpm --root $::pwd/root -e a");