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

Test switching of module streams #1462

Merged
merged 2 commits into from
Apr 12, 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
29 changes: 3 additions & 26 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,11 @@ 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 All @@ -68,7 +47,6 @@ Scenario: Fail to install a different stream of an already enabled module
"""
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.
"""


Expand All @@ -92,7 +70,6 @@ Scenario: Fail to install a different stream of an already enabled module using
"""
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.
"""

@dnf5
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 @@ -40,3 +40,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 | |
Loading