Commit 4aa6a32 Merge #4 `Adding behave-docker tests for dnf package`

348 files Merged and Committed by rasibley a year ago
 1 @@ -0,0 +1,72 @@
 2 + FROM fedora:26
 3 + ENV LANG C
 4 + ARG type=local
 5 + 
 6 + COPY dnf-docker-test/repo /var/www/html/repo/
 7 + COPY dnf-docker-test/features /behave/
 8 + COPY dnf-docker-test/features /tests/
 9 + COPY dnf-docker-test/x509certgen /usr/local/bin
10 + 
11 + RUN set -x && \
12 +     echo -e "deltarpm=0\ntsflags=nodocs" >> /etc/dnf/dnf.conf && \
13 +     # httpd:        http-style repos
14 +     # vsftpd:       ftp-style repos
15 +     # behave:       core
16 +     # six:          py2/py3
17 +     # enum34:       enum for py2, rpmdb.State
18 +     # whichcraft:   shutil.which() for py2
19 +     # jinja2:       rpmspec template
20 +     # pexpect:      shell tests_list
21 +     # rpm-build:    building dummy RPMs
22 +     # openssl:      generating TLS certificates
23 +     # mod_ssl:      https-style repos
24 +     # gnupg2:       GPG keys
25 +     # rng-tools:    to generate enough _random_ data for GPG keys
26 +     # rpm-sign:     rpm signing
27 +     # createrepo_c: building repos
28 +     dnf -y install httpd vsftpd python2-behave python2-six python-enum34 python2-whichcraft python-jinja2 python2-pexpect rpm-build openssl mod_ssl gnupg2 rng-tools rpm-sign createrepo_c && \
29 +     if [ $type = "local" ]; then \
30 +         # Allows to run test with rpms from only single component in rpms/
31 +         dnf -y install dnf-plugins-core python3-dnf-plugins-core python2-dnf-plugins-core createrepo_c && \
32 +         dnf -y copr enable rpmsoftwaremanagement/dnf-nightly; \
33 +     fi && \
34 +     # prevent installation of dnf-plugins-extras (versionlock, local, torproxy)
35 +     rm -vf /rpms/*dnf-plugin-versionlock*.rpm /rpms/*dnf-plugin-local*.rpm /rpms/*dnf-plugin-torproxy*.rpm && \
36 +     # update dnf
37 +     dnf -y --best upgrade dnf && \
38 +     if [ $type = "local" ]; then \
39 +         # install all rpms if present
40 +         if ls /rpms/*.rpm 1>/dev/null 2>&1; then dnf -y --skip-broken install /rpms/*.rpm; fi && \
41 +         # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1398272
42 +         rpm -q dnf && \
43 +         # some unknown thing
44 +         dnf -q repoquery --unneeded | xargs --no-run-if-empty dnf mark install; \
45 +     else \
46 +         dnf -y install /rpms/*.rpm && \
47 +         dnf -y autoremove; \
48 +     fi && \
49 +     # generate certificates that will be used for the testing purposes
50 +     /usr/local/bin/x509certgen x509KeyGen ca && \
51 +     /usr/local/bin/x509certgen x509KeyGen server && \
52 +     /usr/local/bin/x509certgen x509KeyGen client && \
53 +     /usr/local/bin/x509certgen x509KeyGen ca2 && \
54 +     /usr/local/bin/x509certgen x509KeyGen server2 && \
55 +     /usr/local/bin/x509certgen x509KeyGen client2 && \
56 +     /usr/local/bin/x509certgen x509SelfSign -t ca ca && \
57 +     /usr/local/bin/x509certgen x509SelfSign -t ca ca2 && \
58 +     /usr/local/bin/x509certgen x509CertSign -t webserver --CA ca server && \
59 +     /usr/local/bin/x509certgen x509CertSign -t webclient --CA ca client && \
60 +     /usr/local/bin/x509certgen x509CertSign -t webserver --CA ca2 server2 && \
61 +     /usr/local/bin/x509certgen x509CertSign -t webclient --CA ca2 client2 && \
62 +     # configure httpd
63 +     #sed -i "s/#ServerName .*/ServerName ${HOSTNAME}:80/" /etc/httpd/conf/httpd.conf && \
64 +     sed -i 's:^SSLCertificateFile .*:SSLCertificateFile /etc/pki/tls/certs/testcerts/server/cert.pem:' /etc/httpd/conf.d/ssl.conf && \
65 +     sed -i 's:^SSLCertificateKeyFile .*:SSLCertificateKeyFile /etc/pki/tls/certs/testcerts/server/key.pem:' /etc/httpd/conf.d/ssl.conf && \
66 +     sed -i 's:.*SSLCACertificateFile .*:SSLCACertificateFile /etc/pki/tls/certs/testcerts/ca/cert.pem:' /etc/httpd/conf.d/ssl.conf && \
67 +     dnf -y clean all && \
68 +     mkdir /tmp/repos.d && mv /etc/yum.repos.d/* /tmp/repos.d/ && \
69 +     mkdir /repo && \
70 +     rm -f /behave/*.feature
71 + 
72 + ADD dnf-docker-test/launch-test /usr/bin/
73 + VOLUME ["/junit"]
  1 @@ -0,0 +1,152 @@
  2 + ci-dnf-stack
  3 + ============
  4 + 
  5 + ci-dnf-stack is a set of configuration and scripts that allow continuous
  6 + integrations DNF (https://github.com/rpm-software-management/dnf) stack.
  7 + 
  8 + This serves as an ad hoc solution to where to store routines that belong
  9 + to all the components of the stack. It would be nice to merge them into
 10 + the respective components.
 11 + 
 12 + These scripts are free and open-source software; see the section License
 13 + to understand the terms and conditions under which you can use, study,
 14 + modify and distribute ci-dnf-stack.
 15 + 
 16 + Dnf Docker Test in ci-dnf-stack
 17 + -------------------------------
 18 + 
 19 + The project originated from richdeps-docker (https://github.com/shaded-enmity/richdeps-docker).
 20 + Docker image for testing rich dependencies and CLI in DNF/RPM
 21 + using the Behave framework. The project was optimized for incorporation to
 22 + ci-dnf-stack as a module.
 23 + Each test runs in it's own container making it possible to run multiple tests
 24 + in parallel without interfering with each other. These tests are meant to
 25 + verify that both DNF and RPM (if relevant) interpret the rich dependency semantics
 26 + correctly and all functionality of DNF and related component is intact. Dnf Docker
 27 + Test use its own feature files and steps descriptions placed in its directory
 28 + (dnf-docker-test/).
 29 + 
 30 + License
 31 + -------
 32 + 
 33 + The project is licensed under the copyleft GNU General Public License;
 34 + either version 2, or (at your option) any later version. See the
 35 + LICENSE file found in the top-level directory of this distribution and
 36 + at https://github.com/rpm-software-management/ci-dnf-stack/. No part of
 37 + ci-dnf-stack, including this file, may be copied, modified, propagated,
 38 + or distributed except according to the terms contained in the LICENSE
 39 + file.
 40 + 
 41 + Requirements
 42 + ------------
 43 + 
 44 + * python
 45 + * python3 >= 3.5
 46 + * jenkins
 47 + * docker
 48 + * git-core
 49 + * /usr/bin/rpmbuild
 50 + * docker
 51 + * jq
 52 + 
 53 + For building in COPR:
 54 + * python3-copr
 55 + * python3-beautifulsoup4
 56 + * python3-requests
 57 + 
 58 + sudo should be configured for `jenkins` user to use `docker`:
 59 + ```
 60 + # cat << EOF > /etc/sudoers.d/99-jenkins
 61 + jenkins ALL=(ALL) NOPASSWD: /usr/bin/docker
 62 + EOF
 63 + ```
 64 + 
 65 + To rebuild `test-1` or `upgrade_1` repository for Dnf Docker Test run
 66 + `test-1.py` or `upgrade_1.py` in `dnf-docker-test/repo_create directory`.
 67 + It requires following components:
 68 + * python3-rpmfluff
 69 + 
 70 + Configuring Jenkins
 71 + -------------------
 72 + 
 73 + We are using [jenkins-job-builder](http://docs.openstack.org/infra/jenkins-job-builder/)
 74 + to manage jenkins jobs.
 75 + 
 76 + To deploy jobs you need configure your [jenkins_jobs.ini](http://docs.openstack.org/infra/jenkins-job-builder/execution.html)
 77 + and run `jenkins-jobs --config=/path/to/jenkins_jobs.ini update jobs/`.
 78 + 
 79 + Local run
 80 + ---------
 81 + 
 82 + Local test can be performed with dnf-testing.sh
 83 + * Container build:
 84 + ** Put your RPMs into "dnf-docker-test/rpms" directory
 85 + ** Then run ``dnf-testing.sh build``
 86 + * Run tests
 87 + ** Run all tests with last built container use command ``./dnf-testing.sh run``
 88 + ** Run all tests with specified container use command``./dnf-testing.sh run -c <CONTAINER>``
 89 + ** Run particular tests run: ``./dnf-testing.sh run TEST-A TEST-B ...``
 90 + * Run in devel mode
 91 + ** It shares local feature dir with description of tests and test steps with docker image, therefore you can develop CI stack on fly.
 92 + ** Use command ``./dnf-testing.sh run --devel $CONTAINER TEST-A``
 93 + * Get help
 94 + ** ./dnf-testing.sh --help
 95 + 
 96 + 
 97 + Describing a test
 98 + -----------------
 99 + 
100 + Here's an example configuration from the first ported test:
101 + 
102 + ```
103 + Feature: Install package with dependency
104 + 
105 +     @setup
106 +     Scenario: Feature setup
107 +         Given repository "test" with packages
108 +            | Package | Tag      | Value |
109 +            | TestA   | Requires | TestB |
110 +            | TestB   |          |       |
111 + 
112 +     Scenario: Install TestA from repository "test" with dependency TestB
113 +          When I save rpmdb
114 +           And I enable repository "test"
115 +           And I successfully run "dnf install -y TestA" with "success"
116 +          Then rpmdb changes are
117 +            | State     | Packages     |
118 +            | installed | TestA, TestB |
119 + ```
120 + 
121 + Possible states: installed, removed, absent, unchanged, reinstalled, updated, downgraded.
122 + The states unchanged and absent can be used
123 + for detailed description of tested step or to ensure, that required conditions before or after tested step were met.
124 + 
125 + Support
126 + -------
127 + 
128 + If you are having issues, please report them via the issue tracking
129 + system.
130 + 
131 + - issue tracker: https://github.com/rpm-software-management/ci-dnf-stack/issues
132 + 
133 + Notes for functional testing
134 + ----------------------------
135 + 
136 + Repo upgrade_1:
137 + updateinfo.xml was added using modifyrepo_c updateinfo.xml path/upgrade_1/repodata/
138 + 
139 + Repo test-1-gpg:
140 + Was created from rpms in test-1 repo. All rpm were signed with gpg-pubkey-2d2e7ca3-56c1e69d»       gpg(DNF Test1 (TESTER)
141 + <dnf@testteam.org>) except TestE (not signed), TestG (signed with key gpg-pubkey-705f3e8c-56c2e298»       gpg(DNF Test2
142 + (TESTER) <dnf@testteam.org>)), and TestJ (not signed and incorrect check-sum).
143 + 
144 + Repo upgrade_1-gpg:
145 + Was created from rpms in upgrade_1 repo. All rpm were signed with gpg-pubkey-705f3e8c-56c2e298»       gpg(DNF Test2
146 + (TESTER) <dnf@testteam.org>) except both TestE (not signed) packages.
147 + 
148 + Contributions
149 + -------------
150 + 
151 + Any contribution or feedback is more than welcome.
152 + 
153 + - version control system: https://github.com/rpm-software-management/ci-dnf-stack
 1 @@ -0,0 +1,19 @@
 2 + Generate documentation
 3 + ----------------------
 4 + 
 5 + Following packages (or their python2 equivalents) should be installed:
 6 +   python3-behave python3-sphinx python3-whichcraft python3-pexpect
 7 + 
 8 + ```
 9 + $ rm -vf doc/*.rst
10 + $ behave-3 -q --dry-run -f sphinx.steps -o doc/
11 + $ sphinx-build-3 -W -b html doc/ doc/_build/
12 + ```
13 + 
14 + respectively
15 + 
16 + ```
17 + $ rm -vf doc/*.rst
18 + $ behave-2 -q --dry-run -f sphinx.steps -o doc/
19 + $ sphinx-build-2 -W -b html doc/ doc/_build/
20 + ```
 1 @@ -0,0 +1,32 @@
 2 + Feature: Autoremoval of unneeded packages
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "base" with packages
 7 +          | Package | Tag         | Value |
 8 +          | TestA   | Requires    | TestB |
 9 +          | TestB   | Recommends  | TestC |
10 +          | TestC   |             |       |
11 +          | TestD   | Supplements | TestC |
12 +         And repository "updates" with packages
13 +          | Package | Tag         | Value |
14 +          | TestA   | Release     | 2     |
15 +        When I save rpmdb
16 +         And I enable repository "base"
17 +         And I successfully run "dnf -y install TestA"
18 +        Then rpmdb changes are
19 +          | State     | Packages                   |
20 +          | installed | TestA, TestB, TestC, TestD |
21 + 
22 +   Scenario: Autoremoval of package which became non-required by others
23 +        When I save rpmdb
24 +         And I enable repository "updates"
25 +         And I successfully run "dnf -y update"
26 +        Then rpmdb changes are
27 +          | State     | Packages            |
28 +          | upgraded  | TestA               |
29 +        When I save rpmdb
30 +         And I successfully run "dnf -y autoremove"
31 +        Then rpmdb changes are
32 +          | State     | Packages            |
33 +          | removed   | TestB, TestC, TestD |
 1 @@ -0,0 +1,78 @@
 2 + Feature: Builddep
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given enabled repository "available" with packages
 7 +          | Package | Tag      | Value            |
 8 +          | TestA   |          |                  |
 9 +          | TestB   |          |                  |
10 +          | TestC   |          |                  |
11 +          | TestD   |          |                  |
12 +          | TestE   |          |                  |
13 +          | TestF   | Provides | /usr/bin/TestXXX |
14 +         And a file "/tmp/test.spec" with
15 +             """
16 +             Name:          test
17 +             Version:       1
18 +             Release:       1
19 +             Summary:       Test
20 + 
21 +             License:       Public Domain
22 +             URL:           http://localhost
23 + 
24 +             BuildRequires: %{?buildrequires}%{?!buildrequires:TestA}
25 +             BuildArch:     noarch
26 + 
27 +             %description
28 +             %{summary}.
29 + 
30 +             %prep
31 +             %autosetup -c -D -T
32 +             """
33 + 
34 +   Scenario: Builddep with simple dependency (spec)
35 +        When I save rpmdb
36 +         And I successfully run "dnf -y builddep /tmp/test.spec"
37 +        Then rpmdb changes are
38 +          | State     | Packages |
39 +          | installed | TestA    |
40 + 
41 +   Scenario: Builddep with simple dependency (spec) + define
42 +        When I save rpmdb
43 +         And I successfully run "dnf -y builddep /tmp/test.spec --define 'buildrequires TestB'"
44 +        Then rpmdb changes are
45 +          | State     | Packages |
46 +          | installed | TestB    |
47 + 
48 +   Scenario: Builddep with simple dependency (srpm)
49 +        When I successfully run "rpmbuild -D '_srcrpmdir /tmp' -D 'buildrequires TestC' -bs /tmp/test.spec"
50 +        When I save rpmdb
51 +         And I successfully run "dnf -y builddep /tmp/test-1-1.src.rpm"
52 +        Then rpmdb changes are
53 +          | State     | Packages |
54 +          | installed | TestC    |
55 + 
56 +   Scenario: Builddep with rich dependency
57 +        When I save rpmdb
58 +         And I successfully run "dnf -y builddep /tmp/test.spec --define 'buildrequires (TestD and TestE)'"
59 +        Then rpmdb changes are
60 +          | State     | Packages     |
61 +          | installed | TestD, TestE |
62 + 
63 +   Scenario: Builddep with simple dependency (files-like provide)
64 +        When I save rpmdb
65 +         And I successfully run "dnf -y builddep /tmp/test.spec --define 'buildrequires /usr/bin/TestXXX'"
66 +        Then rpmdb changes are
67 +          | State     | Packages |
68 +          | installed | TestF    |
69 + 
70 +   Scenario: Builddep with simple dependency (non-existent)
71 +        When I run "dnf -y builddep /tmp/test.spec --define 'buildrequires TestX = 1'"
72 +        Then the command should fail
73 +         And the command stderr should match exactly
74 +             """
75 +             No matching package to install: 'TestX = 1'
76 +             Not all dependencies satisfied
77 +             Error: Some packages could not be found.
78 + 
79 +             """
 1 @@ -0,0 +1,51 @@
 2 + Feature: Test for dnf check --duplicates command
 3 + 
 4 +   Scenario: Install package in version 1
 5 +       Given repository "base" with packages
 6 +          | Package      | Tag       | Value        |
 7 +          | TestA        | Version   | 1            |
 8 +        When I save rpmdb
 9 +         And I enable repository "base"
10 +         And I successfully run "dnf -y install TestA"
11 +        Then rpmdb changes are
12 +          | State     | Packages       |
13 +          | installed | TestA          |
14 +        When I successfully run "dnf check"
15 +        Then the command stdout should be empty
16 +         And the command stderr should be empty
17 + 
18 +   Scenario: Install package in version 2 and check for duplicates
19 +       Given repository "base2" with packages
20 +          | Package      | Tag       | Value        |
21 +          | TestA        | Version   | 2            |
22 +        When I enable repository "base2"
23 +         And I successfully run "rpm -i TestA*.rpm" in repository "base2"
24 +        Then the command should pass
25 +        When I run "dnf check"
26 +        Then the command should fail
27 +         And the command stdout should match regexp "TestA.* is a duplicate with TestA-2.*"
28 +         And the command stderr should match exactly
29 +             """
30 +             Error: Check discovered 1 problem(s)
31 + 
32 +             """
33 +        When I run "dnf check --duplicates"
34 +        Then the command should fail
35 +         And the command stdout should match regexp "TestA.* is a duplicate with TestA-2.*"
36 +         And the command stderr should match exactly
37 +             """
38 +             Error: Check discovered 1 problem(s)
39 + 
40 +             """
41 +        When I run "dnf check --dependencies"
42 +        Then the command should pass
43 +         And the command stdout should be empty
44 +         And the command stderr should be empty
45 +        When I run "dnf check --obsoleted"
46 +        Then the command should pass
47 +         And the command stdout should be empty
48 +         And the command stderr should be empty
49 +        When I run "dnf check --provides"
50 +        Then the command should pass
51 +         And the command stdout should be empty
52 +         And the command stderr should be empty
 1 @@ -0,0 +1,84 @@
 2 + Feature: Test for check --dependencies command
 3 + 
 4 +   @setup
 5 +   Scenario: Prepare "base" repository with test packages
 6 +       Given repository "base" with packages
 7 +          | Package      | Tag       | Value        |
 8 +          | TestA        | Requires  | TestB        |
 9 +          |              | Conflicts | TestC        |
10 +          | TestB        |           |              |
11 +          | TestC        |           |              |
12 + 
13 +   Scenario: Force installation of package with broken dependencies
14 +        When I enable repository "base"
15 +         And I successfully run "rpm -i --nodeps TestA*.rpm" in repository "base"
16 +        Then the command should pass
17 +        When I run "dnf check"
18 +        Then the command should fail
19 +         And the command stdout should match regexp "TestA-1.* has missing requires of TestB"
20 +         And the command stderr should match exactly
21 +             """
22 +             Error: Check discovered 1 problem(s)
23 + 
24 +             """
25 +        When I run "dnf check --dependencies"
26 +        Then the command should fail
27 +         And the command stdout should match regexp "TestA-1.* has missing requires of TestB"
28 +         And the command stderr should match exactly
29 +             """
30 +             Error: Check discovered 1 problem(s)
31 + 
32 +             """
33 +        When I run "dnf check --duplicates"
34 +        Then the command should pass
35 +         And the command stdout should be empty
36 +         And the command stderr should be empty
37 +        When I run "dnf check --obsoleted"
38 +        Then the command should pass
39 +         And the command stdout should be empty
40 +         And the command stderr should be empty
41 +        When I run "dnf check --provides"
42 +        Then the command should pass
43 +         And the command stdout should be empty
44 +         And the command stderr should be empty
45 + 
46 +   Scenario: Fulfill the missing dependencies
47 +        When I enable repository "base"
48 +         And I successfully run "dnf -y install TestB"
49 +        When I run "dnf check"
50 +        Then the command should pass
51 +         And the command stdout should be empty
52 +         And the command stderr should be empty
53 + 
54 +   Scenario: Force installation of conflicting package
55 +        When I enable repository "base"
56 +         And I successfully run "rpm -i --nodeps TestC*.rpm" in repository "base"
57 +        Then the command should pass
58 +        When I run "dnf check"
59 +        Then the command should fail
60 +         And the command stdout should match regexp "TestA-1.* has installed conflict "TestC": TestC-1.*"
61 +         And the command stderr should match exactly
62 +             """
63 +             Error: Check discovered 1 problem(s)
64 + 
65 +             """
66 +        When I run "dnf check --dependencies"
67 +        Then the command should fail
68 +         And the command stdout should match regexp "TestA-1.* has installed conflict "TestC": TestC-1.*"
69 +         And the command stderr should match exactly
70 +             """
71 +             Error: Check discovered 1 problem(s)
72 + 
73 +             """
74 +        When I run "dnf check --duplicates"
75 +        Then the command should pass
76 +         And the command stdout should be empty
77 +         And the command stderr should be empty
78 +        When I run "dnf check --obsoleted"
79 +        Then the command should pass
80 +         And the command stdout should be empty
81 +         And the command stderr should be empty
82 +        When I run "dnf check --provides"
83 +        Then the command should pass
84 +         And the command stdout should be empty
85 +         And the command stderr should be empty
 1 @@ -0,0 +1,46 @@
 2 + Feature: Test for dnf check --obsoleted command
 3 + 
 4 +   Scenario: Force install package that obsoletes already installed package
 5 +       Given repository "base" with packages
 6 +          | Package      | Tag       | Value        |
 7 +          | TestA        |           |              |
 8 +          | TestB        | Obsoletes | TestA        |
 9 +        When I enable repository "base"
10 +         And I successfully run "rpm -i --nodeps TestA*.rpm" in repository "base"
11 +        Then the command should pass
12 +        When I run "dnf check"
13 +        Then the command should pass
14 +         And the command stdout should be empty
15 +         And the command stderr should be empty
16 +        When I successfully run "rpm -i --nodeps TestB*.rpm" in repository "base"
17 +        Then the command should pass
18 +         And the command stdout should be empty
19 +         And the command stderr should be empty
20 +        When I run "dnf check"
21 +        Then the command should fail
22 +         And the command stdout should match regexp "TestA-1.* is obsoleted by TestB-1.*"
23 +         And the command stderr should match exactly
24 +             """
25 +             Error: Check discovered 1 problem(s)
26 + 
27 +             """
28 +        When I run "dnf check --obsoleted"
29 +        Then the command should fail
30 +         And the command stdout should match regexp "TestA-1.* is obsoleted by TestB-1.*"
31 +         And the command stderr should match exactly
32 +             """
33 +             Error: Check discovered 1 problem(s)
34 + 
35 +             """
36 +        When I run "dnf check --duplicates"
37 +        Then the command should pass
38 +         And the command stdout should be empty
39 +         And the command stderr should be empty
40 +        When I run "dnf check --dependencies"
41 +        Then the command should pass
42 +         And the command stdout should be empty
43 +         And the command stderr should be empty
44 +        When I run "dnf check --provides"
45 +        Then the command should pass
46 +         And the command stdout should be empty
47 +         And the command stderr should be empty
 1 @@ -0,0 +1,20 @@
 2 + Feature: DNF/Behave test (clean - host)
 3 + 
 4 + Scenario: Ensure that metadata are unavailable after "dnf clean all"
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I create a file "/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=file:///var/www/html/repo/test-1\nenabled=1\ngpgcheck=0\nskip_if_unavailable=False"
 7 +   When _deprecated I execute "dnf" command "makecache" with "success"
 8 +   Then _deprecated I execute "dnf" command "-y -C install TestB" with "success"
 9 +   Then _deprecated transaction changes are as follows
10 +    | State        | Packages   |
11 +    | installed    | TestB      |
12 +   When _deprecated I execute "dnf" command "clean all" with "success"
13 +   Then _deprecated I execute "dnf" command "-y -C install TestC" with "fail"
14 +   Then _deprecated transaction changes are as follows
15 +    | State        | Packages   |
16 +    | absent       | TestC      |
17 +   # Cleaning after scenario
18 +   When _deprecated I execute "dnf" command "-y remove TestB" with "success"
19 +   Then _deprecated transaction changes are as follows
20 +    | State        | Packages   |
21 +    | removed      | TestB      |
 1 @@ -0,0 +1,11 @@
 2 + Feature: DNF/Behave test (clean - installroot)
 3 + 
 4 + Scenario: Ensure that metadata are unavailable after "dnf --installroot=path clean all"
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I create a file "/dockertesting1/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=file:///var/www/html/repo/test-1\nenabled=1\ngpgcheck=0\nskip_if_unavailable=False"
 7 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting1 makecache" with "success"
 8 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting1 -y -C install TestB" with "success"
 9 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting1 TestB" with "success"
10 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting1 clean all" with "success"
11 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting1 -y -C install TestC" with "fail"
12 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting1 TestC" with "fail"
 1 @@ -0,0 +1,33 @@
 2 + Feature: Removal of package with clean_requirements_on_remove
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given enabled repository "available" with packages
 7 +          | Package | Tag      | Value  |
 8 +          | TestA   | Requires | TestB  |
 9 +          | TestB   |          |        |
10 + 
11 +   Scenario: Remove with --setopt=clean_requirements_on_remove=True
12 +        When I save rpmdb
13 +         And I successfully run "dnf -y install TestA"
14 +        Then rpmdb changes are
15 +          | State     | Packages     |
16 +          | installed | TestA, TestB |
17 +        When I save rpmdb
18 +         And I successfully run "dnf --setopt=clean_requirements_on_remove=True -y remove TestA"
19 +        Then rpmdb changes are
20 +          | State     | Packages     |
21 +          | removed   | TestA, TestB |
22 + 
23 +   Scenario: Remove with --setopt=clean_requirements_on_remove=False
24 +        When I save rpmdb
25 +         And I successfully run "dnf -y install TestA"
26 +        Then rpmdb changes are
27 +          | State     | Packages     |
28 +          | installed | TestA, TestB |
29 +        When I save rpmdb
30 +         And I successfully run "dnf --setopt=clean_requirements_on_remove=False -y remove TestA"
31 +        Then rpmdb changes are
32 +          | State     | Packages     |
33 +          | removed   | TestA        |
34 +          | unchanged | TestB        |
 1 @@ -0,0 +1,15 @@
 2 + Feature: DNF/Behave test (DNF config and config files in installroot)
 3 + 
 4 + Scenario: Reposdir option in dnf.conf file with --config option in installroot if it correctly taken first from installroot then from host
 5 +   Given _deprecated I use the repository "upgrade_1"
 6 +   When _deprecated I create a file "/dnf/dnf.conf" with content: "[main]\nreposdir=/var/www/html/repo/test-1-gpg,/testdir"
 7 +   When _deprecated I execute "bash" command "mkdir -p  /dockertesting2/testdir" with "success"
 8 +   Then _deprecated the path "/dockertesting2/testdir/" should be "present"
 9 +   # It shoud fail due to lo repository in /dockertesting2/testdir (If dir in installroot, only from installroot reposdirs)
10 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting2 -c /dnf/dnf.conf -y install TestC" with "fail"
11 +   When _deprecated I execute "bash" command "rm -rf  /dockertesting2/testdir" with "success"
12 +   Then _deprecated the path "/dockertesting2/testdir/" should be "absent"
13 +   # It give success. Repos is taken from /var/www/html/repo/test-1-gpg (no reposdir in installroot)
14 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting2 -c /dnf/dnf.conf -y install TestC" with "success"
15 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestC" with "success"
16 +   Then _deprecated line from "stdout" should "start" with "TestC-1.0.0-1"
  1 @@ -0,0 +1,111 @@
  2 + Feature: DNF/Behave test (DNF config and config files in installroot)
  3 + 
  4 + Scenario: Create dnf.conf file and test if host is using /etc/dnf/dnf.conf.
  5 +   Given _deprecated I use the repository "test-1"
  6 +   When _deprecated I execute "dnf" command "install -y TestC" with "success"
  7 +   Then _deprecated transaction changes are as follows
  8 +    | State        | Packages   |
  9 +    | installed    | TestC      |
 10 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\nexclude=TestA"
 11 +   When _deprecated I execute "dnf" command "install -y TestA" with "fail"
 12 +   Then _deprecated transaction changes are as follows
 13 +    | State        | Packages      |
 14 +    | absent       | TestA, TestB  |
 15 +   # Cleaning traces from scenario - dnf.conf with only main section
 16 +   When _deprecated I execute "dnf" command "remove -y TestC" with "success"
 17 +   Then _deprecated transaction changes are as follows
 18 +    | State        | Packages   |
 19 +    | removed      | TestC      |
 20 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]"
 21 + 
 22 + Scenario: Test removal of depemdency when clean_requirements_on_remove=false
 23 +   Given _deprecated I use the repository "test-1"
 24 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\nexclude=TestA\nclean_requirements_on_remove=false"
 25 +   When _deprecated I execute "dnf" command "install -y --disableexcludes=main TestA" with "success"
 26 +   Then _deprecated transaction changes are as follows
 27 +    | State        | Packages      |
 28 +    | installed    | TestA, TestB  |
 29 +   When _deprecated I execute "dnf" command "remove -y --disableexcludes=all TestA" with "success"
 30 +   Then _deprecated transaction changes are as follows
 31 +    | State        | Packages   |
 32 +    | removed      | TestA      |
 33 +   When _deprecated I execute "dnf" command "remove -y TestB" with "success"
 34 +   Then _deprecated transaction changes are as follows
 35 +    | State        | Packages   |
 36 +    | removed      | TestB      |
 37 +   # Cleaning traces from scenario - dnf.conf with only main section
 38 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]"
 39 + 
 40 + Scenario: Create dnf.conf file and test if host is taking option -c /test/dnf.conf file (absolute and relative path)
 41 +   Given _deprecated I use the repository "test-1"
 42 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\nexclude=TestA\nclean_requirements_on_remove=false"
 43 +   When _deprecated I create a file "/test/dnf.conf" with content: "[main]\nexclude=TestD\nclean_requirements_on_remove=true"
 44 +   When _deprecated I execute "dnf" command "install -y -c /test/dnf.conf TestA" with "success"
 45 +   Then _deprecated transaction changes are as follows
 46 +    | State        | Packages      |
 47 +    | installed    | TestA, TestB  |
 48 +   When _deprecated I execute "dnf" command "install -y -c /test/dnf.conf TestD" with "fail"
 49 +   When _deprecated I execute "dnf" command "install -y --config test/dnf.conf TestD" with "fail"
 50 + # TestA cannot be removed due to host exclude in dnf.conf
 51 +   When _deprecated I execute "dnf" command "remove -y TestA" with "fail"
 52 + # TestB can be removed because excludes were disabled
 53 +   When _deprecated I execute "dnf" command "remove -y --disableexcludes=all TestB" with "success"
 54 +   Then _deprecated transaction changes are as follows
 55 +    | State        | Packages      |
 56 +    | removed      | TestA, TestB  |
 57 + 
 58 + Scenario: Test without dnf.conf in installroot (dnf.conf is not taken from host)
 59 +   Given _deprecated I use the repository "test-1"
 60 +   When _deprecated I create a file "/test/dnf.conf" with content: "[main]\nexclude=TestD\nclean_requirements_on_remove=true"
 61 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\nexclude=TestA\nclean_requirements_on_remove=true"
 62 +   When _deprecated I execute "dnf" command "config-manager --setopt=reposdir=/dockertesting/etc/yum.repos.d --add-repo /etc/yum.repos.d/test-1.repo" with "success"
 63 +   Then _deprecated the path "/dockertesting/etc/yum.repos.d/test-1.repo" should be "present"
 64 +   And _deprecated the path "/dockertesting/etc/dnf/dnf.conf" should be "absent"
 65 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y install TestA" with "fail"
 66 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA" with "fail"
 67 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\nclean_requirements_on_remove=true"
 68 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y install TestA" with "success"
 69 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA" with "success"
 70 +   Then _deprecated line from "stdout" should "start" with "TestA-1.0.0-1."
 71 + 
 72 + Scenario: Test with dnf.conf in installroot (dnf.conf is taken from installroot)
 73 +   Given _deprecated I use the repository "test-1"
 74 +   When _deprecated I create a file "/dockertesting/etc/dnf/dnf.conf" with content: "[main]\nexclude=TestE"
 75 +   Then _deprecated the path "/dockertesting/etc/dnf/dnf.conf" should be "present"
 76 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y install TestE" with "fail"
 77 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestE" with "fail"
 78 + 
 79 + Scenario: Test with dnf.conf in installroot and --config (dnf.conf is taken from --config)
 80 +   Given _deprecated I use the repository "test-1"
 81 +   When _deprecated I create a file "/dockertesting/etc/dnf/dnf.conf" with content: "[main]\nexclude=TestE"
 82 +   When _deprecated I create a file "/test/dnf.conf" with content: "[main]\nexclude=TestD\nclean_requirements_on_remove=true"
 83 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y -c /test/dnf.conf install TestE" with "success"
 84 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestE" with "success"
 85 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y -c /test/dnf.conf install TestD" with "fail"
 86 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestD" with "fail"
 87 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y install TestD" with "success"
 88 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestD" with "success"
 89 + 
 90 + Scenario: Reposdir option in dnf conf.file in host
 91 +   Given _deprecated I use the repository "upgrade_1"
 92 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\nreposdir=/var/www/html/repo/test-1-gpg"
 93 +   When _deprecated I execute "dnf" command "-y install TestN" with "success"
 94 +   Then _deprecated transaction changes are as follows
 95 +    | State        | Packages       |
 96 +    | installed    | TestN-1.0.0-1  |
 97 + 
 98 + Scenario: Reposdir option in dnf.conf file in installroot=dockertesting2
 99 +   Given _deprecated I use the repository "test-1"
100 +   When _deprecated I create a file "/dockertesting2/etc/dnf/dnf.conf" with content: "[main]\nreposdir=/var/www/html/repo/upgrade_1-gpg"
101 +   When _deprecated I create a file "/dockertesting2/var/www/html/repo/upgrade_1-gpg/install.repo" with content: "[upgrade_1-gpg-file]\nname=upgrade_1-gpg-file\nbaseurl=http://127.0.0.1/repo/upgrade_1-gpg\nenabled=1\ngpgcheck=1\ngpgkey=file:///var/www/html/repo/upgrade_1-gpg/RPM-GPG-KEY-dtest2"
102 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting2 -y install TestN" with "success"
103 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestN" with "success"
104 +   Then _deprecated line from "stdout" should "start" with "TestN-1.0.0-4"
105 + 
106 + Scenario: Reposdir option in dnf.conf file with --config option in installroot=dockertesting2
107 +   Given _deprecated I use the repository "test-1"
108 +   When _deprecated I create a file "/dnf/dnf.conf" with content: "[main]\nreposdir=/var/www/html/repo/test-1-gpg"
109 +   When _deprecated I create a file "/dockertesting2/var/www/html/repo/test-1-gpg/test.repo" with content: "[test]\nname=test\nbaseurl=http://127.0.0.1/repo/test-1-gpg\nenabled=1\ngpgcheck=1\ngpgkey=file:///var/www/html/repo/test-1-gpg/RPM-GPG-KEY-dtest1"
110 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting2 -c /dnf/dnf.conf -y install TestC" with "success"
111 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestC" with "success"
112 +   Then _deprecated line from "stdout" should "start" with "TestC-1.0.0-1"
 1 @@ -0,0 +1,64 @@
 2 + Feature: Deplist as commmand and option
 3 + 
 4 +   Scenario: Feature Setup
 5 +       Given _deprecated I use the repository "upgrade_1"
 6 +       When I successfully run "dnf makecache"
 7 + 
 8 +   Scenario: Deplist as command
 9 +        When I successfully run "yum deplist TestA"
10 +        Then the command stdout should match exactly
11 +             """
12 +             package: TestA-1.0.0-1.noarch
13 +               dependency: TestB
14 +                provider: TestB-1.0.0-2.noarch
15 + 
16 +             package: TestA-1.0.0-2.noarch
17 +               dependency: TestB
18 +                provider: TestB-1.0.0-2.noarch
19 + 
20 +             """
21 + 
22 +   Scenario: Deplist as repoquery option
23 +        When I successfully run "dnf repoquery --deplist TestA"
24 +        Then the command stdout should match exactly
25 +             """
26 +             package: TestA-1.0.0-1.noarch
27 +               dependency: TestB
28 +                provider: TestB-1.0.0-2.noarch
29 + 
30 +             package: TestA-1.0.0-2.noarch
31 +               dependency: TestB
32 +                provider: TestB-1.0.0-2.noarch
33 + 
34 +             """
35 + 
36 +   Scenario: Deplist as repoquery option but using dnf bin
37 +        When I successfully run "sh -c 'dnf repoquery --deplist TestA'"
38 +        Then the command stdout should match exactly
39 +             """
40 +             package: TestA-1.0.0-1.noarch
41 +               dependency: TestB
42 +                provider: TestB-1.0.0-2.noarch
43 + 
44 +             package: TestA-1.0.0-2.noarch
45 +               dependency: TestB
46 +                provider: TestB-1.0.0-2.noarch
47 + 
48 +             """
49 + 
50 +   Scenario: Deplist with --latest-limit
51 +        When I successfully run "dnf repoquery --deplist --latest-limit 1 TestA"
52 +        Then the command stdout should match exactly
53 +             """
54 +             package: TestA-1.0.0-2.noarch
55 +               dependency: TestB
56 +                provider: TestB-1.0.0-2.noarch
57 + 
58 +             """
59 + 
60 +   Scenario: Deplist with --latest-limit and verbose
61 +        When _deprecated I execute "dnf" command "repoquery --deplist --latest-limit 1 --verbose TestA" with "success"
62 +        Then _deprecated line from "stdout" should "start" with "package: TestA-1.0.0-2.noarch"
63 +        And _deprecated line from "stdout" should "start" with "  dependency: TestB"
64 +        And _deprecated line from "stdout" should "start" with "   provider: TestB-1.0.0-1.noarch"
65 +        And _deprecated line from "stdout" should "start" with "   provider: TestB-1.0.0-2.noarch"
 1 @@ -0,0 +1,37 @@
 2 + Feature: DNF/Behave test (downgrade test)
 3 + 
 4 + Scenario: Downgrade TestA from repository "upgrade_1"
 5 +  Given _deprecated I use the repository "upgrade_1"
 6 +  When _deprecated I execute "dnf" command "-y install TestA" with "success"
 7 +  Then _deprecated transaction changes are as follows
 8 +    | State        | Packages      |
 9 +    | installed    | TestA, TestB  |
10 +    | absent       | TestC         |
11 +  When _deprecated I execute "dnf" command "-y downgrade TestA" with "success"
12 +  Then _deprecated transaction changes are as follows
13 +    | State        | Packages   |
14 +    | downgraded   | TestA      |
15 +    | present      | TestB      |
16 +    | absent       | TestC      |
17 + 
18 + Scenario: Downgrade TestD from repository "upgrade_1" that require downgrade of dependency
19 +  Given _deprecated I use the repository "upgrade_1"
20 +  When _deprecated I execute "dnf" command "-y install TestD" with "success"
21 +  Then _deprecated transaction changes are as follows
22 +    | State        | Packages      |
23 +    | installed    | TestD, TestE  |
24 +  When _deprecated I execute "dnf" command "-y downgrade TestD" with "success"
25 +  Then _deprecated transaction changes are as follows
26 +    | State        | Packages      |
27 +    | downgraded   | TestD, TestE  |
28 + 
29 + Scenario: Downgrade TestN from repository "upgrade_1" only to previous version
30 +  Given _deprecated I use the repository "upgrade_1"
31 +  When _deprecated I execute "dnf" command "-y install TestN" with "success"
32 +  Then _deprecated transaction changes are as follows
33 +    | State        | Packages   |
34 +    | installed    | TestN      |
35 +  When _deprecated I execute "dnf" command "-y downgrade TestN" with "success"
36 +  Then _deprecated transaction changes are as follows
37 +    | State        | Packages       |
38 +    | downgraded   | TestN-1.0.0-3  |
  1 @@ -0,0 +1,100 @@
  2 + Feature: Test for download command, options --destdir, --resolve
  3 +          # --source should be added when there's support for .src.rpm in repos
  4 + 
  5 +   @setup
  6 +   Scenario: Feature Setup
  7 +       Given http repository "base" with packages
  8 +          | Package  | Tag       | Value  |
  9 +          | TestA    | Version   |  1     |
 10 +          | TestA v2 | Requires  | TestB  |
 11 +          |          | Requires  | TestE  |
 12 +          |          | Version   |  2     |
 13 +          | TestC    | Provides  | TestB  |
 14 +          |          | Conflicts | TestD  |
 15 +          | TestD    | Provides  | TestB  |
 16 +          |          | Conflicts | TestC  |
 17 +          | TestE    |           |        |
 18 + 
 19 +   Scenario: dnf download (when there is no such pkg)
 20 +        When I run "dnf download TestA"
 21 +        Then the command should fail
 22 +         And the command stderr should match regexp "No package.*available"
 23 + 
 24 +   Scenario: dnf download (when there is such pkg)
 25 +        When I enable repository "base"
 26 +         And I successfully run "dnf download TestA"
 27 +        Then the command stdout should match regexp "TestA-2.*rpm" 
 28 +         # check that the file has been downloaded into working directory
 29 +         And I successfully run "stat TestA-2-1.noarch.rpm"
 30 +         # check that downloaded .rpm is the same as the one in the repo
 31 +         And I successfully run "bash -c 'diff TestA-2-1.noarch.rpm /var/www/html/tmp*/TestA-2-1.noarch.rpm'"
 32 + 
 33 +   # check also download --verbose, there were some problems with it 
 34 +   Scenario: dnf download --verbose (when there is such pkg)
 35 +        When I successfully run "rm -f TestA-2-1.noarch.rpm"
 36 +         And I successfully run "dnf download --verbose TestA"
 37 +        Then the command stdout should match regexp "TestA-2.*rpm" 
 38 +         And I successfully run "stat TestA-2-1.noarch.rpm"
 39 +         And I successfully run "bash -c 'diff TestA-2-1.noarch.rpm /var/www/html/tmp*/TestA-2-1.noarch.rpm'"
 40 + 
 41 +   Scenario: dnf download --resolve (download also dependencies)
 42 +        When I successfully run "dnf download --resolve TestA"
 43 +        Then the command stdout should match regexp "TestC-1.*rpm" 
 44 +         And the command stdout should match regexp "TestE-1.*rpm" 
 45 +         # TestA-2 has already been downloaded, it is not downloaded again
 46 +         And the command stdout should match regexp "SKIPPED.*TestA-2"
 47 +         And I successfully run "stat TestE-1-1.noarch.rpm"
 48 +         And I successfully run "bash -c 'diff TestE-1-1.noarch.rpm /var/www/html/tmp*/TestE-1-1.noarch.rpm'"
 49 +         And I successfully run "stat TestC-1-1.noarch.rpm"
 50 +         And I successfully run "bash -c 'diff TestC-1-1.noarch.rpm /var/www/html/tmp*/TestC-1-1.noarch.rpm'"
 51 + 
 52 +   Scenario: dnf download --destdir (when there is such pkg)
 53 +        When I successfully run "mkdir -p /tmp/testrpms"
 54 +         And I successfully run "dnf download --destdir /tmp/testrpms TestA"
 55 +        Then the command stdout should match regexp "TestA-2.*rpm" 
 56 +         # check that the file has been downloaded into working directory
 57 +         And I successfully run "stat /tmp/testrpms/TestA-2-1.noarch.rpm"
 58 +         # check that downloaded .rpm is the same as the one in the repo
 59 +         And I successfully run "bash -c 'diff /tmp/testrpms/TestA-2-1.noarch.rpm /var/www/html/tmp*/TestA-2-1.noarch.rpm'"
 60 + 
 61 +   Scenario: dnf download --destdir --verbose (when there is such pkg)
 62 +        When I successfully run "bash -c 'rm -f /tmp/testrpms/TestA*'"
 63 +         And I successfully run "dnf download --verbose --destdir /tmp/testrpms TestA"
 64 +        Then the command stdout should match regexp "TestA-2.*rpm" 
 65 +         # check that the file has been downloaded into working directory
 66 +         And I successfully run "stat /tmp/testrpms/TestA-2-1.noarch.rpm"
 67 +         # check that downloaded .rpm is the same as the one in the repo
 68 +         And I successfully run "bash -c 'diff /tmp/testrpms/TestA-2-1.noarch.rpm /var/www/html/tmp*/TestA-2-1.noarch.rpm'"
 69 + 
 70 +   Scenario: dnf download --resolve (download dependencies when some are installed)
 71 +        When I successfully run "bash -c 'rm -f Test*rpm'"
 72 +         And I successfully run "dnf -y install TestE"
 73 +         And I successfully run "dnf download --resolve TestA"
 74 +        Then the command stdout should match regexp "TestA-2.*rpm"
 75 +         And the command stdout should match regexp "TestC-1.*rpm" 
 76 +         And the command stdout should not match regexp "TestE-1.*rpm" 
 77 +         And I successfully run "stat TestA-2-1.noarch.rpm"
 78 +         And I successfully run "bash -c 'diff TestA-2-1.noarch.rpm /var/www/html/tmp*/TestA-2-1.noarch.rpm'"
 79 +         And I successfully run "stat TestC-1-1.noarch.rpm"
 80 +         And I successfully run "bash -c 'diff TestC-1-1.noarch.rpm /var/www/html/tmp*/TestC-1-1.noarch.rpm'"
 81 +        When I run "stat TestE-1-1.noarch.rpm"
 82 +        Then the command should fail
 83 +         # cleanup of downloaded files
 84 +         And I successfully run "bash -c 'rm -f Test*rpm'"
 85 + 
 86 +   Scenario: dnf download --resolve --destdir (download dependencies when all are installed)
 87 +        When I successfully run "bash -c 'rm -f /tmp/testrpms/Test*rpm'"
 88 +         And I successfully run "dnf -y install TestA"
 89 +         And I successfully run "dnf download --resolve --destdir /tmp/testrpms TestA"
 90 +        # only TestA should be downloaded (no matter that it is installed)
 91 +        Then the command stdout should match regexp "TestA-2.*rpm"
 92 +         And the command stdout should not match regexp "TestC-1.*rpm" 
 93 +         And the command stdout should not match regexp "TestE-1.*rpm" 
 94 +         And I successfully run "stat /tmp/testrpms/TestA-2-1.noarch.rpm"
 95 +         And I successfully run "bash -c 'diff /tmp/testrpms/TestA-2-1.noarch.rpm /var/www/html/tmp*/TestA-2-1.noarch.rpm'"
 96 +        When I run "stat /tmp/testrpms/TestC-1-1.noarch.rpm"
 97 +        Then the command should fail
 98 +        When I run "stat /tmp/testrpms/TestE-1-1.noarch.rpm"
 99 +        Then the command should fail
100 +         # cleanup of downloaded files and the test dir
101 +         And I successfully run "bash -c 'rm -rf /tmp/testrpms'"
 1 @@ -0,0 +1,19 @@
 2 + import unittest
 3 + 
 4 + class dummy(unittest.TestCase):
 5 +     maxDiff = None
 6 + 
 7 +     def runTest(self):
 8 +         pass
 9 + 
10 + def before_all(ctx):
11 +     ctx.command_map = {
12 +         "dnf": ctx.config.userdata.get("dnf_cmd", "dnf")
13 +     }
14 +     ctx.rpmdb = None
15 +     ctx.wipe_rpmdb = False
16 +     ctx.assertion = dummy()
17 + 
18 + def after_step(ctx, step):
19 +     if ctx.wipe_rpmdb:
20 +         ctx.rpmdb = None
 1 @@ -0,0 +1,26 @@
 2 + Feature: DNF/Behave test (Import GPG-key and test repolist)
 3 + 
 4 + Scenario: Add repository to host with gpgcheck=1 from repofile and test 'repolist' command plus dnf.log test
 5 +  Given _deprecated I use the repository "test-1"
 6 +  When _deprecated I execute "dnf" command "repolist" with "success"
 7 +  Then _deprecated line from "stdout" should "not start" with "upgrade_1-gpg"
 8 +  And _deprecated line from "stdout" should "start" with "test-1"
 9 +  When _deprecated I execute "dnf" command "config-manager --add-repo http://127.0.0.1/repo/upgrade_1-gpg/upgrade_1-gpg-file.repo" with "success"
10 +  When _deprecated I execute "dnf" command "repolist" with "success"
11 +  Then _deprecated line from "stdout" should "start" with "upgrade_1-gpg-file"
12 +  And _deprecated line from "stdout" should "start" with "test-1"
13 + # It also test if dnf.log file is used from host if package installed in host
14 +  When _deprecated I execute "bash" command "rm -f /var/log/dnf.log" with "success"
15 +  Then _deprecated the path "/var/log/dnf.log" should be "absent"
16 +  When _deprecated I execute "bash" command "rm -f /dockertesting/var/log/dnf.log" with "success"
17 +  Then _deprecated the path "/dockertesting/var/log/dnf.log" should be "absent"
18 + # Test if correct repo is enabled and gpg-key import
19 +  When _deprecated I execute "dnf" command "-y --disablerepo=* --enablerepo=upgrade_1-gpg-file install TestN" with "success"
20 +  Then _deprecated transaction changes are as follows
21 +    | State        | Packages      |
22 +    | installed    | TestN-1.0.0-4 |
23 +  And _deprecated the path "/dockertesting/var/log/dnf.log" should be "absent"
24 +  And _deprecated the path "/var/log/dnf.log" should be "present"
25 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "fail"
26 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
27 +  Then _deprecated line from "stdout" should "start" with "gpg-pubkey-705f3e8c-56c2e298 --> gpg(DNF Test2 (TESTER) <dnf@testteam.org>)"
 1 @@ -0,0 +1,21 @@
 2 + Feature: DNF/Behave test (GPG key import in installroot)
 3 + 
 4 + Scenario: GPG key import after package install from installroot repository into installroot
 5 +  When _deprecated I execute "dnf" command "--setopt=reposdir=/dockertesting/etc/yum.repos.d config-manager --add-repo http://127.0.0.1/repo/test-1-gpg/test-1-gpg-file.repo" with "success"
 6 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "fail"
 7 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
 8 +  Then _deprecated line from "stdout" should "not start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
 9 + # It also test if dnf.log file is used from installroot if package installed in installroot
10 +  When _deprecated I execute "bash" command "rm -f /var/log/dnf.log" with "success"
11 +  Then _deprecated the path "/var/log/dnf.log" should be "absent"
12 +  When _deprecated I execute "bash" command "rm -f /dockertesting/var/log/dnf.log" with "success"
13 +  Then _deprecated the path "/dockertesting/var/log/dnf.log" should be "absent"
14 +  When _deprecated I execute "dnf" command "--installroot=/dockertesting -y --disablerepo=* --enablerepo=test-1-gpg-file install TestA" with "success"
15 +  Then _deprecated the path "/dockertesting/var/log/dnf.log" should be "present"
16 +  When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA TestB" with "success"
17 +  Then _deprecated line from "stdout" should "start" with "TestA-1.0.0-1."
18 +  And _deprecated line from "stdout" should "start" with "TestB-1.0.0-1."
19 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
20 +  Then _deprecated line from "stdout" should "start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
21 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
22 +  Then _deprecated line from "stdout" should "not start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
 1 @@ -0,0 +1,17 @@
 2 + Feature: DNF/Behave test (GPG key import in installroot)
 3 + 
 4 + Scenario: GPG key import after package install from host repository into installroot
 5 +  When _deprecated I execute "dnf" command "config-manager --add-repo http://127.0.0.1/repo/test-1-gpg/test-1-gpg-file.repo" with "success"
 6 +  When _deprecated I execute "dnf" command "repolist" with "success"
 7 +  Then _deprecated line from "stdout" should "start" with "test-1-gpg-file"
 8 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "fail"
 9 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
10 +  Then _deprecated line from "stdout" should "not start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
11 +  When _deprecated I execute "dnf" command "--installroot=/dockertesting -y --disablerepo=* --enablerepo=test-1-gpg-file install TestA" with "success"
12 +  When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA TestB" with "success"
13 +  Then _deprecated line from "stdout" should "start" with "TestA-1.0.0-1."
14 +  And _deprecated line from "stdout" should "start" with "TestB-1.0.0-1."
15 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
16 +  Then _deprecated line from "stdout" should "start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
17 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
18 +  Then _deprecated line from "stdout" should "not start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
 1 @@ -0,0 +1,28 @@
 2 + Feature: DNF/Behave test (GPG key handing in installroot)
 3 + 
 4 + Scenario: Install signed package with signed dependecy with key from host from repository with gpgcheck=1
 5 + # Install package and import Test2-gpg-key to host
 6 +  When _deprecated I execute "dnf" command "config-manager --add-repo http://127.0.0.1/repo/upgrade_1-gpg/upgrade_1-gpg-file.repo" with "success"
 7 +  When _deprecated I execute "dnf" command "-y install TestN" with "success"
 8 +  Then _deprecated transaction changes are as follows
 9 +    | State        | Packages      |
10 +    | installed    | TestN-1.0.0-4 |
11 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "fail"
12 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
13 +  Then _deprecated line from "stdout" should "start" with "gpg-pubkey-705f3e8c-56c2e298 --> gpg(DNF Test2 (TESTER) <dnf@testteam.org>)"
14 + # Install package and import Test1-gpg-key to installroot
15 +  When _deprecated I execute "dnf" command "--setopt=reposdir=/dockertesting/etc/yum.repos.d config-manager --add-repo http://127.0.0.1/repo/test-1-gpg/test-1-gpg-file.repo" with "success"
16 +  When _deprecated I execute "dnf" command "--installroot=/dockertesting -y install TestA" with "success"
17 +  When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA TestB" with "success"
18 +  Then _deprecated line from "stdout" should "start" with "TestA-1.0.0-1."
19 +  And _deprecated line from "stdout" should "start" with "TestB-1.0.0-1."
20 +  When _deprecated I execute "bash" command "rpm --root=/dockertesting -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
21 +  Then _deprecated line from "stdout" should "start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
22 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
23 +  Then _deprecated line from "stdout" should "not start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
24 + # Install package into installroot that requires gpg-key from host (fail)
25 +  When _deprecated I execute "dnf" command "--installroot=/dockertesting -y install TestF" with "fail"
26 +  When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestF TestG TestH" with "fail"
27 +  Then _deprecated line from "stdout" should "not start" with "TestF"
28 +  And _deprecated line from "stdout" should "not start" with "TestG"
29 +  And _deprecated line from "stdout" should "not start" with "TestH"
 1 @@ -0,0 +1,87 @@
 2 + Feature: DNF/Behave test (gpg, check-sum)
 3 + 
 4 + Scenario: Add repository with gpgcheck=1 from repofile and control 'repolist' command
 5 +  Given _deprecated I use the repository "test-1"
 6 +  When _deprecated I execute "dnf" command "repolist" with "success"
 7 +  Then _deprecated line from "stdout" should "start" with "test-1 "
 8 +  And _deprecated line from "stdout" should "not start" with "test-1-gpg-file"
 9 +  When _deprecated I execute "dnf" command "config-manager --add-repo http://127.0.0.1/repo/test-1-gpg/test-1-gpg-file.repo" with "success"
10 +  When _deprecated I execute "dnf" command "repolist test-1-g*" with "success"
11 +  Then _deprecated line from "stdout" should "not start" with "test-1 "
12 +  And _deprecated line from "stdout" should "start" with "test-1-gpg-file"
13 + 
14 + Scenario: GPG key import after package install
15 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
16 +  Then _deprecated line from "stdout" should "not start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
17 +  When _deprecated I execute "dnf" command "-y --disablerepo=test-1 install TestA" with "success"
18 +  Then _deprecated transaction changes are as follows
19 +    | State        | Packages      |
20 +    | installed    | TestA, TestB  |
21 +  When _deprecated I execute "bash" command "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'" with "success"
22 +  Then _deprecated line from "stdout" should "start" with "gpg-pubkey-2d2e7ca3-56c1e69d --> gpg(DNF Test1 (TESTER) <dnf@testteam.org>)"
23 + # Cleaning artifacts from test
24 +  When _deprecated I execute "dnf" command "-y remove TestA" with "success"
25 +  Then _deprecated transaction changes are as follows
26 +    | State        | Packages      |
27 +    | removed      | TestA, TestB  |
28 + 
29 + Scenario: Install signed package with unsigned dependecy from repository with gpgcheck=1
30 +  When _deprecated I execute "dnf" command "-y --disablerepo=test-1 install TestD" with "fail"
31 +  Then _deprecated transaction changes are as follows
32 +    | State        | Packages      |
33 +    | absent       | TestD, TestE  |
34 + 
35 + Scenario: Install signed package with signed dependece with different key from repository with gpgcheck=1
36 +  When _deprecated I execute "dnf" command "-y --disablerepo=test-1 install TestF" with "fail"
37 +  Then _deprecated transaction changes are as follows
38 +    | State        | Packages             |
39 +    | absent       | TestF, TestG, TestH  |
40 + 
41 + Scenario: Install package with incorrect checksum from repository with gpgcheck=1
42 +  Then _deprecated the file "/var/cache/dnf/expired_repos.json" should contain "[]"
43 +  When _deprecated I execute "dnf" command "-y --disablerepo=test-1 install TestJ" with "fail"
44 +  Then _deprecated transaction changes are as follows
45 +    | State        | Packages   |
46 +    | absent       | TestJ      |
47 +  Then _deprecated the file "/var/cache/dnf/expired_repos.json" should contain "["test-1-gpg-file"]"
48 +  When _deprecated I execute "dnf" command "makecache" with "success"
49 +  Then _deprecated the file "/var/cache/dnf/expired_repos.json" should contain "[]"
50 + 
51 + Scenario: Add repository with gpgcheck=0 and install package with unknown key and signed and unsigned packages
52 +  Given _deprecated I use the repository "test-1-gpg"
53 +  When _deprecated I execute "dnf" command "-y install TestF" with "success"
54 +  Then _deprecated transaction changes are as follows
55 +    | State        | Packages             |
56 +    | installed    | TestF, TestG, TestH  |
57 +  When _deprecated I execute "dnf" command "-y install TestD" with "success"
58 +  Then _deprecated transaction changes are as follows
59 +    | State        | Packages      |
60 +    | installed    | TestD, TestE  |
61 + # Cleaning artifacts from test
62 +  When _deprecated I execute "dnf" command "-y remove TestF TestD" with "success"
63 +  Then _deprecated transaction changes are as follows
64 +    | State        | Packages                           |
65 +    | removed      | TestD, TestE, TestF, TestG, TestH  |
66 + 
67 + Scenario: Add repository with without gpgcheck and try to install insigned package (test if gpgcheck is taken from dnf.conf)
68 +  Given _deprecated I use the repository "test-1"
69 +  When _deprecated I create a file "/etc/yum.repos.d/gpg.repo" with content: "[gpg]\nname=gpg\nbaseurl=http://127.0.0.1/repo/test-1\nenabled=1"
70 +  Then _deprecated the path "/etc/yum.repos.d/gpg.repo" should be "present"
71 +  When _deprecated I execute "dnf" command "-y --disablerepo=test-1 install TestC" with "fail"
72 +  Then _deprecated transaction changes are as follows
73 +    | State        | Packages   |
74 +    | absent       | TestC      |
75 +  When _deprecated I execute "dnf" command "-y --disablerepo=test-1 --nogpgcheck install TestC" with "success"
76 +  Then _deprecated transaction changes are as follows
77 +    | State        | Packages   |
78 +    | installed    | TestC      |
79 + 
80 + #It is brocken - activate after fix in dnf - if gpgcheck=0 dnf doesn't controle checksum (https://bugzilla.redhat.com/show_bug.cgi?id=1314405)
81 + #Scenario: Install package with incorrect checksum from repository with gpgcheck=0
82 + # Given _deprecated I use the repository "test-1-gpg"
83 + # Then _deprecated the file "/var/cache/dnf/expired_repos.json" should contain "[]"
84 + # When _deprecated I execute "dnf" command "-y install TestJ" with "fail"
85 + # Then _deprecated transaction changes are as follows
86 + #   | State        | Packages   |
87 + #   | absent       | TestJ      |
88 + # Then _deprecated the file "/var/cache/dnf/expired_repos.json" should contain "["test-1-gpg"]"
 1 @@ -0,0 +1,27 @@
 2 + Feature: DNF/Behave test test (Test if group are marked correctly - transaction fail)
 3 + 
 4 + Scenario: Install TestB first with RPM, then install TestA with DNF and observe if the Recommended TestC is also installed
 5 +   Given _deprecated I use the repository "test-1"
 6 + # Initial check
 7 +   When _deprecated I execute "dnf" command "group list Testgroup" with "success"
 8 +   Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
 9 +   And _deprecated line from "stdout" should "start" with "Available Groups:"
10 + # Exclude of dependency of mandatory package
11 + # When _deprecated I execute "dnf" command "group install -y --exclude=TestB Testgroup" with "fail"
12 + # Then _deprecated I execute "dnf" command "group list Testgroup" with "success"
13 + # And _deprecated line from "stdout" should "not start" with "Installed Groups:"
14 + # And _deprecated line from "stdout" should "start" with "Available Groups:"
15 +   When _deprecated I execute "dnf" command "group install -y --exclude=TestC Testgroup" with "success"
16 +   Then _deprecated transaction changes are as follows
17 +   | State        | Packages                   |
18 +   | installed    | TestA, TestB |
19 +   And _deprecated I execute "dnf" command "group list Testgroup" with "success"
20 +   And _deprecated line from "stdout" should "start" with "Installed Groups:"
21 +   And _deprecated line from "stdout" should "not start" with "Available Groups:"
22 +   When _deprecated I execute "dnf" command "-y group remove Testgroup" with "success"
23 +   Then _deprecated transaction changes are as follows
24 +   | State        | Packages            |
25 +   | removed      | TestA, TestB |
26 +   And _deprecated I execute "dnf" command "group list Testgroup" with "success"
27 +   And _deprecated line from "stdout" should "not start" with "Installed Groups:"
28 +   And _deprecated line from "stdout" should "start" with "Available Groups:"
 1 @@ -0,0 +1,32 @@
 2 + Feature: DNF/Behave test test (Test if group are marked correctly - mandatory unavailable)
 3 + 
 4 + Scenario: Install TestB first with RPM, then install TestA with DNF and observe if the Recommended TestC is also installed
 5 +   Given _deprecated I use the repository "test-1"
 6 + # Initial check
 7 +   When _deprecated I execute "dnf" command "group list Testgroup" with "success"
 8 +   Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
 9 +   And _deprecated line from "stdout" should "start" with "Available Groups:"
10 + # Exclude of mandatory package
11 + # When _deprecated I execute "dnf" command "group install -y --exclude=TestA Testgroup" with "fail"
12 + # Then _deprecated I execute "dnf" command "group list Testgroup" with "success"
13 + # And _deprecated line from "stdout" should "not start" with "Installed Groups:"
14 + # And _deprecated line from "stdout" should "start" with "Available Groups:"
15 + # Test with "--assumeno"
16 +   When _deprecated I execute "dnf" command "group install --assumeno Testgroup" with "fail"
17 +   Then _deprecated I execute "dnf" command "group list Testgroup" with "success"
18 +   And _deprecated line from "stdout" should "not start" with "Installed Groups:"
19 +   And _deprecated line from "stdout" should "start" with "Available Groups:"
20 +   When _deprecated I execute "dnf" command "group install -y --exclude=TestC Testgroup" with "success"
21 +   Then _deprecated transaction changes are as follows
22 +   | State        | Packages      |
23 +   | installed    | TestA, TestB  |
24 +   And _deprecated I execute "dnf" command "group list Testgroup" with "success"
25 +   And _deprecated line from "stdout" should "start" with "Installed Groups:"
26 +   And _deprecated line from "stdout" should "not start" with "Available Groups:"
27 +   When _deprecated I execute "dnf" command "group -y remove Testgroup" with "success"
28 +   Then _deprecated transaction changes are as follows
29 +   | State        | Packages     |
30 +   | removed      | TestA, TestB |
31 +   And _deprecated I execute "dnf" command "group list Testgroup" with "success"
32 +   And _deprecated line from "stdout" should "not start" with "Installed Groups:"
33 +   And _deprecated line from "stdout" should "start" with "Available Groups:"
 1 @@ -0,0 +1,18 @@
 2 + Feature: DNF/Behave test test (Test if optional pkgs of group are installed correctly)
 3 + 
 4 + Scenario: Install conditional TestE if required TestG is about to be installed
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "install --assumeyes @Testgroup TestG" with "success"
 7 +   Then _deprecated transaction changes are as follows
 8 +   | State        | Packages                          |
 9 +   | installed    | TestA, TestB, TestC, TestE, TestG |
10 + 
11 + Scenario: Install conditional TestE if required TestG has been already installed
12 +   Given _deprecated I use the repository "test-1"
13 +   When _deprecated I execute "dnf" command "group remove --assumeyes Testgroup" with "success"
14 +   | State        | Packages                   |
15 +   | removed      | TestA, TestB, TestC, TestE |
16 +   When _deprecated I execute "dnf" command "group install --assumeyes Testgroup" with "success"
17 +   Then _deprecated transaction changes are as follows
18 +   | State        | Packages                   |
19 +   | installed    | TestA, TestB, TestC, TestE |
 1 @@ -0,0 +1,22 @@
 2 + Feature: DNF/Behave test (argument parser help)
 3 + 
 4 + Scenario: General help
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "--help" with "success"
 7 +   Then _deprecated line from "stdout" should "start" with "List of Main Commands"
 8 +   When _deprecated I execute "dnf" command "--unknown-opt" with "success"
 9 +   Then _deprecated line from "stdout" should "start" with "List of Main Commands"
10 +   When _deprecated I execute "dnf" command "unknown-command" with "fail"
11 +   Then _deprecated line from "stderr" should "start" with "No such command"
12 +   Then _deprecated line from "stderr" should "start" with "It could be a DNF plugin command"
13 +   When _deprecated I execute "dnf" command "help" with "success"
14 +   Then _deprecated line from "stdout" should "start" with "List of Main Commands"
15 + 
16 + Scenario: Command help
17 +   Given _deprecated I use the repository "test-1"
18 +   When _deprecated I execute "dnf" command "help install" with "success"
19 +   Then _deprecated line from "stdout" should "start" with "install a package or packages on your system"
20 +   When _deprecated I execute "dnf" command "install --help" with "success"
21 +   Then _deprecated line from "stdout" should "start" with "install a package or packages on your system"
22 +   When _deprecated I execute "dnf" command "update --unknown-opt" with "fail"
23 +   Then _deprecated line from "stderr" should "start" with "dnf upgrade: error: unrecognized arguments: --unknown-opt"
  1 @@ -0,0 +1,102 @@
  2 + Feature: DNF/Behave test Transaction history - base
  3 + 
  4 +     @setup
  5 +     Scenario: Feature Setup
  6 +         Given repository "test" with packages
  7 +            | Package | Tag      | Value |
  8 +            | TestA   | Requires | TestB |
  9 +            | TestB   |          |       |
 10 +            | TestC   |          |       |
 11 +            | TestD   | Requires | TestE |
 12 +            | TestE   | Requires | TestC |
 13 +           And repository "updates" with packages
 14 +            | Package | Tag     | Value |
 15 +            | TestA   | Version | 2     |
 16 +            | TestB   | Version | 2     |
 17 +            | TestC   | Version | 2     |
 18 +            | TestD   | Version | 2     |
 19 +          When I save rpmdb
 20 +           And I enable repository "test"
 21 + 
 22 +     Scenario: History list of simple transaction
 23 +          When I save rpmdb
 24 +           And I successfully run "dnf install -y TestA"
 25 +          Then rpmdb changes are
 26 +            | State        | Packages      |
 27 +            | installed    | TestA, TestB  |
 28 +           And history should match "install -y TestA" with "Install" and "2" packages
 29 + 
 30 +     Scenario: Undo last transaction
 31 +          When I save rpmdb
 32 +           And I successfully run "dnf history undo last -y"
 33 +          Then rpmdb changes are
 34 +            | State        | Packages      |
 35 +            | removed      | TestA, TestB  |
 36 +           And history should match "history undo last -y" with "Erase" and "2" packages
 37 + 
 38 +     Scenario: Undo last transaction again
 39 +          When I save rpmdb
 40 +           And I successfully run "dnf history undo last -y"
 41 +          Then rpmdb changes are
 42 +            | State        | Packages      |
 43 +            | installed    | TestA, TestB  |
 44 +           And history should match "history undo last -y" with "Install" and "2" packages
 45 + 
 46 +     Scenario: Undo transaction last-2
 47 +          When I save rpmdb
 48 +           And I successfully run "dnf history undo last-2 -y"
 49 +          Then rpmdb changes are
 50 +            | State        | Packages      |
 51 +            | removed      | TestA, TestB  |
 52 +           And history should match "history undo last-2 -y" with "Erase" and "2" packages
 53 + 
 54 +     Scenario: Redo last transaction
 55 +          When I save rpmdb
 56 +           And I successfully run "dnf install -y TestA"
 57 +          Then rpmdb changes are
 58 +            | State        | Packages      |
 59 +            | installed    | TestA, TestB  |
 60 +          When I save rpmdb
 61 +           And I successfully run "dnf remove -y TestA"
 62 +          Then rpmdb changes are
 63 +            | State        | Packages      |
 64 +            | removed      | TestA, TestB  |
 65 +          When I save rpmdb
 66 +           And I successfully run "dnf history redo last-1 -y"
 67 +          Then rpmdb changes are
 68 +            | State        | Packages      |
 69 +            | installed    | TestA, TestB  |
 70 +           And history should match "history redo last-1 -y" with "Install" and "2" packages
 71 +          When I save rpmdb
 72 +           And I successfully run "dnf history redo last-1 -y"
 73 +          Then rpmdb changes are
 74 +            | State        | Packages      |
 75 +            | removed      | TestA, TestB  |
 76 +           And history should match "history redo last-1 -y" with "Erase" and "2" packages
 77 + 
 78 +     Scenario: History list of update packages
 79 +          When I save rpmdb
 80 +           And I successfully run "dnf install -y TestA TestD"
 81 +          Then rpmdb changes are
 82 +            | State        | Packages                          |
 83 +            | installed    | TestA, TestB, TestC, TestD, TestE |
 84 +          When I save rpmdb
 85 +           And I enable repository "updates"
 86 +           And I successfully run "dnf update -y"
 87 +          Then rpmdb changes are
 88 +            | State        | Packages                    |
 89 +            | updated      | TestA, TestB, TestC, TestD  |
 90 +          When I successfully run "dnf history"
 91 +          Then history should match "update -y" with "Update" and "4" package
 92 + 
 93 +     Scenario: Rollback update
 94 +          When I save rpmdb
 95 +           And I successfully run "dnf history rollback last-1 -y"
 96 +          Then rpmdb changes are
 97 +            | State        | Packages                   |
 98 +            | downgraded   | TestA, TestB, TestC, TestD |
 99 +          When I save rpmdb
100 +           And I successfully run "dnf history rollback last-3 -y"
101 +          Then rpmdb changes are
102 +            | State        | Packages                          |
103 +            | removed      | TestA, TestB, TestC, TestD, TestE |
 1 @@ -0,0 +1,96 @@
 2 + Feature: DNF/Behave test Transaction history [info, list, userinstalled]
 3 + 
 4 +     @setup
 5 +     Scenario: Feature Setup
 6 +         Given repository "test" with packages
 7 +            | Package | Tag      | Value |
 8 +            | TestA   | Requires | TestB |
 9 +            | TestB   |          |       |
10 +            | TestC   |          |       |
11 +            | TestD   | Requires | TestE |
12 +            | TestE   | Requires | TestC |
13 +           And repository "updates" with packages
14 +            | Package | Tag     | Value |
15 +            | TestA   | Version | 2     |
16 +            | TestB   | Version | 2     |
17 +            | TestC   | Version | 2     |
18 +            | TestD   | Version | 2     |
19 +          When I save rpmdb
20 +           And I enable repository "test"
21 + 
22 +     Scenario: List userinstalled packages
23 +          When I save rpmdb
24 +           And I successfully run "dnf install -y TestA TestE"
25 +          Then history userinstalled should
26 +            | Action    | Packages     |
27 +            | Match     | TestA, TestE |
28 +            | Not match | TestB, TestC |
29 + 
30 +     Scenario: History list last and range
31 +          When I save rpmdb
32 +           And I successfully run "dnf install -y TestD"
33 +           And I successfully run "dnf remove -y TestE"
34 +          Then history "last-1..last" should match "install -y TestD" with "Install" and "1" package
35 +           And history "list last-1..last" should match "remove -y TestE" with "Erase" and "3" packages
36 +           And history "last" should match "remove -y TestE" with "Erase" and "3" packages
37 + 
38 +     Scenario: History list package
39 +          When I save rpmdb
40 +           And I successfully run "dnf install -y TestC"
41 +          Then history "TestC" should match "install -y TestC" with "Install" and "1" package
42 +           And history "list TestC" should match "remove -y TestE" with "Erase" and "3" packages
43 + 
44 +     Scenario: History info
45 +          When I save rpmdb
46 +          Then history info should match
47 +            | Key          | Value            |
48 +            | Command Line | install -y TestC |
49 +            | Return-Code  | Success          |
50 +            | Install      | TestC            |
51 +          When I successfully run "dnf remove -y TestA"
52 +          Then history info should match
53 +            | Key          | Value            |
54 +            | Command Line | remove -y TestA  |
55 +            | Return-Code  | Success          |
56 +            | Erase        | TestA, TestB     |
57 + 
58 +     Scenario: History info in range - transaction merging
59 +          When I save rpmdb
60 +           And I successfully run "dnf install -y TestA"
61 +          Then history info should match
62 +            | Key          | Value            |
63 +            | Command Line | install -y TestA |
64 +            | Return-Code  | Success          |
65 +            | Install      | TestA, TestB     |
66 +          When I save rpmdb
67 +           And I enable repository "updates"
68 +           And I successfully run "dnf update -y"
69 +          Then history info should match
70 +            | Key          | Value            |
71 +            | Command Line | update -y        |
72 +            | Return-Code  | Success          |
73 +            | Upgrade      | TestA, TestB     |
74 +            | Upgraded     | TestA, TestB     |
75 + 
76 +           And history info "last-1..last" should match
77 +            | Key          | Value            |
78 +            | Return-Code  | Success          |
79 +            | Install      | TestA            |
80 +           And history info "last-2..last" should match
81 +            | Key          | Value            |
82 +            | Return-Code  | Success          |
83 +            | Upgrade      | TestA            |
84 +            | Upgraded     | TestA            |
85 +           And history info "last-2..last-1" should match
86 +            | Key          | Value            |
87 +            | Return-Code  | Success          |
88 +            | Reinstall      | TestA            |
89 + 
90 +     Scenario: History info of package
91 +           And history info "TestA" should match
92 +            | Key          | Value                      |
93 +            | Return-Code  | Success                    |
94 +            | Upgrade      | TestA, TestB               |
95 +            | Upgraded     | TestA, TestB               |
96 +            | Install      | TestA, TestB, TestC, TestE |
97 +            | Erase        | TestA, TestB               |
 1 @@ -0,0 +1,56 @@
 2 + Feature: history undo install and erase - test reason of undone packages
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "base" with packages
 7 +          | Package | Tag       | Value |
 8 +          | TestA   |           |       |
 9 +          | TestB   | Requires  | TestC |
10 +          | TestC   |           |       |
11 +       Given repository "update" with packages
12 +          | Package | Tag       | Value |
13 +          | TestD   | Requires  | TestE |
14 +          | TestE   | Obsoletes | TestA |
15 +        When I save rpmdb
16 +         And I enable repository "base"
17 +         And I successfully run "dnf install -y TestA"
18 +        Then rpmdb changes are
19 +          | State        | Packages     |
20 +          | installed    | TestA        |
21 + 
22 +   Scenario: Handle package install
23 +        When I save rpmdb
24 +         And I enable repository "update"
25 +         And I successfully run "dnf install -y TestD"
26 +        Then rpmdb changes are
27 +          | State        | Packages     |
28 +          | installed    | TestD, TestE |
29 +          | removed      | TestA        |
30 +        When I save rpmdb
31 +         And I successfully run "dnf history undo last -y"
32 +        Then rpmdb changes are
33 +          | State        | Packages     |
34 +          | removed      | TestD, TestE |
35 +          | installed    | TestA        |
36 + 
37 +   Scenario: Handle package erase
38 +       When I save rpmdb
39 +        And I successfully run "dnf install -y TestB"
40 +       Then rpmdb changes are
41 +         | State        | Packages     |
42 +         | installed    | TestB, TestC |
43 +       When I save rpmdb
44 +        And I successfully run "dnf remove -y TestB"
45 +       Then rpmdb changes are
46 +         | State        | Packages     |
47 +         | removed      | TestB, TestC |
48 +       When I save rpmdb
49 +        And I successfully run "dnf history undo last -y"
50 +       Then rpmdb changes are
51 +         | State        | Packages     |
52 +         | installed    | TestB, TestC |
53 +       When I save rpmdb
54 +        And I successfully run "dnf remove -y TestC"
55 +       Then rpmdb changes are
56 +         | State        | Packages     |
57 +         | removed      | TestB, TestC |
 1 @@ -0,0 +1,25 @@
 2 + Feature: DNF/Behave test (apply exclude for rpms)
 3 + 
 4 + Scenario: Apply exclude for rpms
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "install -y --exclude=TestB /repo/TestB-1*.rpm" with "fail"
 7 +   Then _deprecated transaction changes are as follows
 8 +    | State        | Packages   |
 9 +    | absent       | TestB      |
10 +   When _deprecated I execute "dnf" command "install -y --exclude=TestB /repo/TestB-1*.rpm /repo/TestA-1*.rpm" with "fail"
11 +   Then _deprecated transaction changes are as follows
12 +    | State        | Packages       |
13 +    | absent       | TestB, TestA   |
14 +   When _deprecated I execute "dnf" command "install -y --exclude=TestB --setopt strict=false /repo/TestB-1*.rpm /repo/TestC-1*.rpm" with "success"
15 +   Then _deprecated transaction changes are as follows
16 +    | State        | Packages       |
17 +    | absent       | TestB          |
18 +    | installed    | TestC          |
19 +   When _deprecated I execute "dnf" command "install -y --exclude=TestC /repo/TestB-1*.rpm /repo/TestA-1*.rpm" with "success"
20 +   Then _deprecated transaction changes are as follows
21 +    | State        | Packages       |
22 +    | installed    | TestB, TestA   |
23 +   When _deprecated I execute "dnf" command "remove -y --exclude=TestC TestB TestA" with "success"
24 +   Then _deprecated transaction changes are as follows
25 +    | State        | Packages       |
26 +    | removed      | TestB, TestA   |
 1 @@ -0,0 +1,30 @@
 2 + Feature: Install installed pkg with just name or NEVR
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given _deprecated I use the repository "upgrade_1"
 7 +       When _deprecated I execute "dnf" command "-y install TestB-1.0.0-1  TestC-1.0.0-2 TestE-1.0.0-1" with "success"
 8 +       Then _deprecated transaction changes are as follows
 9 +          | State        | Packages      |
10 +          | installed    | TestB-1.0.0-1, TestC-1.0.0-2, TestE-1.0.0-1   |
11 + 
12 +   Scenario: Install of installed package by name (upgrade available)
13 +       When _deprecated I execute "dnf" command "-y install TestB" with "success"
14 +       Then _deprecated transaction changes are as follows
15 +         | State        | Packages              |
16 +         | present      | TestB-1.0.0-1         |
17 + 
18 +   Scenario: Install of installed package by name (only downgrade available)
19 +       Given _deprecated I use the repository "test-1"
20 +       When _deprecated I execute "dnf" command "-y install TestC" with "success"
21 +       Then _deprecated transaction changes are as follows
22 +         | State        | Packages              |
23 +         | present      | TestC-1.0.0-2         |
24 + 
25 + 
26 +   Scenario: Install of installed package by NEVR of installed (upgrade available)
27 +       Given _deprecated I use the repository "test-1"
28 +       When _deprecated I execute "dnf" command "-y install TestE-1.0.0-1" with "success"
29 +       Then _deprecated transaction changes are as follows
30 +         | State        | Packages              |
31 +         | present      | TestE-1.0.0-1         |
 1 @@ -0,0 +1,27 @@
 2 + Feature: Installing package with lover version
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "available" with packages
 7 +          | Package   | Tag       | Value       |
 8 +          | TestA     | Version   | 1           |
 9 +          |           | Requires  | TestB = 1-1 |
10 +          | TestA v2  | Version   | 2           |
11 +          |           | Requires  | TestB = 2-1 |
12 +          | TestB     | Version   | 1           |
13 +          | TestB v2  | Version   | 2           |
14 + 
15 +   Scenario: Install "TestA" should be propagated to installing "TestB"
16 +        When I save rpmdb
17 +         And I enable repository "available"
18 +         And I successfully run "dnf -y install TestA-2-1"
19 +        Then rpmdb changes are
20 +          | State     | Packages           |
21 +          | installed | TestA/2, TestB/2   |
22 + 
23 +   Scenario: Install "TestA-1-1" should be propagated to installing "TestB-1-1"
24 +        When I save rpmdb
25 +         And I successfully run "dnf -y install TestA-1-1"
26 +        Then rpmdb changes are
27 +          | State      | Packages         |
28 +          | downgraded | TestA/1, TestB/1 |
 1 @@ -0,0 +1,16 @@
 2 + Feature: Installing obsoleted packages
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "available" with packages
 7 +          | Package | Tag       | Value |
 8 +          | TestA   |           |       |
 9 +          | TestB   | Obsoletes | TestA |
10 + 
11 +   Scenario: Install "TestA" should be propagated to installing "TestB"
12 +        When I save rpmdb
13 +         And I enable repository "available"
14 +         And I successfully run "dnf -y install TestA"
15 +        Then rpmdb changes are
16 +          | State     | Packages |
17 +          | installed | TestB    |
  1 @@ -0,0 +1,226 @@
  2 + Feature: DNF/Behave test (install remove test)
  3 + 
  4 + Scenario: Install Remove TestA from repository "test-1" that requires TestB
  5 +  Given _deprecated I use the repository "test-1"
  6 +  When _deprecated I execute "dnf" command "install -y TestA" with "success"
  7 +  Then _deprecated the "Installing" section should contain package "TestA"
  8 +  And _deprecated the "Installing dependencies" section should contain package "TestB"
  9 +  Then _deprecated transaction changes are as follows
 10 +    | State        | Packages      |
 11 +    | installed    | TestA, TestB  |
 12 +    | absent       | TestC         |
 13 +  When _deprecated I execute "dnf" command "-y install TestA" with "success"
 14 +  Then _deprecated transaction changes are as follows
 15 +    | State        | Packages      |
 16 +    | present      | TestA, TestB  |
 17 +  When _deprecated I execute "dnf" command "-y remove TestA" with "success"
 18 +  Then _deprecated transaction changes are as follows
 19 +    | State        | Packages      |
 20 +    | removed      | TestA, TestB  |
 21 +    | absent       | TestC         |
 22 + 
 23 + Scenario: Install Remove TestD from repository "test-1" that requires TestE = 1.0.0-1
 24 +  Given _deprecated I use the repository "test-1"
 25 +  When _deprecated I execute "dnf" command "-y install TestD" with "success"
 26 +  Then _deprecated transaction changes are as follows
 27 +    | State        | Packages      |
 28 +    | installed    | TestD, TestE  |
 29 +  When _deprecated I execute "dnf" command "-y remove TestD" with "success"
 30 +  Then _deprecated the "Removing" section should contain package "TestD"
 31 +  And _deprecated the "Removing unused dependencies" section should contain package "TestE"
 32 +  Then _deprecated transaction changes are as follows
 33 +    | State        | Packages      |
 34 +    | removed      | TestD, TestE  |
 35 + 
 36 + Scenario: Install Remove TestF from repository "test-1" that requires TestG >= 1.0.0-1, TestH = 1.0.0-1
 37 +  Given _deprecated I use the repository "test-1"
 38 +  When _deprecated I execute "dnf" command "-y install TestF" with "success"
 39 +  Then _deprecated transaction changes are as follows
 40 +    | State        | Packages             |
 41 +    | installed    | TestF, TestG, TestH  |
 42 +  When _deprecated I execute "dnf" command "-y remove TestF" with "success"
 43 +  Then _deprecated transaction changes are as follows
 44 +    | State        | Packages             |
 45 +    | removed      | TestF, TestG, TestH  |
 46 + 
 47 + Scenario: Install TestI from repository "test-1" that requires TestJ >= 1.0.0-2 and requirements cannot be installed
 48 +  Given _deprecated I use the repository "test-1"
 49 +  When _deprecated I execute "dnf" command "install -y TestI" with "fail"
 50 +  Then _deprecated transaction changes are as follows
 51 +    | State        | Packages      |
 52 +    | absent       | TestI, TestJ  |
 53 + 
 54 + Scenario: Install Remove multiple packages TestK, TestL from repository "test-1" that both require TestM
 55 +  Given _deprecated I use the repository "test-1"
 56 +  When _deprecated I execute "dnf" command "-y install TestK TestL" with "success"
 57 +  Then _deprecated transaction changes are as follows
 58 +    | State        | Packages             |
 59 +    | installed    | TestK, TestL, TestM  |
 60 +  When _deprecated I execute "dnf" command "-y remove TestK" with "success"
 61 +  Then _deprecated transaction changes are as follows
 62 +    | State        | Packages      |
 63 +    | removed      | TestK         |
 64 +    | present      | TestL, TestM  |
 65 +  When _deprecated I execute "dnf" command "-y remove TestL" with "success"
 66 +  Then _deprecated transaction changes are as follows
 67 +    | State        | Packages      |
 68 +    | removed      | TestL, TestM  |
 69 + 
 70 + Scenario: Install Remove provide from repository "test-1" that is provided by TestO that require TestC
 71 +  Given _deprecated I use the repository "test-1"
 72 +  When _deprecated I execute "dnf" command "install -y ProvideA" with "success"
 73 +  Then _deprecated transaction changes are as follows
 74 +    | State        | Packages      |
 75 +    | installed    | TestO, TestC  |
 76 +  When _deprecated I execute "dnf" command "remove -y ProvideA" with "success"
 77 +  Then _deprecated transaction changes are as follows
 78 +    | State        | Packages      |
 79 +    | removed      | TestO, TestC  |
 80 + 
 81 + Scenario: Install package from URL
 82 +  Given _deprecated I use the repository "test-1"
 83 +  When _deprecated I execute "dnf" command "install -y http://127.0.0.1/repo/test-1/TestB-1.0.0-1.noarch.rpm" with "success"
 84 +  Then _deprecated transaction changes are as follows
 85 +    | State        | Packages   |
 86 +    | installed    | TestB      |
 87 +  When _deprecated I execute "dnf" command "remove -y TestB" with "success"
 88 +  Then _deprecated transaction changes are as follows
 89 +    | State        | Packages   |
 90 +    | removed      | TestB      |
 91 + 
 92 + Scenario: Install TestB-1.0.0-1.noarch.rpm from local path
 93 +  Given _deprecated I use the repository "test-1"
 94 +  When _deprecated I execute "dnf" command "install -y /var/www/html/repo/test-1/TestB-1.0.0-1.noarch.rpm" with "success"
 95 +  Then _deprecated transaction changes are as follows
 96 +    | State        | Packages   |
 97 +    | installed    | TestB      |
 98 +  When _deprecated I execute "dnf" command "remove -y TestB" with "success"
 99 +  Then _deprecated transaction changes are as follows
100 +    | State        | Packages   |
101 +    | removed      | TestB      |
102 + 
103 + Scenario: Install *.rpm from local path
104 +  Given _deprecated I use the repository "test-1"
105 +  When _deprecated I execute "bash" command "mkdir /test" with "success"
106 +  When _deprecated I execute "bash" command "cp /var/www/html/repo/test-1/Test{A,B,C}-1*.rpm /test" with "success"
107 +  When _deprecated I execute "dnf" command "install -y /test/*.rpm" with "success"
108 +  Then _deprecated transaction changes are as follows
109 +    | State        | Packages             |
110 +    | installed    | TestA, TestB, TestC  |
111 +  When _deprecated I execute "dnf" command "remove -y TestA TestB TestC" with "success"
112 +  Then _deprecated transaction changes are as follows
113 +    | State        | Packages             |
114 +    | removed      | TestA, TestB, TestC  |
115 + 
116 + Scenario: Group Install Remove
117 +  Given _deprecated I use the repository "test-1"
118 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
119 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
120 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
121 +  When _deprecated I execute "dnf" command "install -y @Testgroup" with "success"
122 +  Then _deprecated transaction changes are as follows
123 +    | State        | Packages             |
124 +    | installed    | TestA, TestB, TestC  |
125 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
126 +  Then _deprecated line from "stdout" should "start" with "Installed Groups:"
127 +  And _deprecated line from "stdout" should "not start" with "Available Groups:"
128 +  When _deprecated I execute "dnf" command "install -y TestD" with "success"
129 +  Then _deprecated transaction changes are as follows
130 +    | State        | Packages      |
131 +    | installed    | TestD, TestE  |
132 +  When _deprecated I execute "dnf" command "group remove -y Testgroup" with "success"
133 +  Then _deprecated transaction changes are as follows
134 +    | State        | Packages             |
135 +    | removed      | TestA, TestB, TestC  |
136 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
137 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
138 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
139 +  When _deprecated I execute "dnf" command "remove -y TestD, TestE" with "success"
140 +  Then _deprecated transaction changes are as follows
141 +    | State        | Packages      |
142 +    | removed      | TestD, TestE  |
143 + 
144 + Scenario: Group Install Remove List with with-optional option
145 +  Given _deprecated I use the repository "test-1"
146 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
147 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
148 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
149 +  When _deprecated I execute "dnf" command "group install -y --with-optional Testgroup" with "success"
150 +  Then _deprecated transaction changes are as follows
151 +    | State        | Packages                           |
152 +    | installed    | TestA, TestB, TestC, TestD, TestE  |
153 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
154 +  Then _deprecated line from "stdout" should "start" with "Installed Groups:"
155 +  And _deprecated line from "stdout" should "not start" with "Available Groups:"
156 +  When _deprecated I execute "dnf" command "remove -y @Testgroup" with "success"
157 +  Then _deprecated transaction changes are as follows
158 +    | State        | Packages                           |
159 +    | removed      | TestA, TestB, TestC, TestD, TestE  |
160 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
161 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
162 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
163 + 
164 + Scenario: Group Install Remove List if package with dependency is installed before group install
165 +  Given _deprecated I use the repository "test-1"
166 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
167 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
168 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
169 +  When _deprecated I execute "dnf" command "install -y TestA" with "success"
170 +  Then _deprecated transaction changes are as follows
171 +    | State        | Packages      |
172 +    | installed    | TestA, TestB  |
173 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
174 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
175 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
176 +  When _deprecated I execute "dnf" command "install -y @Testgroup" with "success"
177 +  Then _deprecated transaction changes are as follows
178 +    | State        | Packages      |
179 +    | installed    | TestC         |
180 +    | present      | TestA, TestB  |
181 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
182 +  Then _deprecated line from "stdout" should "start" with "Installed Groups:"
183 +  And _deprecated line from "stdout" should "not start" with "Available Groups:"
184 +  When _deprecated I execute "dnf" command "group remove -y Testgroup" with "success"
185 +  Then _deprecated transaction changes are as follows
186 +    | State        | Packages      |
187 +    | removed      | TestC         |
188 +    | present      | TestA, TestB  |
189 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
190 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
191 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
192 +  When _deprecated I execute "dnf" command "remove -y TestA" with "success"
193 +  Then _deprecated transaction changes are as follows
194 +    | State        | Packages      |
195 +    | removed      | TestA, TestB  |
196 + 
197 + Scenario: Group Install Remove List if package is installed before group install
198 +  Given _deprecated I use the repository "test-1"
199 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
200 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
201 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
202 +  When _deprecated I execute "dnf" command "install -y TestC" with "success"
203 +  Then _deprecated transaction changes are as follows
204 +    | State        | Packages   |
205 +    | installed    | TestC      |
206 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
207 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
208 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
209 +  When _deprecated I execute "dnf" command "install -y @Testgroup" with "success"
210 +  Then _deprecated transaction changes are as follows
211 +    | State        | Packages      |
212 +    | installed    | TestA, TestB  |
213 +    | present      | TestC         |
214 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
215 +  Then _deprecated line from "stdout" should "start" with "Installed Groups:"
216 +  And _deprecated line from "stdout" should "not start" with "Available Groups:"
217 +  When _deprecated I execute "dnf" command "group remove -y Testgroup" with "success"
218 +  Then _deprecated transaction changes are as follows
219 +    | State        | Packages      |
220 +    | removed      | TestA, TestB  |
221 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
222 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
223 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
224 +  When _deprecated I execute "dnf" command "remove -y TestC" with "success"
225 +  Then _deprecated transaction changes are as follows
226 +    | State        | Packages   |
227 +    | removed      | TestC      |
 1 @@ -0,0 +1,12 @@
 2 + Feature: DNF/Behave test (installroot test)
 3 + 
 4 + Scenario: Install package from host repository into empty installroot
 5 +   Given _deprecated I use the repository "test-1"
 6 + # In installroot there is no repository therefore it is taken from host.
 7 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23 -y TestC" with "success"
 8 +   Then _deprecated the path "/dockertesting/etc/yum.repos.d/test-1.repo" should be "absent"
 9 +   Then _deprecated transaction changes are as follows
10 +     | State        | Packages      |
11 +     | absent       | TestC         |
12 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestC" with "success"
13 +   Then _deprecated line from "stdout" should "start" with "TestC-1.0.0-1."
 1 @@ -0,0 +1,34 @@
 2 + Feature: DNF/Behave test (installroot test)
 3 + 
 4 + Scenario: Install package from installroot repository into installroot, and test metadata handling in installroot
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "config-manager --setopt=reposdir=/dockertesting/etc/yum.repos.d --add-repo /etc/yum.repos.d/test-1.repo" with "success"
 7 +   Then _deprecated the path "/dockertesting/etc/yum.repos.d/test-1.repo" should be "present"
 8 + # Install first package from installroot repo into installroot and make cache for metadata in installroot.
 9 + # It have to prefer installroot repo
10 +   Given _deprecated I use the repository "upgrade_1"
11 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23 -y TestC" with "success"
12 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestC" with "success"
13 +   Then _deprecated line from "stdout" should "start" with "TestC-1.0.0-1."
14 +   When _deprecated I execute "bash" command "rpm -q TestC" with "fail"
15 + # Install package from host repo into host and make host cache for metadata in host
16 +   When _deprecated I execute "dnf" command "install -y TestB" with "success"
17 +   Then _deprecated transaction changes are as follows
18 +     | State        | Packages      |
19 +     | installed    | TestB-1.0.0-2 |
20 + # Delete installroot cache and commands for installroot with -C should fail
21 +   When _deprecated I execute "bash" command "rm -rf /dockertesting/var/cache/dnf/*" with "success"
22 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23  -y -C TestB" with "fail"
23 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestB" with "fail"
24 + # If makecache for installroot it downloads correct metadata for installroot and install package with -C into installroot
25 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting --releasever=23  makecache" with "success"
26 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23  -y -C TestB" with "fail"
27 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestB" with "fail"
28 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23  -y --downloadonly TestB" with "success"
29 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23  -y -C TestB" with "success"
30 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestB" with "success"
31 +   Then _deprecated line from "stdout" should "start" with "TestB-1.0.0-1."
32 +   When _deprecated I execute "dnf" command "remove --installroot=/dockertesting --releasever=23 -y TestB" with "success"
33 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestB" with "fail"
34 +   When _deprecated I execute "bash" command "rpm -q TestB" with "success"
35 +   Then _deprecated line from "stdout" should "start" with "TestB-1.0.0-2."
 1 @@ -0,0 +1,13 @@
 2 + Feature: DNF/Behave test (installroot test)
 3 + 
 4 + Scenario: Remove package from installroot
 5 +   When _deprecated I execute "dnf" command "--setopt=reposdir=/dockertesting/etc/yum.repos.d config-manager --add-repo http://127.0.0.1/repo/test-1" with "success"
 6 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting --setopt=gpgcheck=0 config-manager --save 127.0.0.1_repo_test-1" with "success"
 7 +   When _deprecated I execute "dnf" command "-y --installroot /dockertesting install TestA TestC" with "success"
 8 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA TestB TestC" with "success"
 9 +   Then _deprecated line from "stdout" should "start" with "TestA-1.0.0-1."
10 +   And _deprecated line from "stdout" should "start" with "TestB-1.0.0-1."
11 +   And _deprecated line from "stdout" should "start" with "TestC-1.0.0-1."
12 +   When _deprecated I execute "dnf" command "remove --installroot=/dockertesting -y TestC" with "success"
13 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestC" with "fail"
14 + 
 1 @@ -0,0 +1,12 @@
 2 + Feature: DNF/Behave test (test repolist with host and installroot)
 3 + 
 4 + Scenario: Add repository to installroot with gpgcheck=1 from repofile and control 'repolist' command
 5 +  Given _deprecated I use the repository "upgrade_1"
 6 + # Success and show host repository cached into installroot
 7 +  When _deprecated I execute "dnf" command "--installroot=/dockertesting repolist" with "success"
 8 +  Then _deprecated line from "stdout" should "start" with "upgrade_1"
 9 +  And _deprecated line from "stdout" should "not start" with "test-1-gpg-file"
10 +  When _deprecated I execute "dnf" command "--setopt=reposdir=/dockertesting/etc/yum.repos.d config-manager --add-repo http://127.0.0.1/repo/test-1-gpg/test-1-gpg-file.repo" with "success"
11 +  When _deprecated I execute "dnf" command "--installroot=/dockertesting repolist" with "success"
12 +  Then _deprecated line from "stdout" should "start" with "test-1-gpg-file"
13 +  And _deprecated line from "stdout" should "not start" with "upgrade_1"
 1 @@ -0,0 +1,21 @@
 2 + Feature: DNF/Behave test (test upgrade in installroot)
 3 + 
 4 + Scenario: test upgrade in installroot
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "install -y TestA" with "success"
 7 +   Then _deprecated the path "/dockertesting/etc/yum.repos.d/test-1.repo" should be "absent"
 8 +   Then _deprecated transaction changes are as follows
 9 +     | State           | Packages                       |
10 +     | installed       | TestA-1.0.0-1, TestB-1.0.0-1   |
11 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting --releasever=23 -y TestA" with "success"
12 +   Then _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA TestB" with "success"
13 +   And _deprecated line from "stdout" should "start" with "TestA-1.0.0-1."
14 +   And _deprecated line from "stdout" should "start" with "TestB-1.0.0-1."
15 +   Given _deprecated I use the repository "upgrade_1"
16 +   When _deprecated I execute "dnf" command "upgrade --installroot=/dockertesting -y" with "success"
17 +   Then _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestA TestB" with "success"
18 +   And _deprecated line from "stdout" should "start" with "TestA-1.0.0-2."
19 +   And _deprecated line from "stdout" should "start" with "TestB-1.0.0-2."
20 +   And _deprecated transaction changes are as follows
21 +     | State         | Packages                       |
22 +     | present       | TestA-1.0.0-1, TestB-1.0.0-1   |
  1 @@ -0,0 +1,178 @@
  2 + Feature: Test for dnf list (including all documented suboptions and yum compatibility)
  3 +  repo base: TestA-1 TestB-1
  4 +  repo ext: XTest-2 TestA-2 TestB-2
  5 + 
  6 +   @setup
  7 +   Scenario: Setup (create test repos)
  8 +       Given repository "base" with packages
  9 +          | Package      | Tag      | Value     |
 10 +          | TestA        | Version  | 1         |
 11 +          | TestB        | Version  | 1         |
 12 +         And repository "ext" with packages
 13 +          | Package      | Tag      | Value     |
 14 +          | XTest        | Version  | 2         |
 15 +          |              | Obsoletes| TestB     |
 16 +          | TestA        | Version  | 2         |
 17 +          | TestB        | Version  | 2         |
 18 + 
 19 +   Scenario: dnf list nonexistentpkg
 20 +        When I run "dnf list nonexistentpkg"
 21 +        Then the command exit code is 1
 22 +         And the command stderr should match regexp "No matching Packages"
 23 + 
 24 +   Scenario: dnf list extras (installed pkgs, not from known repos)
 25 +        When I successfully run "rpm -i TestA-1*.rpm" in repository "base"
 26 +         And I successfully run "dnf list extras"
 27 +        Then the command stdout should match regexp "TestA.*1-1"
 28 + 
 29 +   Scenario: dnf list --extras (installed pkgs, not from known repos)
 30 +        When I successfully run "dnf list --extras"
 31 +        Then the command stdout should match regexp "TestA.*1-1"
 32 + 
 33 +   Scenario: dnf list TestA (when TestA is installed)
 34 +        When I successfully run "dnf list TestA"
 35 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 36 +         And the command stdout should not match regexp "Available Packages"
 37 + 
 38 +   Scenario: dnf list TestB (when TestB is not installed but it is available)
 39 +        When I enable repository "base"
 40 +         And I successfully run "dnf list TestB"
 41 +        Then the command stdout section "Available Packages" should match regexp "TestB.*1-1"
 42 +         And the command stdout should not match regexp "Installed Packages"
 43 + 
 44 +   Scenario: dnf list installed TestA (when TestA is installed)
 45 +        When I successfully run "dnf list installed TestA"
 46 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 47 +         And the command stdout should not match regexp "Available Packages"
 48 + 
 49 +   Scenario: dnf list --installed TestA (when TestA is installed)
 50 +        When I successfully run "dnf list --installed TestA"
 51 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 52 +         And the command stdout should not match regexp "Available Packages"
 53 + 
 54 +   Scenario: dnf list available TestB (when TestB is available)
 55 +        When I successfully run "dnf list available TestB"
 56 +        Then the command stdout section "Available Packages" should match regexp "TestB.*1-1"
 57 +         And the command stdout should not match regexp "Installed Packages"
 58 + 
 59 +   Scenario: dnf list --available TestB (when TestB is available)
 60 +        When I successfully run "dnf list --available TestB"
 61 +        Then the command stdout section "Available Packages" should match regexp "TestB.*1-1"
 62 +         And the command stdout should not match regexp "Installed Packages"
 63 + 
 64 +   Scenario: dnf list TestB TestA (when TestB is not installed)
 65 +        When I successfully run "dnf list TestB TestA"
 66 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 67 +         And the command stdout section "Available Packages" should match regexp "TestB.*1-1"
 68 + 
 69 +   Scenario: dnf list installed TestB TestA (when TestB is not installed)
 70 +        When I successfully run "dnf list installed TestB TestA"
 71 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 72 +         And the command stdout should not match regexp "TestB"
 73 +         And the command stdout should not match regexp "Available Packages"
 74 + 
 75 +   Scenario: dnf list available TestB TestA (when TestB is available)
 76 +        When I successfully run "dnf list available TestB TestA"
 77 +        Then the command stdout section "Available Packages" should match regexp "TestB.*1-1"
 78 +         And the command stdout should not match regexp "TestA"
 79 +         And the command stdout should not match regexp "Installed Packages"
 80 + 
 81 +   Scenario: dnf list TestA TestB (when both pkgs are installed)
 82 +        When I successfully run "dnf -y install TestB"
 83 +         And I successfully run "dnf list TestA TestB"
 84 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 85 +         And the command stdout section "Installed Packages" should match regexp "TestB.*1-1"
 86 +         And the command stdout should not match regexp "Available Packages"
 87 + 
 88 +   Scenario: dnf list installed TestA TestB (when both pkgs are installed)
 89 +        When I successfully run "dnf list installed TestA TestB"
 90 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
 91 +         And the command stdout section "Installed Packages" should match regexp "TestB.*1-1"
 92 +         And the command stdout should not match regexp "Available Packages"
 93 + 
 94 +   Scenario: dnf list available TestA TestB (when both pkgs are installed)
 95 +        When I run "dnf list available TestA TestB"
 96 +        Then the command exit code is 1
 97 +         And the command stderr should match regexp "No matching Packages"
 98 + 
 99 +   Scenario: dnf list Test\* 
100 +        When I enable repository "ext"
101 +        When I successfully run "dnf list Test\*"
102 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
103 +         And the command stdout section "Installed Packages" should match regexp "TestB.*1-1"
104 +         And the command stdout section "Available Packages" should match regexp "TestA.*2-1"
105 +         And the command stdout section "Available Packages" should match regexp "TestB.*2-1"
106 +         And the command stdout should not match regexp "XTest"
107 + 
108 +   Scenario: dnf list upgrades
109 +        When I successfully run "dnf list upgrades"
110 +        Then the command stdout section "Available Upgrades" should match regexp "TestA.*2-1"
111 +         And the command stdout section "Available Upgrades" should match regexp "TestB.*2-1"
112 + 
113 +   Scenario: dnf list --upgrades
114 +        When I successfully run "dnf list --upgrades"
115 +        Then the command stdout section "Available Upgrades" should match regexp "TestA.*2-1"
116 +         And the command stdout section "Available Upgrades" should match regexp "TestB.*2-1"
117 + 
118 +   Scenario: dnf list updates (yum compatibility)
119 +        When I successfully run "dnf list updates"
120 +        Then the command stdout section "Available Upgrades" should match regexp "TestA.*2-1"
121 +         And the command stdout section "Available Upgrades" should match regexp "TestB.*2-1"
122 + 
123 +   Scenario: dnf list upgrades XTest (when XTest is not installed)
124 +        When I run "dnf list upgrades XTest"
125 +        Then the command exit code is 1
126 +         And the command stderr should match regexp "No matching Packages"
127 +         And the command stdout should not match regexp "Upgraded Packages"
128 + 
129 +   Scenario: dnf list obsoletes
130 +        When I successfully run "dnf list obsoletes"
131 +        Then the command stdout section "Obsoleting Packages" should match regexp "XTest.*2-1"
132 +         And the command stdout section "Obsoleting Packages" should match regexp "\sTestB.*1-1"
133 + 
134 +   Scenario: dnf list --obsoletes
135 +        When I successfully run "dnf list --obsoletes"
136 +        Then the command stdout section "Obsoleting Packages" should match regexp "XTest.*2-1"
137 +         And the command stdout section "Obsoleting Packages" should match regexp "\sTestB.*1-1"
138 + 
139 +   Scenario: dnf list obsoletes TestA (when TestA is not obsoleted)
140 +        When I run "dnf list obsoletes TestA"
141 +        Then the command exit code is 1
142 +         And the command stderr should match regexp "No matching Packages"
143 + 
144 +   Scenario: dnf list recent (recently added are pkgs in the ext repo)
145 +        When I successfully run "dnf list recent"
146 +        Then the command stdout section "Recently Added Packages" should match regexp "TestA.*2-1"
147 +         And the command stdout section "Recently Added Packages" should match regexp "TestB.*2-1"
148 +         And the command stdout section "Recently Added Packages" should match regexp "XTest.*2-1"
149 +         And the command stdout should not match regexp "TestA.*1-1"
150 +         And the command stdout should not match regexp "TestB.*1-1"
151 + 
152 +   Scenario: dnf list --recent (recently added are pkgs in the ext repo)
153 +        When I successfully run "dnf list --recent"
154 +        Then the command stdout section "Recently Added Packages" should match regexp "TestA.*2-1"
155 +         And the command stdout section "Recently Added Packages" should match regexp "TestB.*2-1"
156 +         And the command stdout section "Recently Added Packages" should match regexp "XTest.*2-1"
157 +         And the command stdout should not match regexp "TestA.*1-1"
158 +         And the command stdout should not match regexp "TestB.*1-1"
159 + 
160 +   Scenario: dnf list recent TestC (when TestC is not recently added)
161 +        When I run "dnf list recent TestC"
162 +        Then the command exit code is 1
163 +         And the command stderr should match regexp "No matching Packages"
164 + 
165 +   Scenario: dnf list all Test\*
166 +        When I successfully run "dnf list all Test\*"
167 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
168 +         And the command stdout section "Installed Packages" should match regexp "TestB.*1-1"
169 +         And the command stdout section "Available Packages" should match regexp "TestA.*2-1"
170 +         And the command stdout section "Available Packages" should match regexp "TestB.*2-1"
171 +         And the command stdout should not match regexp "XTest"
172 + 
173 +   Scenario: dnf list --all Test\*
174 +        When I successfully run "dnf list --all Test\*"
175 +        Then the command stdout section "Installed Packages" should match regexp "TestA.*1-1"
176 +         And the command stdout section "Installed Packages" should match regexp "TestB.*1-1"
177 +         And the command stdout section "Available Packages" should match regexp "TestA.*2-1"
178 +         And the command stdout section "Available Packages" should match regexp "TestB.*2-1"
179 +         And the command stdout should not match regexp "XTest"
 1 @@ -0,0 +1,65 @@
 2 + Feature: DNF/Behave test list installed packages from repository
 3 + 
 4 +     @setup
 5 +     Scenario: Feature Setup
 6 +         Given repository "test" with packages
 7 +            | Package | Tag      | Value  |
 8 +            | TestA   | Requires | TestB  |
 9 +            | TestB   | Version  | 4.2    |
10 +           And repository "test2" with packages
11 +            | Package | Tag      | Value  |
12 +            | TestC   | Requires | TestD  |
13 +            | TestD   | Arch     | x86_64 |
14 +            | TestE   | Version  | 6.9    |
15 +          When I save rpmdb
16 +           And I enable repository "test"
17 +           And I enable repository "test2"
18 +           And I successfully run "dnf install -y TestA TestC"
19 +          Then rpmdb changes are
20 +            | State     | Packages                   |
21 +            | installed | TestA, TestB, TestC, TestD |
22 + 
23 + 
24 +     Scenario: List all packages available
25 +          When I successfully run "dnf list"
26 +          Then the command stdout should match regexp "TestA\.noarch.*1-1.*test"
27 +           And the command stdout should match regexp "TestB\.noarch.*4\.2-1.*test"
28 +           And the command stdout should match regexp "TestC\.noarch.*1-1.*test2"
29 +           And the command stdout should match regexp "TestD\.x86_64.*1-1.*test2"
30 +           And the command stdout should match regexp "TestE\.noarch.*6\.9-1.*test2"
31 + 
32 +     Scenario: List packages when all repositories enabled
33 +          When I successfully run "dnf list --installed"
34 +          Then the command stdout should match regexp "TestA\.noarch.*1-1.*test"
35 +           And the command stdout should match regexp "TestB\.noarch.*4\.2-1.*test"
36 +           And the command stdout should match regexp "TestC\.noarch.*1-1.*test2"
37 +           And the command stdout should match regexp "TestD\.x86_64.*1-1.*test2"
38 +           And the command stdout should not match regexp "TestE"
39 + 
40 +     Scenario: List packages when all repositories enabled (yum compatibility)
41 +          When I successfully run "dnf list installed"
42 +          Then the command stdout should match regexp "TestA\.noarch.*1-1.*test"
43 +           And the command stdout should match regexp "TestB\.noarch.*4\.2-1.*test"
44 +           And the command stdout should match regexp "TestC\.noarch.*1-1.*test2"
45 +           And the command stdout should match regexp "TestD\.x86_64.*1-1.*test2"
46 +           And the command stdout should not match regexp "TestE"
47 + 
48 +     Scenario: List installed packages from repo "test"
49 +          When I successfully run "dnf repository-packages -q test list --installed"
50 +          Then the command stdout should match exactly
51 +               """
52 +               Installed Packages
53 +               TestA.noarch                             1-1                               @test
54 +               TestB.noarch                             4.2-1                             @test
55 + 
56 +               """
57 + 
58 +     Scenario: List installed from repo "test2"
59 +          When I successfully run "dnf repository-packages -q test2 list --installed"
60 +          Then the command stdout should match exactly
61 +               """
62 +               Installed Packages
63 +               TestC.noarch                             1-1                              @test2
64 +               TestD.x86_64                             1-1                              @test2
65 + 
66 +               """
 1 @@ -0,0 +1,22 @@
 2 + Feature: DNF/Behave test (dnf group mark command)
 3 + 
 4 + Scenario: Mark group as installed and unmark group as installed
 5 +  Given _deprecated I use the repository "test-1"
 6 +  When _deprecated I execute "dnf" command "group list Testgroup" with "success"
 7 +  Then _deprecated line from "stdout" should "not start" with "Installed Groups:"
 8 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
 9 +  When _deprecated I execute "dnf" command "group mark install Testgroup" with "success"
10 +  # TestA-mandatory, TestC-defaults, TestD-optional
11 +  Then _deprecated transaction changes are as follows
12 +    | State       | Packages             |
13 +    | absent      | TestA, TestC, TestD  |
14 +  And _deprecated I execute "dnf" command "group list Testgroup" with "success"
15 +  And _deprecated line from "stdout" should "start" with "Installed Groups:"
16 +  And _deprecated line from "stdout" should "not start" with "Available Groups:"
17 +  When _deprecated I execute "dnf" command "group mark remove Testgroup" with "success"
18 +  Then _deprecated transaction changes are as follows
19 +    | State       | Packages             |
20 +    | absent      | TestA, TestC, TestD  |
21 +  And _deprecated I execute "dnf" command "group list Testgroup" with "success"
22 +  And _deprecated line from "stdout" should "not start" with "Installed Groups:"
23 +  And _deprecated line from "stdout" should "start" with "Available Groups:"
 1 @@ -0,0 +1,31 @@
 2 + Feature: Mark install
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "test" with packages
 7 +          | Package | Tag      | Value |
 8 +          | TestA   | Requires | TestB |
 9 +          | TestB   |          |       |
10 +       When I save rpmdb
11 +        And I enable repository "test"
12 +        And I successfully run "dnf -y install TestA"
13 +       Then rpmdb changes are
14 +         | State     | Packages     |
15 +         | installed | TestA, TestB |
16 + 
17 +   Scenario: Marking dependency as user-installed should not remove it automatically
18 +        When I save rpmdb
19 +         And I successfully run "dnf mark install TestB"
20 +         And I successfully run "dnf -y remove TestA"
21 +        Then rpmdb changes are
22 +          | State   | Packages |
23 +          | removed | TestA    |
24 +        When I save rpmdb
25 +         And I successfully run "dnf -y remove TestB"
26 +        Then rpmdb changes are
27 +          | State   | Packages |
28 +          | removed | TestB    |
29 + 
30 +   Scenario: Mark on non-existent package
31 +        When I run "dnf mark install I_doesnt_exist"
32 +        Then the command should fail
 1 @@ -0,0 +1,30 @@
 2 + Feature: Mark remove
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "available" with packages
 7 +          | Package | Tag      | Value |
 8 +          | TestA   | Requires | TestC |
 9 +          | TestB   | Requires | TestC |
10 +          | TestC   |          |       |
11 +        When I save rpmdb
12 +         And I enable repository "available"
13 +         And I successfully run "dnf -y install TestA TestB"
14 +        Then rpmdb changes are
15 +          | State     | Packages            |
16 +          | installed | TestA, TestB, TestC |
17 + 
18 +   Scenario: Marking toplevel package as for removal should not remove dependencies
19 +        When I save rpmdb
20 +         And I successfully run "dnf mark remove TestA"
21 +         And I successfully run "dnf -y autoremove"
22 +        Then rpmdb changes are
23 +          | State        | Packages |
24 +          | removed      | TestA    |
25 + 
26 +        When I save rpmdb
27 +         And I successfully run "dnf mark remove TestB"
28 +         And I successfully run "dnf -y autoremove"
29 +        Then rpmdb changes are
30 +          | State        | Packages     |
31 +          | removed      | TestB, TestC |
 1 @@ -0,0 +1,16 @@
 2 + Feature: Install of obsoleted package
 3 + 
 4 + Scenario: Install of obsoleted package, but with presence of package with higher version that obsoleted
 5 +  Given _deprecated I use the repository "obsoletes-1"
 6 +  When _deprecated I execute "dnf" command "-y install TestA" with "success"
 7 +  Then _deprecated transaction changes are as follows
 8 +    | State        | Packages      |
 9 +    | installed    | TestA-3.0.0   |
10 +    | absent       | TestB         |
11 + 
12 + Scenario: Install of obsoleted package
13 +  Given _deprecated I use the repository "obsoletes-1"
14 +  When _deprecated I execute "dnf" command "-y install TestD" with "success"
15 +  Then _deprecated transaction changes are as follows
16 +    | State        | Packages      |
17 +    | installed    | TestE         |
 1 @@ -0,0 +1,12 @@
 2 + Feature: Upgrade obsoleted package if higher version presented
 3 + 
 4 + Scenario: Upgrade of obsoleted package by package with higher version that obsoleted
 5 +  Given _deprecated I use the repository "obsoletes-1"
 6 +  When _deprecated I execute "dnf" command "-y install TestA-1.0.0" with "success"
 7 +  Then _deprecated transaction changes are as follows
 8 +    | State        | Packages      |
 9 +    | installed    | TestA-1.0.0   |
10 +  When _deprecated I execute "dnf" command "-y upgrade" with "success"
11 +  Then _deprecated transaction changes are as follows
12 +    | State      | Packages      |
13 +    | upgraded   | TestA-3.0.0   |
 1 @@ -0,0 +1,13 @@
 2 + Feature: Upgrade obsoleted package
 3 + 
 4 + Scenario: Upgrade of obsoleted package
 5 +  Given _deprecated I use the repository "obsoletes-1"
 6 +  When _deprecated I execute "dnf" command "-y install TestF-1.0.0" with "success"
 7 +  Then _deprecated transaction changes are as follows
 8 +    | State        | Packages      |
 9 +    | installed    | TestF-1.0.0   |
10 +  When _deprecated I execute "dnf" command "-y upgrade" with "success"
11 +  Then _deprecated transaction changes are as follows
12 +    | State        | Packages      |
13 +    | installed    | TestG         |
14 +    | removed      | TestF         |
 1 @@ -0,0 +1,12 @@
 2 + Feature: Upgrade obsoleted package
 3 + 
 4 + Scenario: Upgrade of obsoleted package if package specified by version with glob (no obsoletes applied)
 5 +  Given _deprecated I use the repository "obsoletes-1"
 6 +  When _deprecated I execute "dnf" command "-y install TestF-1.0.0" with "success"
 7 +  Then _deprecated transaction changes are as follows
 8 +    | State        | Packages      |
 9 +    | installed    | TestF-1.0.0   |
10 +  When _deprecated I execute "dnf" command "-y upgrade TestF-2*" with "success"
11 +  Then _deprecated transaction changes are as follows
12 +    | State        | Packages      |
13 +    | upgraded     | TestF-2.0.1   |
 1 @@ -0,0 +1,32 @@
 2 + Feature: DNF/Behave test Obsolete keep reason
 3 + 
 4 +     @setup
 5 +     Scenario: Feature Setup
 6 +         Given repository "test" with packages
 7 +            | Package | Tag       | Value |
 8 +            | TestB   |           |       |
 9 +           And repository "updates" with packages
10 +            | Package | Tag       | Value |
11 +            | TestA   | Obsoletes | TestB |
12 +          When I save rpmdb
13 +           And I enable repository "test"
14 +           And I successfully run "dnf install -y TestB"
15 +          Then rpmdb changes are
16 +            | State     | Packages |
17 +            | installed | TestB    |
18 + 
19 +     Scenario: Keep reason of obsolete package
20 +          When I successfully run "dnf mark remove TestB"
21 +          Then history userinstalled should
22 +            | Action    | Packages |
23 +            | Not match | TestB    |
24 +          When I save rpmdb
25 +           And I enable repository "updates"
26 +           And I successfully run "dnf update -y"
27 +          Then rpmdb changes are
28 +            | State     | Packages |
29 +            | installed | TestA    |
30 +            | removed   | TestB    |
31 +           And history userinstalled should
32 +            | Action    | Packages |
33 +            | Not match | TestA    |
 1 @@ -0,0 +1,25 @@
 2 + Feature: Obsoleting packages one-to-one
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "base" with packages
 7 +          | Package | Tag       | Value       |
 8 +          | TestA   |           |             |
 9 +         And repository "updates" with packages
10 +          | Package | Tag       | Value       |
11 +          | TestB   | Obsoletes | TestA < 1-2 |
12 +        When I save rpmdb
13 +         And I enable repository "base"
14 +         And I successfully run "dnf -y install TestA"
15 +        Then rpmdb changes are
16 +          | State     | Packages |
17 +          | installed | TestA    |
18 + 
19 +   Scenario: Update should replace one package with another
20 +        When I save rpmdb
21 +         And I enable repository "updates"
22 +         And I successfully run "dnf -y update"
23 +        Then rpmdb changes are
24 +          | State     | Packages |
25 +          | removed   | TestA    |
26 +          | installed | TestB    |
 1 @@ -0,0 +1,34 @@
 2 + Feature: Reason of obsoleted package
 3 +   Replaced package by "Obsoletes" must not be marked for autoremoval.
 4 + 
 5 +   Expects following tests to work:
 6 + 
 7 +   * Obsoleting packages one-to-one
 8 +   * Autoremoval of unneeded packages
 9 + 
10 +   @setup
11 +   Scenario: Feature Setup
12 +       Given repository "base" with packages
13 +          | Package | Tag       | Value |
14 +          | TestA   |           |       |
15 +         And repository "updates" with packages
16 +          | Package | Tag       | Value |
17 +          | TestB   | Obsoletes | TestA |
18 +        When I save rpmdb
19 +         And I enable repository "base"
20 +         And I successfully run "dnf -y install TestA"
21 +        Then rpmdb changes are
22 +          | State     | Packages |
23 +          | installed | TestA    |
24 + 
25 +   Scenario: Obsolete "TestA" with "TestB" and autoremove
26 +        When I save rpmdb
27 +         And I enable repository "updates"
28 +         And I successfully run "dnf -y update"
29 +        Then rpmdb changes are
30 +          | State     | Packages |
31 +          | installed | TestB    |
32 +          | removed   | TestA    |
33 +        When I save rpmdb
34 +         And I successfully run "dnf -y autoremove"
35 +        Then rpmdb does not change
 1 @@ -0,0 +1,11 @@
 2 + Feature: Tracking information are stored in host persist-dir if package is installed in host
 3 + 
 4 + Scenario: Tracking information are stored in host persist-dir if package is installed in host
 5 +   Given _deprecated I use the repository "upgrade_1"
 6 +   When _deprecated I execute "bash" command "rm -rf /var/lib/dnf" with "success"
 7 +   Then _deprecated the path "/var/lib/dnf/" should be "absent"
 8 +   When _deprecated I execute "dnf" command "-y install TestG" with "success"
 9 +   Then _deprecated transaction changes are as follows
10 +     | State        | Packages      |
11 +     | installed    | TestG-1.0.0-2 |
12 +   And _deprecated the path "/var/lib/dnf/*" should be "present" 
13 \ No newline at end of file
1 @@ -0,0 +1,8 @@
2 + Feature: Tracking information are stored in installroot persist-dir if package is installed in installroot
3 + 
4 + Scenario: Tracking information are stored in installroot persist-dir if package is installed in installroot
5 +   Given _deprecated I use the repository "test-1"
6 +   Then _deprecated the path "/dockertesting/var/lib/dnf/" should be "absent"
7 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting -y --disablerepo=* --enablerepo=test-1 install TestH" with "success"
8 +   Then _deprecated the path "/dockertesting/var/lib/dnf/*" should be "present"
9 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting TestH" with "success"
 1 @@ -0,0 +1,13 @@
 2 + Feature: DNF/Behave test (pluginspath and pluginsconfpath test)
 3 + 
 4 + Scenario: Redirect host pluginspath
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "download TestA" with "success"
 7 +   And _deprecated I execute "dnf" command "config-manager --help" with "success"
 8 +   When _deprecated I copy plugin module "download.py" from default plugin path into "/test/plugins"
 9 +   And _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\npluginpath=/test/plugins"
10 +   Then _deprecated I execute "dnf" command "download TestA" with "success"
11 +   And _deprecated I execute "dnf" command "config-manager" with "fail"
12 +   When _deprecated I copy plugin module "config_manager.py" from default plugin path into "/test/plugins"
13 +   Then _deprecated I execute "dnf" command "config-manager" with "success"
14 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]"
 1 @@ -0,0 +1,11 @@
 2 + Feature: DNF/Behave test (pluginspath and pluginsconfpath test)
 3 + 
 4 + Scenario: Redirect installroot pluginspath
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting download TestA" with "success"
 7 +   And _deprecated I execute "dnf" command "--installroot=/dockertesting config-manager" with "success"
 8 +   When _deprecated I copy plugin module "download.py" from default plugin path into "/test/plugins2"
 9 +   And _deprecated I create a file "/dockertesting/etc/dnf/dnf.conf" with content: "[main]\npluginpath=/test/plugins2"
10 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting download TestA" with "success"
11 +   And _deprecated I execute "dnf" command "--installroot=/dockertesting config-manager" with "fail"
12 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]"
 1 @@ -0,0 +1,26 @@
 2 + Feature: DNF/Behave test (pluginspath and pluginsconfpath test)
 3 + 
 4 + Scenario: Test host default pluginsconfpath (/etc/dnf/plugins/)
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=0"
 7 +   When _deprecated I create a file "/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=file:///var/www/html/repo/test-1-gpg\nenabled=1\ngpgcheck=0\n\n[test-1-debuginfo]\nname=test-1-debuginfo\nbaseurl=file:///var/www/html/repo/test-1\nenabled=0\ngpgcheck=0"
 8 +   Then _deprecated I execute "dnf" command "-y debuginfo-install TestA" with "success"
 9 +   And _deprecated transaction changes are as follows
