add tests, 05 is broken

This commit is contained in:
gitGnome
2026-03-30 10:42:11 +02:00
parent c5fc74d142
commit 9fb5f952c5
12 changed files with 280 additions and 6 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# Create a group as user1
source "$(dirname "$0")/config.sh"
TOKEN1=$(load_state "TOKEN1")
if [[ -z "$TOKEN1" ]]; then
echo "ERROR: No token found. Run 02_login.sh first."
exit 1
fi
echo "=== Creating group: $GROUP_NAME ==="
# Pipe curl directly to od to avoid null bytes being lost in bash variables
GROUP_ID=$(curl -s -X POST "$BASE_URL/new/group" \
-d "token=$TOKEN1" \
-d "name=$GROUP_NAME" \
-d "color=$GROUP_COLOR" \
| od -An -tu4 -N4 --endian=big | tr -d ' ')
echo "Group ID: $GROUP_ID"
save_state "GROUP_ID" "$GROUP_ID"