Skip to content
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
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/plugin-api.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@xfail
# Reported as https://github.com/rpm-software-management/ci-dnf-stack/issues/1632
Feature: Plugin API


Expand Down
58 changes: 36 additions & 22 deletions dnf-behave-tests/dnf/plugin-enable.feature
Original file line number Diff line number Diff line change
@@ -1,42 +1,56 @@
@dnf5
#TODO(amatej): replace log checking with https://github.com/rpm-software-management/dnf5/issues/1335
Feature: Plugin enablement by config file and command line option


Background:
Given I do not disable plugins


Scenario: Verify that debuginfo-install plugin is enabled
When I execute dnf with args "-v repolist"
Then stdout contains "Loaded plugins:.* debuginfo-install.*"
Scenario: Verify that actions plugin is enabled
When I execute dnf with args "repo list"
Then file "/var/log/dnf5.log" contains lines
"""
.* Loaded libdnf plugin "actions" .*
"""


Scenario: Disable enabled debuginfo-install plugin from command line
When I execute dnf with args "-v repolist --disableplugin=debuginfo-install"
Then stdout does not contain "Loaded plugins:.* debuginfo-install.*"
Scenario: Disable enabled actions plugin from command line
When I execute dnf with args "repo list --disable-plugin=actions"
Then file "/var/log/dnf5.log" does not contain lines
"""
.* Loaded libdnf plugin "actions" .*
"""


Scenario: Disable debuginfo-install plugin by config file
Given I create file "/etc/dnf/plugins/debuginfo-install.conf" with
"""
[main]
enabled=0
"""
Scenario: Disable actions plugin by config file
Given I create file "/etc/dnf/plugins/actions.conf" with
"""
[main]
enabled= 0
"""
And I configure dnf with
| key | value |
| pluginconfpath | {context.dnf.installroot}/etc/dnf/plugins |
When I execute dnf with args "-v repolist"
Then stdout does not contain "Loaded plugins:.* debuginfo-install.*"
When I execute dnf with args "repo list"
Then file "/var/log/dnf5.log" does not contain lines
"""
.* Loaded libdnf plugin "actions" .*
"""


@bz1614539
Scenario: Enable disabled debuginfo-install plugin from command line
Given I create file "/etc/dnf/plugins/debuginfo-install.conf" with
"""
[main]
enabled=0
"""
Scenario: Enable disabled actions plugin from command line
Given I create file "/etc/dnf/plugins/actions.conf" with
"""
[main]
enabled= 0
"""
And I configure dnf with
| key | value |
| pluginconfpath | {context.dnf.installroot}/etc/dnf/plugins |
When I execute dnf with args "-v repolist --enableplugin=debuginfo-install"
Then stdout contains "Loaded plugins:.* debuginfo-install.*"
When I execute dnf with args "repo list --enable-plugin=actions"
Then file "/var/log/dnf5.log" contains lines
"""
.* Loaded libdnf plugin "actions" .*
"""
130 changes: 81 additions & 49 deletions dnf-behave-tests/dnf/plugins-path.feature
Original file line number Diff line number Diff line change
@@ -1,57 +1,89 @@
@dnf5
#TODO(amatej): replace log checking with https://github.com/rpm-software-management/dnf5/issues/1335
Feature: Pluginspath and pluginsconfpath test

Scenario: Redirect pluginspath
When I execute dnf with args "download --help"
Then the exit code is 0
When I execute dnf with args "versionlock --help"
Then the exit code is 0
Given I configure dnf with
| key | value |
| pluginpath | {context.dnf.installroot}/test/plugins |
And I create file "/test/plugins/download.py" with
"""
import dnf.cli

@dnf.plugin.register_command
class DownloadCommand(dnf.cli.Command):
aliases = ['download']
"""
When I execute dnf with args "download --help"
Then the exit code is 0
When I execute dnf with args "versionlock --help"
Then the exit code is 1
And stderr contains "No such command: versionlock."

