fix(tests): X-Test-Sub → X-Auth-Token во всех тест-скриптах, cleanup для test59.sh

This commit is contained in:
“Naeel”
2026-05-03 13:50:32 +04:00
parent a09291e208
commit f18508d2cb
8 changed files with 117 additions and 106 deletions
+12 -1
View File
@@ -1,10 +1,21 @@
#!/bin/bash
BASE="https://fission.kube5s.ru/console/api"
ROOT_DIR=$(cd "$(dirname "$0")" && pwd)
NS_CLEANUP_SCRIPT="${ROOT_DIR}/cleanup_test_namespaces.sh"
TEST_SUB="len59direct@test.local"
cleanup() {
if [ -x "$NS_CLEANUP_SCRIPT" ]; then
"$NS_CLEANUP_SCRIPT" "$TEST_SUB" >/dev/null 2>&1 || true
fi
}
trap cleanup EXIT
NAME59=$(python3 -c "print('a'*59)")
echo "Name len: ${#NAME59}"
echo "Pkg name would be: ${NAME59}-pkg (len=$(python3 -c "print(59+4)"))"
curl -s -w "\nHTTP:%{http_code}" -X POST "${BASE}/functions" \
-H "X-Test-Sub: len59direct@test.local" \
-H "X-Auth-Token: ${TEST_SUB}" \
-H "Content-Type: application/json" \
--data-raw "{\"name\":\"${NAME59}\",\"language\":\"nodejs\",\"code\":\"module.exports=async()=>42\"}"
echo