diff --git a/dnf-behave-tests/dnf/installonly.feature b/dnf-behave-tests/dnf/installonly.feature index a8d3e2811..4d7afe210 100644 --- a/dnf-behave-tests/dnf/installonly.feature +++ b/dnf-behave-tests/dnf/installonly.feature @@ -365,3 +365,55 @@ Examples: | command | args | | downgrade | kernel-core | | install | kernel-core-4.18.16-300.fc29.x86_64 | + + +@dnf5 +@bz2163474 +Scenario: Do not bypass installonly limit (2) when installing kernel-core through provide + Given I set config option "installonly_limit" to "2" + And I successfully execute dnf with args "install kernel" + And I use repository "dnf-ci-fedora-updates" + And I successfully execute dnf with args "upgrade" + And I use repository "dnf-ci-fedora-updates-testing" + When I execute dnf with args "install kernel-core-uname-r" + Then the exit code is 0 + # For some reason libsolv installs kernel and kernel-modules, while this is desired behavior it is + # somewhat confusing. There is no requirement for it. If in the future libsolv is changed to install + # only kernel-core it is still valid. + And Transaction is following + | Action | Package | + | install | kernel-0:4.20.6-300.fc29.x86_64 | + | install | kernel-core-0:4.20.6-300.fc29.x86_64 | + | install | kernel-modules-0:4.20.6-300.fc29.x86_64 | + | unchanged | kernel-0:4.19.15-300.fc29.x86_64 | + | unchanged | kernel-core-0:4.19.15-300.fc29.x86_64 | + | unchanged | kernel-modules-0:4.19.15-300.fc29.x86_64 | + | remove-dep | kernel-0:4.18.16-300.fc29.x86_64 | + | remove | kernel-core-0:4.18.16-300.fc29.x86_64 | + | remove-dep | kernel-modules-0:4.18.16-300.fc29.x86_64 | + + +@dnf5 +@bz2163474 +Scenario: Do not bypass installonly limit (default 3) when installing kernel-core through provide + Given I drop repository "dnf-ci-fedora" + And I use repository "kernel" + And I successfully execute dnf with args "install kernel-1.0.0" + And I successfully execute dnf with args "install kernel-2.0.0" + And I successfully execute dnf with args "install kernel-3.0.0" + When I execute dnf with args "install kernel-core-uname-r" + Then the exit code is 0 + # For some reason libsolv installs kernel and kernel-modules, while this is desired behavior it is + # somewhat confusing. There is no requirement for it. If in the future libsolv is changed to install + # only kernel-core it is still valid. + And Transaction is following + | Action | Package | + | install | kernel-0:4.0.0-1.fc29.x86_64 | + | install | kernel-core-0:4.0.0-1.fc29.x86_64 | + | install-dep | kernel-modules-0:4.0.0-1.fc29.x86_64 | + | unchanged | kernel-0:2.0.0-1.fc29.x86_64 | + | unchanged | kernel-core-0:2.0.0-1.fc29.x86_64 | + | unchanged | kernel-modules-0:2.0.0-1.fc29.x86_64 | + | remove-dep | kernel-0:1.0.0-1.fc29.x86_64 | + | remove | kernel-core-0:1.0.0-1.fc29.x86_64 | + | remove-dep | kernel-modules-0:1.0.0-1.fc29.x86_64 | diff --git a/dnf-behave-tests/fixtures/specs/kernel/kernel-1.0.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/kernel/kernel-1.0.0-1.fc29.spec new file mode 100644 index 000000000..490d4a07a --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/kernel/kernel-1.0.0-1.fc29.spec @@ -0,0 +1,48 @@ +Name: kernel +Epoch: 0 +Version: 1.0.0 +Release: 1.fc29 + +License: GPLv2 and Redistributable, no modification permitted +URL: https://www.kernel.org/ + +Summary: The Linux kernel + +Requires: kernel-modules-uname-r = %{version}-%{release}.x86_64 +Requires: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description +The kernel meta package + +%package core +Summary: The Linux kernel + +Provides: installonlypkg(kernel) +Provides: kernel-uname-r = %{version}-%{release}.x86_64 +Provides: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description core +The kernel package contains the Linux kernel (vmlinuz), the core of any +Linux operating system. The kernel handles the basic functions +of the operating system: memory allocation, process allocation, device +input and output, etc. + +%package modules +Summary: kernel modules to match the core kernel + +Provides: installonlypkg(kernel-module) +Provides: kernel-modules-uname-r = %{version}-%{release}.x86_64 + +Requires: kernel-uname-r = %{version}-%{release}.x86_64 + +%description modules +This package provides commonly used kernel modules for the core kernel package. + +%files + +%files core +%ghost /boot/vmlinuz-%{version}-%{release}.x86_64 + +%files modules + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/kernel/kernel-2.0.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/kernel/kernel-2.0.0-1.fc29.spec new file mode 100644 index 000000000..3814c5902 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/kernel/kernel-2.0.0-1.fc29.spec @@ -0,0 +1,48 @@ +Name: kernel +Epoch: 0 +Version: 2.0.0 +Release: 1.fc29 + +License: GPLv2 and Redistributable, no modification permitted +URL: https://www.kernel.org/ + +Summary: The Linux kernel + +Requires: kernel-modules-uname-r = %{version}-%{release}.x86_64 +Requires: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description +The kernel meta package + +%package core +Summary: The Linux kernel + +Provides: installonlypkg(kernel) +Provides: kernel-uname-r = %{version}-%{release}.x86_64 +Provides: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description core +The kernel package contains the Linux kernel (vmlinuz), the core of any +Linux operating system. The kernel handles the basic functions +of the operating system: memory allocation, process allocation, device +input and output, etc. + +%package modules +Summary: kernel modules to match the core kernel + +Provides: installonlypkg(kernel-module) +Provides: kernel-modules-uname-r = %{version}-%{release}.x86_64 + +Requires: kernel-uname-r = %{version}-%{release}.x86_64 + +%description modules +This package provides commonly used kernel modules for the core kernel package. + +%files + +%files core +%ghost /boot/vmlinuz-%{version}-%{release}.x86_64 + +%files modules + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/kernel/kernel-3.0.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/kernel/kernel-3.0.0-1.fc29.spec new file mode 100644 index 000000000..28e34731b --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/kernel/kernel-3.0.0-1.fc29.spec @@ -0,0 +1,48 @@ +Name: kernel +Epoch: 0 +Version: 3.0.0 +Release: 1.fc29 + +License: GPLv2 and Redistributable, no modification permitted +URL: https://www.kernel.org/ + +Summary: The Linux kernel + +Requires: kernel-modules-uname-r = %{version}-%{release}.x86_64 +Requires: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description +The kernel meta package + +%package core +Summary: The Linux kernel + +Provides: installonlypkg(kernel) +Provides: kernel-uname-r = %{version}-%{release}.x86_64 +Provides: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description core +The kernel package contains the Linux kernel (vmlinuz), the core of any +Linux operating system. The kernel handles the basic functions +of the operating system: memory allocation, process allocation, device +input and output, etc. + +%package modules +Summary: kernel modules to match the core kernel + +Provides: installonlypkg(kernel-module) +Provides: kernel-modules-uname-r = %{version}-%{release}.x86_64 + +Requires: kernel-uname-r = %{version}-%{release}.x86_64 + +%description modules +This package provides commonly used kernel modules for the core kernel package. + +%files + +%files core +%ghost /boot/vmlinuz-%{version}-%{release}.x86_64 + +%files modules + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/kernel/kernel-4.0.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/kernel/kernel-4.0.0-1.fc29.spec new file mode 100644 index 000000000..1a665f351 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/kernel/kernel-4.0.0-1.fc29.spec @@ -0,0 +1,48 @@ +Name: kernel +Epoch: 0 +Version: 4.0.0 +Release: 1.fc29 + +License: GPLv2 and Redistributable, no modification permitted +URL: https://www.kernel.org/ + +Summary: The Linux kernel + +Requires: kernel-modules-uname-r = %{version}-%{release}.x86_64 +Requires: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description +The kernel meta package + +%package core +Summary: The Linux kernel + +Provides: installonlypkg(kernel) +Provides: kernel-uname-r = %{version}-%{release}.x86_64 +Provides: kernel-core-uname-r = %{version}-%{release}.x86_64 + +%description core +The kernel package contains the Linux kernel (vmlinuz), the core of any +Linux operating system. The kernel handles the basic functions +of the operating system: memory allocation, process allocation, device +input and output, etc. + +%package modules +Summary: kernel modules to match the core kernel + +Provides: installonlypkg(kernel-module) +Provides: kernel-modules-uname-r = %{version}-%{release}.x86_64 + +Requires: kernel-uname-r = %{version}-%{release}.x86_64 + +%description modules +This package provides commonly used kernel modules for the core kernel package. + +%files + +%files core +%ghost /boot/vmlinuz-%{version}-%{release}.x86_64 + +%files modules + +%changelog