Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for installing installonly through provides #1392

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions dnf-behave-tests/dnf/installonly.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
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
Loading