Skip to content

Commit af5546f

Browse files
committed
Update, enable and annotate plugin* features
1 parent 72ef25c commit af5546f

File tree

4 files changed

+122
-72
lines changed

4 files changed

+122
-72
lines changed

dnf-behave-tests/dnf/plugin-api.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@xfail
2+
# Reported as https://github.com/rpm-software-management/ci-dnf-stack/issues/1632
13
Feature: Plugin API
24

35

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,56 @@
1+
@dnf5
2+
#TODO(amatej): replace log checking with https://github.com/rpm-software-management/dnf5/issues/1335
13
Feature: Plugin enablement by config file and command line option
24

35

46
Background:
57
Given I do not disable plugins
68

79

8-
Scenario: Verify that debuginfo-install plugin is enabled
9-
When I execute dnf with args "-v repolist"
10-
Then stdout contains "Loaded plugins:.* debuginfo-install.*"
10+
Scenario: Verify that actions plugin is enabled
11+
When I execute dnf with args "repo list"
12+
Then file "/var/log/dnf5.log" contains lines
13+
"""
14+
.* Loaded libdnf plugin "actions" .*
15+
"""
1116

1217

1318
Scenario: Disable enabled debuginfo-install plugin from command line
14-
When I execute dnf with args "-v repolist --disableplugin=debuginfo-install"
15-
Then stdout does not contain "Loaded plugins:.* debuginfo-install.*"
16-
17-
18-
Scenario: Disable debuginfo-install plugin by config file
19-
Given I create file "/etc/dnf/plugins/debuginfo-install.conf" with
20-
"""
21-
[main]
22-
enabled=0
23-
"""
19+
When I execute dnf with args "repo list --disable-plugin=actions"
20+
Then file "/var/log/dnf5.log" does not contain lines
21+
"""
22+
.* Loaded libdnf plugin "actions" .*
23+
"""
24+
25+
26+
Scenario: Disable actions plugin by config file
27+
Given I create file "/etc/dnf/plugins/actions.conf" with
28+
"""
29+
[main]
30+
enabled= 0
31+
"""
2432
And I configure dnf with
2533
| key | value |
2634
| pluginconfpath | {context.dnf.installroot}/etc/dnf/plugins |
27-
When I execute dnf with args "-v repolist"
28-
Then stdout does not contain "Loaded plugins:.* debuginfo-install.*"
35+
When I execute dnf with args "repo list"
36+
Then file "/var/log/dnf5.log" does not contain lines
37+
"""
38+
.* Loaded libdnf plugin "actions" .*
39+
"""
2940

3041

3142
@bz1614539
32-
Scenario: Enable disabled debuginfo-install plugin from command line
33-
Given I create file "/etc/dnf/plugins/debuginfo-install.conf" with
34-
"""
35-
[main]
36-
enabled=0
37-
"""
43+
Scenario: Enable disabled actions plugin from command line
44+
Given I create file "/etc/dnf/plugins/actions.conf" with
45+
"""
46+
[main]
47+
enabled= 0
48+
"""
3849
And I configure dnf with
3950
| key | value |
4051
| pluginconfpath | {context.dnf.installroot}/etc/dnf/plugins |
41-
When I execute dnf with args "-v repolist --enableplugin=debuginfo-install"
42-
Then stdout contains "Loaded plugins:.* debuginfo-install.*"
52+
When I execute dnf with args "repo list --enable-plugin=actions"
53+
Then file "/var/log/dnf5.log" contains lines
54+
"""
55+
.* Loaded libdnf plugin "actions" .*
56+
"""
Lines changed: 81 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,89 @@
1+
@dnf5
2+
#TODO(amatej): replace log checking with https://github.com/rpm-software-management/dnf5/issues/1335
13
Feature: Pluginspath and pluginsconfpath test
24

