diff options
-rw-r--r-- | t/02create_pkgs.t | 17 | ||||
-rw-r--r-- | t/rpm-v3/libtermcap-2.0.8-2.i386.rpm | bin | 0 -> 7159 bytes | |||
-rw-r--r-- | t/rpm-v3/nls-1.0-2.i386.rpm | bin | 0 -> 2688 bytes | |||
-rw-r--r-- | t/rpm-v3/p2c-1.20-7.i386.rpm | bin | 0 -> 8004 bytes | |||
-rw-r--r-- | t/superuser--media_info_dir.t | 38 |
5 files changed, 44 insertions, 11 deletions
diff --git a/t/02create_pkgs.t b/t/02create_pkgs.t index ff6dabba..ff4fda0c 100644 --- a/t/02create_pkgs.t +++ b/t/02create_pkgs.t @@ -6,7 +6,7 @@ use Test::More 'no_plan'; chdir 't' if -d 't'; system('rm -rf BUILD RPMS media'); -for (qw(media BUILD RPMS RPMS/noarch)) { +foreach (qw(media BUILD RPMS RPMS/noarch)) { mkdir $_; } # locally build a test rpms @@ -17,14 +17,23 @@ foreach my $spec (glob("SPECS/*.spec")) { system_("mv RPMS/*/*.rpm media/$name"); if ($name eq 'various') { - system_("cp -r media/various media/various_nohdlist"); - system_("cp -r media/various media/various_no_subdir"); - system_("genhdlist --dest media/various_no_subdir"); + system_("cp -r media/$name media/${name}_nohdlist"); + system_("cp -r media/$name media/${name}_no_subdir"); + system_("genhdlist --dest media/${name}_no_subdir"); } system_("genhdlist --subdir media/$name/media_info media/$name"); } +{ + my $name = 'rpm-v3'; + system_("cp -r $name media"); + system_("cp -r media/$name media/${name}_nohdlist"); + system_("cp -r media/$name media/${name}_no_subdir"); + system_("genhdlist --dest media/${name}_no_subdir"); + system_("genhdlist --subdir media/$name/media_info media/$name"); +} + sub system_ { my ($cmd) = @_; system($cmd); diff --git a/t/rpm-v3/libtermcap-2.0.8-2.i386.rpm b/t/rpm-v3/libtermcap-2.0.8-2.i386.rpm Binary files differnew file mode 100644 index 00000000..390524dc --- /dev/null +++ b/t/rpm-v3/libtermcap-2.0.8-2.i386.rpm diff --git a/t/rpm-v3/nls-1.0-2.i386.rpm b/t/rpm-v3/nls-1.0-2.i386.rpm Binary files differnew file mode 100644 index 00000000..c05d7f85 --- /dev/null +++ b/t/rpm-v3/nls-1.0-2.i386.rpm diff --git a/t/rpm-v3/p2c-1.20-7.i386.rpm b/t/rpm-v3/p2c-1.20-7.i386.rpm Binary files differnew file mode 100644 index 00000000..a0fd4e41 --- /dev/null +++ b/t/rpm-v3/p2c-1.20-7.i386.rpm diff --git a/t/superuser--media_info_dir.t b/t/superuser--media_info_dir.t index bfa2be56..9cb623f0 100644 --- a/t/superuser--media_info_dir.t +++ b/t/superuser--media_info_dir.t @@ -7,13 +7,37 @@ use Test::More 'no_plan'; need_root_and_prepare(); +various(); +rpm_v3(); -my $name = 'various'; +sub various { + my $name = 'various'; + foreach my $medium_name ('various', '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"); + urpme($name); + urpmi_removemedia($medium_name); + } +} + +sub rpm_v3 { + my @names = qw(libtermcap nls p2c); + my $check_installed = sub { + is(`rpm -qa --qf '%{name}\\n' --root $::pwd/root | sort`, join('', map { "$_\n" } @names)); + }; + + system_("rpm --root $::pwd/root -i --noscripts media/rpm-v3/*.rpm"); + $check_installed->(); + system_("rpm --root $::pwd/root -e --noscripts " . join(' ', @names)); + is(`rpm -qa --root $::pwd/root`, ''); -foreach my $medium_name ('various', '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"); - urpme($name); - urpmi_removemedia($medium_name); + foreach my $medium_name ('rpm-v3', 'rpm-v3_nohdlist', 'rpm-v3_no_subdir') { + urpmi_addmedia("$medium_name $::pwd/media/$medium_name"); + urpmi('--no-verify-rpm --noscripts ' . join(' ', @names)); + $check_installed->(); + urpme('-a --auto --noscripts'); + is(`rpm -qa --root $::pwd/root`, ''); + urpmi_removemedia($medium_name); + } } |