summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST6
-rw-r--r--t/data/SPECS/kernel-1/kernel-desktop1.spec22
-rw-r--r--t/data/SPECS/kernel-1/kernel-desktop2.spec22
-rw-r--r--t/data/SPECS/kernel-1/kernel-desktop3.spec22
-rw-r--r--t/data/SPECS/kernel-1/kernel-desktop4.spec22
-rw-r--r--t/data/SPECS/kernel-1/kernel-desktop5.spec22
-rw-r--r--t/superuser--orphans-kernels.t32
7 files changed, 148 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST
index 1a132e0a..cec11a08 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -196,6 +196,11 @@ t/data/SPECS/handle-conflict-deps2/c-2.spec
t/data/SPECS/handle-conflict-deps2/d1-1.spec
t/data/SPECS/handle-conflict-deps2/d1-2.spec
t/data/SPECS/handle-conflict-deps2/d2.spec
+t/data/SPECS/kernel-1/kernel-desktop1.spec
+t/data/SPECS/kernel-1/kernel-desktop2.spec
+t/data/SPECS/kernel-1/kernel-desktop3.spec
+t/data/SPECS/kernel-1/kernel-desktop4.spec
+t/data/SPECS/kernel-1/kernel-desktop5.spec
t/data/SPECS/multi-line-macro.spec
t/data/SPECS/multi-line-macro2.spec
t/data/SPECS/obsolete-and-conflict/a.spec
@@ -437,6 +442,7 @@ t/superuser--mirrorlist.t
t/superuser--obsolete-and-conflict.t
t/superuser--ordering-scriptlets.t
t/superuser--orphans.t
+t/superuser--orphans-kernels.t
t/superuser--prefer.t
t/superuser--prefer2.t
t/superuser--priority-upgrade.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/superuser--orphans-kernels.t b/t/superuser--orphans-kernels.t
new file mode 100644
index 00000000..2b6e00dd
--- /dev/null
+++ b/t/superuser--orphans-kernels.t
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+# kernel-desktop-latest request latest kernel-desktop-foobar
+#
+use strict;
+use lib '.', 't';
+use helper;
+use urpm::orphans;
+use Test::More 'no_plan';
+
+need_root_and_prepare();
+
+my $name = 'kernel';
+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');
+
+sub test_unorphan_kernels {
+ my ($medium, $pkg) = @_;
+ my $base_kversion = '5.15.4';
+ print "# test_unorphan_kernels($pkg) ($base_kversion)\n";
+ urpmi("--media $medium --auto $pkg-${base_kversion}$_-1") foreach 1..4;
+ urpmi("--media $medium --auto $pkg");
+ urpme("--auto --auto-orphans");
+ check_installed_and_remove($pkg, "kernel-desktop-${base_kversion}5-1.mga8");
+}
+