Skip to content

Commit

Permalink
Add test for installing installonly through provides
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura committed Oct 4, 2023
1 parent 70b841d commit 56df15d
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 0 deletions.
50 changes: 50 additions & 0 deletions dnf-behave-tests/dnf/installonly.feature
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,53 @@ Scenario: Kernel upgrade does not fail when installonly_limit=1 (default value i
| Action | Package |
| install | kernel-core-0:4.19.15-300.fc29.x86_64 |
| unchanged | kernel-core-0:4.18.16-300.fc29.x86_64 |


@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-dep | kernel-core-0:4.20.6-300.fc29.x86_64 |
| install-dep | 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 |


@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-dep | 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 |
48 changes: 48 additions & 0 deletions dnf-behave-tests/fixtures/specs/kernel/kernel-1.0.0-1.fc29.spec
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions dnf-behave-tests/fixtures/specs/kernel/kernel-2.0.0-1.fc29.spec
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions dnf-behave-tests/fixtures/specs/kernel/kernel-3.0.0-1.fc29.spec
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions dnf-behave-tests/fixtures/specs/kernel/kernel-4.0.0-1.fc29.spec
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 56df15d

Please sign in to comment.