Implement the tor_family_identity resource
This commit is contained in:
parent
0951242b32
commit
ec57a47ba2
22 changed files with 558 additions and 67 deletions
34
e2e-tests/tor-family/test.sh
Executable file
34
e2e-tests/tor-family/test.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env sh
|
||||
set -e
|
||||
../setup.sh
|
||||
rm -f terraform.tfstate*
|
||||
./tf init
|
||||
./tf plan
|
||||
./tf apply -auto-approve
|
||||
|
||||
set +e
|
||||
|
||||
# Start tor and let it run for a few seconds
|
||||
echo "Starting Tor to verify family key..."
|
||||
timeout 5 tor -f ./torrc >tor.log 2>&1
|
||||
TOR_EXIT_CODE=$?
|
||||
|
||||
set -e
|
||||
|
||||
# Check if tor exited with an error (not due to timeout)
|
||||
# timeout returns 124 when it kills the process
|
||||
if [ $TOR_EXIT_CODE -ne 0 ] && [ $TOR_EXIT_CODE -ne 124 ]; then
|
||||
echo "ERROR: Tor exited with error code $TOR_EXIT_CODE"
|
||||
cat tor.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if tor started bootstrapping (indicates successful key loading)
|
||||
if grep -q "Bootstrapped [0-9]" tor.log; then
|
||||
echo "SUCCESS: Tor started bootstrapping with generated family key"
|
||||
exit 0
|
||||
else
|
||||
echo "ERROR: Tor did not start bootstrapping"
|
||||
cat tor.log
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue