Skip to content

Commit da8d5a4

Browse files
committed
Test that environment list and info respect the display_order
1 parent d54babf commit da8d5a4

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
@dnf5daemon
2+
Feature: Tests for environment list and info commands
3+
4+
Background: Enable repo and mark an environment as installed
5+
Given I use repository "comps-group-list"
6+
Given I create file "/usr/lib/sysimage/libdnf5/environments.toml" with
7+
"""
8+
version = "1.0"
9+
10+
[environments]
11+
12+
test-environment = {groups = [], userinstalled = true}
13+
"""
14+
15+
# https://github.com/rpm-software-management/dnf5/issues/1502
16+
@xfail
17+
Scenario: I can list environments (installed environment is not duplicated)
18+
When I execute dnf with args "environment list"
19+
Then the exit code is 0
20+
And stderr is
21+
"""
22+
<REPOSYNC>
23+
"""
24+
And stdout is
25+
"""
26+
ID Name Installed
27+
test-environment Test Environment yes
28+
empty-environment Empty Environment no
29+
no-name-environment no
30+
"""
31+
32+
Scenario: I can filter listed environments by their ids
33+
When I execute dnf with args "environment list "empty-*""
34+
Then the exit code is 0
35+
And stderr is
36+
"""
37+
<REPOSYNC>
38+
"""
39+
And stdout is
40+
"""
41+
ID Name Installed
42+
empty-environment Empty Environment no
43+
"""
44+
45+
Scenario: I can filter listed environments by their names
46+
When I execute dnf with args "environment list "Empty *""
47+
Then the exit code is 0
48+
And stderr is
49+
"""
50+
<REPOSYNC>
51+
"""
52+
And stdout is
53+
"""
54+
ID Name Installed
55+
empty-environment Empty Environment no
56+
"""
57+
58+
Scenario: I can list only installed environments
59+
When I execute dnf with args "environment list --installed"
60+
Then the exit code is 0
61+
And stderr is
62+
"""
63+
<REPOSYNC>
64+
"""
65+
And stdout is
66+
"""
67+
ID Name Installed
68+
test-environment Test Environment yes
69+
"""
70+
71+
Scenario: I can list only available environments
72+
When I execute dnf with args "environment list --available"
73+
Then the exit code is 0
74+
And stderr is
75+
"""
76+
<REPOSYNC>
77+
"""
78+
And stdout is
79+
"""
80+
ID Name Installed
81+
test-environment Test Environment no
82+
empty-environment Empty Environment no
83+
no-name-environment no
84+
"""
85+
86+
# https://github.com/rpm-software-management/dnf5/issues/1502
87+
@xfail
88+
Scenario: I can get info about all environments (installed environment is not duplicated)
89+
When I execute dnf with args "environment info"
90+
Then the exit code is 0
91+
And stderr is
92+
"""
93+
<REPOSYNC>
94+
"""
95+
And stdout is
96+
"""
97+
Id : test-environment
98+
Name : Test Environment
99+
Description : Test Environment description.
100+
Order : 4
101+
Installed : True
102+
Repositories : @System
103+
Required groups : test-group
104+
105+
Id : empty-environment
106+
Name : Empty Environment
107+
Description :
108+
Order : 16
109+
Installed : False
110+
Repositories : comps-group-list
111+
112+
Id : no-name-environment
113+
Name :
114+
Description :
115+
Order :
116+
Installed : False
117+
Repositories : comps-group-list
118+
Required groups : test-group
119+
"""
120+
121+
122+
Scenario Outline: Info command accepts <option> option
123+
When I execute dnf with args "environment info <option>"
124+
Then the exit code is 0
125+
126+
Examples:
127+
| option |
128+
| --installed |
129+
| --available |

dnf-behave-tests/fixtures/specs/comps-group-list/comps.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,31 @@
4040
</packagelist>
4141
</group>
4242

43+
<environment>
44+
<id>test-environment</id>
45+
<name>Test Environment</name>
46+
<description>Test Environment description.</description>
47+
<display_order>4</display_order>
48+
<grouplist>
49+
<groupid>test-group</groupid>
50+
</grouplist>
51+
</environment>
52+
53+
<environment>
54+
<id>no-name-environment</id>
55+
<name></name>
56+
<description></description>
57+
<grouplist>
58+
<groupid>test-group</groupid>
59+
</grouplist>
60+
</environment>
61+
62+
<environment>
63+
<id>empty-environment</id>
64+
<name>Empty Environment</name>
65+
<description></description>
66+
<display_order>16</display_order>
67+
<grouplist>
68+
</grouplist>
69+
</environment>
4370
</comps>

0 commit comments

Comments
 (0)