Skip to content

Commit

Permalink
Enable and update some module tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pkratoch committed Nov 21, 2023
1 parent 72de2d9 commit 4b427d0
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 37 deletions.
49 changes: 23 additions & 26 deletions dnf-behave-tests/dnf/module/defaults-conflict.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: Not fail if conflicts in module metadata.

@bz1656019
Expand All @@ -7,33 +8,30 @@ Feature: Not fail if conflicts in module metadata.
When I execute dnf with args "module list"
Then the exit code is 0
And module list is
| Repository | Name | Stream | Profiles |
| dnf-ci-thirdparty-modular-updates | cookbook | 1 | ham-and-eggs, orange-juice, axe-soup |
| dnf-ci-thirdparty-modular-updates | ingredience | chicken | default |
| dnf-ci-thirdparty-modular-updates | ingredience | egg | default |
| dnf-ci-thirdparty-modular-updates | ingredience | orange | default |
| dnf-ci-thirdparty-modular-updates | ingredience | strawberry | default |
| dnf-ci-thirdparty-modular-updates-conflict | ingredience | chicken| default |
| dnf-ci-thirdparty-modular-updates-conflict | ingredience | egg | default |
| dnf-ci-thirdparty-modular-updates-conflict | ingredience | orange | default |
| Name | Stream | Profiles |
| cookbook | 1 | ham-and-eggs, orange-juice, axe-soup |
| ingredience | chicken | default |
| ingredience | egg | default |
| ingredience | orange | default |
| ingredience | strawberry | default |

When I execute dnf with args "module list --disablerepo=dnf-ci-thirdparty-modular-updates-conflict"
Then the exit code is 0
And module list is
| Repository | Name | Stream | Profiles |
| dnf-ci-thirdparty-modular-updates | cookbook | 1 | ham-and-eggs, orange-juice, axe-soup |
| dnf-ci-thirdparty-modular-updates | ingredience | chicken | default |
| dnf-ci-thirdparty-modular-updates | ingredience | egg | default |
| dnf-ci-thirdparty-modular-updates | ingredience | orange [d] | default |
| dnf-ci-thirdparty-modular-updates | ingredience | strawberry | default |
| Name | Stream | Profiles |
| cookbook | 1 | ham-and-eggs, orange-juice, axe-soup |
| ingredience | chicken | default |
| ingredience | egg | default |
| ingredience | orange [d] | default |
| ingredience | strawberry | default |

When I execute dnf with args "module list --disablerepo=dnf-ci-thirdparty-modular-updates"
Then the exit code is 0
And module list is
| Repository | Name | Stream | Profiles|
| dnf-ci-thirdparty-modular-updates-conflict | ingredience | chicken [d] | default |
| dnf-ci-thirdparty-modular-updates-conflict | ingredience | egg | default |
| dnf-ci-thirdparty-modular-updates-conflict | ingredience | orange | default |
| Name | Stream | Profiles|
| ingredience | chicken [d] | default |
| ingredience | egg | default |
| ingredience | orange | default |


Scenario: Two streams that have matching NSVCA but different content (conflict) are dropped by libmodulemd, but defaults are unaffected
Expand All @@ -42,10 +40,9 @@ Given I use repository "dnf-ci-thirdparty-modular-updates"
When I execute dnf with args "module list"
Then the exit code is 0
And module list is
| Repository | Name | Stream | Profiles |
| dnf-ci-thirdparty-modular-updates | cookbook | 1 | ham-and-eggs, orange-juice, axe-soup |
| dnf-ci-thirdparty-modular-updates | ingredience | chicken | default |
| dnf-ci-thirdparty-modular-updates | ingredience | egg | default |
| dnf-ci-thirdparty-modular-updates | ingredience | orange [d] | default |
| dnf-ci-thirdparty-modular-updates | ingredience | strawberry | default |
| dnf-ci-thirdparty-modular-updates-duplicate | ingredience | egg | default |
| Name | Stream | Profiles |
| cookbook | 1 | ham-and-eggs, orange-juice, axe-soup |
| ingredience | chicken | default |
| ingredience | egg | default |
| ingredience | orange [d] | default |
| ingredience | strawberry | default |
11 changes: 6 additions & 5 deletions dnf-behave-tests/dnf/module/defaults.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ Scenario: The default stream is used when enabling a module
| nodejs | enabled | 8 | |


