Skip to content

Commit 48a4a73

Browse files
committed
Adapt behave tests for dnf5 allow_vendor_change=false
1 parent 560a60a commit 48a4a73

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Feature: DNF allow_vendor_change defaults to false
2+
Background:
3+
Given I use repository "dnf-ci-vendor-1"
4+
And I configure dnf with
5+
| key | value |
6+
| allow_vendor_change | False |
7+
And I successfully execute dnf with args "install vendor"
8+
Then the exit code is 0
9+
And Transaction is following
10+
| Action | Package |
11+
| install | vendor-1.0-1.x86_64 |
12+
13+
Given I successfully execute rpm with args "-qi vendor"
14+
Then the exit code is 0
15+
And stdout contains "Vendor : First Vendor"
16+
17+
18+
Scenario: Upgrade sticks to vendor by default
19+
Given I use repository "dnf-ci-vendor-1-updates"
20+
Given I use repository "dnf-ci-vendor-2-updates"
21+
When I execute dnf with args "upgrade vendor"
22+
Then the exit code is 0
23+
And Transaction is following
24+
| Action | Package |
25+
| upgrade | vendor-1.1-1.x86_64 |
26+
Given I successfully execute rpm with args "-qi vendor"
27+
Then the exit code is 0
28+
And stdout contains "Vendor : First Vendor"
29+
30+
31+
Scenario: No upgrade if same vendor not found by default
32+
Given I use repository "dnf-ci-vendor-2-updates"
33+
When I execute dnf with args "upgrade vendor"
34+
Then the exit code is 0
35+
And Transaction is empty
36+
Given I successfully execute rpm with args "-qi vendor"
37+
Then the exit code is 0
38+
And stdout contains "Vendor : First Vendor"
39+
40+
41+
Scenario: Hint shown when vendor change blocked by default
42+
Given I use repository "dnf-ci-vendor-1-updates"
43+
When I execute dnf with args "upgrade vendor"
44+
Given I drop repository "dnf-ci-vendor-1"
45+
Given I use repository "dnf-ci-vendor-2"
46+
When I execute dnf with args "downgrade vendor"
47+
Then the exit code is 1
48+
And Transaction is empty
49+
And stdout is empty
50+
And stderr contains "--setopt=allow_vendor_change=true to allow changing package vendors"
51+
52+
53+
Scenario: Override default with --setopt=allow_vendor_change=true
54+
Given I use repository "dnf-ci-vendor-1-updates"
55+
Given I use repository "dnf-ci-vendor-2-updates"
56+
When I execute dnf with args "upgrade --setopt=allow_vendor_change=true vendor"
57+
Then the exit code is 0
58+
And Transaction is following
59+
| Action | Package |
60+
| upgrade | vendor-1.2-1.x86_64 |
61+
Given I successfully execute rpm with args "-qi vendor"
62+
Then the exit code is 0
63+
And stdout contains "Vendor : Second Vendor"

dnf-behave-tests/dnf/stick-to-vendor.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ Scenario: Downgrade is unable to resolve transaction
5959
- 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
6060
- conflicting requests
6161
You can try to add to command line:
62+
--setopt=allow_vendor_change=true to allow changing package vendors
6263
--skip-broken to skip uninstallable packages
6364
"""

0 commit comments

Comments
 (0)