Skip to content
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
63 changes: 63 additions & 0 deletions dnf-behave-tests/dnf/stick-to-vendor-default.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Feature: DNF allow_vendor_change defaults to false
Background:
Given I use repository "dnf-ci-vendor-1"
And I configure dnf with
| key | value |
| allow_vendor_change | False |
And I successfully execute dnf with args "install vendor"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | vendor-1.0-1.x86_64 |

Given I successfully execute rpm with args "-qi vendor"
Then the exit code is 0
And stdout contains "Vendor : First Vendor"


Scenario: Upgrade sticks to vendor by default
Given I use repository "dnf-ci-vendor-1-updates"
Given I use repository "dnf-ci-vendor-2-updates"
When I execute dnf with args "upgrade vendor"
Then the exit code is 0
And Transaction is following
| Action | Package |
| upgrade | vendor-1.1-1.x86_64 |
Given I successfully execute rpm with args "-qi vendor"
Then the exit code is 0
And stdout contains "Vendor : First Vendor"


Scenario: No upgrade if same vendor not found by default
Given I use repository "dnf-ci-vendor-2-updates"
When I execute dnf with args "upgrade vendor"
Then the exit code is 0
And Transaction is empty
Given I successfully execute rpm with args "-qi vendor"
Then the exit code is 0
And stdout contains "Vendor : First Vendor"


Scenario: Hint shown when vendor change blocked by default
Given I use repository "dnf-ci-vendor-1-updates"
When I execute dnf with args "upgrade vendor"
Given I drop repository "dnf-ci-vendor-1"
Given I use repository "dnf-ci-vendor-2"
When I execute dnf with args "downgrade vendor"
Then the exit code is 1
And Transaction is empty
And stdout is empty
And stderr contains "--setopt=allow_vendor_change=true to allow changing package vendors"


Scenario: Override default with --setopt=allow_vendor_change=true
Given I use repository "dnf-ci-vendor-1-updates"
Given I use repository "dnf-ci-vendor-2-updates"
When I execute dnf with args "upgrade --setopt=allow_vendor_change=true vendor"
Then the exit code is 0
And Transaction is following
| Action | Package |
| upgrade | vendor-1.2-1.x86_64 |
Given I successfully execute rpm with args "-qi vendor"
Then the exit code is 0
And stdout contains "Vendor : Second Vendor"
1 change: 1 addition & 0 deletions dnf-behave-tests/dnf/stick-to-vendor.feature
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ Scenario: Downgrade is unable to resolve transaction
- cannot install both vendor-1.0-1.x86_64 from dnf-ci-vendor-2 and vendor-1.1-1.x86_64 from dnf-ci-vendor-1-updates
- conflicting requests
You can try to add to command line:
--setopt=allow_vendor_change=true to allow changing package vendors
--skip-broken to skip uninstallable packages
"""
Loading