Skip to content

Commit

Permalink
Update base_url in test if content_origin is null
Browse files Browse the repository at this point in the history
If `content_origin` is not set, the `distribution.base_url` will be
defined with the relative path and the curl command in the test
script will fail to run because of the missing hostname/address.

ref: pulp/pulpcore#6175
  • Loading branch information
git-hyagi authored and ggainey committed Jan 20, 2025
1 parent e12f411 commit 466f1eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/scripts/pulp_file/test_distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ fi
expect_succ pulp file distribution list --base-path "cli_test_file_distro"
test "$(echo "$OUTPUT" | jq -r length)" -eq 1
base_url="$(echo "$OUTPUT" | jq -r .[0].base_url)"

# if base_url starts with "/" (relative path) we need to prepend it with the server address
if [[ $base_url == /* ]]
then
base_url="http://localhost:8080${base_url}"
fi

expect_succ pulp file distribution list --base-path-contains "CLI"
test "$(echo "$OUTPUT" | jq -r length)" -gt 0

Expand Down

0 comments on commit 466f1eb

Please sign in to comment.