|
| 1 | +@dnf5 |
| 2 | +#TODO(amatej): replace log checking with https://github.com/rpm-software-management/dnf5/issues/1335 |
1 | 3 | Feature: Pluginspath and pluginsconfpath test |
2 | 4 |
|
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 | + """ |
24 | 40 |
|
25 | 41 |
|
26 | 42 | 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 | + """ |
39 | 63 |
|
40 | 64 |
|
41 | 65 | 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 | + """ |
0 commit comments