From 973997944c5c9f885b592a8e7e7b7270c96aa471 Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Thu, 20 Aug 2026 14:58:59 -0400 Subject: [PATCH] Have orphans test occur in separate domain --- tests/scripts/pulpcore/test_orphans.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/scripts/pulpcore/test_orphans.sh b/tests/scripts/pulpcore/test_orphans.sh index 03fc22ff8..661f795af 100755 --- a/tests/scripts/pulpcore/test_orphans.sh +++ b/tests/scripts/pulpcore/test_orphans.sh @@ -4,7 +4,19 @@ set -eu # shellcheck source=tests/scripts/config.source . "$(dirname "$(dirname "$(realpath "$0")")")"/config.source -expect_succ pulp orphan cleanup +eval "$(pulp status | jq -r '.domain_enabled // false')" || exit 23 + +DOMAIN="cli_test_orphans" + +cleanup() { + pulp domain destroy --name "$DOMAIN" || true +} +trap cleanup EXIT + +# Setup test domain to avoid other tests +expect_succ pulp domain create --name "$DOMAIN" --storage-class "pulpcore.app.models.storage.FileSystem" --storage-settings '{"location": "/var/lib/pulp/media"}' + +expect_succ pulp --domain "$DOMAIN" orphan cleanup test "$(echo "${OUTPUT}" | jq -r '.state' )" = "completed" @@ -12,8 +24,8 @@ pulp debug has-plugin --name "file" || exit 23 dd if=/dev/urandom of=test_1.txt bs=2MiB count=1 -expect_succ pulp file content upload --file test_1.txt --relative-path orphan_test/test_1.txt +expect_succ pulp --domain "$DOMAIN" file content upload --file test_1.txt --relative-path orphan_test/test_1.txt content_href=$(echo "${OUTPUT}" | jq -r .pulp_href) -expect_succ pulp orphan cleanup --content-hrefs "[\"$content_href\"]" -expect_succ pulp orphan cleanup --protection-time 10 +expect_succ pulp --domain "$DOMAIN" orphan cleanup --content-hrefs "[\"$content_href\"]" +expect_succ pulp --domain "$DOMAIN" orphan cleanup --protection-time 10