diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2022-07-27 01:59:53 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2023-04-13 15:18:22 +0200 |
commit | fd7041b779aace703abe9f31f88d86b89ebb5439 (patch) | |
tree | e39ddc44d09ad05d38d7d0726949abcf9d553a56 /t/superuser--orphans-kernels.t | |
parent | c32645103037dd4a2b6f31598d31880e947466a7 (diff) | |
download | urpmi-fd7041b779aace703abe9f31f88d86b89ebb5439.tar urpmi-fd7041b779aace703abe9f31f88d86b89ebb5439.tar.gz urpmi-fd7041b779aace703abe9f31f88d86b89ebb5439.tar.bz2 urpmi-fd7041b779aace703abe9f31f88d86b89ebb5439.tar.xz urpmi-fd7041b779aace703abe9f31f88d86b89ebb5439.zip |
Add kernel testsuite for old style kernels
Aka the jernel 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".
Diffstat (limited to 't/superuser--orphans-kernels.t')
-rw-r--r-- | t/superuser--orphans-kernels.t | 32 |
1 files changed, 32 insertions, 0 deletions
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"); +} + |