From 8d79b3e2f3003f02e33e9ed696e91573da1fa93c Mon Sep 17 00:00:00 2001 From: Pavla Kratochvilova Date: Fri, 5 Apr 2024 15:00:33 +0200 Subject: [PATCH] Remove --duplicates and --oldinstallonly exit with 0 when nothing to remove --- dnf-behave-tests/dnf/installonly.feature | 15 +++++++++++++++ dnf-behave-tests/dnf/remove-duplicates.feature | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/dnf-behave-tests/dnf/installonly.feature b/dnf-behave-tests/dnf/installonly.feature index 9f897f010..ff92120b6 100644 --- a/dnf-behave-tests/dnf/installonly.feature +++ b/dnf-behave-tests/dnf/installonly.feature @@ -162,6 +162,21 @@ Scenario: Remove all installonly packages but keep the latest and running kernel | unchanged | kernel-core-0:4.18.16-300.fc29.x86_64 | +Scenario: When there are no old installonly packages to be removed, exit with 0 + When I execute dnf with args "remove --oldinstallonly" + Then the exit code is 0 + And Transaction is empty + And stderr is empty + And stdout is + """ + + No old installonly packages found for removal. + Dependencies resolved. + Nothing to do. + Complete! + """ + + # TODO(jkolarik): autoremove not yet available in dnf5 # @dnf5 @bz1934499 diff --git a/dnf-behave-tests/dnf/remove-duplicates.feature b/dnf-behave-tests/dnf/remove-duplicates.feature index 1fa314a8c..cc81c8768 100644 --- a/dnf-behave-tests/dnf/remove-duplicates.feature +++ b/dnf-behave-tests/dnf/remove-duplicates.feature @@ -52,3 +52,20 @@ Scenario: Remove a duplicate RPM and reinstall an existing RPM when a copy is av | Action | Package | | reinstall | flac-0:1.3.3-3.fc29.x86_64 | | obsoleted | flac-0:1.3.3-1.fc29.x86_64 | + + +@RHEL-6424 +Scenario: When there are no duplicates to be removed, exit with 0 + When I execute dnf with args "remove --duplicates" + Then the exit code is 0 + And Transaction is empty + And stderr is empty + And stdout is + """ + + No duplicated packages found for removal. + Dependencies resolved. + Nothing to do. + Complete! + """ +