Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review k*-p* feature files for dnf5 #1584

Merged
merged 11 commits into from
Nov 4, 2024
1 change: 0 additions & 1 deletion dnf-behave-tests/dnf/list-showduplicates.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@dnf5
# TODO(nsella) Unknown argument "list" for command "microdnf"
Feature: for list --showduplicates option


Expand Down
39 changes: 10 additions & 29 deletions dnf-behave-tests/dnf/list.feature
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@dnf5
Feature: Test for dnf list (including all documented suboptions and yum compatibility)


Background: Enable dnf-ci-fedora repository
Given I use repository "dnf-ci-fedora"


@dnf5
Scenario: dnf list nonexistentpkg
When I execute dnf with args "list non-existent-pkg"
Then the exit code is 1
Expand All @@ -16,7 +16,6 @@ Scenario: dnf list nonexistentpkg
"""


@dnf5
Scenario: List all packages available
When I execute dnf with args "list"
Then the exit code is 0
Expand All @@ -27,7 +26,6 @@ Scenario: List all packages available
Then stdout section "Available packages" contains "glibc-all-langpacks.x86_64\s+2.28-9.fc29\s+dnf-ci-fedora"


@dnf5
Scenario: dnf list --extras (installed pkgs, not from known repos)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -45,7 +43,6 @@ Given I drop repository "dnf-ci-fedora"
"""


@dnf5
Scenario: dnf list setup (when setup is installed)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -61,7 +58,7 @@ Given I drop repository "dnf-ci-fedora"
setup.noarch +2.12.1-1.fc29 +dnf-ci-fedora
"""

@dnf5

Scenario: dnf list is case insensitive
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -77,7 +74,7 @@ Given I drop repository "dnf-ci-fedora"
setup.noarch +2.12.1-1.fc29 +dnf-ci-fedora
"""

@dnf5

Scenario: dnf list setup (when setup is not installed but it is available)
When I execute dnf with args "list setup"
Then stderr is
Expand All @@ -92,7 +89,6 @@ Scenario: dnf list setup (when setup is not installed but it is available)
"""


@dnf5
Scenario: dnf list --installed setup (when setup is installed)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -109,7 +105,6 @@ Given I drop repository "dnf-ci-fedora"
"""


@dnf5
Scenario: List --installed alias packages from all enabled repositories
When I execute dnf with args "install glibc"
Then the exit code is 0
Expand All @@ -131,7 +126,6 @@ Scenario: List --installed alias packages from all enabled repositories
"""


@dnf5
Scenario: dnf list --available setup (when setup is available)
When I execute dnf with args "list --available setup"
Then stderr is
Expand All @@ -146,7 +140,6 @@ Scenario: dnf list --available setup (when setup is available)
"""


@dnf5
Scenario: dnf list setup basesystem (when basesystem is not installed)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -167,7 +160,6 @@ Scenario: dnf list setup basesystem (when basesystem is not installed)
"""


@dnf5
Scenario: dnf list installed setup basesystem (when basesystem is not installed)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -185,7 +177,6 @@ Scenario: dnf list installed setup basesystem (when basesystem is not installed)

# Change in behavior compared to dnf4 - Available section contains all available
# packages, installed versions are not filtered out
@dnf5
Scenario: dnf list available setup basesystem (when basesystem is available)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -204,7 +195,6 @@ Scenario: dnf list available setup basesystem (when basesystem is available)
"""


@dnf5
Scenario: dnf list setup basesystem (when both are installed)
When I execute dnf with args "install setup basesystem"
Then the exit code is 0
Expand Down Expand Up @@ -250,7 +240,6 @@ Scenario: dnf list setup basesystem (when both are installed)
"""


@dnf5
Scenario: dnf list glibc\*
When I execute dnf with args "install glibc"
Then the exit code is 0
Expand All @@ -263,7 +252,6 @@ Given I use repository "dnf-ci-fedora-updates"
Then stdout does not contain "setup"


@dnf5
Scenario Outline: dnf list <upgrades alias>
When I execute dnf with args "install glibc"
Then the exit code is 0
Expand All @@ -288,7 +276,6 @@ Examples:
| --updates |


@dnf5
Scenario: dnf list upgrades glibc (when glibc is not installed)
Given I use repository "dnf-ci-fedora-updates"
When I execute dnf with args "list --upgrades glibc"
Expand All @@ -301,7 +288,6 @@ Given I use repository "dnf-ci-fedora-updates"
And stdout is empty


@dnf5
Scenario: dnf list --obsoletes
When I execute dnf with args "install glibc"
Then the exit code is 0
Expand All @@ -320,7 +306,6 @@ Given I use repository "dnf-ci-fedora-updates"
"""