10 +    | State        | Packages                 |
11 +    | installed    | TestA-debuginfo-1.0.0-1  |
12 +   When _deprecated I create a file "/etc/yum.repos.d/test-1.repo" with content: "[upgrade_1]\nname=upgrade_1\nbaseurl=file:///var/www/html/repo/upgrade_1-gpg\nenabled=1\ngpgcheck=0\n\n[upgrade_1-debuginfo]\nname=upgrade_1-debuginfo\nbaseurl=file:///var/www/html/repo/upgrade_1\nenabled=0\ngpgcheck=0"
13 +   Then _deprecated I execute "dnf" command "-y upgrade" with "success"
14 +   And _deprecated transaction changes are as follows
15 +    | State        | Packages         |
16 +    | present      | TestA-debuginfo  |
17 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=1"
18 +   Then _deprecated I execute "dnf" command "-y upgrade" with "success"
19 +   And _deprecated transaction changes are as follows
20 +    | State        | Packages                 |
21 +    | upgraded     | TestA-debuginfo-1.0.0-2  |
22 + # Reset to original state
23 +   When _deprecated I execute "dnf" command "-y remove TestA-debuginfo" with "success"
24 +   Then _deprecated transaction changes are as follows
25 +    | State        | Packages         |
26 +    | removed      | TestA-debuginfo  |
27 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=0"
 1 @@ -0,0 +1,26 @@
 2 + Feature: DNF/Behave test (pluginspath and pluginsconfpath test)
 3 + 
 4 + Scenario: Redirect host pluginsconfpath in dnf.conf
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I create a file "/test/pluginconfpath/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=1"
 7 +   When _deprecated I create a file "/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=file:///var/www/html/repo/test-1-gpg\nenabled=1\ngpgcheck=0\n\n[test-1-debuginfo]\nname=test-1-debuginfo\nbaseurl=file:///var/www/html/repo/test-1\nenabled=0\ngpgcheck=0"
 8 +   Then _deprecated I execute "dnf" command "-y debuginfo-install TestB" with "success"
 9 +   And _deprecated transaction changes are as follows
10 +    | State        | Packages                 |
11 +    | installed    | TestB-debuginfo-1.0.0-1  |
12 +   When _deprecated I create a file "/etc/yum.repos.d/test-1.repo" with content: "[upgrade_1]\nname=upgrade_1\nbaseurl=file:///var/www/html/repo/upgrade_1-gpg\nenabled=1\ngpgcheck=0\n\n[upgrade_1-debuginfo]\nname=upgrade_1-debuginfo\nbaseurl=file:///var/www/html/repo/upgrade_1\nenabled=0\ngpgcheck=0"
13 +   Then _deprecated I execute "dnf" command "-y upgrade" with "success"
14 +   And _deprecated transaction changes are as follows
15 +    | State        | Packages         |
16 +    | present      | TestB-debuginfo  |
17 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]\npluginconfpath=/test/pluginconfpath"
18 +   Then _deprecated I execute "dnf" command "-y upgrade" with "success"
19 +   And _deprecated transaction changes are as follows
20 +    | State        | Packages                 |
21 +    | upgraded     | TestB-debuginfo-1.0.0-2  |
22 + # Reset to original state
23 +   When _deprecated I execute "dnf" command "-y remove TestB-debuginfo" with "success"
24 +   Then _deprecated transaction changes are as follows
25 +    | State        | Packages         |
26 +    | removed      | TestB-debuginfo  |
27 +   When _deprecated I create a file "/etc/dnf/dnf.conf" with content: "[main]"
 1 @@ -0,0 +1,19 @@
 2 + Feature: DNF/Behave test (pluginspath and pluginsconfpath test)
 3 + 
 4 + Scenario: Test installroot default pluginsconfpath (/etc/dnf/plugins/)
 5 +   Given _deprecated I use the repository "test-1-gpg"
 6 +   When _deprecated I create a file "/dockertesting2/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=1"
 7 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=0"
 8 +   When _deprecated I create a file "/dockertesting2/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=file:///var/www/html/repo/test-1-gpg\nenabled=1\ngpgcheck=0\n\n[test-1-debuginfo]\nname=test-1-debuginfo\nbaseurl=file:///var/www/html/repo/test-1\nenabled=0\ngpgcheck=0"
 9 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting2 -y debuginfo-install TestA" with "success"