Background:
Given I do not disable plugins


Scenario: Redirect pluginpath and pluginconfpath
Given I successfully execute dnf with args "repo list"
And file "/var/log/dnf5.log" contains lines
"""
.* Loaded libdnf plugin "actions" .*
"""
And I configure dnf with
| key | value |
| pluginpath | {context.dnf.installroot}/test/plugins |
When I execute dnf with args "repo list"
Then the exit code is 1
And stdout is empty
And stderr is
"""
Cannot load libdnf plugin enabled from: /etc/dnf/libdnf5-plugins/actions.conf
Cannot find plugin library "{context.dnf.installroot}/test/plugins/actions.so"
"""
# Remove the previous log which contains successfully loaded plugin actions msg
Given I delete file "/var/log/dnf5.log"
And I configure dnf with
| key | value |
| pluginconfpath | {context.dnf.installroot}/test/plugins |
When I execute dnf with args "repo list"
Then the exit code is 0
And stdout is empty
And stderr is empty
And file "/var/log/dnf5.log" does not contain lines
"""
.* Loaded libdnf plugin "actions" .*
"""


Scenario: Test default pluginsconfpath
Given I do not disable plugins
When I execute dnf with args "versionlock"
Then the exit code is 0
# create versionlock.conf inside the installroot
Given I create file "/etc/dnf/plugins/versionlock.conf" with
"""
[main]
enabled = 0
"""
# pluginconfpath is not related to installroot, so versionlock is not disabled
When I execute dnf with args "versionlock"
Then the exit code is 0
Given I successfully execute dnf with args "repo list"
And file "/var/log/dnf5.log" contains lines
"""
.* Loaded libdnf plugin "actions" .*
"""
# create actions.conf inside the installroot
And I create file "/etc/dnf/libdnf5-plugins/actions.conf" with
"""
[main]
enabled = 0
"""
# pluginconfpath is not related to installroot, so actions are not disabled
When I execute dnf with args "repo list"
Then the exit code is 0
And stdout is empty
And stderr is empty
And file "/var/log/dnf5.log" contains lines
"""
.* Loaded libdnf plugin "actions" .*
"""


Scenario: Redirect pluginsconfpath in dnf.conf
Given I do not disable plugins
When I execute dnf with args "versionlock"
Then the exit code is 0
Given I configure dnf with
| key | value |
| pluginconfpath | {context.dnf.installroot}/test/pluginconfpath |
Given I create file "/test/pluginconfpath/versionlock.conf" with
"""
[main]
enabled = 0
"""
# pluginconfpath is now set in installroot, so versionlock is disabled
When I execute dnf with args "versionlock"
Then the exit code is 1
And stderr contains "No such command: versionlock."

Given I successfully execute dnf with args "repo list"
And file "/var/log/dnf5.log" contains lines
"""
.* Loaded libdnf plugin "actions" .*
"""
And I configure dnf with
| key | value |
| pluginconfpath | {context.dnf.installroot}/test/pluginconfpath |
And I create file "/test/pluginconfpath/actions.conf" with
"""
[main]
enabled = 0
"""
# Remove the previous log which contains successfully loaded plugin actions msg
And I delete file "/var/log/dnf5.log"
# pluginconfpath is now set in installroot, so versionlock is disabled
When I execute dnf with args "repo list"
Then the exit code is 0
And stdout is empty
And stderr is empty
And file "/var/log/dnf5.log" does not contain lines
"""
.* Loaded libdnf plugin "actions" .*
"""
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/plugins-removal.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@xfail
# Reported as https://github.com/rpm-software-management/ci-dnf-stack/issues/1632
@no_installroot
Feature: Test execution of transaction() callback of removed plugin

Expand Down
58 changes: 0 additions & 58 deletions dnf-behave-tests/dnf/plugins-third/swidtags.feature

This file was deleted.

Loading