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

dnf5 config-manager: Sync w upstream - Add repoid to gener repo name, test warning messages #1429

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented Jan 4, 2024

The new upstream code rpm-software-management/dnf5#1128

  • adds the repository id to the generated repository name
  • writes warnings also to stderr (previously only to the log)

@jrohel jrohel force-pushed the feature/dnf5_config_manager2_tests branch from e9e7c7b to 6df66ec Compare February 29, 2024 11:43
@jrohel jrohel changed the title dnf5 config-manager: Sync with upstream - Add repoid to gener repo name dnf5 config-manager: Sync w upstream - Add repoid to gener repo name, test warning messages Feb 29, 2024
Comment on lines +174 to +181
Scenario: trying to unset an not set main option (config file is not found) is OK, but a warning is written
Given I delete file "/etc/dnf/dnf.conf"
When I execute dnf with args "config-manager unsetopt best"
Then the exit code is 0
And stderr is
"""
config-manager: Request to remove main option but config file not found: {context.dnf.installroot}/etc/dnf/dnf.conf
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what changed, but this scenario fails for me now. The problem is that dnf5 always fails with "Configuration file {config_path} not found" when the config file path is provided on the cli, which is also the case for the ci-dnf-stack tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkratoch It passed the tests locally on my PC. But you're right. If CI stack runs tests with config file path on cli it should fail. I have to look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkratoch
I looked into it. Why does it pass in local CI? And I saw the command:
dnf5 -y --installroot=/tmp/dnf_ci_installroot_q04aelti --releasever=29 --setopt=module_platform_id=platform:f29 --disableplugin='*' config-manager unsetopt best

This means that the path to the configuration file is not provided on the cli. And that's why it goes right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. The problem is in the CI stack in the get_dnf5_cmd method.
Compared to get_dnf4_cmd, it adds:

result.append("--setopt=reposdir=%s" % self.installroot + "/etc/yum.repos.d")
result.append("--setopt=config_file_path=%s" % self.installroot + "/etc/dnf/dnf.conf")
result.append("--setopt=cachedir=%s" % self.installroot + "/var/cache/dnf")

I started CI tests without --tags=dnf5, so get_dnf4_cmd was used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests pass with the change #1467

@pkratoch pkratoch merged commit ba3fb59 into rpm-software-management:main Mar 8, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants