Add full integration test with real Technitium DNS server
- Add docker-compose.integration.yml with Technitium + DDNS services - Add full-integration-test.sh for end-to-end testing - Add technitium-init.sh for automated zone/token setup - Add comprehensive logging to DNS client - Test creates real DNS records and verifies them in Technitium - 8/9 tests passing with real DNS integration
This commit is contained in:
42
tests/integration/technitium-init.sh
Executable file
42
tests/integration/technitium-init.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Wait for Technitium to be ready
|
||||
echo "Waiting for Technitium DNS to start..."
|
||||
while ! wget -q --spider http://localhost:5380/ 2>/dev/null; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "Technitium is up, configuring..."
|
||||
|
||||
# Login and get session
|
||||
curl -s -X POST http://localhost:5380/api/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"admin","password":"admin123"}' > /tmp/login.json
|
||||
|
||||
if [ ! -f /tmp/login.json ]; then
|
||||
echo "Failed to login to Technitium"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the zone 'space.test.rip'
|
||||
echo "Creating zone space.test.rip..."
|
||||
curl -s -X POST http://localhost:5380/api/zones/create \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"zone": "space.test.rip",
|
||||
"type": "Primary"
|
||||
}'
|
||||
|
||||
echo ""
|
||||
|
||||
# Create API token for DDNS service
|
||||
echo "Creating API token..."
|
||||
curl -s -X POST http://localhost:5380/api/user/createApiToken \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"username": "admin",
|
||||
"tokenName": "ddns-bridge",
|
||||
"token": "dns-api-token-12345"
|
||||
}'
|
||||
|
||||
echo ""
|
||||
echo "Technitium initialization complete!"
|
||||
Reference in New Issue
Block a user