diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | t/helper.pm | 2 | ||||
-rw-r--r-- | t/superuser--arch_to_noarch.t | 2 | ||||
-rw-r--r-- | t/superuser--http.t | 4 | ||||
-rw-r--r-- | t/superuser--media_info_dir.t | 2 | ||||
-rw-r--r-- | t/superuser--priority-upgrade.t | 8 | ||||
-rw-r--r-- | t/superuser--provide-and-no-obsolete.t | 2 | ||||
-rw-r--r-- | t/superuser--rpmnew.t | 6 |
8 files changed, 14 insertions, 13 deletions
@@ -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"); |