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

[needs-restarting] add opt using config file (RhBug:1810123) #814

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,120 @@
Feature: Add package to needs-restarting using config files

Background:
Given I enable plugin "needs_restarting"
And I use repository "needs-restarting"
And I move the clock backward to "before boot-up"
And I execute dnf with args "install wget abcde"
And I move the clock forward to "the present"
And I use repository "needs-restarting-updates"
And I create directory "/etc/dnf/plugins/needs-restarting.d"
And I create and substitute file "/etc/dnf/plugins/needs-restarting.d/wget.conf" with
"""
wget
"""

@bz1810123
Scenario: restarting needed after updating package in conf files
Given I execute dnf with args "upgrade wget"
When I execute dnf with args "needs-restarting -r"
Then the exit code is 1
And stdout is
"""
Core libraries or services have been updated since boot-up:
* wget

Reboot is required to fully utilize these updates.
More information: https://access.redhat.com/solutions/27943
"""

@bz1810123
Scenario: conf files can be more than one
Given I create and substitute file "/etc/dnf/plugins/needs-restarting.d/abcde.conf" with
"""
abcde
"""
And I successfully execute dnf with args "upgrade wget abcde"
When I execute dnf with args "needs-restarting -r"
Then the exit code is 1
And stdout is
"""
Core libraries or services have been updated since boot-up:
* abcde
* wget

Reboot is required to fully utilize these updates.
More information: https://access.redhat.com/solutions/27943
"""

@bz1810123
Scenario: conf files can contain more than one option
Given I create and substitute file "/etc/dnf/plugins/needs-restarting.d/wget.conf" with
"""
wget
abcde
"""
And I successfully execute dnf with args "upgrade wget abcde"
When I execute dnf with args "needs-restarting -r"
Then the exit code is 1
And stdout is
"""
Core libraries or services have been updated since boot-up:
* abcde
* wget

Reboot is required to fully utilize these updates.
More information: https://access.redhat.com/solutions/27943
"""

@bz1810123
Scenario: conf files without .conf extension are ignored
Given I create and substitute file "/etc/dnf/plugins/needs-restarting.d/abcde" with
"""
abcde
"""
And I successfully execute dnf with args "upgrade abcde"
When I execute dnf with args "needs-restarting -r"
Then the exit code is 0
And stdout is
"""
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.
"""

@bz1810123
Scenario: user gets a warning when program is not installed
Given I create and substitute file "/etc/dnf/plugins/needs-restarting.d/abcde.conf" with
"""
abcde
"""
And I successfully execute dnf with args "remove abcde"
And I successfully execute dnf with args "upgrade wget"
When I execute dnf with args "needs-restarting -r"
Then the exit code is 1
And stdout is
"""
Core libraries or services have been updated since boot-up:
* wget

Reboot is required to fully utilize these updates.
More information: https://access.redhat.com/solutions/27943
"""
And stderr is
"""
No installed package found for package name "abcde" specified in needs-restarting file "abcde.conf".
"""

@bz1810123
Scenario: package self adds to needs-restarting
Given I successfully execute dnf with args "install dwm"
When I execute dnf with args "needs-restarting -r"
Then the exit code is 1
And stdout is
"""
Core libraries or services have been updated since boot-up:
* dwm

Reboot is required to fully utilize these updates.
More information: https://access.redhat.com/solutions/27943
"""

@@ -0,0 +1,18 @@
Name: abcde
Version: 1.1
Release: 1%{?dist}
Summary: A Better CD Encoder

# cddb-tool is Public Domain, otherwise GPLv2+
License: GPLv2+ and Public Domain
URL: https://abcde.einval.com/

BuildArch: noarch
Requires: wget

%description
Test package for needs-restarting plugin

%files

%changelog
@@ -0,0 +1,18 @@
Name: wget
Version: 1.1
Release: 1%{?dist}
Summary: A utility for retrieving files using the HTTP or FTP protocols

License: GPLv3+
Group: Applications/Internet
Url: http://www.gnu.org/software/wget/

Provides: webclient
Provides: bundled(gnulib)

%description
Test package for needs-restarting plugin

%files

%changelog
@@ -0,0 +1,18 @@
Name: abcde
Version: 1.0
Release: 1%{?dist}
Summary: A Better CD Encoder

# cddb-tool is Public Domain, otherwise GPLv2+
License: GPLv2+ and Public Domain
URL: https://abcde.einval.com/

BuildArch: noarch
Requires: wget

%description
Test package for needs-restarting plugin

%files

%changelog
@@ -0,0 +1,30 @@
BuildArch: x86_64
Name: dwm
Version: 1.0
Release: 1
License: MIT
Group: User Interface/Desktops
Summary: Dynamic window manager for X
Distribution: Fedora Project
DistTag: module(dwm:6.0:20180813144159:6c81f848)
URL: http://dwm.suckless.org/
Vendor: Fedora Project
Packager: Fedora Project




Provides: dwm = 6.0-1.module_1997+c375c79c
Provides: dwm(x86-64) = 6.0-1.module_1997+c375c79c
#suggest
#enhance
%description
Test package for needs-restarting plugins

%install
mkdir -p %{buildroot}/etc/dnf/plugins/needs-restarting.d/
echo "dwm" > %{buildroot}/etc/dnf/plugins/needs-restarting.d/dwm.conf

%files
%dir /etc/dnf/plugins/needs-restarting.d
/etc/dnf/plugins/needs-restarting.d/dwm.conf
@@ -0,0 +1,18 @@
Name: wget
Version: 1.0
Release: 1%{?dist}
Summary: A utility for retrieving files using the HTTP or FTP protocols

License: GPLv3+
Group: Applications/Internet
Url: http://www.gnu.org/software/wget/

Provides: webclient
Provides: bundled(gnulib)

%description
Test package for needs-restarting plugins

%files

%changelog