diff options
Diffstat (limited to 't')
41 files changed, 549 insertions, 2 deletions
diff --git a/t/02create_pkgs.t b/t/02create_pkgs.t index 7bd625f3..9f200ca9 100644 --- a/t/02create_pkgs.t +++ b/t/02create_pkgs.t @@ -74,6 +74,12 @@ if (!is_rpm_v3_support_broken()) { genhdlist_std($name); } +{ + my $name = 'rpm-i586-to-i686'; + system_("cp -r data/$name media"); + genhdlist_std($name); +} + mkdir 'media/reconfig'; system_("cp -r data/reconfig.urpmi media/reconfig"); @@ -32,6 +32,15 @@ eatmydata make testall If you didn't alter the tests data, you can further speedup a re-run by using: [[ -d t/media ]] && mv -f t/02create_pkgs.t{,.i} +You can selectively run some tests: +# Run everything: +PERL_DL_NONLAZY=1 perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t +# Only run everything orphans tests: +PERL_DL_NONLAZY=1 perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*orphans*.t +# If you want to see the output: +perl t/superuser--orphans.t + + Layout: ======= diff --git a/t/data/SPECS/arch_to_noarch_1.spec b/t/data/SPECS/arch_to_noarch_1.spec index 36b059f1..37e0b1fa 100644 --- a/t/data/SPECS/arch_to_noarch_1.spec +++ b/t/data/SPECS/arch_to_noarch_1.spec @@ -1,5 +1,7 @@ # For CPAN testers that run FreeBSD: %global __brp_strip_static_archive %nil +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: arch_to_noarch Name: arch_to_noarch diff --git a/t/data/SPECS/arch_to_noarch_2.spec b/t/data/SPECS/arch_to_noarch_2.spec index 39d73f39..a331caa2 100644 --- a/t/data/SPECS/arch_to_noarch_2.spec +++ b/t/data/SPECS/arch_to_noarch_2.spec @@ -1,5 +1,7 @@ # For CPAN testers that run FreeBSD: %global __brp_strip_static_archive %nil +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: arch_to_noarch Name: arch_to_noarch diff --git a/t/data/SPECS/arch_to_noarch_4.spec b/t/data/SPECS/arch_to_noarch_4.spec index 369f2aef..518bf4df 100644 --- a/t/data/SPECS/arch_to_noarch_4.spec +++ b/t/data/SPECS/arch_to_noarch_4.spec @@ -1,5 +1,7 @@ # For CPAN testers that run FreeBSD: %global __brp_strip_static_archive %nil +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: arch_to_noarch Name: arch_to_noarch diff --git a/t/data/SPECS/buildroot_default.spec b/t/data/SPECS/buildroot_default.spec index 33cfc763..c555ea04 100644 --- a/t/data/SPECS/buildroot_default.spec +++ b/t/data/SPECS/buildroot_default.spec @@ -1,6 +1,8 @@ %define macro_using_buildroot $(echo %buildroot) %undefine distepoch %undefine disttag +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: x Name: buildroot diff --git a/t/data/SPECS/i586-to-i686/libfoobar.spec b/t/data/SPECS/i586-to-i686/libfoobar.spec new file mode 100644 index 00000000..bb322414 --- /dev/null +++ b/t/data/SPECS/i586-to-i686/libfoobar.spec @@ -0,0 +1,36 @@ +# This one is not directly used by the testsuite. +# It has been used to generate once t/data/rpm-i586-to-i686/* +# using: +# linux32 rpmbuild -ba libfoobar.spec --target i586 +# linux32 rpmbuild -ba libfoobar.spec --target i686 +# Which are the pkgs actually used by the testsuite for simulating an i586 to +# i686 upgrade + +# Fix build with rpm-4.20: +%global debug_package %{nil} + + +# we could build with -static but then pkg goes up from 8.5kb to 280Kb: +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}libc.so +Summary: x +Name: libfoobar +Version: 1 +Release: 1 +License: x + +%build +cat > t.c <<EOF +void main () {} +EOF +#linux32 gcc -m32 -march=i586 -o t t.c +cc -o t t.c + +%install +mkdir -p %buildroot/%_bindir +cp -a t %buildroot/%_bindir + +%description +binary lib + +%files +%_bindir/t diff --git a/t/data/SPECS/kernel-1/kernel-desktop1.spec b/t/data/SPECS/kernel-1/kernel-desktop1.spec new file mode 100644 index 00000000..3466df6e --- /dev/null +++ b/t/data/SPECS/kernel-1/kernel-desktop1.spec @@ -0,0 +1,22 @@ +%global ver 5.15.41 +Summary: x +Name: kernel-desktop-%{ver}-1 +Version: 1 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Version: %ver +Requires: kernel-desktop-%{ver}-1 + +%description +Kernel naming as used in mdv & mga[1-8]. +Each kernel has an unique name ("kernel-v-r") +Thus fullname is "kernel-v-r-1-1". + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/kernel-desktop2.spec b/t/data/SPECS/kernel-1/kernel-desktop2.spec new file mode 100644 index 00000000..9424b939 --- /dev/null +++ b/t/data/SPECS/kernel-1/kernel-desktop2.spec @@ -0,0 +1,22 @@ +%global ver 5.15.42 +Summary: x +Name: kernel-desktop-%{ver}-1 +Version: 1 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Version: %ver +Requires: kernel-desktop-%{ver}-1 + +%description +Kernel naming as used in mdv & mga[1-8]. +Each kernel has an unique name ("kernel-v-r") +Thus fullname is "kernel-v-r-1-1". + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/kernel-desktop3.spec b/t/data/SPECS/kernel-1/kernel-desktop3.spec new file mode 100644 index 00000000..aafd5468 --- /dev/null +++ b/t/data/SPECS/kernel-1/kernel-desktop3.spec @@ -0,0 +1,22 @@ +%global ver 5.15.43 +Summary: x +Name: kernel-desktop-%{ver}-1 +Version: 1 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Version: %ver +Requires: kernel-desktop-%{ver}-1 + +%description +Kernel naming as used in mdv & mga[1-8]. +Each kernel has an unique name ("kernel-v-r") +Thus fullname is "kernel-v-r-1-1". + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/kernel-desktop4.spec b/t/data/SPECS/kernel-1/kernel-desktop4.spec new file mode 100644 index 00000000..6b433a52 --- /dev/null +++ b/t/data/SPECS/kernel-1/kernel-desktop4.spec @@ -0,0 +1,22 @@ +%global ver 5.15.44 +Summary: x +Name: kernel-desktop-%{ver}-1 +Version: 1 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Version: %ver +Requires: kernel-desktop-%{ver}-1 + +%description +Kernel naming as used in mdv & mga[1-8]. +Each kernel has an unique name ("kernel-v-r") +Thus fullname is "kernel-v-r-1-1". + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/kernel-desktop5.spec b/t/data/SPECS/kernel-1/kernel-desktop5.spec new file mode 100644 index 00000000..9352a6f6 --- /dev/null +++ b/t/data/SPECS/kernel-1/kernel-desktop5.spec @@ -0,0 +1,22 @@ +%global ver 5.15.45 +Summary: x +Name: kernel-desktop-%{ver}-1 +Version: 1 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Version: %ver +Requires: kernel-desktop-%{ver}-1 + +%description +Kernel naming as used in mdv & mga[1-8]. +Each kernel has an unique name ("kernel-v-r") +Thus fullname is "kernel-v-r-1-1". + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/virtualbox-kernel-desktop1.spec b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop1.spec new file mode 100644 index 00000000..34306fb7 --- /dev/null +++ b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop1.spec @@ -0,0 +1,19 @@ +%global kver 5.15.41 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 1 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-1 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/virtualbox-kernel-desktop2.spec b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop2.spec new file mode 100644 index 00000000..eba571ef --- /dev/null +++ b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop2.spec @@ -0,0 +1,19 @@ +%global kver 5.15.42 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 2 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-2 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/virtualbox-kernel-desktop3.spec b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop3.spec new file mode 100644 index 00000000..76e56f0e --- /dev/null +++ b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop3.spec @@ -0,0 +1,19 @@ +%global kver 5.15.43 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 3 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-3 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/virtualbox-kernel-desktop4.spec b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop4.spec new file mode 100644 index 00000000..a6a68765 --- /dev/null +++ b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop4.spec @@ -0,0 +1,19 @@ +%global kver 5.15.44 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 4 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-4 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-1/virtualbox-kernel-desktop5.spec b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop5.spec new file mode 100644 index 00000000..4e8b8d7b --- /dev/null +++ b/t/data/SPECS/kernel-1/virtualbox-kernel-desktop5.spec @@ -0,0 +1,18 @@ +%global kver 5.15.45 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 5 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-5 +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/kernel-desktop1.spec b/t/data/SPECS/kernel-2/kernel-desktop1.spec new file mode 100644 index 00000000..ca218706 --- /dev/null +++ b/t/data/SPECS/kernel-2/kernel-desktop1.spec @@ -0,0 +1,20 @@ +Summary: x +Name: kernel-desktop +Version: 5.15.41 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Requires: kernel-desktop = %{version}-%{release} + +%description +Kernel naming as used in mga9+. +Each kernel is named "kernel". +So we can have multiple packages named "kernel" installed at the same time, with different versions + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/kernel-desktop2.spec b/t/data/SPECS/kernel-2/kernel-desktop2.spec new file mode 100644 index 00000000..f42de4d0 --- /dev/null +++ b/t/data/SPECS/kernel-2/kernel-desktop2.spec @@ -0,0 +1,20 @@ +Summary: x +Name: kernel-desktop +Version: 5.15.42 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Requires: kernel-desktop = %{version}-%{release} + +%description +Kernel naming as used in mga9+. +Each kernel is named "kernel". +So we can have multiple packages named "kernel" installed at the same time, with different versions + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/kernel-desktop3.spec b/t/data/SPECS/kernel-2/kernel-desktop3.spec new file mode 100644 index 00000000..ff40fec8 --- /dev/null +++ b/t/data/SPECS/kernel-2/kernel-desktop3.spec @@ -0,0 +1,20 @@ +Summary: x +Name: kernel-desktop +Version: 5.15.43 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Requires: kernel-desktop = %{version}-%{release} + +%description +Kernel naming as used in mga9+. +Each kernel is named "kernel". +So we can have multiple packages named "kernel" installed at the same time, with different versions + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/kernel-desktop4.spec b/t/data/SPECS/kernel-2/kernel-desktop4.spec new file mode 100644 index 00000000..edbd9745 --- /dev/null +++ b/t/data/SPECS/kernel-2/kernel-desktop4.spec @@ -0,0 +1,20 @@ +Summary: x +Name: kernel-desktop +Version: 5.15.44 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Requires: kernel-desktop = %{version}-%{release} + +%description +Kernel naming as used in mga9+. +Each kernel is named "kernel". +So we can have multiple packages named "kernel" installed at the same time, with different versions + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/kernel-desktop5.spec b/t/data/SPECS/kernel-2/kernel-desktop5.spec new file mode 100644 index 00000000..e22152a9 --- /dev/null +++ b/t/data/SPECS/kernel-2/kernel-desktop5.spec @@ -0,0 +1,20 @@ +Summary: x +Name: kernel-desktop +Version: 5.15.45 +Release: 1 +License: x + +%package -n kernel-desktop-latest +Summary: x +Requires: kernel-desktop = %{version}-%{release} + +%description +Kernel naming as used in mga9+. +Each kernel is named "kernel". +So we can have multiple packages named "kernel" installed at the same time, with different versions + +%description -n kernel-desktop-latest +x + +%files +%files -n kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/virtualbox-kernel-desktop1.spec b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop1.spec new file mode 100644 index 00000000..34306fb7 --- /dev/null +++ b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop1.spec @@ -0,0 +1,19 @@ +%global kver 5.15.41 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 1 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-1 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/virtualbox-kernel-desktop2.spec b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop2.spec new file mode 100644 index 00000000..eba571ef --- /dev/null +++ b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop2.spec @@ -0,0 +1,19 @@ +%global kver 5.15.42 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 2 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-2 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/virtualbox-kernel-desktop3.spec b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop3.spec new file mode 100644 index 00000000..76e56f0e --- /dev/null +++ b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop3.spec @@ -0,0 +1,19 @@ +%global kver 5.15.43 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 3 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-3 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/virtualbox-kernel-desktop4.spec b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop4.spec new file mode 100644 index 00000000..a6a68765 --- /dev/null +++ b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop4.spec @@ -0,0 +1,19 @@ +%global kver 5.15.44 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 4 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-4 + +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/kernel-2/virtualbox-kernel-desktop5.spec b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop5.spec new file mode 100644 index 00000000..4e8b8d7b --- /dev/null +++ b/t/data/SPECS/kernel-2/virtualbox-kernel-desktop5.spec @@ -0,0 +1,18 @@ +%global kver 5.15.45 +Summary: x +Name: virtualbox-kernel-%{kver}-desktop-1 +Version: 6.1.36 +Release: 5 +License: x + +%package -n virtualbox-kernel-desktop-latest +Summary: x +Requires: virtualbox-kernel-%{kver}-desktop-1 = 6.1.36-5 +%description +x + +%description -n virtualbox-kernel-desktop-latest +x + +%files +%files -n virtualbox-kernel-desktop-latest diff --git a/t/data/SPECS/multi-line-macro.spec b/t/data/SPECS/multi-line-macro.spec index 06e8eb95..9b0f36d7 100644 --- a/t/data/SPECS/multi-line-macro.spec +++ b/t/data/SPECS/multi-line-macro.spec @@ -1,3 +1,5 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} %define foobar /etc/foo \ /etc/bar diff --git a/t/data/SPECS/multi-line-macro2.spec b/t/data/SPECS/multi-line-macro2.spec index 8dddbf92..2d1a7418 100644 --- a/t/data/SPECS/multi-line-macro2.spec +++ b/t/data/SPECS/multi-line-macro2.spec @@ -1,3 +1,5 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} %define foobar echo foo > $RPM_BUILD_ROOT/etc/foo \ echo bar > $RPM_BUILD_ROOT/etc/bar diff --git a/t/data/SPECS/obsolete-and-conflict/a.spec b/t/data/SPECS/obsolete-and-conflict/a.spec index f15a27e0..dbb0ebb2 100644 --- a/t/data/SPECS/obsolete-and-conflict/a.spec +++ b/t/data/SPECS/obsolete-and-conflict/a.spec @@ -1,3 +1,6 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} + Summary: a Name: a Version: 1 diff --git a/t/data/SPECS/obsolete-and-conflict/b.spec b/t/data/SPECS/obsolete-and-conflict/b.spec index 96aa265b..2bf98a5c 100644 --- a/t/data/SPECS/obsolete-and-conflict/b.spec +++ b/t/data/SPECS/obsolete-and-conflict/b.spec @@ -1,3 +1,6 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} + Summary: b Name: b Version: 1 diff --git a/t/data/SPECS/obsolete-and-conflict/c.spec b/t/data/SPECS/obsolete-and-conflict/c.spec index 2cacfc00..c18c03df 100644 --- a/t/data/SPECS/obsolete-and-conflict/c.spec +++ b/t/data/SPECS/obsolete-and-conflict/c.spec @@ -1,3 +1,5 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: c Name: c Version: 1 diff --git a/t/data/SPECS/various.spec b/t/data/SPECS/various.spec index 250f737c..5cf933f8 100644 --- a/t/data/SPECS/various.spec +++ b/t/data/SPECS/various.spec @@ -1,3 +1,5 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: various Name: various Version: 1 diff --git a/t/data/SPECS/various2.spec b/t/data/SPECS/various2.spec index 6a10084c..a14d786d 100644 --- a/t/data/SPECS/various2.spec +++ b/t/data/SPECS/various2.spec @@ -1,3 +1,5 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: various2 Name: various2 Version: 1 diff --git a/t/data/SPECS/various3.spec b/t/data/SPECS/various3.spec index 74e08459..5a061f52 100644 --- a/t/data/SPECS/various3.spec +++ b/t/data/SPECS/various3.spec @@ -1,3 +1,5 @@ +# Fix build with rpm-4.20: +%global debug_package %{nil} Summary: various3 Name: various3 Version: 1 diff --git a/t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm b/t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm Binary files differnew file mode 100644 index 00000000..ed0d9211 --- /dev/null +++ b/t/data/rpm-i586-to-i686/libfoobar-1-1.i586.rpm diff --git a/t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm b/t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm Binary files differnew file mode 100644 index 00000000..94055db8 --- /dev/null +++ b/t/data/rpm-i586-to-i686/libfoobar-1-1.i686.rpm diff --git a/t/gendistrib b/t/gendistrib index 193c3a64..e0457505 100755 --- a/t/gendistrib +++ b/t/gendistrib @@ -1,4 +1,4 @@ -#!/usr/bin/perl5.32.1 +#!/usr/bin/perl (our $VERSION) = q(Id: gendistrib 20724 2006-11-30 13:13:27Z rafael ) =~ /(\d+)/; diff --git a/t/genhdlist2 b/t/genhdlist2 index 8799086e..04c95b7d 100755 --- a/t/genhdlist2 +++ b/t/genhdlist2 @@ -1,4 +1,4 @@ -#!/usr/bin/perl5.32.1 +#!/usr/bin/perl our ($VERSION) = q(Id: genhdlist2 20460 2006-11-23 13:19:11Z pixel ) =~ /(\d+\.\d+)/; diff --git a/t/superuser--i586-to-i686.t b/t/superuser--i586-to-i686.t new file mode 100644 index 00000000..6ff3914e --- /dev/null +++ b/t/superuser--i586-to-i686.t @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +# kernel-desktop-latest request latest kernel-desktop-foobar +# +use strict; +use lib '.', 't'; +use helper; +use urpm::cfg; +use urpm::orphans; +use Test::More 'no_plan'; + +need_root_and_prepare(); + +my $arch = urpm::cfg::get_arch(); +my $name = 'kernel'; +my $medium = 'i586-to-i686'; +urpmi_addmedia("$medium $::pwd/media/rpm-i586-to-i686/"); +urpmi("--media $medium --auto libfoobar-1-1.i586"); +check_installed_names('libfoobar'); +urpmi("--media $medium --auto libfoobar-1-1.i686"); +is(`rpm -q --qf '%{NVRA}' --root $::pwd/root libfoobar`, 'libfoobar-1-1.i686', 'i686 pkgs is installed (aka upgraded)'); +check_installed_and_remove('libfoobar'); diff --git a/t/superuser--orphans-kernels.t b/t/superuser--orphans-kernels.t new file mode 100644 index 00000000..4fe25d43 --- /dev/null +++ b/t/superuser--orphans-kernels.t @@ -0,0 +1,50 @@ +#!/usr/bin/perl + +# kernel-desktop-latest request latest kernel-desktop-foobar +# +use strict; +use lib '.', 't'; +use helper; +use urpm::cfg; +use urpm::orphans; +use Test::More 'no_plan'; + +need_root_and_prepare(); + +my $arch = urpm::cfg::get_arch(); +my $name = 'kernel'; +my $dkms_name = 'virtualbox'; +urpmi_addmedia("$name-1 $::pwd/media/$name-1"); +urpmi_addmedia("$name-2 $::pwd/media/$name-2"); + +# we want urpmi --auto-select to always check orphans (when not using --auto-orphans) +set_urpmi_cfg_global_options({ 'nb-of-new-unrequested-pkgs-between-auto-select-orphans-check' => 0 }); + +# old naming, each kernel NVR is N=kernel-desktop-5.6.2-1, V=1 R=1.mga8 +test_unorphan_kernels("$name-1", 'kernel-desktop-latest'); +# new naming, each kernel NVR is N=kernel-desktop, V=5.6.2 R=1.mga8 +test_unorphan_kernels("$name-2", 'kernel-desktop-latest', 'kernel-desktop'); + +# FIXME: add virtualbox-kernel-XXX -> kernel-XXX +sub test_unorphan_kernels { + my ($medium, $pkg, $o_pkg2) = @_; + my $base_kversion = '5.15.4'; + my $dkms_version = '6.1.36'; + #my $latest_dkms_dep = 'virtualbox-kernel-5.15.45-desktop-1'; # harcoded but no choice... + my $latest_dkms_dep = "virtualbox-kernel-${base_kversion}5-desktop-1"; # harcoded but no choice... + my ($latest_kpkg, $latest_dpkg); + print "# test_unorphan_kernels($pkg) ($base_kversion)\n"; + foreach (1..5) { + $latest_kpkg = "$pkg-${base_kversion}$_-1"; + urpmi("--media $medium --auto $latest_kpkg"); + # Add some DKMS packages: + $latest_dpkg = "$dkms_name-$pkg-${dkms_version}-$_.$arch"; + urpmi("--media $medium --auto $latest_dpkg"); + } + #urpmi("--media $medium --auto $pkg"); + urpme("--auto --auto-orphans"); + $o_pkg2 ||= $latest_kpkg; + $o_pkg2 =~ s/-latest//; + check_installed_and_remove($pkg, 'virtualbox-kernel-desktop-latest', $o_pkg2, $latest_dkms_dep); +} + |