Skip to content

Commit

Permalink
Test switching of module streams
Browse files Browse the repository at this point in the history
  • Loading branch information
pkratoch committed Feb 28, 2024
1 parent 01855b3 commit e89bb48
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
26 changes: 3 additions & 23 deletions dnf-behave-tests/dnf/module/enable-errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Background:
Given I use repository "dnf-ci-fedora-modular-updates"


Scenario: Fail to enable a different stream of an already enabled module (dnf)
Given I set dnf command to "dnf"
@dnf5
Scenario: Fail to enable a different stream of an already enabled module
When I execute dnf with args "module enable nodejs:8"
Then the exit code is 0
And Transaction is following
Expand All @@ -22,32 +22,12 @@ Scenario: Fail to enable a different stream of an already enabled module (dnf)
| nodejs | enabled | 8 | |
And stderr is
"""
Failed to resolve the transaction:
The operation would result in switching of module 'nodejs' stream '8' to stream '10'
Error: It is not possible to switch enabled streams of a module unless explicitly enabled via configuration option module_stream_switch.
It is recommended to rather remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can install the other stream.
"""

Scenario: Fail to enable a different stream of an already enabled module (yum)
Given I set dnf command to "yum"
When I execute dnf with args "module enable nodejs:8"
Then the exit code is 0
And Transaction is following
| Action | Package |
| module-stream-enable | nodejs:8 |
And modules state is following
| Module | State | Stream | Profiles |
| nodejs | enabled | 8 | |
When I execute dnf with args "module enable nodejs:10"
Then the exit code is 1
And modules state is following
| Module | State | Stream | Profiles |
| nodejs | enabled | 8 | |
And stderr is
"""
The operation would result in switching of module 'nodejs' stream '8' to stream '10'
Error: It is not possible to switch enabled streams of a module unless explicitly enabled via configuration option module_stream_switch.
It is recommended to rather remove all installed content from the module, and reset the module using 'yum module reset <module_name>' command. After you reset the module, you can install the other stream.
"""

Scenario: Fail to install a different stream of an already enabled module
Given I set dnf command to "dnf"
Expand Down
23 changes: 23 additions & 0 deletions dnf-behave-tests/dnf/module/enable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,26 @@ Scenario: Enable a module stream that was already enabled
And modules state is following
| Module | State | Stream | Profiles |
| nodejs | enabled | 8 | |


@dnf5
Scenario: Enable a different stream of an already enabled module when module_stream_switch=true
Given I configure dnf with
| key | value |
| module_stream_switch | True |
When I execute dnf with args "module enable nodejs:8"
Then the exit code is 0
And Transaction is following
| Action | Package |
| module-stream-enable | nodejs:8 |
And modules state is following
| Module | State | Stream | Profiles |
| nodejs | enabled | 8 | |
When I execute dnf with args "module enable nodejs:10"
Then the exit code is 0
And Transaction is following
| Action | Package |
| module-stream-switch | nodejs:8 -> 10 |
And modules state is following
| Module | State | Stream | Profiles |
| nodejs | enabled | 10 | |

0 comments on commit e89bb48

Please sign in to comment.