Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tests/scripts/pulpcore/test_orphans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@ 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"

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
Comment on lines -18 to -19

@mdellweg mdellweg Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the issue? As these two commands are meant to be very careful about the stuff that gets cleaned up, are we sure this is not exposing an actual issue with cleanup on the server side?

What if instead, we stop configuring anything for this test, add zero protection time to the first and increase the number on the second to a day? (This test really does not care what the server does, other than responding correctly.)

expect_succ pulp --domain "$DOMAIN" orphan cleanup --content-hrefs "[\"$content_href\"]"
expect_succ pulp --domain "$DOMAIN" orphan cleanup --protection-time 10
Loading