summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2022-07-27 02:02:58 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2022-12-10 14:15:07 +0100
commit589bb393d044e097782759ebb0cbec630b971d42 (patch)
tree153bfa6ce6883e5e2d528f18f865781c95a44ec3
parent7a7c616d0add53a98641410376588fca509524a6 (diff)
downloadurpmi-589bb393d044e097782759ebb0cbec630b971d42.tar
urpmi-589bb393d044e097782759ebb0cbec630b971d42.tar.gz
urpmi-589bb393d044e097782759ebb0cbec630b971d42.tar.bz2
urpmi-589bb393d044e097782759ebb0cbec630b971d42.tar.xz
urpmi-589bb393d044e097782759ebb0cbec630b971d42.zip
Add kernel testsuite for new style kernels
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 It now works with previous commit.
-rw-r--r--MANIFEST5
-rw-r--r--t/data/SPECS/kernel-2/kernel-desktop1.spec20
-rw-r--r--t/data/SPECS/kernel-2/kernel-desktop2.spec20
-rw-r--r--t/data/SPECS/kernel-2/kernel-desktop3.spec20
-rw-r--r--t/data/SPECS/kernel-2/kernel-desktop4.spec20
-rw-r--r--t/data/SPECS/kernel-2/kernel-desktop5.spec20
-rw-r--r--t/superuser--orphans-kernels.t7
7 files changed, 110 insertions, 2 deletions
diff --git a/MANIFEST b/MANIFEST
index cec11a08..4625799e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -201,6 +201,11 @@ 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/kernel-2/kernel-desktop1.spec
+t/data/SPECS/kernel-2/kernel-desktop2.spec
+t/data/SPECS/kernel-2/kernel-desktop3.spec
+t/data/SPECS/kernel-2/kernel-desktop4.spec
+t/data/SPECS/kernel-2/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
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/superuser--orphans-kernels.t b/t/superuser--orphans-kernels.t
index 2b6e00dd..f101f1f5 100644
--- a/t/superuser--orphans-kernels.t
+++ b/t/superuser--orphans-kernels.t
@@ -19,14 +19,17 @@ set_urpmi_cfg_global_options({ 'nb-of-new-unrequested-pkgs-between-auto-select-o
# 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');
sub test_unorphan_kernels {
- my ($medium, $pkg) = @_;
+ my ($medium, $pkg, $o_pkg2) = @_;
my $base_kversion = '5.15.4';
+ $o_pkg2 ||= "kernel-desktop-${base_kversion}5-1.mga8";
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");
+ check_installed_and_remove($pkg, $o_pkg2);
}