10 +   And _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestA-debuginfo" with "success"
11 +   And _deprecated line from "stdout" should "start" with "TestA-debuginfo-1.0.0-1"
12 +   When _deprecated I create a file "/dockertesting2/etc/yum.repos.d/test-1.repo" with content: "[upgrade_1]\nname=upgrade_1\nbaseurl=file:///var/www/html/repo/upgrade_1-gpg\nenabled=1\ngpgcheck=0\n\n[upgrade_1-debuginfo]\nname=upgrade_1-debuginfo\nbaseurl=file:///var/www/html/repo/upgrade_1\nenabled=0\ngpgcheck=0"
13 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting2 -y upgrade" with "success"
14 +   And _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestA-debuginfo" with "success"
15 +   And _deprecated line from "stdout" should "start" with "TestA-debuginfo-1.0.0-1"
16 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=1"
17 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting2 -y upgrade" with "success"
18 +   And _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestA-debuginfo" with "success"
19 +   And _deprecated line from "stdout" should "start" with "TestA-debuginfo-1.0.0-2"
20 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=0"
 1 @@ -0,0 +1,19 @@
 2 + Feature: DNF/Behave test (pluginspath and pluginsconfpath test)
 3 + 
 4 + Scenario: Redirect installroot pluginsconfpath in dnf.conf (path redirected into installroot)
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I create a file "/dockertesting3/test/pluginconfpath/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=0"
 7 +   When _deprecated I create a file "/test/pluginconfpath/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=1"
 8 +   When _deprecated I create a file "/etc/dnf/plugins/debuginfo-install.conf" with content: "[main]\nenabled=1\nautoupdate=0"
 9 +   When _deprecated I create a file "/dockertesting3/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=file:///var/www/html/repo/test-1-gpg\nenabled=1\ngpgcheck=0\n\n[test-1-debuginfo]\nname=test-1-debuginfo\nbaseurl=file:///var/www/html/repo/test-1\nenabled=0\ngpgcheck=0"
