From 6ff9ae3c09bd0b47927cfdc256589944abfeef58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Mon, 14 Oct 2024 10:16:22 +0200 Subject: [PATCH] Add obsoletes tests for yum behavior --- .../dnf/install-obsoletes.feature | 22 +++++++++++++++++++ .../obsoletes-yum/copper-1.0-1.fc29.spec | 16 ++++++++++++++ .../specs/obsoletes-yum/iron-1.0-1.fc29.spec | 16 ++++++++++++++ .../specs/obsoletes-yum/wood-1.0-1.fc29.spec | 14 ++++++++++++ .../specs/obsoletes-yum/wood-2.0-1.fc29.spec | 16 ++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 dnf-behave-tests/fixtures/specs/obsoletes-yum/copper-1.0-1.fc29.spec create mode 100644 dnf-behave-tests/fixtures/specs/obsoletes-yum/iron-1.0-1.fc29.spec create mode 100644 dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-1.0-1.fc29.spec create mode 100644 dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-2.0-1.fc29.spec diff --git a/dnf-behave-tests/dnf/install-obsoletes.feature b/dnf-behave-tests/dnf/install-obsoletes.feature index 51c5316b9..f1f8d3ba5 100644 --- a/dnf-behave-tests/dnf/install-obsoletes.feature +++ b/dnf-behave-tests/dnf/install-obsoletes.feature @@ -146,3 +146,25 @@ Scenario: Install obsoleting package and inherit the best reason - user """ glibc-0:2.28-9.fc29.x86_64 """ + + +# dnf-3 fails this test, it incorrectly installs the new packages +# as dependencies. +Scenario: install all obsoleters (as user installed), obsoles behavior specified by `SOLVER_FLAG_YUM_OBSOLETES` libsolv flag + Given I use repository "obsoletes-yum" + And I successfully execute dnf with args "install wood-1.0" + When I execute dnf with args "upgrade" + Then the exit code is 0 + And Transaction is following + | Action | Package | + | install | copper-0:1.0-1.fc29.x86_64 | + | install | iron-0:1.0-1.fc29.x86_64 | + | upgrade | wood-0:2.0-1.fc29.x86_64 | + When I execute dnf with args "rq --installed --qf '%{{name}} - %{{reason}}\n'" + Then stdout is + """ + copper - User + iron - User + wood - User + """ + diff --git a/dnf-behave-tests/fixtures/specs/obsoletes-yum/copper-1.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/obsoletes-yum/copper-1.0-1.fc29.spec new file mode 100644 index 000000000..478d1e981 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/obsoletes-yum/copper-1.0-1.fc29.spec @@ -0,0 +1,16 @@ +Name: copper +Version: 1.0 +Release: 1.fc29 +Summary: Made up package + +License: GPLv3+ +Url: None + +Obsoletes: wood < 2.0 + +%description +copper description + +%files + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/obsoletes-yum/iron-1.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/obsoletes-yum/iron-1.0-1.fc29.spec new file mode 100644 index 000000000..40e7473c2 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/obsoletes-yum/iron-1.0-1.fc29.spec @@ -0,0 +1,16 @@ +Name: iron +Version: 1.0 +Release: 1.fc29 +Summary: Made up package + +License: GPLv3+ +Url: None + +Obsoletes: wood < 2.0 + +%description +iron description + +%files + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-1.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-1.0-1.fc29.spec new file mode 100644 index 000000000..cfa4524a2 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-1.0-1.fc29.spec @@ -0,0 +1,14 @@ +Name: wood +Version: 1.0 +Release: 1.fc29 +Summary: Made up package + +License: GPLv3+ +Url: None + +%description +wood description + +%files + +%changelog diff --git a/dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-2.0-1.fc29.spec b/dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-2.0-1.fc29.spec new file mode 100644 index 000000000..2e9141349 --- /dev/null +++ b/dnf-behave-tests/fixtures/specs/obsoletes-yum/wood-2.0-1.fc29.spec @@ -0,0 +1,16 @@ +Name: wood +Version: 2.0 +Release: 1.fc29 +Summary: Made up package + +License: GPLv3+ +Url: None + +Obsoletes: wood < 2.0 + +%description +wood description + +%files + +%changelog