@dnf5
Scenario: dnf list obsoletes setup (when setup is not obsoleted)
When I execute dnf with args "install setup"
Then the exit code is 0
Expand All @@ -333,17 +318,15 @@ Scenario: dnf list obsoletes setup (when setup is not obsoleted)
"""


# TODO(mblaha) - the test does not respect dnf_command and runs dnf4 in subprocess
@1550560
Scenario: dnf list available pkgs with long names piped to grep
Given I use repository "dnf-ci-thirdparty"
When I execute dnf with args "clean all"
When I execute "eval dnf -y --releasever={context.dnf.releasever} --installroot={context.dnf.installroot} --setopt=module_platform_id={context.dnf.module_platform_id} --disableplugin='*' list available | grep 1" in "{context.dnf.installroot}"
When I execute "eval {context.dnf.dnf_command} -y --releasever={context.dnf.releasever} --installroot={context.dnf.installroot} --setopt=module_platform_id={context.dnf.module_platform_id} --disableplugin='*' list --available | grep 1" in "{context.dnf.installroot}"
Then the exit code is 0
Then stdout contains "forTestingPurposesWeEvenHaveReallyLongVersions.x86_64\s+1435347658326856238756823658aaaa-1\s+dnf-ci-thirdparty"


@dnf5
@bz1800342
Scenario: dnf list respects repo priorities
Given I use repository "dnf-ci-fedora-updates" with configuration
Expand All @@ -363,7 +346,6 @@ Scenario: dnf list respects repo priorities
"""


@dnf5
Scenario: dnf list --showduplicates lists all (even from lower-priority repo)
Given I use repository "dnf-ci-fedora-updates" with configuration
| key | value |
Expand All @@ -385,7 +367,6 @@ Scenario: dnf list --showduplicates lists all (even from lower-priority repo)
"""


@dnf5
@bz1800342
Scenario: dnf list doesn't show any available packages when there are no upgrades in the highest-priority repo
Given I use repository "dnf-ci-fedora-updates" with configuration
Expand All @@ -406,7 +387,6 @@ Scenario: dnf list doesn't show any available packages when there are no upgrade
"""


@dnf5
Scenario: dnf list shows available packages when there are upgrades in the highest-priority repo
Given I use repository "dnf-ci-fedora-updates" with configuration
| key | value |
Expand All @@ -429,7 +409,6 @@ Scenario: dnf list shows available packages when there are upgrades in the highe
"""


@dnf5
Scenario: dnf list doesn't show package with same nevra from lower-priority repo
Given I configure a new repository "dnf-ci-fedora2" with
| key | value |
Expand All @@ -449,12 +428,13 @@ Scenario: dnf list doesn't show package with same nevra from lower-priority repo
"""


# TODO(mblaha) --security not supported for list command
@xfail
# https://github.com/rpm-software-management/dnf5/issues/1816
@bz2124483
Scenario: dnf list updates --security shows upgrades as available when it changes arch from noarch
Given I use repository "security-upgrade"
And I execute dnf with args "install change-arch-noarch-1-1.noarch"
When I execute dnf with args "list upgrades --security"
When I execute dnf with args "list --upgrades --security"
Then the exit code is 0
And stderr is
"""
Expand All @@ -467,7 +447,8 @@ Given I use repository "security-upgrade"
"""


# TODO(mblaha) --security not supported for list command
@xfail
# https://github.com/rpm-software-management/dnf5/issues/1816
@bz2124483
Scenario: dnf list updates --security doesn't shnow an upgrade when it would require an arch change (when its not noarch)
Given I use repository "security-upgrade"
Expand All @@ -483,7 +464,7 @@ Given I use repository "security-upgrade"
"""
change-arch-0:2-2.x86_64
"""
When I execute dnf with args "list upgrades --security"
When I execute dnf with args "list --upgrades --security"
Then the exit code is 0
And stderr is
"""
Expand Down
57 changes: 18 additions & 39 deletions dnf-behave-tests/dnf/log-rotate.feature
Original file line number Diff line number Diff line change
@@ -1,50 +1,29 @@
# @dnf5
# TODO(nsella) different stdout
@dnf5
Feature: Log rotation


@xfail
# https://github.com/rpm-software-management/dnf5/issues/1818
@bz1702690
@bz1816573
Scenario: Size and number of log files respects log_size and log_rotate options
Given I use repository "dnf-ci-fedora"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 --setopt=logfilelevel=10 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 remove glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 install glibc"
And I execute dnf with args "--setopt=log_size=1024 --setopt=log_rotate=2 remove glibc"

When I execute "ls {context.dnf.installroot}/var/log | grep "dnf\.log""
When I execute "ls {context.dnf.installroot}/var/log | grep "dnf5\.log""
Then stdout is
"""
dnf.log
dnf.log.1
dnf.log.2
dnf5.log
dnf5.log.1
dnf5.log.2
"""
Then size of file "var/log/dnf.log" is at most "1024"
Then size of file "var/log/dnf.log.1" is at most "1024"
Then size of file "var/log/dnf.log.2" is at most "1024"

When I execute "ls {context.dnf.installroot}/var/log | grep "dnf\.rpm\.log""
Then stdout is
"""
dnf.rpm.log
dnf.rpm.log.1
dnf.rpm.log.2
"""
Then size of file "var/log/dnf.rpm.log" is at most "1024"
Then size of file "var/log/dnf.rpm.log.1" is at most "1024"
Then size of file "var/log/dnf.rpm.log.2" is at most "1024"

When I execute "ls {context.dnf.installroot}/var/log | grep "dnf\.librepo\.log""
Then stdout is
"""
dnf.librepo.log
dnf.librepo.log.1
dnf.librepo.log.2
"""
Then size of file "var/log/dnf.librepo.log" is at most "1024"
Then size of file "var/log/dnf.librepo.log.1" is at most "1024"
Then size of file "var/log/dnf.librepo.log.2" is at most "1024"
Then size of file "var/log/dnf5.log" is at most "1024"
Then size of file "var/log/dnf5.log.1" is at most "1024"
Then size of file "var/log/dnf5.log.2" is at most "1024"
Loading
Loading