10 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting3 -y debuginfo-install TestB" with "success"
11 +   And _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestB-debuginfo" with "success"
12 +   And _deprecated line from "stdout" should "start" with "TestB-debuginfo-1.0.0-1"
13 +   When _deprecated I create a file "/dockertesting3/etc/yum.repos.d/test-1.repo" with content: "[upgrade_1]\nname=upgrade_1\nbaseurl=file:///var/www/html/repo/upgrade_1-gpg\nenabled=1\ngpgcheck=0\n\n[upgrade_1-debuginfo]\nname=upgrade_1-debuginfo\nbaseurl=file:///var/www/html/repo/upgrade_1\nenabled=0\ngpgcheck=0"
14 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting3 -y upgrade" with "success"
15 +   And _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestB-debuginfo" with "success"
16 +   And _deprecated line from "stdout" should "start" with "TestB-debuginfo-1.0.0-1"
17 +   When _deprecated I create a file "/dockertesting3/etc/dnf/dnf.conf" with content: "[main]\npluginconfpath=/test/pluginconfpath"
18 +   Then _deprecated I execute "dnf" command "--installroot=/dockertesting3 -y upgrade" with "success"
19 +   And _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestB-debuginfo" with "success"
20 +   And _deprecated line from "stdout" should "start" with "TestB-debuginfo-1.0.0-2"
 1 @@ -0,0 +1,66 @@
 2 + Feature: Protected packages
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given repository "base" with packages
 7 +          | Package | Tag      | Value |
 8 +          | TestA   | Requires | TestB |
 9 +          | TestB   |          |       |
10 +        When I save rpmdb
11 +         And I enable repository "base"
12 +         And I successfully run "dnf -y install TestA"
13 +        Then rpmdb changes are
14 +          | State     | Packages     |
15 +          | installed | TestA, TestB |
16 + 
17 +   Scenario: Removal of directly protected package
18 +        When I save rpmdb
19 +         And I run "dnf -y remove TestA --setopt=protected_packages=TestA"
20 +        Then the command should fail
21 +         And the command stderr should match exactly
22 +             """
23 +             Error: 
24 +              Problem: The operation would result in removing the following protected packages: TestA
25 + 
26 +             """
27 +         And rpmdb does not change
28 + 
29 +   Scenario: Removal of indirectly protected package
30 +        When I save rpmdb
31 +         And I run "dnf -y remove TestB --setopt=protected_packages=TestA"
32 +        Then the command should fail
33 + # FIXME: Error: package TestA-1-1.fc24.noarch requires TestB, but none of the providers can be installed
34 + #       And the command stderr should match exactly
35 + #           """
36 + #           Error: The operation would result in removing the following protected packages: TestA
37 + #
38 + #           """
39 +         And rpmdb does not change
40 + 
41 +   Scenario: Removal of DNF itself
42 +        When I save rpmdb
43 +         And I run "dnf -y remove dnf"
44 +        Then the command should fail
45 +         And the command stderr should match exactly
46 +             """
47 +             Error: 
48 +              Problem: The operation would result in removing the following protected packages: dnf
49 + 
50 +             """
51 +         And rpmdb does not change
52 +              
53 +   Scenario: Removal of protected package with conffile
54 +       Given a file "/etc/yum/protected.d/test.conf" with
55 +             """
56 +             TestA
57 +             """
58 +        When I save rpmdb
59 +         And I run "dnf -y remove TestA"
60 +        Then the command should fail
61 +         And the command stderr should match exactly
62 +             """
63 +             Error: 
64 +              Problem: The operation would result in removing the following protected packages: TestA
65 + 
66 +             """
67 +         And rpmdb does not change
 1 @@ -0,0 +1,58 @@
 2 + Feature: Test for dnf provides
 3 + 
 4 +   @setup
 5 +   Scenario: Setup (create test repo)
 6 +       Given repository "base" with packages
 7 +          | Package      | Tag       | Value         |
 8 +          | TestA        | Version   | 1             |
 9 +          |              | Requires  | TestB         |
10 +          | TestC        | Version   | 1             |
11 +          | TestD        | Version   | 1             |
12 +          |              | Provides  | TestB         |
13 +          | TestE        | Version   | 1             |
14 +          |              | Provides  | TestEVal      |
15 +         And repository "update" with packages
16 +          | Package      | Tag       | Value         |
17 +          | TestA        | Version   | 2             |
18 +          |              | Requires  | TestB         |
19 +          | TestC        | Version   | 2             |
20 +          |              | Provides  | TestB         |
21 +          |              | Conflicts | TestD         |
22 +          | TestD        | Version   | 2             |
23 +          |              | Provides  | TestB         |
24 +          |              | Conflicts | TestC         |
25 +          | TestE        | Version   | 2             |
26 +          |              | Provides  | TestEVal      |
27 +       When I save rpmdb
28 +         And I enable repository "base"
29 +         And I successfully run "dnf -y install TestA TestC TestD"
30 +         And I disable repository "base"
31 +       Then rpmdb changes are
32 +         | State     | Packages            |
33 +         | installed | TestA, TestC, TestD |      
34 + 
35 +   Scenario: dnf provides TestB - installed package TestD-1 provides TestB
36 +        When I successfully run "dnf provides TestB"
37 +        Then the command stdout should match regexp "TestD-1-[^R]+Repo[ \t]+: @System"
38 +         And the command stdout should not match regexp "(Test[ACE]-1-)|(Test[ACDE]-2-)"
39 + 
40 +   Scenario: dnf provides TestB - package TestD-1 (installed and in base repo) provides TestB
41 +        When I enable repository "base"
42 +         And I successfully run "dnf provides TestB"
43 +        Then the command stdout should match regexp "TestD-1-[^R]+Repo[ \t]+: @System"
44 +         And the command stdout should match regexp "TestD-1-[^R]+Repo[ \t]+: base"
45 +         And the command stdout should not match regexp "(Test[ACE]-1-)|(Test[ACDE]-2-)"
46 + 
47 +   Scenario: dnf provides TestB - packages TestD-1 (installed and in base repo), TestC-2 and TestD-2 (in update repo) provides TestB
48 +        When I enable repository "update"
49 +         And I successfully run "dnf provides TestB"
50 +        Then the command stdout should match regexp "TestD-1-[^R]+Repo[ \t]+: @System"
51 +         And the command stdout should match regexp "TestD-1-[^R]+Repo[ \t]+: base"
52 +         And the command stdout should match regexp "TestC-2-[^R]+Repo[ \t]+: update"
53 +         And the command stdout should match regexp "TestD-2-[^R]+Repo[ \t]+: update"
54 +         And the command stdout should not match regexp "(Test[ACE]-1-)|(Test[AE]-2-)"
55 + 
56 +   Scenario: dnf provides nonexistentprovide
57 +        When I run "dnf provides nonexistentprovide"
58 +        Then the command exit code is 1
59 +         And the command stderr should match regexp "No Matches found"
 1 @@ -0,0 +1,28 @@
 2 + Feature: DNF/Behave test reinstall command
 3 + 
 4 +     @setup
 5 +     Scenario: Feature Setup
 6 +         Given repository "test" with packages
 7 +            | Package      | Tag      | Value      |
 8 +            | TestA        | Requires | TestA-libs |
 9 +            | TestA-libs   |          |            |
10 +          When I save rpmdb
11 +           And I enable repository "test"
12 +           And I successfully run "dnf install -y TestA"
13 +          Then rpmdb changes are
14 +            | State       | Packages          |
15 +            | installed   | TestA, TestA-libs |
16 + 
17 +     Scenario: Reinstall package
18 +          When I save rpmdb
19 +           And I enable repository "test"
20 +           And I successfully run "dnf reinstall -y TestA-libs"
21 +          Then rpmdb changes are
22 +            | State        | Packages   |
23 +            | reinstalled  | TestA-libs |
24 + 
25 +     Scenario: Reinstall - pkg not available
26 +          When I save rpmdb
27 +           And I disable repository "test"
28 +           And I run "dnf reinstall -y TestA-libs"
29 +          Then the command should fail
 1 @@ -0,0 +1,31 @@
 2 + Feature: "Reason" of reinstalled package
 3 +   Re-install must not change "reason" of package which has been installed
 4 +   as dependency.
 5 + 
 6 +   After reinstalling dependent package removal of main package should remove
 7 +   dependent package as well.
 8 + 
 9 +   @setup
10 +   Scenario: Feature Setup
11 +       Given repository "available" with packages
12 +          | Package    | Tag      | Value      |
13 +          | TestA      | Requires | TestA-libs |
14 +          | TestA-libs |          |            |
15 +        When I save rpmdb
16 +         And I enable repository "available"
17 +         And I successfully run "dnf -y install TestA"
18 +        Then rpmdb changes are
19 +          | State     | Packages          |
20 +          | installed | TestA, TestA-libs |
21 + 
22 +   Scenario: Reinstall dependency, remove main package
23 +        When I save rpmdb
24 +         And I successfully run "dnf -y reinstall TestA-libs"
25 +        Then rpmdb changes are
26 +          | State       | Packages          |
27 +          | reinstalled | TestA-libs        |
28 +        When I save rpmdb
29 +         And I successfully run "dnf -y remove TestA"
30 +        Then rpmdb changes are
31 +          | State       | Packages          |
32 +          | removed     | TestA, TestA-libs |
 1 @@ -0,0 +1,24 @@
 2 + Feature: Test for dnf remove with excluded dependent package
 3 +  repo base: TestA-1 TestB-1
 4 +  repo ext: XTest-2 TestA-2 TestB-2
 5 + 
 6 +   @setup
 7 +   Scenario: Setup (create test repos)
 8 +       Given repository "base" with packages
 9 +          | Package      | Tag      | Value     |
10 +          | TestA        | Version  | 1         |
11 +          |              | Requires | TestB     |
12 +          | TestB        | Version  | 1         |
13 + 
14 +       When I save rpmdb
15 +         And I enable repository "base"
16 +         And I successfully run "dnf -y install TestA"
17 +       Then rpmdb changes are
18 +         | State     | Packages     |
19 +         | installed | TestA, TestB |
20 + 
21 +   Scenario: dnf remove (when there are such pkgs)
22 +        When I save rpmdb
23 +         And I run "dnf -y remove TestB -x TestA"
24 +        Then the command should fail
25 +         And rpmdb does not change
 1 @@ -0,0 +1,52 @@
 2 + Feature: DNF/Behave test Repository packages remove-or-distro-sync
 3 + 
 4 +     @setup
 5 +     Scenario: Feature setup
 6 +         Given repository "distro1" with packages
 7 +            | Package | Tag     | Value |
 8 +            | TestA   |         |       |
 9 +            | TestB   |         |       |