3-
Scenario: Redirect pluginspath
4-
When I execute dnf with args "download --help"
5-
Then the exit code is 0
6-
When I execute dnf with args "versionlock --help"
7-
Then the exit code is 0
8-
Given I configure dnf with
9-
| key | value |
10-
| pluginpath | {context.dnf.installroot}/test/plugins |
11-
And I create file "/test/plugins/download.py" with
12-
"""
13-
import dnf.cli
14-
15-
@dnf.plugin.register_command
16-
class DownloadCommand(dnf.cli.Command):
17-
aliases = ['download']
18-
"""
19-
When I execute dnf with args "download --help"
20-
Then the exit code is 0
21-
When I execute dnf with args "versionlock --help"
22-
Then the exit code is 1
23-
And stderr contains "No such command: versionlock."
5+
6+
Background:
7+
Given I do not disable plugins
8+
9+
10+
Scenario: Redirect pluginpath and pluginconfpath
11+
Given I successfully execute dnf with args "repo list"
12+
And file "/var/log/dnf5.log" contains lines
13+
"""
14+
.* Loaded libdnf plugin "actions" .*
15+
"""
16+
And I configure dnf with
17+
| key | value |
18+
| pluginpath | {context.dnf.installroot}/test/plugins |
19+
When I execute dnf with args "repo list"
20+
Then the exit code is 1
21+
And stdout is empty
22+
And stderr is
23+
"""
24+
Cannot load libdnf plugin enabled from: /etc/dnf/libdnf5-plugins/actions.conf
25+
Cannot find plugin library "{context.dnf.installroot}/test/plugins/actions.so"
26+
"""
27+
# Remove the previous log which contains successfully loaded plugin actions msg
28+
Given I delete file "/var/log/dnf5.log"
29+
And I configure dnf with
30+
| key | value |
31+
| pluginconfpath | {context.dnf.installroot}/test/plugins |
32+
When I execute dnf with args "repo list"
33+
Then the exit code is 0
34+
And stdout is empty
35+
And stderr is empty
36+
And file "/var/log/dnf5.log" does not contain lines
37+
"""
38+
.* Loaded libdnf plugin "actions" .*
39+
"""
2440

2541

2642
Scenario: Test default pluginsconfpath
27-
Given I do not disable plugins
28-
When I execute dnf with args "versionlock"
29-
Then the exit code is 0
30-
# create versionlock.conf inside the installroot
31-
Given I create file "/etc/dnf/plugins/versionlock.conf" with
32-
"""
33-
[main]
34-
enabled = 0
35-
"""
36-
# pluginconfpath is not related to installroot, so versionlock is not disabled
37-
When I execute dnf with args "versionlock"
38-
Then the exit code is 0
43+
Given I successfully execute dnf with args "repo list"
44+
And file "/var/log/dnf5.log" contains lines
45+
"""
46+
.* Loaded libdnf plugin "actions" .*
47+
"""
48+
# create actions.conf inside the installroot
49+
And I create file "/etc/dnf/libdnf5-plugins/actions.conf" with
50+
"""
51+
[main]
52+
enabled = 0
53+
"""
54+
# pluginconfpath is not related to installroot, so actions are not disabled
55+
When I execute dnf with args "repo list"
56+
Then the exit code is 0
57+
And stdout is empty
58+
And stderr is empty
59+
And file "/var/log/dnf5.log" contains lines
60+
"""
61+
.* Loaded libdnf plugin "actions" .*
62+
"""
3963

4064

4165
Scenario: Redirect pluginsconfpath in dnf.conf
42-
Given I do not disable plugins
43-
When I execute dnf with args "versionlock"
44-
Then the exit code is 0
45-
Given I configure dnf with
46-
| key | value |
47-
| pluginconfpath | {context.dnf.installroot}/test/pluginconfpath |
48-
Given I create file "/test/pluginconfpath/versionlock.conf" with
49-
"""
50-
[main]
51-
enabled = 0
52-
"""
53-
# pluginconfpath is now set in installroot, so versionlock is disabled
54-
When I execute dnf with args "versionlock"
55-
Then the exit code is 1
56-
And stderr contains "No such command: versionlock."
57-
66+
Given I successfully execute dnf with args "repo list"
67+
And file "/var/log/dnf5.log" contains lines
68+
"""
69+
.* Loaded libdnf plugin "actions" .*
70+
"""
71+
And I configure dnf with
72+
| key | value |
73+
| pluginconfpath | {context.dnf.installroot}/test/pluginconfpath |
74+
And I create file "/test/pluginconfpath/actions.conf" with
75+
"""
76+
[main]
77+
enabled = 0
78+
"""
79+
# Remove the previous log which contains successfully loaded plugin actions msg
80+
And I delete file "/var/log/dnf5.log"
81+
# pluginconfpath is now set in installroot, so versionlock is disabled
82+
When I execute dnf with args "repo list"
83+
Then the exit code is 0
84+
And stdout is empty
85+
And stderr is empty
86+
And file "/var/log/dnf5.log" does not contain lines
87+
"""
88+
.* Loaded libdnf plugin "actions" .*
89+
"""

dnf-behave-tests/dnf/plugins-removal.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@xfail
2+
# Reported as https://github.com/rpm-software-management/ci-dnf-stack/issues/1632
13
@no_installroot
24
Feature: Test execution of transaction() callback of removed plugin
35

0 commit comments

Comments
 (0)