-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add tests for dnf5 config-manager #1402
Add tests for dnf5 config-manager #1402
Conversation
7788d71
to
70bad0b
Compare
|
||
|
||
Background: | ||
Given I enable plugin "config_manager" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a problem of the PR, but personally I would prefer that we will not require to enable a particular plugin in test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed enabling of plugin. Plugins are enabled by default in configuration file.
|
||
|
||
Scenario: test "addrepo" from repofile, destination directory does not exist, "--create-missing-dir" creates missing directory | ||
Given I delete directory "/etc/yum.repos.d/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: I believe that there should be an additional space before Given:
. This is valid for multiple steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added space before Given
enabled=1 | ||
baseurl=http://something1.com/os/ | ||
""" | ||
And I create file "/etc/yum.repos.d/repo2.repo" with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be I overlooked something, but it looks like that repository repo2
is not used in any test in the feature file. Is there any reason to create it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repo2 was unused in this file. I deleted its creation.
|
||
|
||
Scenario: repository configuration overrides - new option to "repo1" | ||
Given I create directory "/etc/dnf/repos.override.d/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that should be additional space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
""" | ||
|
||
|
||
Scenario: unset/remove an main option, trying to unset an not set option is OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a problem of the test. What about to create a warning when option is not present in config file. It will help to discover typos - dnf config-manager unsetopt bests
. I think that return value 0 is OK for this case. What do you think?
priority=50 | ||
skip_if_unavailable=0 | ||
""" | ||
When I execute dnf with args "config-manager unsetopt repo1.priority" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use case must be well documented in man pages - config-manager does not touch original repository definition but only creates or remove overrides
""" | ||
|
||
|
||
Scenario: repository configuration overrides - unset/remove option, trying to unset an not set option is OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a warning for repository use case is essential. When I have a repository in yum.repos.d and I would like to modify the file by removing an option, config manager is not fulfill the requirement silently.
""" | ||
|
||
|
||
Scenario: unset/remove an existing variable, removing non-existent variable is OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we have a warning for this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor changes requested
There are old test that use
They could be enabled in the next PR. @jrohel What do you think? |
New tests for dnf5 "config-manager" have been written. They cover many more use cases than the original tests for dnf4 "config-manager". It serves as a replacement for the original tests. In addition, dnf5 "config-manager" has incompatible parameters and functionality, and therefore the original tests for dnf4 "config-manager" could not be used.
Original dnf4 test "Scenario: Lines that contain only whitespaces do not spoil previous config options" uses "config-manager --dump" to verify the value of the repository configuration option. In dnf5, the global configuration argument "--dump-repo-config" is used instead.
c56310c
to
13e6514
Compare
As agreed, I made changes to the CI tests that do not require modifications to the "config-manager" plugin source code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tests for rpm-software-management/dnf5#907