@dnf5
@bz1629702
Scenario: The default streams are identified in the output of module list
When I execute dnf with args "module list nodejs"
Then the exit code is 0
And module list is
| Repository | Name | Stream | Profiles |
| dnf-ci-fedora-modular | nodejs | 5 | development, minimal, default |
| dnf-ci-fedora-modular | nodejs | 8 [d] | development, minimal, default [d] |
| dnf-ci-fedora-modular | nodejs | 10 | development, minimal, default [d] |
| dnf-ci-fedora-modular | nodejs | 11 | development, minimal, default |
| Name | Stream | Profiles |
| nodejs | 5 | development, minimal, default |
| nodejs | 8 [d] | development, minimal, default [d] |
| nodejs | 10 | development, minimal, default [d] |
| nodejs | 11 | development, minimal, default |


@bz1618553
Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/module/disable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Background:
Given I use repository "dnf-ci-fedora"


@dnf5
@bz1677640
Scenario: I can disable a module when specifying module name
When I execute dnf with args "module enable nodejs:8"
Expand All @@ -21,6 +22,7 @@ Scenario: I can disable a module when specifying module name
| nodejs | disabled | | |


@dnf5
# this is not test for @bz1677640, but test is failing until the bug is fixed
Scenario: Disabling an already disabled module should pass
When I execute dnf with args "module enable nodejs:8"
Expand Down
1 change: 1 addition & 0 deletions dnf-behave-tests/dnf/module/enable-confirmation.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: Enable module requires confirmation


Expand Down
5 changes: 5 additions & 0 deletions dnf-behave-tests/dnf/module/enable-dependencies.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Scenario: Enabling a default stream depending on a non-default stream
| beverage | enabled | soda | |
| fluid | enabled | water | |

@dnf5
Scenario: Enabling a non-default stream depending on a default stream
Given I create file "/etc/dnf/modules.defaults.d/defaults.yaml" with
"""
Expand Down Expand Up @@ -106,6 +107,7 @@ Scenario: Enabling a non-default stream depending on a default stream
| fluid | enabled | water | |


@dnf5
# rely on merging bz1649261 fix
Scenario: Enabling a disabled stream depending on a default stream
Given I create file "/etc/dnf/modules.defaults.d/defaults.yaml" with
Expand Down Expand Up @@ -146,6 +148,7 @@ Scenario: Enabling a disabled stream depending on a default stream
| fluid | enabled | water | |


@dnf5
# rely on merging bz1649261 fix
Scenario: Enabling a disabled stream depending on a non-default stream
Given I create file "/etc/dnf/modules.defaults.d/defaults.yaml" with
Expand Down Expand Up @@ -321,6 +324,7 @@ Scenario: Cannot enable a stream depending on a disabled module
| ingredience | disabled | | |


@dnf5
Scenario: Enable a module stream dependent on a module with a default stream
When I execute dnf with args "module enable food-type:edible"
Then the exit code is 0
Expand All @@ -334,6 +338,7 @@ Scenario: Enable a module stream dependent on a module with a default stream
| ingredience | enabled | orange | |


@dnf5
Scenario: Enable a module stream dependent on a module without default stream
Given I use repository "dnf-ci-fedora-modular-updates"
When I execute dnf with args "module enable nodejs:12"
Expand Down
6 changes: 3 additions & 3 deletions dnf-behave-tests/dnf/module/enable-errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ Scenario: Fail to enable a non-existent module stream
And stderr contains "missing groups or modules: nodejs:1"


@dnf5
Scenario: Fail to enable a module stream when not specifying anything
Given I set dnf command to "dnf"
When I execute dnf with args "module enable"
Then the exit code is 1
Then the exit code is 2
And Transaction is empty
And modules state is following
| Module | State | Stream | Profiles |
And stderr is
"""
Error: dnf module enable: too few arguments
Missing positional argument "specs" for command "enable". Add "--help" for more information about the arguments.
"""


Expand Down
1 change: 1 addition & 0 deletions dnf-behave-tests/dnf/module/enable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Examples:
| glob:glob:glob | node*:*:*0801* |


@dnf5
Scenario: Enable a module stream that was already enabled
When I execute dnf with args "module enable nodejs:8"
Then the exit code is 0
Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/module/filter-rpms.feature
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Given I use repository "dnf-ci-fedora"
| install | ninja-build-0:1.8.2-5.fc29.x86_64 |


@dnf5
Scenario: ursine pkg is preferred over module without default
Given I use repository "dnf-ci-fedora"
When I execute dnf with args "install dwm"
Expand All @@ -59,6 +60,7 @@ Given I use repository "dnf-ci-fedora"
| install | dwm-0:6.1-1.x86_64 |


@dnf5
Scenario: RPMs from non-active streams are not available
When I execute dnf with args "module disable nodejs:8"
Then I execute dnf with args "list --available dwm.x86_64"
Expand Down
4 changes: 4 additions & 0 deletions dnf-behave-tests/dnf/module/filtering.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: Modular filtering must provide onlu relevant source packages

Background:
Expand All @@ -14,6 +15,7 @@ Scenario: Check that only module packages including src are available
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
berry-0:1.0-1.wood.src
berry-0:1.0-1.wood.x86_64
"""
Expand All @@ -29,6 +31,7 @@ Scenario: Check that only module packages including src are available
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
berry-0:1.0-1.garden.src
berry-0:1.0-1.garden.x86_64
"""
Expand All @@ -45,6 +48,7 @@ Scenario: Check that source packages do not filter binary rpms
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
yum-0:3.4.3-0.x86_64
yum-0:3.8.3-0.f29.modular.src
yum-0:3.8.3-0.f29.modular.x86_64
Expand Down
7 changes: 5 additions & 2 deletions dnf-behave-tests/dnf/module/help.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@dnf5
Feature: Module usage help

Scenario: I can print help using dnf module --help
When I execute dnf with args "module --help"
Then stdout contains "usage: .+ module \[-c \[config file\]\]"
Then stdout contains "Usage:"
And stdout contains "dnf5 \[GLOBAL OPTIONS\] module <COMMAND>"

Scenario: I can print help using dnf module -h
When I execute dnf with args "module -h"
Then stdout contains "usage: .+ module \[-c \[config file\]\]"
Then stdout contains "Usage:"
And stdout contains "dnf5 \[GLOBAL OPTIONS\] module <COMMAND>"
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/module/metadata-format.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Given I use repository "additional-field-modulemd"
"""


