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

Adjust dnf-automatic tests for dnf5 #1399

Merged
merged 1 commit into from
Mar 6, 2024
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
31 changes: 13 additions & 18 deletions dnf-behave-tests/dnf/dnf-automatic/reboot.feature
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
@no_installroot
@dnf5
Feature: dnf-automatic reboots


Background:
Given I delete file "/etc/yum.repos.d/*.repo" with globs
And I create file "/etc/dnf/dnf.conf" with
"""
[main]
plugins=0
"""
Given I enable plugin "automatic"
And I use repository "simple-base"
And I successfully execute dnf with args "install labirinto"
And I use repository "simple-updates"


@bz2124793
Scenario: dnf-automatic does not reboot when reboot = never
Given I create file "/etc/dnf/automatic.conf" with
Given I create file "/etc/dnf/dnf5-plugins/automatic.conf" with
"""
[commands]
reboot = never
Expand All @@ -24,7 +19,7 @@ Scenario: dnf-automatic does not reboot when reboot = never
[emitters]
emit_via = stdio
"""
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 0
And Transaction is following
| Action | Package |
Expand All @@ -36,7 +31,7 @@ Scenario: dnf-automatic does not reboot when reboot = never

@bz2124793
Scenario: dnf-automatic reboots when packages changed and reboot = when-changed
Given I create file "/etc/dnf/automatic.conf" with
Given I create file "/etc/dnf/dnf5-plugins/automatic.conf" with
"""
[commands]
reboot = when-changed
Expand All @@ -45,7 +40,7 @@ Scenario: dnf-automatic reboots when packages changed and reboot = when-changed
[emitters]
emit_via = stdio
"""
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 0
And Transaction is following
| Action | Package |
Expand All @@ -57,7 +52,7 @@ Scenario: dnf-automatic reboots when packages changed and reboot = when-changed

@bz2124793
Scenario: dnf-automatic reboots when reboot = when-needed and important package changed
Given I create file "/etc/dnf/automatic.conf" with
Given I create file "/etc/dnf/dnf5-plugins/automatic.conf" with
"""
[commands]
reboot = when-needed
Expand All @@ -69,7 +64,7 @@ Scenario: dnf-automatic reboots when reboot = when-needed and important package
And I use repository "dnf-ci-fedora"
And I successfully execute dnf with args "install kernel"
And I use repository "dnf-ci-fedora-updates"
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 0
And stdout contains lines:
"""
Expand All @@ -78,7 +73,7 @@ Scenario: dnf-automatic reboots when reboot = when-needed and important package

@bz2124793
Scenario: dnf-automatic does not reboot when reboot = when-needed and nothing important changed
Given I create file "/etc/dnf/automatic.conf" with
Given I create file "/etc/dnf/dnf5-plugins/automatic.conf" with
"""
[commands]
reboot = when-needed
Expand All @@ -87,7 +82,7 @@ Scenario: dnf-automatic does not reboot when reboot = when-needed and nothing im
[emitters]
emit_via = stdio
"""
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 0
And Transaction is following
| Action | Package |
Expand All @@ -99,7 +94,7 @@ Scenario: dnf-automatic does not reboot when reboot = when-needed and nothing im

@bz2124793
Scenario: dnf-automatic shows error message when reboot command failed
Given I create file "/etc/dnf/automatic.conf" with
Given I create file "/etc/dnf/dnf5-plugins/automatic.conf" with
"""
[commands]
reboot = when-changed
Expand All @@ -108,7 +103,7 @@ Scenario: dnf-automatic shows error message when reboot command failed
[emitters]
emit_via = stdio
"""
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 1
And Transaction is following
| Action | Package |
Expand Down
29 changes: 11 additions & 18 deletions dnf-behave-tests/dnf/dnf-automatic/update.feature
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
@no_installroot
@dnf5
Feature: dnf-automatic performs update


Background:
Given I delete file "/etc/yum.repos.d/*.repo" with globs
And I create file "/etc/dnf/dnf.conf" with
"""
[main]
plugins=0
"""
Given I enable plugin "automatic"
And I use repository "simple-base"


Scenario: dnf-automatic can update package
Given I use repository "simple-base"
And I successfully execute dnf with args "install labirinto"
Given I successfully execute dnf with args "install labirinto"
And I use repository "simple-updates"
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 0
And Transaction is following
| Action | Package |
Expand All @@ -24,23 +19,21 @@ Scenario: dnf-automatic can update package

@bz1793298
Scenario: dnf-automatic fails to update when the update package is not signed
Given I use repository "simple-base"
And I successfully execute dnf with args "install labirinto"
Given I successfully execute dnf with args "install labirinto"
And I use repository "simple-updates" with configuration
| key | value |
| gpgcheck | 1 |
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 1
And Transaction is empty
And RPMDB Transaction is empty


@bz1793298
Scenario: dnf-automatic fails to update when the public gpg key is not installed
Given I use repository "simple-base"
And I successfully execute dnf with args "install dedalo-signed-1.0"
Given I successfully execute dnf with args "install dedalo-signed-1.0"
And I use repository "simple-updates" with configuration
| key | value |
| gpgcheck | 1 |
When I execute dnf-automatic with args "--installupdates"
When I execute dnf with args "automatic --installupdates"
Then the exit code is 1
And Transaction is empty
And RPMDB Transaction is empty
Loading