|
| 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 | |
0 commit comments