Skip to content

Commit 466f1eb

Browse files
git-hyagiggainey
authored andcommitted
Update base_url in test if content_origin is null
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
1 parent e12f411 commit 466f1eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/scripts/pulp_file/test_distribution.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ fi
5959
expect_succ pulp file distribution list --base-path "cli_test_file_distro"
6060
test "$(echo "$OUTPUT" | jq -r length)" -eq 1
6161
base_url="$(echo "$OUTPUT" | jq -r .[0].base_url)"
62+
63+
# if base_url starts with "/" (relative path) we need to prepend it with the server address
64+
if [[ $base_url == /* ]]
65+
then
66+
base_url="http://localhost:8080${base_url}"
67+
fi
68+
6269
expect_succ pulp file distribution list --base-path-contains "CLI"
6370
test "$(echo "$OUTPUT" | jq -r length)" -gt 0
6471

0 commit comments

Comments
 (0)