From 11aa6020976e2609c718e16060e01e656022c152 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 25 Aug 2024 15:02:28 +0200 Subject: [PATCH] curl tests: fix tests during upgrade from older versions --- lib/tests.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/tests.sh b/lib/tests.sh index 46d5dc3..dec8734 100644 --- a/lib/tests.sh +++ b/lib/tests.sh @@ -238,8 +238,14 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () { log_small_title "Validating that the app $app_id_to_check can/can't be accessed with its URL..." - - python3 -c "import toml, sys; t = toml.loads(sys.stdin.read()); print(toml.dumps(t['default'].get('curl_tests', {})))" < $package_path/tests.toml > $TEST_CONTEXT/curl_tests.toml + if [ -e "$package_path/tests.toml" ] + then + local current_test_serie=$(jq -r '.test_serie' $testfile) + python3 -c "import toml, sys; t = toml.loads(sys.stdin.read()); print(toml.dumps(t['$current_test_serie'].get('curl_tests', {})))" < "$package_path/tests.toml" > $TEST_CONTEXT/curl_tests.toml + # Upgrade from older versions may still be in packaging v1 without a tests.toml + else + echo "" > $TEST_CONTEXT/curl_tests.toml + fi DOMAIN="$DOMAIN" \ SUBDOMAIN="$SUBDOMAIN" \