@dnf5
@bz2004853
@bz2007166
@bz2007167
Expand All @@ -41,6 +42,7 @@ Given I use repository "additional-field-modulemd"
When I execute dnf with args "repoquery nodejs"
Then stdout is
"""
<REPOSYNC>
nodejs-1:5.3.1-1.module_2011+41787af0.src
nodejs-1:5.3.1-1.module_2011+41787af0.x86_64
"""
3 changes: 2 additions & 1 deletion dnf-behave-tests/dnf/module/obsoletes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ Given I execute dnf with args "module install nodejs:5/minimal"
| nodejs | enabled | 10 | |


@dnf5
Scenario: two stream changes, one of which is obsoletes, do not throw exception
Given I execute dnf with args "module enable nodejs:5"
When I use repository "dnf-ci-fedora-modular-obsoletes"
And I execute dnf with args "module reset nodejs"
Then the exit code is 0
And modules state is following
| Module | State | Stream | Profiles |
| nodejs | | | |
| nodejs | available | | |


Scenario: stream is resetted according to obsoletes in new metadata
Expand Down
4 changes: 4 additions & 0 deletions dnf-behave-tests/dnf/module/platform-detection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Detecting proper modular platform
Background:
Given I use repository "dnf-ci-pseudo-platform-modular"

@dnf5
Scenario: Platform pseudo module name:stream is created based on /usr/lib/os-release
Given I do not set default module platformid
And I create file "/usr/lib/os-release" with
Expand All @@ -22,6 +23,7 @@ Scenario: Platform pseudo module name:stream is created based on /usr/lib/os-rel
| dwm | enabled | 6.0 | |


@dnf5
@jiraRHELPLAN-6083
Scenario: Platform pseudo module name:stream is created based on /etc/os-release
Given I do not set default module platformid
Expand Down Expand Up @@ -51,6 +53,7 @@ Scenario: Platform pseudo module name:stream is created based on /etc/os-release



@dnf5
Scenario: Platform is detected using virtual provide of installed os-release package
Given I do not set default module platformid
And I create file "/etc/os-release" with
Expand All @@ -73,6 +76,7 @@ Scenario: Platform is detected using virtual provide of installed os-release pac
| Module | State | Stream | Profiles |
| dwm | enabled | 6.0 | |

@dnf5
@bz1709453
Scenario: Platform is detected using virtual provide of os-release package in enabled repo but not from excluded package
Given I do not set default module platformid
Expand Down
1 change: 1 addition & 0 deletions dnf-behave-tests/dnf/module/platform.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Given I delete file "/etc/os-release"
And stderr contains "nothing provides module\(pseudoplatform:6.0\) needed by module dwm:6.0:20180813144159:.x86_64"


@dnf5
Scenario: I can't see pseudo-module in module listing
When I execute dnf with args "module enable dwm:6.0"
Then the exit code is 0
Expand Down
1 change: 1 addition & 0 deletions dnf-behave-tests/dnf/module/reset.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: Reset modules


Expand Down

0 comments on commit 4b427d0

Please sign in to comment.