10 +            | TestC   |         |       |
11 +            | TestD   |         |       |
12 +         Given repository "distro2" with packages
13 +            | Package | Tag     | Value |
14 +            | TestA   | Version | 2.0   |
15 +            | TestD   | Version | 2.0   |
16 +          When I save rpmdb
17 +           And I enable repository "distro1"
18 +           And I successfully run "dnf install -y TestA TestB TestC TestD"
19 +          Then rpmdb changes are
20 +            | State     | Packages                   |
21 +            | installed | TestA, TestB, TestC, TestD |
22 + 
23 +     Scenario: Sync package to latest version in available repositories
24 +          When I save rpmdb
25 +           And I enable repository "distro2"
26 +           And I successfully run "dnf -y repository-packages distro1 remove-or-distro-sync TestA"
27 +          Then rpmdb changes are
28 +            | State    | Packages |
29 +            | upgraded | TestA    |
30 + 
31 +     Scenario: Remove repository package
32 +          When I save rpmdb
33 +           And I enable repository "distro2"
34 +           And I successfully run "dnf -y repository-packages distro1 remove-or-distro-sync TestB"
35 +          Then rpmdb changes are
36 +            | State    | Packages |
37 +            | removed  | TestB    |
38 + 
39 +     Scenario: Remove or distrosync remaining packages from repository
40 +          When I save rpmdb
41 +           And I successfully run "dnf -y repository-packages distro1 remove-or-distro-sync"
42 +          Then rpmdb changes are
43 +            | State    | Packages |
44 +            | removed  | TestC    |
45 +            | upgraded | TestD    |
46 + 
47 +     Scenario: Distro-sync repo with no package installed
48 +          When I run "dnf -y repository-packages distro1 remove-or-distro-sync"
49 +          Then the command should fail
50 + 
51 +     Scenario: Distro-sync non-existent package
52 +          When I run "dnf -y repository-packages distro1 remove-or-distro-sync I_doesnt_exist"
53 +          Then the command should fail
  1 @@ -0,0 +1,117 @@
  2 + Feature: Test for repository priorities
  3 + 
  4 +   @setup
  5 +   Scenario: Preparing the test repositories
  6 +       Given repository "repo10" with packages
  7 +          | Package      | Tag       | Value        |
  8 +          | TestA        | Version   | 2            |
  9 +          | TestB        | Version   | 1            |
 10 +          |              | Requires  | TestC        |
 11 +          | TestD        | Version   | 1            |
 12 +       And repository "repo20" with packages
 13 +          | Package      | Tag       | Value        |
 14 +          | TestA        | Version   | 1            |
 15 +          | TestB        | Version   | 2            |
 16 +          |              | Requires  | TestC        |
 17 +          | TestC        | Version   | 2            |
 18 +          |              | Requires  | TestD        |
 19 +       And repository "repo30" with packages
 20 +          | Package      | Tag       | Value        |
 21 +          | TestA        | Version   | 3            |
 22 +          | TestB        | Version   | 3            |
 23 +          |              | Requires  | TestC        |
 24 +          | TestC        | Version   | 3            |
 25 +          |              | Requires  | TestD        |
 26 +          | TestD        | Version   | 3            |
 27 +          | TestE        | Version   | 3            |
 28 +       And an INI file "/etc/yum.repos.d/repo10.repo" modified with
 29 +          | Section | Key        | Value |
 30 +          | repo10  | priority   | 10    |
 31 +       And an INI file "/etc/yum.repos.d/repo20.repo" modified with
 32 +          | Section | Key        | Value |
 33 +          | repo20  | priority   | 20    |
 34 +       And an INI file "/etc/yum.repos.d/repo30.repo" modified with
 35 +          | Section | Key        | Value |
 36 +          | repo30  | priority   | 30    |
 37 + 
 38 +   Scenario: Install a single pkg from the highest prio repo
 39 +        When I save rpmdb
 40 +         And I enable repository "repo10"
 41 +         And I enable repository "repo20"
 42 +         And I enable repository "repo30"
 43 +         And I run "dnf -y install TestA"
 44 +        Then rpmdb changes are
 45 +          | State     | Packages           |
 46 +          | installed | TestA/2            |
 47 + 
 48 +   Scenario: Install required version of a pkg (not from the highest prio repo)
 49 +        When I run "dnf -y remove TestA"
 50 +         And I save rpmdb
 51 +         And I run "dnf -y install TestA-3"
 52 +        Then rpmdb changes are
 53 +          | State     | Packages           |
 54 +          | installed | TestA/3            |
 55 + 
 56 +   Scenario: Install wildcard-specified pkgs from different highest prio repos
 57 +      When I save rpmdb
 58 +       And I run "dnf -y install Test[DE]*"
 59 +      Then rpmdb changes are
 60 +        | State     | Packages           |
 61 +        | installed | TestD/1,TestE/3    |
 62 + 
 63 +   Scenario: Install a pkg and its deps from the proper highest prio repos
 64 +        When I run "dnf -y remove TestD"
 65 +         And I save rpmdb
 66 +         And I run "dnf -y install TestB"
 67 +        Then rpmdb changes are
 68 +          | State     | Packages                |
 69 +          | installed | TestB/1,TestC/2,TestD/1 |
 70 + 
 71 +   Scenario: Upgrade a single pkg from the highest prio repo
 72 +        When I run "dnf -y downgrade TestA-1"
 73 +         And I save rpmdb
 74 +         And I run "dnf -y upgrade TestA"
 75 +        Then rpmdb changes are
 76 +          | State     | Packages           |
 77 +          | updated   | TestA/2            |
 78 + 
 79 +   Scenario: Upgrade to required version of a pkg (not from the highest prio repo)
 80 +        When I save rpmdb
 81 +         And I run "dnf -y upgrade TestB-3"
 82 +        Then rpmdb changes are
 83 +          | State     | Packages           |
 84 +          | updated   | TestB/3            |
 85 + 
 86 +   Scenario: Upgrade wildcard-specified pkgs from different highest prio repos
 87 +        When I run "dnf -y downgrade Test[ABD]-1"
 88 +         And I disable repository "repo10"
 89 +         And I save rpmdb
 90 +         And I run "dnf -y upgrade Test*"
 91 +        Then rpmdb changes are
 92 +          | State     | Packages           |
 93 +          | updated   | TestB/2,TestD/3    |
 94 + 
 95 +   Scenario: Downgrade a single pkg from the highest prio repo
 96 +        When I enable repository "repo10"
 97 +         And I run "dnf -y upgrade TestB-3"
 98 +         And I save rpmdb
 99 +         And I run "dnf -y downgrade TestB"
100 +        Then rpmdb changes are
101 +          | State      | Packages           |
102 +          | downgraded | TestB/1            |
103 + 
104 +   Scenario: Downgrade to required version of a pkg (not from the highest prio repo)
105 +        When I run "dnf -y upgrade TestA-3"
106 +         And I save rpmdb
107 +         And I run "dnf -y downgrade TestA-1"
108 +        Then rpmdb changes are
109 +          | State      | Packages           |
110 +          | downgraded | TestA/1            |
111 + 
112 +   Scenario: Downgrade wildcard-specified pkgs from different highest prio repos
113 +        When I run "dnf -y upgrade Test[ABCD]-3"
114 +         And I save rpmdb
115 +         And I run "dnf -y downgrade Test*"
116 +        Then rpmdb changes are
117 +          | State      | Packages           |
118 +          | downgraded | TestA/2,TestB/1,TestC/2,TestD/1 |
 1 @@ -0,0 +1,38 @@
 2 + Feature: Handling of --disablerepo and --enablerepo
 3 +   strict=false --disablerepo -> warning
 4 +   strict=false --enablerepo  -> warning
 5 +   strict=true  --disablerepo -> warning
 6 +   strict=true  --enablerepo  -> error
 7 + 
 8 +   Scenario: Handling of --disablerepo and --enablerepo with no repo
 9 +        When I run "dnf repolist --enablerepo=* --setopt=strict=true"
10 +        Then the command should fail
11 +         And the command stderr should match exactly
12 +             """
13 +             Error: Unknown repo: '*'
14 + 
15 +             """
16 + 
17 +        When I successfully run "dnf repolist --disablerepo=* --setopt=strict=true"
18 +        Then the command stderr should match exactly
19 +             """
20 +             No repository match: *
21 +             No repositories available
22 + 
23 +             """
24 + 
25 +        When I successfully run "dnf repolist --enablerepo=* --setopt=strict=false"
26 +        Then the command stderr should match exactly
27 +             """
28 +             No repository match: *
29 +             No repositories available
30 + 
31 +             """
32 + 
33 +        When I successfully run "dnf repolist --disablerepo=* --setopt=strict=false"
34 +        Then the command stderr should match exactly
35 +             """
36 +             No repository match: *
37 +             No repositories available
38 + 
39 +             """
 1 @@ -0,0 +1,35 @@
 2 + Feature: Handling of --disablerepo and --enablerepo
 3 +   strict=false --disablerepo -> warning
 4 +   strict=false --enablerepo  -> warning
 5 +   strict=true  --disablerepo -> warning
 6 +   strict=true  --enablerepo  -> error
 7 + 
 8 +   @setup
 9 +   Scenario: Feature Setup
10 +       Given empty repository "test-1"
11 +       When I successfully run "dnf --enablerepo=test* makecache"
12 + 
13 +   Scenario: Handling of --disablerepo and --enablerepo with one repo
14 +        When I successfully run "dnf repolist --enablerepo=test* --setopt=strict=true"
15 +        Then the command stdout should match exactly
16 +             """
17 +             repo id                              repo name                            status
18 +             test-1                               test-1                               0
19 +             test-1-source                        test-1-source                        0
20 + 
21 +             """
22 + 
23 +        When I successfully run "dnf repolist --disablerepo=test* --setopt=strict=true"
24 +        Then the command stdout should be empty
25 + 
26 +        When I successfully run "dnf repolist --enablerepo=test* --setopt=strict=false"
27 +        Then the command stdout should match exactly
28 +             """
29 +             repo id                              repo name                            status
30 +             test-1                               test-1                               0
31 +             test-1-source                        test-1-source                        0
32 + 
33 +             """
34 + 
35 +        When I successfully run "dnf repolist --disablerepo=test* --setopt=strict=false"
36 +        Then the command stdout should be empty
 1 @@ -0,0 +1,43 @@
 2 + Feature: Repolist when all repositories are disabled
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given empty repository "TestA"
 7 +         And empty repository "TestB"
 8 +         And empty repository "TestC"
 9 + 
10 +   Scenario: Repolist without arguments
11 +        When I successfully run "dnf repolist"
12 +        Then the command stdout should be empty
13 + 
14 +   Scenario: Repolist with "enabled"
15 +        When I successfully run "dnf repolist enabled"
16 +        Then the command stdout should be empty
17 + 
18 +   Scenario: Repolist with "disabled"
19 +        When I successfully run "dnf repolist disabled"
20 +        Then the command stdout should match exactly
21 +             """
22 +             repo id                                 repo name                               
23 +             TestA                                   TestA                                   
24 +             TestA-source                            TestA-source                            
25 +             TestB                                   TestB                                   
26 +             TestB-source                            TestB-source                            
27 +             TestC                                   TestC                                   
28 +             TestC-source                            TestC-source                            
29 + 
30 +             """
31 + 
32 +   Scenario: Repolist with "all"
33 +        When I successfully run "dnf repolist all"
34 +        Then the command stdout should match exactly
35 +             """
36 +             repo id                             repo name                           status
37 +             TestA                               TestA                               disabled
38 +             TestA-source                        TestA-source                        disabled
39 +             TestB                               TestB                               disabled
40 +             TestB-source                        TestB-source                        disabled
41 +             TestC                               TestC                               disabled
42 +             TestC-source                        TestC-source                        disabled
43 + 
44 +             """
 1 @@ -0,0 +1,60 @@
 2 + Feature: Repolist with enabled/disabled repositories
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +       Given empty repository "TestA"
 7 +         And empty repository "TestB"
 8 +         And repository "TestC" with packages
 9 +          | Package | Tag | Value |
10 +          | TestA   |     |       |
11 +          | TestB   |     |       |
12 +          | TestC   |     |       |
13 +        When I enable repository "TestB"
14 +         And I enable repository "TestC"
15 +         And I successfully run "dnf makecache"
16 + 
17 +   Scenario: Repolist without arguments
18 +        When I successfully run "dnf repolist"
19 +        Then the command stdout should match exactly
20 +             """
21 +             repo id                               repo name                           status
22 +             TestB                                 TestB                               0
23 +             TestC                                 TestC                               3
24 + 
25 +             """
26 + 
27 +   Scenario: Repolist with "enabled"
28 +        When I successfully run "dnf repolist enabled"
29 +        Then the command stdout should match exactly
30 +             """
31 +             repo id                               repo name                           status
32 +             TestB                                 TestB                               0
33 +             TestC                                 TestC                               3
34 + 
35 +             """
36 + 
37 +   Scenario: Repolist with "disabled"
38 +        When I successfully run "dnf repolist disabled"
39 +        Then the command stdout should match exactly
40 +             """
41 +             repo id                                 repo name                               
42 +             TestA                                   TestA                                   
43 +             TestA-source                            TestA-source                            
44 +             TestB-source                            TestB-source                            
45 +             TestC-source                            TestC-source                            
46 + 
47 +             """
48 + 
49 +   Scenario: Repolist with "all"
50 +        When I successfully run "dnf repolist all"
51 +        Then the command stdout should match exactly
52 +             """
53 +             repo id                            repo name                          status
54 +             TestA                              TestA                              disabled
55 +             TestA-source                       TestA-source                       disabled
56 +             TestB                              TestB                              enabled: 0
57 +             TestB-source                       TestB-source                       disabled
58 +             TestC                              TestC                              enabled: 3
59 +             TestC-source                       TestC-source                       disabled
60 + 
61 +             """
 1 @@ -0,0 +1,17 @@
 2 + Feature: Repolist when no repositories are present
 3 + 
 4 +   Scenario: Repolist without arguments
 5 +        When I successfully run "dnf repolist"
 6 +        Then the command stdout should be empty
 7 + 
 8 +   Scenario: Repolist with "enabled"
 9 +        When I successfully run "dnf repolist enabled"
10 +        Then the command stdout should be empty
11 + 
12 +   Scenario: Repolist with "disabled"
13 +        When I successfully run "dnf repolist disabled"
14 +        Then the command stdout should be empty
15 + 
16 +   Scenario: Repolist with "all"
17 +        When I successfully run "dnf repolist all"
18 +        Then the command stdout should be empty
 1 @@ -0,0 +1,32 @@
 2 + Feature: DNF/Behave test (repoquery)
 3 + 
 4 + Scenario: Repoquery formated output plus --available, --installed, -Cq, -qC options
 5 +   Given _deprecated I use the repository "test-1"
 6 +   When _deprecated I execute "dnf" command "repoquery --available -C --queryformat %{name}-%{version}-%{release}" with "success"
 7 +   Then _deprecated line from "stdout" should "not start" with "TestB-1.0.0-1"
 8 +   Then _deprecated line from "stderr" should "not start" with "Last metadata expiration check"
 9 +   Then _deprecated line from "stderr" should "start" with "Cache-only enabled but no cache for"
10 +   When _deprecated I execute "dnf" command "repoquery --available -qC --queryformat %{name}-%{version}-%{release}" with "success"
11 +   Then _deprecated line from "stdout" should "not start" with "TestB-1.0.0-1"
12 +   Then _deprecated line from "stderr" should "not start" with "Last metadata expiration check"
13 +   Then _deprecated line from "stderr" should "not start" with "Cache-only enabled but no cache for"
14 +   When _deprecated I execute "dnf" command "makecache" with "success"
15 +   When _deprecated I execute "dnf" command "repoquery --available -Cq --queryformat %{name}-%{version}-%{release}" with "success"
16 +   Then _deprecated line from "stdout" should "start" with "TestB-1.0.0-1"
17 +   Then _deprecated line from "stderr" should "not start" with "Cache-only enabled but no cache for"
18 +   Then _deprecated line from "stderr" should "not start" with "Last metadata expiration check"
19 +   When _deprecated I execute "dnf" command "repoquery --installed -Cq --queryformat %{name}-%{version}-%{release}" with "success"
20 +   Then _deprecated line from "stdout" should "not start" with "TestB-1.0.0-1"
21 +   When _deprecated I execute "dnf" command "repoquery -C --queryformat %{name}-%{version}-%{release}" with "success"
22 +   Then _deprecated line from "stdout" should "start" with "TestB-1.0.0-1"
23 +   Then _deprecated line from "stderr" should "start" with "Last metadata expiration check"
24 +   When _deprecated I execute "dnf" command "install -y TestB" with "success"
25 +   Then _deprecated transaction changes are as follows
26 +     | State        | Packages   |
27 +     | installed    | TestB      |
28 +   When _deprecated I execute "dnf" command "repoquery --available -Cq --queryformat %{name}-%{version}-%{release}" with "success"
29 +   Then _deprecated line from "stdout" should "start" with "TestB-1.0.0-1"
30 +   When _deprecated I execute "dnf" command "repoquery --installed -Cq --queryformat %{name}-%{version}-%{release}" with "success"
31 +   Then _deprecated line from "stdout" should "start" with "TestB-1.0.0-1"
32 +   When _deprecated I execute "dnf" command "--disablerepo=test-1 repoquery --available -Cq --queryformat %{name}-%{version}-%{release}" with "success"
33 +   Then _deprecated line from "stdout" should "not start" with "TestB-1.0.0-1"
 1 @@ -0,0 +1,98 @@
 2 + Feature: Test for main repoquery functionality
 3 +   for options --requires, --provides, --conflicts, --obsoletes,
 4 +   --whatrequires, --whatprovides, --whatconflicts, --whatobsoletes
 5 + 
 6 +   @setup
 7 +   Scenario: Feature Setup
 8 +       Given repository "base" with packages
 9 +         | Package | Tag       | Value |
