Skip to content
Merged
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
83 changes: 83 additions & 0 deletions dnf-behave-tests/dnf/plugins-core/config-manager-repos.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Feature: dnf "config-manager" command — test "enable" and "disable" subcommands

Background:
Given I create file "/etc/yum.repos.d/base-oss.repo" with
"""
[base-oss]
name=repository file
enabled=1
baseurl=http://something1.com/os/
"""
And I create file "/etc/yum.repos.d/base-nonoss.repo" with
"""
[base-non-oss]
name=repository file
enabled=0
baseurl=http://something2.com/os/
"""
And I create file "/etc/yum.repos.d/updates-oss.repo" with
"""
[updates-oss]
name=repository file
enabled=1
baseurl=http://something3.com/os/
"""

Scenario: specific repository gets enabled
Given I create directory "/etc/dnf/repos.override.d/"
When I execute dnf with args "config-manager enable base-oss"
Then the exit code is 0
And file "/etc/dnf/repos.override.d/99-config_manager.repo" contents is
"""
# Generated by dnf5 config-manager.
# Do not modify this file manually, use dnf5 config-manager instead.
[base-oss]
enabled=1
"""

Scenario: specific repository gets disabled
Given I create directory "/etc/dnf/repos.override.d/"
When I execute dnf with args "config-manager disable base-oss"
Then the exit code is 0
And file "/etc/dnf/repos.override.d/99-config_manager.repo" contents is
"""
# Generated by dnf5 config-manager.
# Do not modify this file manually, use dnf5 config-manager instead.
[base-oss]
enabled=0
"""

Scenario: specific repository gets disabled and then re-enabled
Given I create directory "/etc/dnf/repos.override.d/"
When I execute dnf with args "config-manager disable base-oss"
And I execute dnf with args "config-manager enable base-oss"
Then the exit code is 0
And file "/etc/dnf/repos.override.d/99-config_manager.repo" contents is
"""
# Generated by dnf5 config-manager.
# Do not modify this file manually, use dnf5 config-manager instead.
[base-oss]
enabled=1
"""

Scenario: pattern is used for enabling repositories
Given I create directory "/etc/dnf/repos.override.d/"
When I execute dnf with args "config-manager enable *-oss"
Then the exit code is 0
And file "/etc/dnf/repos.override.d/99-config_manager.repo" contents is
"""
# Generated by dnf5 config-manager.
# Do not modify this file manually, use dnf5 config-manager instead.
[base-non-oss]
enabled=1
[base-oss]
enabled=1
[updates-oss]
enabled=1
"""

Scenario: invalid pattern is used
Given I create directory "/etc/dnf/repos.override.d/"
When I execute dnf with args "config-manager enable *-proprietary"
Then the exit code is 1
And stderr contains "No matching repository to modify: \*-proprietary"
Loading