Skip to content

Commit 3e997d3

Browse files
pkratochjan-kolarik
authored andcommitted
Test group and environment excludes
1 parent 3b83292 commit 3e997d3

File tree

3 files changed

+191
-0
lines changed

3 files changed

+191
-0
lines changed
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
Feature: Group and environment upgrade
2+
3+
# comps-upgrade-1 repo:
4+
# a-group:
5+
# mandatory: A-mandatory
6+
# default: A-default
7+
# optional: A-optional
8+
# conditional: A-conditional-true (if dummy), A-conditional-false (if nonexistent)
9+
# AB-group:
10+
# mandatory: A-mandatory
11+
# default: A-default
12+
# optional: A-optional
13+
# conditional: A-conditional-true (if dummy), A-conditional-false (if nonexistent)
14+
# AB-environment:
15+
# grouplist: a-group
16+
# empty-group
17+
# empty-environment
18+
# optional-environment
19+
# optionlist: a-group
20+
21+
Scenario: Fail to install excluded group
22+
Given I use repository "comps-upgrade-1"
23+
When I execute dnf with args "group install a-group --setopt=excludegroups=a-group"
24+
Then the exit code is 1
25+
And Transaction is empty
26+
And stderr contains "No match for argument: a-group"
27+
28+
Scenario: Fail to install excluded environment
29+
Given I use repository "comps-upgrade-1"
30+
When I execute dnf with args "group install AB-environment --setopt=excludeenvs=AB-environment"
31+
Then the exit code is 1
32+
And Transaction is empty
33+
And stderr contains "No match for argument: AB-environment"
34+
35+
Scenario: Install an environment when some of its groups are excluded
36+
Given I use repository "comps-upgrade-1"
37+
When I execute dnf with args "group install AC-environment --setopt=excludegroups=a-group"
38+
Then the exit code is 0
39+
And Transaction is following
40+
| Action | Package |
41+
| install-group | C-mandatory-0:1.0-1.x86_64 |
42+
| group-install | C-group |
43+
| env-install | AC-environment |
44+
45+
Scenario: Install an environment when all of its groups are excluded
46+
Given I use repository "comps-upgrade-1"
47+
When I execute dnf with args "group install AC-environment --setopt=excludegroups=a-group,C-group"
48+
Then the exit code is 0
49+
And Transaction is following
50+
| Action | Package |
51+
| env-install | AC-environment |
52+
53+
Scenario: Install comps that are not excluded
54+
Given I use repository "comps-upgrade-1"
55+
When I execute dnf with args "group install *-group *-environment --setopt=excludegroups=a-group --setopt=excludeenvs=AB-environment"
56+
Then the exit code is 0
57+
And Transaction is following
58+
| Action | Package |
59+
| install-group | A-mandatory-0:1.0-1.x86_64 |
60+
| install-group | A-default-0:1.0-1.x86_64 |
61+
| install-group | C-mandatory-0:1.0-1.x86_64 |
62+
| group-install | AB-group |
63+
| group-install | C-group |
64+
| group-install | empty-group |
65+
| env-install | empty-environment |
66+
| env-install | optional-environment |
67+
| env-install | AC-environment |
68+
69+
Scenario: Install comps when there are non-existent excluded comps
70+
Given I use repository "comps-upgrade-1"
71+
When I execute dnf with args "group install a-group AB-environment --setopt=excludegroups=nonexistent-group --setopt=excludeenvs=nonexistent-environment"
72+
Then the exit code is 0
73+
And Transaction is following
74+
| Action | Package |
75+
| install-group | A-mandatory-0:1.0-1.x86_64 |
76+
| install-group | A-default-0:1.0-1.x86_64 |
77+
| group-install | A-group - repo#1 |
78+
| env-install | AB-environment |
79+
80+
Scenario: Install a group when it's excluded but all excludes are disabled
81+
Given I use repository "comps-upgrade-1"
82+
When I execute dnf with args "group install a-group --setopt=excludegroups=a-group --setopt=disable_excludes=*"
83+
Then the exit code is 0
84+
And Transaction is following
85+
| Action | Package |
86+
| install-group | A-mandatory-0:1.0-1.x86_64 |
87+
| install-group | A-default-0:1.0-1.x86_64 |
88+
| group-install | A-group - repo#1 |
89+
90+
Scenario: Install an environment when it's excluded but all excludes are disabled
91+
Given I use repository "comps-upgrade-1"
92+
When I execute dnf with args "group install empty-environment --setopt=excludeenvs=empty-environment --setopt=disable_excludes=*"
93+
Then the exit code is 0
94+
And Transaction is following
95+
| Action | Package |
96+
| env-install | empty-environment |
97+
98+
Scenario: Install a group when it's excluded but main excludes are disabled
99+
Given I use repository "comps-upgrade-1"
100+
When I execute dnf with args "group install a-group --setopt=excludegroups=a-group --setopt=disable_excludes=main"
101+
Then the exit code is 0
102+
And Transaction is following
103+
| Action | Package |
104+
| install-group | A-mandatory-0:1.0-1.x86_64 |
105+
| install-group | A-default-0:1.0-1.x86_64 |
106+
| group-install | A-group - repo#1 |
107+
108+
Scenario: Install an environment when it's excluded but main excludes are disabled
109+
Given I use repository "comps-upgrade-1"
110+
When I execute dnf with args "group install empty-environment --setopt=excludeenvs=empty-environment --setopt=disable_excludes=main"
111+
Then the exit code is 0
112+
And Transaction is following
113+
| Action | Package |
114+
| env-install | empty-environment |
115+
116+
Scenario: Fail to install a group when it's excluded, even though repo excludes are disabled
117+
Given I use repository "comps-upgrade-1"
118+
When I execute dnf with args "group install a-group --setopt=excludegroups=a-group --setopt=disable_excludes=comps-upgrade-1"
119+
Then the exit code is 1
120+
And Transaction is empty
121+
And stderr contains "No match for argument: a-group"
122+
123+
Scenario: Fail to install an environment when it's excluded, even though repo excludes are disabled
124+
Given I use repository "comps-upgrade-1"
125+
When I execute dnf with args "group install empty-environment --setopt=excludeenvs=empty-environment --setopt=disable_excludes=comps-upgrade-1"
126+
Then the exit code is 1
127+
And Transaction is empty
128+
And stderr contains "No match for argument: empty-environment"
129+
130+
Scenario: Fail to install a group excluded using globs
131+
Given I use repository "comps-upgrade-1"
132+
When I execute dnf with args "group install a-group --setopt=excludegroups=a-*"
133+
Then the exit code is 1
134+
And Transaction is empty
135+
And stderr contains "No match for argument: a-group"
136+
137+
Scenario: Fail to install an environment excluded using globs
138+
Given I use repository "comps-upgrade-1"
139+
When I execute dnf with args "group install AB-environment --setopt=excludeenvs=AB-*"
140+
Then the exit code is 1
141+
And Transaction is empty
142+
And stderr contains "No match for argument: AB-environment"
143+
144+
Scenario: Install an environment when its group is excluded using globs
145+
Given I use repository "comps-upgrade-1"
146+
When I execute dnf with args "group install AB-environment --setopt=excludegroups=a-*"
147+
Then the exit code is 0
148+
And Transaction is following
149+
| Action | Package |
150+
| env-install | AB-environment |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Name: C-mandatory
2+
Epoch: 0
3+
Version: 1.0
4+
Release: 1
5+
6+
License: Public Domain
7+
URL: None
8+
9+
Summary: A dummy package.
10+
11+
%description
12+
Dummy.
13+
14+
%files
15+
16+
%changelog

dnf-behave-tests/fixtures/specs/comps-upgrade-1/comps.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
</packagelist>
1919
</group>
2020

21+
<group>
22+
<id>C-group</id>
23+
<default>false</default>
24+
<uservisible>true</uservisible>
25+
<display_order>1024</display_order>
26+
<name>C-group</name>
27+
<description>Testgroup for DNF CI testing</description>
28+
<packagelist>
29+
<packagereq type="mandatory">C-mandatory</packagereq>
30+
</packagelist>
31+
</group>
32+
2133
<group>
2234
<id>AB-group</id>
2335
<default>false</default>
@@ -46,6 +58,19 @@
4658
</grouplist>
4759
</environment>
4860

61+
<environment>
62+
<id>AC-environment</id>
63+
<default>false</default>
64+
<uservisible>true</uservisible>
65+
<display_order>1024</display_order>
66+
<name>AC-environment</name>
67+
<description>Testenvironment for DNF CI testing</description>
68+
<grouplist>
69+
<groupid>a-group</groupid>
70+
<groupid>C-group</groupid>
71+
</grouplist>
72+
</environment>
73+
4974
<group>
5075
<id>empty-group</id>
5176
<default>false</default>

0 commit comments

Comments
 (0)