10 +         | TestA   | Version   | 1     |
11 +         |         | Release   | 1     |
12 +         |         | Requires  | TestB |
13 +         |         | Provides  | TestC |
14 +         |         | Conflicts | TestD |
15 +         |         | Obsoletes | TestE |
16 +        When I save rpmdb
17 +         And I enable repository "base"
18 +         And I run "dnf makecache"
19 + 
20 +   Scenario: repoquery --requires
21 +        When I save rpmdb
22 +         And I enable repository "base"
23 +         And I run "dnf repoquery --requires TestA"
24 +        Then the command stdout should match exactly
25 +             """
26 +             TestB
27 + 
28 +             """
29 + 
30 +   Scenario: repoquery --provides
31 +        When I save rpmdb
32 +         And I enable repository "base"
33 +         And I run "dnf repoquery --provides TestA"
34 +        Then the command stdout should match exactly
35 +             """
36 +             TestA = 1-1
37 +             TestC
38 + 
39 +             """
40 + 
41 +   Scenario: repoquery --conflicts
42 +        When I save rpmdb
43 +         And I enable repository "base"
44 +         And I run "dnf repoquery --conflicts TestA"
45 +        Then the command stdout should match exactly
46 +             """
47 +             TestD
48 + 
49 +             """
50 + 
51 +   Scenario: repoquery --obsoletes
52 +        When I save rpmdb
53 +         And I enable repository "base"
54 +         And I run "dnf repoquery --obsoletes TestA"
55 +        Then the command stdout should match exactly
56 +             """
57 +             TestE
58 + 
59 +             """
60 + 
61 +   Scenario: repoquery --whatrequires
62 +        When I save rpmdb
63 +         And I enable repository "base"
64 +         And I run "dnf repoquery --whatrequires TestB"
65 +        Then the command stdout should match exactly
66 +             """
67 +             TestA-0:1-1.noarch
68 + 
69 +             """
70 + 
71 +   Scenario: repoquery --whatprovides
72 +        When I save rpmdb
73 +         And I enable repository "base"
74 +         And I run "dnf repoquery --whatprovides TestC"
75 +        Then the command stdout should match exactly
76 +             """
77 +             TestA-0:1-1.noarch
78 + 
79 +             """
80 + 
81 +   Scenario: repoquery --whatconflicts
82 +        When I save rpmdb
83 +         And I enable repository "base"
84 +         And I run "dnf repoquery --whatconflicts TestD"
85 +        Then the command stdout should match exactly
86 +             """
87 +             TestA-0:1-1.noarch
88 + 
89 +             """
90 + 
91 +   Scenario: repoquery --whatobsoletes
92 +        When I save rpmdb
93 +         And I enable repository "base"
94 +         And I run "dnf repoquery --whatobsoletes TestE"
95 +        Then the command stdout should match exactly
96 +             """
97 +             TestA-0:1-1.noarch
98 + 
99 +             """
  1 @@ -0,0 +1,131 @@
  2 + Feature: Test for dnf repoquery, options --all, --installed, --available, --upgrades, --recent, --extras, --repo 
  3 +  repo base: TestA-1 TestB-1
  4 +  repo ext: XTest-2 TestA-2 TestB-2
  5 + 
  6 +   @setup
  7 +   Scenario: Setup (create test repos)
  8 +       Given repository "base" with packages
  9 +          | Package      | Tag      | Value     |
 10 +          | TestA        | Version  | 1         |
 11 +          | TestB        | Version  | 1         |
 12 +         And repository "ext" with packages
 13 +          | Package      | Tag      | Value     |
 14 +          | XTest        | Version  | 2         |
 15 +          | TestA        | Version  | 2         |
 16 +          | TestB        | Version  | 2         |
 17 + 
 18 +   # --extras: installed pkgs, not from known repos
 19 +   Scenario: dnf repoquery --extras (when there are such pkgs)
 20 +        When I successfully run "rpm -i TestA-1*.rpm" in repository "base"
 21 +         And I successfully run "dnf repoquery --extras"
 22 +        Then the command stdout should match regexp "TestA.*1-1"
 23 +         And the command stdout should not match regexp "TestB"
 24 +         And the command stdout should not match regexp "XTest"
 25 + 
 26 +   Scenario: dnf repoquery --extras XTest (when there's no such extra pkg installed)
 27 +        When I run "dnf repoquery --extras XTest"
 28 +        Then the command stdout should not match regexp "XTest"
 29 +         And the command stdout should not match regexp "TestA"
 30 +         And the command stdout should not match regexp "TestB"
 31 + 
 32 +   Scenario: dnf repoquery --available Test\* (when there are no such pkgs)
 33 +        When I successfully run "dnf repoquery --available Test\*"
 34 +        Then the command stdout should not match regexp "Test"
 35 + 
 36 +   Scenario: dnf repoquery --available --repo base --repo ext TestB\* (when there are such pkgs in listed repos)
 37 +        When I successfully run "dnf repoquery --available --repo base --repo ext TestB\*"
 38 +        Then the command stdout should match regexp "TestB.*1-1"
 39 +         And the command stdout should match regexp "TestB.*2-1"
 40 +         And the command stdout should not match regexp "TestA"
 41 +         And the command stdout should not match regexp "XTest"
 42 + 
 43 +   Scenario: dnf repoquery --available Test\* (when there are such pkgs)
 44 +        When I enable repository "ext"
 45 +         And I successfully run "dnf repoquery --available Test\*"
 46 +        Then the command stdout should match regexp "TestA.*2-1"
 47 +         And the command stdout should match regexp "TestB.*2-1"
 48 +         And the command stdout should not match regexp "TestA.*1-1"
 49 +         And the command stdout should not match regexp "TestB.*1-1"
 50 +         And the command stdout should not match regexp "XTest"
 51 + 
 52 +   Scenario: dnf repoquery --upgrades (when there are such pkgs)
 53 +        When I successfully run "dnf repoquery --upgrades"
 54 +        Then the command stdout should match regexp "TestA.*2-1"
 55 +         And the command stdout should not match regexp "TestB"
 56 +         And the command stdout should not match regexp "XTest"
 57 + 
 58 +   Scenario: dnf repoquery --upgrades Test\* (when there are no such pkgs)
 59 +        When I disable repository "ext"
 60 +         And I successfully run "dnf repoquery --upgrades Test\*"
 61 +        Then the command stdout should not match regexp "TestA.*2-1"
 62 +         And the command stdout should not match regexp "TestB"
 63 +         And the command stdout should not match regexp "XTest"
 64 + 
 65 +   Scenario: dnf repoquery --upgrades --repo ext (when there are such pkgs in listed repos)
 66 +        When I successfully run "dnf repoquery --upgrades --repo ext"
 67 +        Then the command stdout should match regexp "TestA.*2-1"
 68 +         And the command stdout should not match regexp "TestB"
 69 +         And the command stdout should not match regexp "XTest"
 70 + 
 71 +   Scenario: dnf repoquery --installed XTest\* (when there are no such pkgs)
 72 +        When I successfully run "dnf repoquery --installed XTest\*"
 73 +        Then the command stdout should not match regexp "Test"
 74 + 
 75 +   Scenario: dnf repoquery --installed Test\* (when there are such pkgs)
 76 +        When I enable repository "ext"
 77 +         And I successfully run "dnf -y upgrade TestA"
 78 +         And I successfully run "dnf repoquery --installed Test\*"
 79 +        Then the command stdout should match regexp "TestA.*2-1"
 80 +         And the command stdout should not match regexp "TestB"
 81 +         And the command stdout should not match regexp "XTest"
 82 + 
 83 +   Scenario: dnf repoquery --installed TestA XTest (when TestA is installed and XTest not)
 84 +        When I successfully run "dnf repoquery --installed TestA XTest"
 85 +        Then the command stdout should match regexp "TestA.*2-1"
 86 +         And the command stdout should not match regexp "XTest"
 87 +         And the command stdout should not match regexp "TestB"
 88 + 
 89 +   # --recent: recently edited pkgs, all pkgs in ext and base repos are supposed
 90 +   #           to be recently edited
 91 +   Scenario: dnf repoquery --recent TestC (when there's no such pkg)
 92 +        When I successfully run "dnf repoquery --recent TestC"
 93 +        Then the command stdout should not match regexp "Test"
 94 + 
 95 +   Scenario: dnf repoquery --recent Test\* (when there are such pkgs)
 96 +        When I successfully run "dnf repoquery --recent Test\*"
 97 +        Then the command stdout should match regexp "TestA.*2-1"
 98 +         And the command stdout should match regexp "TestB.*2-1"
 99 +         And the command stdout should not match regexp "XTest"
100 +         And the command stdout should not match regexp "Test.*1-1"
101 + 
102 +   Scenario: dnf repoquery --recent --installed Test\* (when there are such pkgs installed)
103 +        When I successfully run "dnf repoquery --installed --recent Test\*"
104 +        Then the command stdout should match regexp "TestA.*2-1"
105 +         And the command stdout should not match regexp "TestB"
106 +         And the command stdout should not match regexp "XTest"
107 +         And the command stdout should not match regexp "Test.*1-1"
108 + 
109 +   Scenario: dnf repoquery --recent --repo base Test\* (when there are such pkgs in listed repo)
110 +        When I successfully run "dnf repoquery --recent --repo base Test\*"
111 +        Then the command stdout should match regexp "TestA.*1-1"
112 +         And the command stdout should match regexp "TestB.*1-1"
113 +         And the command stdout should not match regexp "XTest"
114 +         And the command stdout should not match regexp "Test.*2-1"
115 + 
116 +   Scenario: dnf repoquery --all TestC (when there's no such pkg)
117 +        When I successfully run "dnf repoquery --all TestC"
118 +        Then the command stdout should not match regexp "Test"
119 + 
120 +   Scenario: dnf repoquery --all Test\* (when there are such pkgs)
121 +        When I successfully run "dnf repoquery --all Test\*"
122 +        Then the command stdout should match regexp "TestA.*2-1"
123 +         And the command stdout should match regexp "TestB.*2-1"
124 +         And the command stdout should not match regexp "XTest"
125 +         And the command stdout should not match regexp "Test.*1-1"
126 + 
127 +   Scenario: dnf repoquery --all --repo base Test\* (when there are such pkgs in listed repo)
128 +        When I successfully run "dnf repoquery --all --repo base Test\*"
129 +        Then the command stdout should match regexp "TestA.*1-1"
130 +         And the command stdout should match regexp "TestB.*1-1"
131 +         And the command stdout should not match regexp "XTest"
132 +         And the command stdout should not match regexp "Test.*2-1"
  1 @@ -0,0 +1,141 @@
  2 + Feature: Test for repoquery weak deps related functionality,
  3 +   options --recommends, --supplements, --suggests, --enhances, 
  4 +   --whatrecommends, --whatsupplements, --whatsuggests, --whatenhances, --repo
  5 + 
  6 +   @setup
  7 +   Scenario: Feature Setup
  8 +       Given repository "base" with packages
  9 +         | Package | Tag       | Value |
 10 +         | TestA   | Version   | 1     |
 11 +         |         | Release   | 1     |
 12 +         |         | Recommends  | TestB |
 13 +         |         | Supplements | TestC |
 14 +         |         | Suggests    | TestD |
 15 +         |         | Enhances    | TestE |
 16 + 
 17 +   Scenario: repoquery --recommends (when there is no such capability)
 18 +        When I run "dnf repoquery --recommends TestA"
 19 +        Then the command stdout should not match regexp "Test"
 20 + 
 21 +   Scenario: repoquery --recommends (when there is such capability in listed repo)
 22 +        When I run "dnf repoquery --recommends TestA --repo base"
 23 +        Then the command stdout should match regexp "TestB"
 24 +         And the command stdout should not match regexp "Test[ACDE]"
 25 + 
 26 +   Scenario: repoquery --recommends (when there is such capability)
 27 +        When I enable repository "base"
 28 +         And I run "dnf repoquery --recommends TestA"
 29 +        Then the command stdout should match regexp "TestB"
 30 +         And the command stdout should not match regexp "Test[ACDE]"
 31 + 
 32 +   Scenario: repoquery --supplements (when there is no such capability)
 33 +        When I disable repository "base"
 34 +         And I run "dnf repoquery --supplements TestA"
 35 +        Then the command stdout should not match regexp "Test"
 36 + 
 37 +   Scenario: repoquery --supplements (when there is such capability in listed repo)
 38 +        When I run "dnf repoquery --supplements TestA --repo base"
 39 +        Then the command stdout should match regexp "TestC"
 40 +         And the command stdout should not match regexp "Test[ABDE]"
 41 + 
 42 +   Scenario: repoquery --supplements (when there is such capability)
 43 +        When I enable repository "base"
 44 +         And I run "dnf repoquery --supplements TestA"
 45 +        Then the command stdout should match regexp "TestC"
 46 +         And the command stdout should not match regexp "Test[ABDE]"
 47 + 
 48 +   Scenario: repoquery --suggests (when there is no such capability)
 49 +        When I disable repository "base"
 50 +         And I run "dnf repoquery --suggests TestA"
 51 +        Then the command stdout should not match regexp "Test"
 52 + 
 53 +   Scenario: repoquery --suggests (when there is such capability in listed repo)
 54 +        When I run "dnf repoquery --suggests TestA --repo base"
 55 +        Then the command stdout should match regexp "TestD"
 56 +         And the command stdout should not match regexp "Test[ABCE]"
 57 + 
 58 +   Scenario: repoquery --suggests (when there is such capability)
 59 +        When I enable repository "base"
 60 +         And I run "dnf repoquery --suggests TestA"
 61 +        Then the command stdout should match regexp "TestD"
 62 +         And the command stdout should not match regexp "Test[ABCE]"
 63 + 
 64 +   Scenario: repoquery --enhances (when there is no such capability)
 65 +        When I disable repository "base"
 66 +         And I run "dnf repoquery --enhances TestA"
 67 +        Then the command stdout should not match regexp "Test"
 68 + 
 69 +   Scenario: repoquery --enhances (when there is such capability in listed repo)
 70 +        When I run "dnf repoquery --enhances TestA --repo base"
 71 +        Then the command stdout should match regexp "TestE"
 72 +         And the command stdout should not match regexp "Test[ABCD]"
 73 + 
 74 +   Scenario: repoquery --enhances (when there is such capability)
 75 +        When I enable repository "base"
 76 +         And I run "dnf repoquery --enhances TestA"
 77 +        Then the command stdout should match regexp "TestE"
 78 +         And the command stdout should not match regexp "Test[ABCD]"
 79 + 
 80 +   Scenario: repoquery --whatrecommends (when there is no such pkg)
 81 +        When I disable repository "base"
 82 +         And I run "dnf repoquery --whatrecommends TestB"
 83 +        Then the command stdout should not match regexp "Test"
 84 + 
 85 +   Scenario: repoquery --whatrecommends (when there is such pkg in listed repo)
 86 +        When I run "dnf repoquery --whatrecommends TestB --repo base"
 87 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
 88 +         And the command stdout should not match regexp "Test[BCDE]"
 89 + 
 90 +   Scenario: repoquery --whatrecommends (when there is such pkg)
 91 +        When I enable repository "base"
 92 +         And I run "dnf repoquery --whatrecommends TestB"
 93 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
 94 +         And the command stdout should not match regexp "Test[BCDE]"
 95 + 
 96 +   Scenario: repoquery --whatsupplements (when there is no such pkg)
 97 +        When I disable repository "base"
 98 +         And I run "dnf repoquery --whatsupplements TestC"
 99 +        Then the command stdout should not match regexp "Test"
100 + 
101 +   Scenario: repoquery --whatsupplements (when there is such pkg in listed repo)
102 +        When I run "dnf repoquery --whatsupplements TestC --repo base"
103 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
104 +         And the command stdout should not match regexp "Test[BCDE]"
105 + 
106 +   Scenario: repoquery --whatsupplements (when there is such pkg)
107 +        When I enable repository "base"
108 +         And I run "dnf repoquery --whatsupplements TestC"
109 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
110 +         And the command stdout should not match regexp "Test[BCDE]"
111 + 
112 +   Scenario: repoquery --whatsuggests (when there is no such pkg)
113 +        When I disable repository "base"
114 +         And I run "dnf repoquery --whatsuggests TestD"
115 +        Then the command stdout should not match regexp "Test"
116 + 
117 +   Scenario: repoquery --whatsuggests (when there is such pkg in listed repo)
118 +        When I run "dnf repoquery --whatsuggests TestD --repo base"
119 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
120 +         And the command stdout should not match regexp "Test[BCDE]"
121 + 
122 +   Scenario: repoquery --whatsuggests (when there is such pkg)
123 +        When I enable repository "base"
124 +         And I run "dnf repoquery --whatsuggests TestD"
125 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
126 +         And the command stdout should not match regexp "Test[BCDE]"
127 + 
128 +   Scenario: repoquery --whatenhances (when there is no such pkg)
129 +        When I disable repository "base"
130 +         And I run "dnf repoquery --whatenhances TestE"
131 +        Then the command stdout should not match regexp "Test"
132 + 
133 +   Scenario: repoquery --whatenhances (when there is such pkg in listed repo)
134 +        When I run "dnf repoquery --whatenhances TestE --repo base"
135 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
136 +         And the command stdout should not match regexp "Test[BCDE]"
137 + 
138 +   Scenario: repoquery --whatenhances (when there is such pkg)
139 +        When I enable repository "base"
140 +         And I run "dnf repoquery --whatenhances TestE"
141 +        Then the command stdout should match regexp "TestA-0:1-1.noarch"
142 +         And the command stdout should not match regexp "Test[BCDE]"
 1 @@ -0,0 +1,10 @@
 2 + Feature: Handling local base url in repository in new installroot dockertesting2
 3 + 
 4 + Scenario: Handling local base url in repository in new installroot dockertesting2
 5 +   Given _deprecated I use the repository "upgrade_1"
 6 +   When _deprecated I create a file "/dockertesting2/etc/yum.repos.d/var.repo" with content: "[var]\nname=var\nbaseurl=file:///var/www/html/repo/test-1\nenabled=1\ngpgcheck=0"
 7 +   Then _deprecated the path "/dockertesting2/etc/yum.repos.d/var.repo" should be "present"
 8 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestC" with "fail"
 9 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting2 --releasever=23 -y TestC" with "success"
10 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting2 TestC" with "success"
11 +   Then _deprecated line from "stdout" should "start" with "TestC-1.0.0-1."
 1 @@ -0,0 +1,9 @@
 2 + Feature: Handling local base url in repository in new installroot dockertesting3
 3 + 
 4 + Scenario: Handling local base url in repository in new installroot dockertesting3
 5 +   Given _deprecated I use the repository "upgrade_1"
 6 +   When _deprecated I create a file "/dockertesting3/etc/yum.repos.d/test-1.repo" with content: "[test-1]\nname=test-1\nbaseurl=http://127.0.0.1/repo/test-1\nenabled=1\ngpgcheck=0"
 7 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestC" with "fail"
 8 +   When _deprecated I execute "dnf" command "install --installroot=/dockertesting3 --releasever=23 -y TestC" with "success"
 9 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestC" with "success"
10 +   Then _deprecated line from "stdout" should "start" with "TestC-1.0.0-1."
  1 @@ -0,0 +1,101 @@
  2 + Feature: DNF/Behave test Repository packages info
  3 + 
  4 +     @setup
  5 +     Scenario: Feature setup
  6 +         Given repository "test" with packages
  7 +            | Package | Tag      | Value |
  8 +            | TestA   |          |       |
  9 +            | TestB   |          |       |
 10 +          When I save rpmdb
 11 +           And I enable repository "test"
 12 +           And I successfully run "dnf install -y TestA"
 13 +          Then rpmdb changes are
 14 +            | State     | Packages |
 15 +            | installed | TestA    |
 16 + 
 17 +     Scenario: List info of all packages in repository test
 18 +          When I successfully run "dnf -q repository-packages test info all"
 19 +          Then the command stdout should match
 20 +               """
 21 +               Installed Packages
 22 +               Name         : TestA
 23 +               Version      : 1
 24 +               Release      : 1
 25 +               Arch         : noarch
 26 +               Size         : 0.0
 27 +               Source       : TestA-1-1.src.rpm
 28 +               Repo         : @System
 29 +               From repo    : test
 30 +               Summary      : Empty
 31 +               License      : Public Domain
 32 +               Description  : Empty.
 33 + 
 34 +               Available Packages
 35 +               Name         : TestB
 36 +               Version      : 1
 37 +               Release      : 1
 38 +               Arch         : noarch
 39 +               Size         : 5.5 k
 40 +               Source       : TestB-1-1.src.rpm
 41 +               Repo         : test
 42 +               Summary      : Empty
 43 +               License      : Public Domain
 44 +               Description  : Empty.
 45 +               """
 46 + 
 47 +     Scenario: List all installed packages from repository
 48 +          When I successfully run "dnf -q repository-packages test info installed"
 49 +          Then the command stdout should match
 50 +               """
 51 +               Installed Packages
 52 +               Name         : TestA
 53 +               Version      : 1
 54 +               Release      : 1
 55 +               Arch         : noarch
 56 +               Size         : 0.0
 57 +               Source       : TestA-1-1.src.rpm
 58 +               Repo         : @System
 59 +               From repo    : test
 60 +               Summary      : Empty
 61 +               License      : Public Domain
 62 +               Description  : Empty.
 63 +               """
 64 + 
 65 +     Scenario: Single repository package info
 66 +          When I successfully run "dnf -q repository-packages test info TestB"
 67 +          Then the command stdout should match
 68 +               """
 69 +               Available Packages
 70 +               Name         : TestB
 71 +               Version      : 1
 72 +               Release      : 1
 73 +               Arch         : noarch
 74 +               Size         : 5.5 k
 75 +               Source       : TestB-1-1.src.rpm
 76 +               Repo         : test
 77 +               Summary      : Empty
 78 +               License      : Public Domain
 79 +               Description  : Empty.
 80 +               """
 81 + 
 82 +     Scenario: List repo extras - installed from repo, but not available anymore
 83 +          When I remove all repositories
 84 +         Given repository "test" with packages
 85 +            | Package | Tag      | Value |
 86 +            | TestB   |          |       |
 87 +          When I successfully run "dnf -q repository-packages test info extras"
 88 +          Then the command stdout should match
 89 +               """
 90 +               Extra Packages
 91 +               Name         : TestA
 92 +               Version      : 1
 93 +               Release      : 1
 94 +               Arch         : noarch
 95 +               Size         : 0.0
 96 +               Source       : TestA-1-1.src.rpm
 97 +               Repo         : @System
 98 +               From repo    : test
 99 +               Summary      : Empty
100 +               License      : Public Domain
101 +               Description  : Empty.
102 +               """
 1 @@ -0,0 +1,28 @@
 2 + Feature: DNF/Behave test Repository packages reinstall
 3 + 
 4 +     @setup
 5 +     Scenario: Feature setup
 6 +         Given repository "test" with packages
 7 +            | Package | Tag      | Value |
 8 +            | TestA   | Requires | TestB |
 9 +            | TestB   | Requires | TestC |
10 +            | TestC   |          |       |
11 +          When I save rpmdb
12 +           And I enable repository "test"
13 +           And I successfully run "dnf install -y TestA"
14 +          Then rpmdb changes are
15 +            | State     | Packages            |
16 +            | installed | TestA, TestB, TestC |
17 + 
18 +     Scenario: Reinstall packages from repository
19 +          When I save rpmdb
20 +           And I successfully run "dnf -y repository-packages test reinstall-old"
21 +          Then rpmdb changes are
22 +            | State       | Packages            |
23 +            | reinstalled | TestA, TestB, TestC |
24 + 
25 +     Scenario: Reinstall packages from nonexistent repository - fail
26 +          When I save rpmdb
27 +          When I remove all repositories
28 +           And I run "dnf -y repository-packages test reinstall-old"
29 +          Then the command should fail
 1 @@ -0,0 +1,64 @@
 2 + Feature: DNF/Behave test Repository packages remove
 3 + 
 4 +     @setup
 5 +     Scenario: Feature setup
 6 +         Given repository "test" with packages
 7 +            | Package | Tag      | Value |
 8 +            | TestA   | Requires | TestB |
 9 +            | TestD   |          |       |
10 +         Given repository "test2" with packages
11 +            | Package | Tag      | Value |
12 +            | TestB   |          |       |
13 +            | TestC   | Requires | TestD |
14 +         Given repository "test3" with packages
15 +            | Package | Tag      | Value  |
16 +            | TestD   |          |        |
17 +         Given repository "test4" with packages
18 +            | Package | Tag      | Value  |
19 +            | TestC   |          |        |
20 +          When I save rpmdb
21 +           And I enable repository "test"
22 +           And I enable repository "test2"
23 +           And I successfully run "dnf install -y TestA TestC"
24 +          Then rpmdb changes are
25 +            | State     | Packages                   |
26 +            | installed | TestA, TestB, TestC, TestD |
27 + 
28 +     Scenario: Remove packages from repository
29 +          When I save rpmdb
30 +           And I successfully run "dnf -y repository-packages test remove"
31 +          Then rpmdb changes are
32 +            | State   | Packages                   |
33 +            | removed | TestA, TestB, TestC, TestD |
34 + 
35 +     Scenario: Remove or reinstall all packages from repository
36 +          When I save rpmdb
37 +           And I successfully run "dnf install -y TestA TestC"
38 +          Then rpmdb changes are
39 +            | State     | Packages                   |
40 +            | installed | TestA, TestB, TestC, TestD |
41 +          When I save rpmdb
42 +           And I enable repository "test3"
43 +           And I successfully run "dnf -y repository-packages test remove-or-reinstall"
44 +          Then rpmdb changes are
45 +            | State       | Packages     |
46 +            | removed     | TestA, TestB |
47 +            | reinstalled | TestD        |
48 + 
49 +     Scenario: Remove or reinstall single package from repository
50 +          When I save rpmdb
51 +           And I successfully run "dnf install -y TestB"
52 +          Then rpmdb changes are
53 +            | State     | Packages |
54 +            | installed | TestB    |
55 +          When I save rpmdb
56 +           And I enable repository "test4"
57 +           And I successfully run "dnf -y repository-packages test2 remove-or-reinstall TestC"
58 +          Then rpmdb changes are
59 +            | State       | Packages |
60 +            | reinstalled | TestC    |
61 +          When I save rpmdb
62 +           And I successfully run "dnf -y repository-packages test2 remove-or-reinstall TestB"
63 +          Then rpmdb changes are
64 +            | State   | Packages |
65 +            | removed | TestB    |
 1 @@ -0,0 +1,52 @@
 2 + Feature: DNF/Behave test Repository packages update
 3 + 
 4 +     @setup
 5 +     Scenario: Feature setup
 6 +         Given repository "test" with packages
 7 +            | Package | Tag      | Value |
 8 +            | TestA   | Requires | TestB |
 9 +            | TestB   | Requires | TestC |
10 +            | TestC   |          |       |
11 +         Given repository "test2" with packages
12 +            | Package | Tag      | Value |
13 +            | TestA   | Version  | 2.0   |
14 +            | TestB   | Version  | 2.0   |
15 +         Given repository "test3" with packages
16 +            | Package | Tag      | Value |
17 +            | TestC   | Version  | 2.0   |
18 +          When I save rpmdb
19 +           And I enable repository "test"
20 +           And I successfully run "dnf install -y TestA"
21 +           And I enable repository "test3"
22 +          Then rpmdb changes are
23 +            | State     | Packages            |
24 +            | installed | TestA, TestB, TestC |
25 + 
26 +     Scenario: Check for updates - no available
27 +          When I run "dnf -q repository-packages test check-update"
28 +          Then the command stdout should be empty
29 + 
30 +     Scenario: Check for updates - available
31 +          When I run "dnf -q repository-packages test2 check-update"
32 +          Then the command stdout should match
33 +               """
34 +               TestA.noarch                             2.0-1                             test2
35 +               TestB.noarch                             2.0-1                             test2
36 +               """
37 +          When I run "dnf -q repository-packages test3 check-update"
38 +          Then the command stdout should match
39 +               """
40 +               TestC.noarch                             2.0-1                             test3
41 +               """
42 + 
43 +     Scenario: Update packages
44 +          When I save rpmdb
45 +           And I run "dnf -y repository-packages test2 upgrade"
46 +          Then rpmdb changes are
47 +            | State    | Packages     |
48 +            | upgraded | TestA, TestB |
49 +          When I save rpmdb
50 +           And I run "dnf -y repository-packages test3 upgrade"
51 +          Then rpmdb changes are
52 +            | State    | Packages |
53 +            | upgraded | TestC    |
 1 @@ -0,0 +1,10 @@
 2 + Feature: Richdeps/Behave test
 3 +  TestA requires (TestB or TestC), TestA recommends TestC
 4 + 
 5 + Scenario: Install TestA that requires (TestB or TestC), TestA recommends TestC
 6 +  Given _deprecated I use the repository "rich-1"
 7 +  When _deprecated I execute "dnf" command "-y install TestA" with "success"
 8 +  Then _deprecated transaction changes are as follows
 9 +    | State        | Packages      |
10 +    | installed    | TestA, TestC  |
11 +    | absent       | TestB         |
 1 @@ -0,0 +1,16 @@
 2 + Feature: Richdeps/Behave test
 3 +   TestA requires (TestB or TestC), TestA recommends TestC
 4 +   Install TestB first with RPM, then install TestA
 5 +   with and observe if the Recommended TestC is also installed
 6 + 
 7 + 
 8 + Scenario: Install TestB first with RPM, then install TestA with DNF and observe if the Recommended TestC is also installed
 9 +   Given _deprecated I use the repository "rich-1"
10 +   When _deprecated I execute "bash" command "rpm -Uvh  /repo/TestB*.rpm" with "success"
11 +   Then _deprecated transaction changes are as follows
12 +    | State        | Packages   |
13 +    | installed    | TestB      |
14 +   When _deprecated I execute "dnf" command "-y install TestA" with "success"
15 +   Then _deprecated transaction changes are as follows
16 +    | State        | Packages      |
17 +    | installed    | TestA, TestC  |
 1 @@ -0,0 +1,10 @@
 2 + Feature: Richdeps/Behave test
 3 +   TestA requires (TestB and (TestC if TestD))
 4 + 
 5 + Scenario: Install TestA that requires (TestB and (TestC if TestD))
 6 +   Given _deprecated I use the repository "rich-2"
 7 +   When _deprecated I execute "dnf" command "-y install TestA" with "success"
 8 +   Then _deprecated transaction changes are as follows
 9 +    | State        | Packages      |
10 +    | installed    | TestA, TestB  |
11 +    | absent       | TestC, TestD  |
 1 @@ -0,0 +1,13 @@
 2 + Feature: Richdeps/Behave test
 3 +   TestA requires (TestB and (TestC if TestD))
 4 + 
 5 + Scenario: Install TestD with rpm, then TestA that requires (TestB and (TestC if TestD))
 6 +   Given _deprecated I use the repository "rich-2"
 7 +   When _deprecated I execute "bash" command "rpm -Uvh /repo/TestD*.rpm" with "success"
 8 +   Then _deprecated transaction changes are as follows
 9 +    | State        | Packages   |
10 +    | installed    | TestD      |
11 +   When _deprecated I execute "dnf" command "-y install TestA" with "success"
12 +   Then _deprecated transaction changes are as follows
13 +    | State        | Packages             |
14 +    | installed    | TestA, TestB, TestC  |
 1 @@ -0,0 +1,10 @@
 2 + Feature: Richdeps/Behave test
 3 +  TestA `Requires: (TestB and ((TestC or TestE) if TestD))` and TestF `Conflicts: TestC`
 4 + 
 5 + Scenario: Install TestA that requires: '(TestB and ((TestC or TestE) if TestD))' and TestF 'Conflicts: TestC'
 6 +   Given _deprecated I use the repository "rich-3"
 7 +   When _deprecated I execute "dnf" command "-y install TestA" with "success"
 8 +   Then _deprecated transaction changes are as follows
 9 +    | State        | Packages                    |
10 +    | installed    | TestA, TestB                |
11 +    | absent       | TestC, TestD, TestE, TestF  |
 1 @@ -0,0 +1,13 @@
 2 + Feature: Richdeps/Behave test
 3 +  TestA `Requires: (TestB and ((TestC or TestE) if TestD))` and TestF `Conflicts: TestC`
 4 + 
 5 + Scenario: Install TestD and TestF with rpm and then TestA that requires: (TestB and ((TestC or TestE) if TestD))` and TestF `Conflicts: TestC`
 6 +   Given _deprecated I use the repository "rich-3"
 7 +   When _deprecated I execute "bash" command "rpm -Uvh /repo/TestD*.rpm /repo/TestF*.rpm" with "success"
 8 +   Then _deprecated transaction changes are as follows
 9 +    | State        | Packages      |
10 +    | installed    | TestD, TestF  |
11 +   When _deprecated I execute "dnf" command "-y install TestA" with "success"
12 +   Then _deprecated transaction changes are as follows
13 +    | State        | Packages             |
14 +    | installed    | TestA, TestB, TestE  |
 1 @@ -0,0 +1,13 @@
 2 + Feature: Richdeps/Behave test
 3 +  TestA `Requires: TestC if (TestB or TestD)`
 4 + 
 5 + Scenario: Install TestD with rpm and then TestA that requires: TestC if (TestB or TestD)
 6 +   Given _deprecated I use the repository "rich-4"
 7 +   When _deprecated I execute "bash" command "rpm -Uvh  /repo/TestD*.rpm" with "success"
 8 +   Then _deprecated transaction changes are as follows
 9 +    | State        | Packages   |
10 +    | installed    | TestD      |
11 +   When _deprecated I execute "dnf" command "-y install TestA" with "success"
12 +   Then _deprecated transaction changes are as follows
13 +    | State        | Packages      |
14 +    | installed    | TestA, TestC  |
 1 @@ -0,0 +1,13 @@
 2 + Feature: Richdeps/Behave test
 3 +  TestA `Requires: TestC if (TestB or TestD)`
 4 + 
 5 + Scenario: Rpm install-remove test with TestA that requires: TestC if (TestB or TestD)
 6 +   Given _deprecated I use the repository "rich-4"
 7 +   When _deprecated I execute "bash" command "rpm -Uvh /repo/TestA*.rpm /repo/TestC*.rpm /repo/TestD*.rpm" with "success"
 8 +   Then _deprecated transaction changes are as follows
 9 +    | State        | Packages             |
10 +    | installed    | TestA, TestC, TestD  |
11 +   When _deprecated I execute "bash" command "rpm -e TestA TestC" with "success"
12 +   Then _deprecated transaction changes are as follows
13 +    | State        | Packages      |
14 +    | removed      | TestA, TestC  |
 1 @@ -0,0 +1,17 @@
 2 + Feature: Richdeps/Behave test
 3 +  TestA `Requires: TestC if (TestB or TestD)`
 4 + 
 5 + Scenario: Install TestA TestC TestD with rpm then remove TestD and then remove TestC (TestA requires: TestC if (TestB or TestD))
 6 +   Given _deprecated I use the repository "rich-4"
 7 +   When _deprecated I execute "bash" command "rpm -Uvh /repo/TestA*.rpm /repo/TestC*.rpm /repo/TestD*.rpm" with "success"
 8 +    Then _deprecated transaction changes are as follows
 9 +    | State        | Packages             |
10 +    | installed    | TestA, TestC, TestD  |
11 +   When _deprecated I execute "dnf" command "-y remove TestD" with "success"
12 +    Then _deprecated transaction changes are as follows
13 +    | State        | Packages   |
14 +    | removed      | TestD      |
15 +   When _deprecated I execute "dnf" command "-y remove TestC" with "success"
16 +    Then _deprecated transaction changes are as follows
17 +    | State        | Packages   |
18 +    | removed      | TestC      |
 1 @@ -0,0 +1,28 @@
 2 + #!/bin/bash
 3 + set -xeuo pipefail
 4 + 
 5 + RESERVE=0
 6 + if [ "$1" == "-r" -o "$1" == "-R" ]; then
 7 +     RESERVE="$1"
 8 +     shift
 9 + fi
10 + 
11 + #httpd -k start
12 + #vsftpd
13 + #rngd -r /dev/urandom -o /dev/random
14 + 
15 + new_name=${1}-${2}
16 + EXIT_STATUS=0
17 + cp /tests/${1}.feature /behave/${new_name}.feature || EXIT_STATUS=1
18 + if [ "$EXIT_STATUS" = 1 ]; then
19 +     >&2 echo "Feature file ${1}.feature not found"
20 +     exit 1
21 + fi
22 + 
23 + TEST_EXIT=0
24 + behave-2 --tags ~@backup --tags ~@restore -i $new_name -D dnf_cmd=$2 --junit --junit-directory /junit/ /behave/ || TEST_EXIT=$?
25 + 
26 + if [ "$RESERVE" == "-r" ] || [ "$RESERVE" == "-R" -a $TEST_EXIT -ne 0 ]; then
27 +     bash || :
28 + fi
29 + exit $TEST_EXIT
  1 @@ -0,0 +1,137 @@
  2 + Feature: Test for successful and failing rpm scriptlets
  3 + 
  4 +   @setup
  5 +   Scenario: Setup phase: prepare packages
  6 +       Given repository "base" with packages
  7 +          | Package       | Tag       | Value            |
  8 +          | Test-pre-ok   | %pre      | echo stdout-pre  |
  9 +          | Test-pre-fail | %pre      | exit 1           |
 10 +          | Test-pretrans-ok   | %pretrans      | echo stdout-pretrans  |
 11 +          | Test-pretrans-fail | %pretrans      | exit 1                |
 12 +          | Test-post-ok   | %post      | echo stdout-post  |
 13 +          | Test-post-fail | %post      | exit 1            |
 14 +          | Test-posttrans-ok   | %posttrans      | echo stdout-posttrans  |
 15 +          | Test-posttrans-fail | %posttrans      | exit 1                 |
 16 +          | Test-preun-ok   | %preun      | echo stdout-preun  |
 17 +          | Test-preun-fail | %preun      | exit 1             |
 18 +          | Test-postun-ok   | %postun      | echo stdout-postun  |
 19 +          | Test-postun-fail | %postun      | exit 1              |
 20 +        When I enable repository "base"
 21 + 
 22 +   Scenario: Install a pkg with a successful %pre scriptlet
 23 +        When I save rpmdb
 24 +         And I run "dnf -y install Test-pre-ok"
 25 +        Then rpmdb changes are
 26 +          | State     | Packages       |
 27 +          | installed | Test-pre-ok    |
 28 +         And the command stdout should match regexp "stdout-pre"
 29 + 
 30 +   Scenario: Install a pkg with a successful %pretrans scriptlet
 31 +        When I save rpmdb
 32 +         And I run "dnf -y install Test-pretrans-ok"
 33 +        Then rpmdb changes are
 34 +          | State     | Packages         |
 35 +          | installed | Test-pretrans-ok |
 36 +         And the command stdout should match regexp "stdout-pretrans"
 37 + 
 38 +   Scenario: Install a pkg with a successful %post scriptlet
 39 +        When I save rpmdb
 40 +         And I run "dnf -y install Test-post-ok"
 41 +        Then rpmdb changes are
 42 +          | State     | Packages       |
 43 +          | installed | Test-post-ok   |
 44 +         And the command stdout should match regexp "stdout-post"
 45 + 
 46 +   Scenario: Install a pkg with a successful %posttrans scriptlet
 47 +        When I save rpmdb
 48 +         And I run "dnf -y install Test-posttrans-ok"
 49 +        Then rpmdb changes are
 50 +          | State     | Packages          |
 51 +          | installed | Test-posttrans-ok |
 52 +         And the command stdout should match regexp "stdout-posttrans"
 53 + 
 54 +   Scenario: Install a pkg with a failing %pre scriptlet
 55 +        When I save rpmdb
 56 +         And I run "dnf -y install Test-pre-fail"
 57 +        Then rpmdb does not change
 58 +         And the command stderr should match regexp "Error in PREIN scriptlet in rpm package Test-pre-fail"
 59 +         And the command stderr should match regexp "Error: Transaction failed"
 60 + 
 61 +   Scenario: Install a pkg with a failing %pretrans scriptlet
 62 +        When I save rpmdb
 63 +         And I run "dnf -y install Test-pretrans-fail"
 64 +        Then rpmdb does not change
 65 +         And the command stderr should match regexp "Error in PRETRANS scriptlet in rpm package Test-pretrans-fail"
 66 +         And the command stderr should match regexp "Error: Transaction failed"
 67 + 
 68 +   Scenario: Install a pkg with a failing %post scriptlet
 69 +        When I save rpmdb
 70 +         And I run "dnf -y install Test-post-fail"
 71 +        Then rpmdb changes are
 72 +          | State     | Packages       |
 73 +          | installed | Test-post-fail |
 74 +         And the command stderr should match regexp "Non-fatal POSTIN scriptlet failure in rpm package Test-post-fail"
 75 + 
 76 +   Scenario: Install a pkg with a failing %posttrans scriptlet
 77 +        When I save rpmdb
 78 +         And I run "dnf -y install Test-posttrans-fail"
 79 +        Then rpmdb changes are
 80 +          | State     | Packages            |
 81 +          | installed | Test-posttrans-fail |
 82 +         And the command stderr should match regexp "Non-fatal POSTTRANS scriptlet failure in rpm package Test-posttrans-fail"
 83 + 
 84 +   Scenario: Remove a pkg with a successful %preun scriptlet
 85 +        When I save rpmdb
 86 +         And I run "dnf -y install Test-preun-ok"
 87 +        Then rpmdb changes are
 88 +          | State     | Packages         |
 89 +          | installed | Test-preun-ok    |
 90 +        When I save rpmdb
 91 +         And I run "dnf -y remove Test-preun-ok"
 92 +        Then rpmdb changes are
 93 +          | State     | Packages         |
 94 +          | removed   | Test-preun-ok    |
 95 +         And the command stdout should match regexp "stdout-preun"
 96 + 
 97 +   Scenario: Remove a pkg with a successful %postun scriptlet
 98 +        When I save rpmdb
 99 +         And I run "dnf -y install Test-postun-ok"
100 +        Then rpmdb changes are
101 +          | State     | Packages          |
102 +          | installed | Test-postun-ok    |
103 +        When I save rpmdb
104 +         And I run "dnf -y remove Test-postun-ok"
105 +        Then rpmdb changes are
106 +          | State     | Packages          |
107 +          | removed   | Test-postun-ok    |
108 +         And the command stdout should match regexp "stdout-postun"
109 + 
110 +   Scenario: Remove a pkg with a failing %preun scriptlet
111 +        When I save rpmdb
112 +         And I run "dnf -y install Test-preun-fail"
113 +        Then rpmdb changes are
114 +          | State     | Packages        |
115 +          | installed | Test-preun-fail |
116 +        When I save rpmdb
117 +         And I run "dnf -y remove Test-preun-fail"
118 +        Then rpmdb does not change
119 +         And the command stderr should match regexp "Error in PREUN scriptlet in rpm package Test-preun-fail"
120 +         And the command stderr should match regexp "Error: Transaction failed"
121 +        When I save rpmdb
122 +         And I run "dnf -y --setopt=tsflags=noscripts remove Test-preun-fail"
123 +        Then rpmdb changes are
124 +          | State     | Packages        |
125 +          | removed   | Test-preun-fail |
126 + 
127 +   Scenario: Remove a pkg with a failing %postun scriptlet
128 +        When I save rpmdb
129 +         And I run "dnf -y install Test-postun-fail"
130 +        Then rpmdb changes are
131 +          | State     | Packages         |
132 +          | installed | Test-postun-fail |
133 +        When I save rpmdb
134 +         And I run "dnf -y remove Test-postun-fail"
135 +        Then rpmdb changes are
136 +          | State     | Packages         |
137 +          | removed   | Test-postun-fail |
138 +         And the command stderr should match regexp "Non-fatal POSTUN scriptlet failure in rpm package Test-postun-fail"
 1 @@ -0,0 +1,15 @@
 2 + Feature: Test security options for update
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +        Given _deprecated I use the repository "upgrade_1"
 7 +        When _deprecated I execute "dnf" command "-y install TestN-1.0.0-1 TestB-1.0.0-1 TestC-1.0.0-1" with "success"
 8 +        Then _deprecated transaction changes are as follows
 9 +         | State     | Packages |
10 +         | installed | TestN-1.0.0-1,TestB-1.0.0-1,TestC-1.0.0-1 |
11 + 
12 +   Scenario: Test security options --bugfix
13 +        When _deprecated I execute "dnf" command "-y update --bugfix" with "success"
14 +        Then _deprecated transaction changes are as follows
15 +          | State     | Packages |
16 +          | upgraded  | TestN-1.0.0-4,TestC-1.0.0-2    |
 1 @@ -0,0 +1,15 @@
 2 + Feature: Test security options for update-minimal
 3 + 
 4 +   @setup
 5 +   Scenario: Feature Setup
 6 +        Given _deprecated I use the repository "upgrade_1"
 7 +        When _deprecated I execute "dnf" command "-y install TestN-1.0.0-1 TestB-1.0.0-1 TestC-1.0.0-1" with "success"
 8 +        Then _deprecated transaction changes are as follows
 9 +         | State     | Packages |
10 +         | installed | TestN-1.0.0-1,TestB-1.0.0-1,TestC-1.0.0-1 |
11 + 
12 +   Scenario: Test security options --bugfix
13 +        When _deprecated I execute "dnf" command "-y update-minimal --bugfix" with "success"
14 +        Then _deprecated transaction changes are as follows
15 +          | State     | Packages |
16 +          | upgraded  | TestN-1.0.0-3,TestC-1.0.0-2    |
  1 @@ -0,0 +1,110 @@
  2 + Feature: Test for check-update, upgrade, update, upgrade-minimal and update-minimal with security option
  3 +  repo base: TestA-1 TestB-1
  4 +  repo sec-err-1: errata security Low: TestA-2
  5 +  repo sec-err-2: errata security Moderate: TestA-3
  6 +  repo enh-err: errata enhancement: TestA-4 TestB-2
  7 + 
  8 +   @setup
  9 +   Scenario: Setup (install TestA-1 TestB-1)
 10 +       Given repository "base" with packages
 11 +          | Package      | Tag      | Value     |
 12 +          | TestA        | Version  | 1         |
 13 +          | TestB        | Version  | 1         |
 14 +         And repository "sec-err-1" with packages
 15 +          | Package      | Tag      | Value     |
 16 +          | TestA        | Version  | 2         |
 17 +         And updateinfo defined in repository "sec-err-1"
 18 +          | Id              | Tag        | Value                  |
 19 +          | RHSA-2999-001   | Title      | TestA security update  |
 20 +          |                 | Type       | security               |
 21 +          |                 | Severity   | Low                    |
 22 +          |                 | Package    | TestA-2                |
 23 +         And repository "sec-err-2" with packages
 24 +          | Package      | Tag      | Value     |
 25 +          | TestA        | Version  | 3         |
 26 +         And updateinfo defined in repository "sec-err-2"
 27 +          | Id              | Tag        | Value                  |
 28 +          | RHSA-2999-002   | Title      | TestA security update  |
 29 +          |                 | Type       | security               |
 30 +          |                 | Severity   | Moderate               |
 31 +          |                 | Package    | TestA-3                |
 32 +         And repository "enh-err" with packages
 33 +          | Package      | Tag      | Value     |
 34 +          | TestA        | Version  | 4         |
 35 +          | TestB        | Version  | 2         |
 36 +         And updateinfo defined in repository "enh-err"
 37 +          | Id              | Tag        | Value                  |
 38 +          | RHEA-2999-003   | Title      | TestA TestB enh        |
 39 +          |                 | Type       | enhancement            |
 40 +          |                 | Package    | TestA-4                |
 41 +          |                 | Package    | TestB-2                |
 42 +        When I save rpmdb
 43 +         And I enable repository "base"
 44 +         And I successfully run "dnf -y install TestA TestB"
 45 +        Then rpmdb changes are
 46 +          | State     | Packages         |
 47 +          | installed | TestA/1, TestB/1 |
 48 + 
 49 +   Scenario: Security check-update when there are no such updates
 50 +        When I run "dnf --security check-update"
 51 +        Then the command exit code is 0
 52 +         And the command stdout should not match regexp "TestA"
 53 +         And the command stdout should not match regexp "TestB"
 54 + 
 55 +   Scenario: Security check-update when there are such updates
 56 +        When I enable repository "sec-err-1"
 57 +         And I enable repository "sec-err-2"
 58 +         And I enable repository "enh-err"
 59 +         And I run "dnf --security check-update"
 60 +        Then the command exit code is 100
 61 +         And the command stdout should match regexp "TestA.*4-1.*enh-err"
 62 +         And the command stdout should not match regexp "TestB"
 63 + 
 64 +   Scenario: Security update
 65 +        When I save rpmdb
 66 +         And I successfully run "dnf -y --security update"
 67 +        Then rpmdb changes are
 68 +          | State      | Packages           |
 69 +          | updated    | TestA/4            |
 70 + 
 71 +   Scenario: Cleanup after security update
 72 +        When I save rpmdb
 73 +         And I successfully run "dnf -y history undo last" 
 74 +        Then rpmdb changes are
 75 +          | State      | Packages             |
 76 +          | downgraded | TestA/1              |
 77 + 
 78 +   Scenario: Security upgrade
 79 +        When I save rpmdb
 80 +         And I successfully run "dnf -y --security upgrade"
 81 +        Then rpmdb changes are
 82 +          | State      | Packages             |
 83 +          | updated    | TestA/4              |
 84 + 
 85 +   Scenario: Cleanup after security upgrade
 86 +        When I save rpmdb
 87 +         And I successfully run "dnf -y history undo last"
 88 +        Then rpmdb changes are
 89 +          | State      | Packages             |
 90 +          | downgraded | TestA/1              |
 91 + 
 92 +   Scenario: Security update-minimal
 93 +        When I save rpmdb
 94 +         And I successfully run "dnf -y --security update-minimal"
 95 +        Then rpmdb changes are
 96 +          | State      | Packages             |
 97 +          | updated    | TestA/3              |
 98 + 
 99 +   Scenario: Cleanup after security update-minimal
100 +        When I save rpmdb
101 +         And I successfully run "dnf -y history undo last"
102 +        Then rpmdb changes are
103 +          | State      | Packages           |
104 +          | downgraded | TestA/1            |
105 + 
106 +   Scenario: Security upgrade-minimal
107 +        When I save rpmdb
108 +         And I successfully run "dnf -y --security upgrade-minimal"
109 +        Then rpmdb changes are
110 +          | State      | Packages           |
111 +          | updated    | TestA/3            |
 1 @@ -0,0 +1,74 @@
 2 + Feature: Test for upgrade and upgrade-minimal with bz and security options
 3 +  repo base: TestA-1 TestB-1
 4 +  repo sec-err-1: errata security Low: TestA-2
 5 +  repo sec-err-2: errata security Moderate: TestB-2
 6 +  repo bug-err: errata bugfix: TestA-3 TestB-3
 7 + 
 8 +   @setup
 9 +   Scenario: Setup (install TestA-1 TestB-1)
10 +       Given repository "base" with packages
11 +          | Package      | Tag      | Value     |
12 +          | TestA        | Version  | 1         |
13 +          | TestB        | Version  | 1         |
14 +         And repository "sec-err-1" with packages
15 +          | Package      | Tag      | Value     |
16 +          | TestA        | Version  | 2         |
17 +         And updateinfo defined in repository "sec-err-1"
18 +          | Id              | Tag        | Value                  |
19 +          | RHSA-2999-001   | Title      | TestA security update  |
20 +          |                 | Type       | security               |
21 +          |                 | Severity   | Low                    |
22 +          |                 | Reference  | BZ123                  |
23 +          |                 | Package    | TestA-2                |
24 +         And repository "sec-err-2" with packages
25 +          | Package      | Tag      | Value     |
26 +          | TestB        | Version  | 2         |
27 +         And updateinfo defined in repository "sec-err-2"
28 +          | Id              | Tag        | Value                  |
29 +          | RHSA-2999-002   | Title      | TestB security update  |
30 +          |                 | Type       | security               |
31 +          |                 | Severity   | Moderate               |
32 +          |                 | Reference  | BZ234                  |
33 +          |                 | Reference  | BZ345                  |
34 +          |                 | Package    | TestB-2                |
35 +         And repository "bug-err" with packages
36 +          | Package      | Tag      | Value     |
37 +          | TestA        | Version  | 3         |
38 +          | TestB        | Version  | 3         |
39 +         And updateinfo defined in repository "bug-err"
40 +          | Id              | Tag        | Value                  |
41 +          | RHBA-2999-003   | Title      | TestA TestB bugfix     |
42 +          |                 | Type       | bugfix                 |
43 +          |                 | Reference  | BZ456                  |
44 +          |                 | Package    | TestA-3                |
45 +          |                 | Package    | TestB-3                |
46 +        When I save rpmdb
47 +         And I enable repository "base"
48 +         And I successfully run "dnf -y install TestA TestB"
49 +        Then rpmdb changes are
50 +          | State     | Packages         |
51 +          | installed | TestA/1, TestB/1 |
52 + 
53 +   Scenario: Security plus three explicitly mentioned bzs upgrade
54 +        When I enable repository "sec-err-1"
55 +         And I enable repository "sec-err-2"
56 +         And I enable repository "bug-err"
57 +         And I save rpmdb
58 +         And I run "dnf -y --bz 123 --bz 234 --bz 345 --security upgrade"
59 +        Then rpmdb changes are
60 +          | State      | Packages           |
61 +          | updated    | TestA/3,TestB/3    |
62 + 
63 +   Scenario: Cleanup after security plus bzs upgrade
64 +        When I save rpmdb
65 +         And I successfully run "dnf -y history undo last"
66 +        Then rpmdb changes are
67 +          | State      | Packages           |
68 +          | downgraded | TestA/1,TestB/1    |
69 + 
70 +   Scenario: Security plus three explicitly mentioned bzs upgrade-minimal
71 +        When I save rpmdb
72 +         And I run "dnf -y --bz 123 --bz 234 --bz 345 --security upgrade-minimal"
73 +        Then rpmdb changes are
74 +          | State      | Packages           |
75 +          | updated    | TestA/2,TestB/2    |
  1 @@ -0,0 +1,171 @@
  2 + Feature: Test for upgrade and upgrade-minimal with cve, cves, bugfix, advisory, advisories, sec-severity, secseverity and security options
  3 +  repo base: TestA-1 TestB-1
  4 +  repo ext1: errata bugfix: TestA-2
  5 +             errata security Moderate: TestB-2
  6 +  repo ext2: errata bugfix: TestA-3 TestB-3
  7 +  repo ext3: errata security Critical: TestB-4
  8 +             errata enhancement: TestA-4
  9 + 
 10 +   @setup
 11 +   Scenario: Setup (install TestA-1 TestB-1)
 12 +       Given repository "base" with packages
 13 +          | Package      | Tag      | Value     |
 14 +          | TestA        | Version  | 1         |
 15 +          | TestB        | Version  | 1         |
 16 +         And repository "ext1" with packages
 17 +          | Package      | Tag      | Value     |
 18 +          | TestA        | Version  | 2         |
 19 +          | TestB        | Version  | 2         |
 20 +         And updateinfo defined in repository "ext1"
 21 +          | Id              | Tag        | Value                  |
 22 +          | RHBA-2999-001   | Title      | TestA bugfix           |
 23 +          |                 | Type       | bugfix                 |
 24 +          |                 | Reference  | BZ111                  |
 25 +          |                 | Package    | TestA-2                |
 26 +          | RHSA-2999-002   | Title      | TestB security update  |
 27 +          |                 | Type       | security               |
 28 +          |                 | Severity   | Moderate               |
 29 +          |                 | Reference  | CVE-2999-0001          |
 30 +          |                 | Reference  | BZ222                  |
 31 +          |                 | Package    | TestB-2                |
 32 +         And repository "ext2" with packages
 33 +          | Package      | Tag      | Value     |
 34 +          | TestA        | Version  | 3         |
 35 +          | TestB        | Version  | 3         |
 36 +         And updateinfo defined in repository "ext2"
 37 +          | Id              | Tag        | Value                  |
 38 +          | RHBA-2999-003   | Title      | TestA TestB bugfix     |
 39 +          |                 | Type       | bugfix                 |
 40 +          |                 | Reference  | BZ333                  |
 41 +          |                 | Package    | TestA-3                |
 42 +          |                 | Package    | TestB-3                |
 43 +         And repository "ext3" with packages
 44 +          | Package      | Tag      | Value     |
 45 +          | TestA        | Version  | 4         |
 46 +          | TestB        | Version  | 4         |
 47 +         And updateinfo defined in repository "ext3"
 48 +          | Id              | Tag        | Value                  |
 49 +          | RHSA-2999-004   | Title      | TestB security update  |
 50 +          |                 | Type       | security               |
 51 +          |                 | Severity   | Critical               |
 52 +          |                 | Reference  | CVE-2999-0002          |
 53 +          |                 | Reference  | BZ444                  |
 54 +          |                 | Package    | TestB-4                |
 55 +          | RHEA-2999-005   | Title      | TestA enhancement      |
 56 +          |                 | Type       | enhancement            |
 57 +          |                 | Package    | TestA-4                |
 58 + 
 59 +        When I save rpmdb
 60 +         And I enable repository "base"
 61 +         And I successfully run "dnf -y install TestA TestB"
 62 +        Then rpmdb changes are
 63 +          | State     | Packages         |
 64 +          | installed | TestA/1, TestB/1 |
 65 + 
 66 +   Scenario: upgrade-minimal cve and advisory
 67 +        When I enable repository "ext1"
 68 +         And I enable repository "ext2"
 69 +         And I enable repository "ext3"
 70 +         And I save rpmdb
 71 +         And I run "dnf -y --cve CVE-2999-0001 --advisory RHBA-2999-001 upgrade-minimal"
 72 +        Then rpmdb changes are
 73 +          | State      | Packages           |
 74 +          | updated    | TestA/2,TestB/2    |
 75 + 
 76 +   Scenario: Cleanup after upgrade-minimal cve and advisory
 77 +        When I save rpmdb
 78 +         And I successfully run "dnf -y history undo last"
 79 +        Then rpmdb changes are
 80 +          | State      | Packages           |
 81 +          | downgraded | TestA/1,TestB/1    |
 82 + 
 83 +   Scenario: upgrade advisories
 84 +        When I save rpmdb
 85 +         And I run "dnf -y --advisories=RHSA-2999-004 --advisories=RHBA-2999-001 upgrade"
 86 +        Then rpmdb changes are
 87 +          | State      | Packages           |
 88 +          | updated    | TestA/4,TestB/4    |
 89 + 
 90 +   Scenario: Cleanup after upgrade advisories
 91 +        When I save rpmdb
 92 +         And I successfully run "dnf -y history undo last"
 93 +        Then rpmdb changes are
 94 +          | State      | Packages           |
 95 +          | downgraded | TestA/1,TestB/1    |
 96 + 
 97 +   Scenario: upgrade cves
 98 +        When I save rpmdb
 99 +         And I run "dnf -y --cves=CVE-2999-0001 --cves=CVE-2999-0002 upgrade"
100 +        Then rpmdb changes are
101 +          | State      | Packages           |
102 +          | updated    | TestB/4            |
103 + 
104 +   Scenario: Cleanup after upgrade cves
105 +        When I save rpmdb
106 +         And I successfully run "dnf -y history undo last"
107 +        Then rpmdb changes are
108 +          | State      | Packages           |
109 +          | downgraded | TestB/1            |
110 + 
111 +   Scenario: upgrade-minimal sec-severity
112 +        When I save rpmdb
113 +         And I run "dnf -y --sec-severity Moderate upgrade-minimal"
114 +        Then rpmdb changes are
115 +          | State      | Packages           |
116 +          | updated    | TestB/2            |
117 + 
118 +   Scenario: Cleanup after upgrade-minimal sec-severity
119 +        When I save rpmdb
120 +         And I successfully run "dnf -y history undo last"
121 +        Then rpmdb changes are
122 +          | State      | Packages           |
123 +          | downgraded | TestB/1            |
124 + 
125 +   Scenario: upgrade secseverity
126 +        When I save rpmdb
127 +         And I run "dnf -y --secseverity Critical upgrade"
128 +        Then rpmdb changes are
129 +          | State      | Packages           |
130 +          | updated    | TestB/4            |
131 + 
132 +   Scenario: Cleanup after upgrade secseverity
133 +        When I save rpmdb
134 +         And I successfully run "dnf -y history undo last"
135 +        Then rpmdb changes are
136 +          | State      | Packages           |
137 +          | downgraded | TestB/1            |
138 + 
139 +   Scenario: upgrade-minimal bugfix
140 +        When I save rpmdb
141 +         And I run "dnf -y --bugfix upgrade-minimal"
142 +        Then rpmdb changes are
143 +          | State      | Packages           |
144 +          | updated    | TestA/3,TestB/3    |
145 + 
146 +   Scenario: Cleanup after upgrade-minimal bugfix
147 +        When I save rpmdb
148 +         And I successfully run "dnf -y history undo last"
149 +        Then rpmdb changes are
150 +          | State      | Packages           |
151 +          | downgraded | TestA/1,TestB/1    |
152 + 
153 +   Scenario: upgrade bugfix
154 +        When I save rpmdb
155 +         And I run "dnf -y --bugfix upgrade"
156 +        Then rpmdb changes are
157 +          | State      | Packages           |
158 +          | updated    | TestA/4,TestB/4    |
159 + 
160 +   Scenario: Cleanup after upgrade bugfix
161 +        When I save rpmdb
162 +         And I successfully run "dnf -y history undo last"
163 +        Then rpmdb changes are
164 +          | State      | Packages           |
165 +          | downgraded | TestA/1,TestB/1    |
166 + 
167 +   Scenario: upgrade-minimal security plus bugfix
168 +        When I save rpmdb
169 +         And I run "dnf -y --security --bugfix upgrade-minimal" 
170 +        Then rpmdb changes are
171 +          | State      | Packages           |
172 +          | updated    | TestA/3,TestB/4    |
 1 @@ -0,0 +1,23 @@
 2 + Feature: DNF/Behave test (DNF --setopt in installroot)
 3 + 
 4 + Scenario: Reposdir option set by --setopt in host and installroot=dockertesting3
 5 +   When _deprecated I create a file "/dockertesting3/repository/install.repo" with content: "[upgrade_1-gpg-file]\nname=upgrade_1-gpg-file\nbaseurl=http://127.0.0.1/repo/upgrade_1-gpg\nenabled=1\ngpgcheck=1\ngpgkey=file:///var/www/html/repo/upgrade_1-gpg/RPM-GPG-KEY-dtest2"
 6 +   # Fail due to unavailable repository in host and installroot
 7 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting3 -y install TestN" with "fail"
 8 +   # Install in installroot from repository described by setopt=reposdir= (path is not affected by installroot path)
 9 +   # Fail due to path is not affected by installroot
10 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting3 -y --setopt=reposdir=/repository install TestN" with "fail"
11 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestN" with "fail"
12 +   When _deprecated I execute "dnf" command "--installroot=/dockertesting3 -y --setopt=reposdir=/dockertesting3/repository install TestN" with "success"
13 +   When _deprecated I execute "bash" command "rpm -q --root=/dockertesting3 TestN" with "success"
14 +   Then _deprecated line from "stdout" should "start" with "TestN-1.0.0-4"
15 +   # Install in host from repository described by setopt=reposdir
16 +   When _deprecated I execute "dnf" command "-y --setopt=reposdir=/dockertesting3/repository install TestB" with "success"
17 +   Then _deprecated transaction changes are as follows
18 +    | State        | Packages       |
19 +    | installed    | TestB-1.0.0-2  |
20 +   # Cleaning steps
21 +   When _deprecated I execute "dnf" command "-y remove TestB" with "success"
22 +   Then _deprecated transaction changes are as follows
23 +    | State        | Packages       |
24 +    | removed      | TestB-1.0.0-2  |
 1 @@ -0,0 +1,92 @@
 2 + Feature: Installing updating and removing a package in dnf shell
 3 + 
 4 +   Scenario: Installing packages
 5 +     Given repository "TestRepoA" with packages
 6 +          | Package | Tag       | Value |
 7 +          |  TestA  |           |       |
 8 +          |  TestB  |           |       |
 9 +       And I have dnf shell session opened with parameters "-y"
10 +      When I save rpmdb
11 +       And I run dnf shell command "repo enable TestRepoA"
12 +       And I run dnf shell command "install TestA TestB"
13 +       And I run dnf shell command "run"
14 +      Then rpmdb changes are
15 +          | State     | Packages     |
16 +          | installed | TestA, TestB |
17 +      When I run dnf shell command "exit"
18 +      Then the command stdout should match exactly
19 +           """
20 +           Leaving Shell
21 + 
22 +           """
23 + 
24 +   Scenario: Updating package using the upgrade command
25 +     Given repository "TestRepoB" with packages
26 +          | Package | Tag       | Value |
27 +          | TestA   | Release   |   2   |
28 +       And I have dnf shell session opened with parameters "-y"
29 +      When I save rpmdb
30 +       And I run dnf shell command "repo enable TestRepoB"
31 +       And I run dnf shell command "upgrade TestA"
32 +       And I run dnf shell command "run"
33 +      Then rpmdb changes are
34 +          | State   | Packages |
35 +          | updated | TestA    |
36 +      When I run dnf shell command "exit"
37 +      Then the command stdout should match exactly
38 +           """
39 +           Leaving Shell
40 + 
41 +           """
42 + 
43 +   Scenario: Updating package using the update command
44 +     Given repository "TestRepoC" with packages
45 +          | Package | Tag       | Value |
46 +          | TestB   | Release   |   2   |
47 +       And I have dnf shell session opened with parameters "-y"
48 +      When I save rpmdb
49 +       And I run dnf shell command "repo enable TestRepoC"
50 +       And I run dnf shell command "update TestB"
51 +       And I run dnf shell command "run"
52 +      Then rpmdb changes are
53 +          | State   | Packages |
54 +          | updated | TestB    |
55 +      When I run dnf shell command "exit"
56 +      Then the command stdout should match exactly
57 +           """
58 +           Leaving Shell
59 + 
60 +           """
61 + 
62 +   Scenario: Removing a package
63 +     Given I have dnf shell session opened with parameters "-y"
64 +      When I save rpmdb
65 +       And I run dnf shell command "remove TestA"
66 +       And I run dnf shell command "run"
67 +      Then rpmdb changes are
68 +          | State     | Packages |
69 +          | removed   | TestA    |
70 +      When I run dnf shell command "exit"
71 +      Then the command stdout should match exactly
72 +           """
73 +           Leaving Shell
74 + 
75 +           """
76 + 
77 +   Scenario: Installing and erasing a package within one transaction
78 +     Given I have dnf shell session opened with parameters "-y"
79 +      When I save rpmdb
80 +       And I run dnf shell command "repo enable TestRepoA"
81 +       And I run dnf shell command "install TestA"
82 +       And I run dnf shell command "erase TestB"
83 +       And I run dnf shell command "run"
84 +      Then rpmdb changes are
85 +          | State     | Packages |
86 +          | installed | TestA    |
87 +          | removed   | TestB    |
88 +      When I run dnf shell command "exit"
89 +      Then the command stdout should match exactly
90 +           """
91 +           Leaving Shell
92 + 
93 +           """
 1 @@ -0,0 +1,35 @@
 2 + Feature: Running dnf shell commands in a batch
 3 + 
 4 +   @setup
 5 +   Scenario: Preparing the test repository
 6 +     Given repository "TestRepoA" with packages
 7 +          | Package | Tag       | Value |
 8 +          | TestA   |           |       |
 9 + 
10 +   Scenario: Passing shell commands stored in a file
11 +     Given a file "/tmp/dnf_shell_transaction" with
12 +           """
13 +           config assumeyes 1
14 +           repo enable TestRepoA
15 +           install TestA
16 +           run
17 +           """
18 +      When I save rpmdb
19 +       And _deprecated I execute "dnf" command "shell /tmp/dnf_shell_transaction" with "success"
20 +      Then rpmdb changes are
21 +          | State     | Packages |
22 +          | installed | TestA    |
23 + 
24 +   Scenario: Passing shell commands through stdin redirection
25 +     Given a file "/tmp/dnf_shell_transaction" with
26 +           """
27 +           config assumeyes 1
28 +           remove TestA
29 +           run
30 +           """
31 +      When I save rpmdb
32 +       And _deprecated I execute "dnf" command "shell < /tmp/dnf_shell_transaction" with "success"
33 +      Then rpmdb changes are
34 +          | State   | Packages |
35 +          | removed | TestA    |
36 + 
 1 @@ -0,0 +1,35 @@
 2 + Feature: Switching conflicting packages in dnf shell
 3 + 
 4 +   @setup
 5 +   Scenario: Preparing the test repository
 6 +     Given repository "TestRepoA" with packages
 7 +          | Package | Tag       | Value |
 8 +          | TestA   | Requires  | TestD |
 9 +          | TestB   | Provides  | TestD |
10 +          |         | Conflicts | TestC |
11 +          | TestC   | Provides  | TestD |
12 +          |         | Conflicts | TestB |
13 + 
14 +   Scenario: Switching conflicting packages via install and remove
15 +     Given I have dnf shell session opened with parameters "-y"
16 +      When I save rpmdb
17 +       And I run dnf shell command "repo enable TestRepoA"
18 +       And I run dnf shell command "install TestA TestB"
19 +       And I run dnf shell command "run"
20 +      Then rpmdb changes are
21 +          | State     | Packages     |
22 +          | installed | TestA, TestB |
23 +      When I save rpmdb
24 +       And I run dnf shell command "remove TestB"
25 +       And I run dnf shell command "install TestC"
26 +       And I run dnf shell command "run"
27 +      Then rpmdb changes are
28 +          | State     | Packages |
29 +          | removed   | TestB    |
30 +          | installed | TestC    |
31 +      When I run dnf shell command "quit"
32 +      Then the command stdout should match exactly
33 +           """
34 +           Leaving Shell
35 + 
36 +           """
 1 @@ -0,0 +1,71 @@
 2 + Feature: Installing a package group in dnf shell
 3 + 
 4 + Scenario: Installing package group in dnf shell
 5 +      Given repository "TestRepo" with packages
 6 +           | Package | Tag | Value |
 7 +           | TestA   |     |       |
 8 +           | TestB   |     |       |
 9 +        And package groups defined in repository "TestRepo"
10 +           | Group     | Tag         | Value   |
11 +           | TestGroup | mandatory   | TestA   |
12 +           |           | default     | TestB   |
13