From 7005e51027e2e7db47086fe008f0afc7c8b029aa Mon Sep 17 00:00:00 2001 From: Grant Gainey Date: Thu, 18 May 2023 14:05:14 -0400 Subject: [PATCH] Fixed tests that break in domain-enabled environments. fixes #692. --- CHANGES/692.bugfix | 2 ++ tests/scripts/pulp_file/test_acs.sh | 2 +- tests/scripts/pulp_file/test_remote.sh | 2 +- tests/scripts/pulp_rpm/test_acs.sh | 2 +- tests/scripts/pulp_rpm/test_rpm_sync_publish.sh | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 CHANGES/692.bugfix diff --git a/CHANGES/692.bugfix b/CHANGES/692.bugfix new file mode 100644 index 000000000..bf3a5e771 --- /dev/null +++ b/CHANGES/692.bugfix @@ -0,0 +1,2 @@ +Fixed some tests that made assumptions that worked, but were nonetheless incorrect. + diff --git a/tests/scripts/pulp_file/test_acs.sh b/tests/scripts/pulp_file/test_acs.sh index a0788bad8..d2f00a3f6 100755 --- a/tests/scripts/pulp_file/test_acs.sh +++ b/tests/scripts/pulp_file/test_acs.sh @@ -38,7 +38,7 @@ test "$(echo "$OUTPUT" | jq ".paths | length")" -eq 2 # test refresh expect_succ pulp --background file acs refresh --acs $acs -task_group=$(echo "$ERROUTPUT" | grep -E -o "${PULP_API_ROOT}([-_a-zA-Z0-9]+/)?api/v3/task-groups/[-[:xdigit:]]*/") +task_group=$(echo "$ERROUTPUT" | grep -E -o "/.*/api/v3/task-groups/[-[:xdigit:]]*/") expect_succ pulp task-group show --href "$task_group" --wait group_task_uuid="${task_group%/}" diff --git a/tests/scripts/pulp_file/test_remote.sh b/tests/scripts/pulp_file/test_remote.sh index 7fe94d0e2..eaa07f33c 100755 --- a/tests/scripts/pulp_file/test_remote.sh +++ b/tests/scripts/pulp_file/test_remote.sh @@ -17,7 +17,7 @@ expect_succ pulp file remote show --remote "cli_test_file_remote" HREF="$(echo "$OUTPUT" | jq -r '.pulp_href')" test "$(echo "$OUTPUT" | jq -r '.proxy_url')" = "http://proxy.org" test "$(echo "$OUTPUT" | jq -r '.max_retries')" = "5" -test "$(echo "$OUTPUT" | jq -r '.total_timeout')" = "32" +test "$(echo "$OUTPUT" | jq -r '.total_timeout')" = "32.0" # total_timeout is a float expect_succ pulp file remote update --remote "$HREF" --proxy-url "" --proxy-username "" --proxy-password "" --max-retries "" --total-timeout "" expect_succ pulp file remote list --name-contains "li_test_file_remot" test "$(echo "$OUTPUT" | jq -r '.[0].proxy_url')" = "null" diff --git a/tests/scripts/pulp_rpm/test_acs.sh b/tests/scripts/pulp_rpm/test_acs.sh index 66c6383cc..8899f1770 100755 --- a/tests/scripts/pulp_rpm/test_acs.sh +++ b/tests/scripts/pulp_rpm/test_acs.sh @@ -38,7 +38,7 @@ test "$(echo "$OUTPUT" | jq ".paths | length")" -eq 2 # test refresh expect_succ pulp rpm acs refresh --acs $acs -task_group=$(echo "$ERROUTPUT" | grep -E -o "${PULP_API_ROOT}api/v3/task-groups/[-[:xdigit:]]*/") +task_group=$(echo "$ERROUTPUT" | grep -E -o "/.*/api/v3/task-groups/[-[:xdigit:]]*/") expect_succ pulp task-group show --href "$task_group" test "$(echo "$OUTPUT" | jq ".tasks | length")" -eq 2 diff --git a/tests/scripts/pulp_rpm/test_rpm_sync_publish.sh b/tests/scripts/pulp_rpm/test_rpm_sync_publish.sh index e4d6b23ba..620d01cd1 100755 --- a/tests/scripts/pulp_rpm/test_rpm_sync_publish.sh +++ b/tests/scripts/pulp_rpm/test_rpm_sync_publish.sh @@ -48,8 +48,8 @@ PUBLICATION_VER_HREF=$(echo "$OUTPUT" | jq -r .pulp_href) expect_succ pulp rpm distribution create --name "cli_test_rpm_distro" \ --base-path "cli_test_rpm_distro" \ --publication "$PUBLICATION_HREF" - -expect_succ curl "$curl_opt" --head --fail "$PULP_BASE_URL/pulp/content/cli_test_rpm_distro/config.repo" +DISTRIBUTION_BASE_URL=$(echo "$OUTPUT" | jq -r .base_url) +expect_succ curl "$curl_opt" --head --fail "${DISTRIBUTION_BASE_URL}config.repo" expect_succ pulp rpm repository version list --repository "cli_test_rpm_repository" expect_succ pulp rpm repository version repair --repository "cli_test_rpm_repository" --version 1