Last active
December 6, 2018 12:29
-
-
Save bofm/677de0b543a071bab68bf77d070d6c3a to your computer and use it in GitHub Desktop.
consul-template dedup test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Running consul... | |
------------ CONSUL KEYS BEFORE ------------- | |
--------------------------------------------- | |
#### Running 10 consul-template instances with different templates... | |
#### Killing all consul-template instances with SIGTERM signal... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
Cleaning up... | |
------------ CONSUL KEYS 5s AFTER CT SIGTERM ---------- | |
consul-template/dedup/0fcd9701c9cb28a6375f5f53a1577bf4/data | |
consul-template/dedup/13b480604c2c493b8da89e442d25e537/data | |
consul-template/dedup/13b480604c2c493b8da89e442d25e537/lock | |
consul-template/dedup/358eac03dac8061944c4426726f89c81/data | |
consul-template/dedup/358eac03dac8061944c4426726f89c81/lock | |
consul-template/dedup/541d4ec9f2ff806f1966a4ef1cea5445/data | |
consul-template/dedup/5eda753ec260f3adc77434795661495d/data | |
consul-template/dedup/5eda753ec260f3adc77434795661495d/lock | |
consul-template/dedup/642a563a08c3846c94e9dc330e4f567d/data | |
consul-template/dedup/8a60476666203be6d7ea9abe573a8e71/data | |
consul-template/dedup/9ab87531cf83f93a888b9f870ba839be/data | |
consul-template/dedup/c1f7b79ba4e52bbe0b777dcad43b7cc1/data | |
consul-template/dedup/e5c8dfe0ddd89506499562e98d6532cf/data | |
consul-template/dedup/e5c8dfe0ddd89506499562e98d6532cf/lock | |
----------------------------------------------------- | |
------------ CONSUL KEYS 30s AFTER CT SIGTERM --------- | |
consul-template/dedup/0fcd9701c9cb28a6375f5f53a1577bf4/data | |
consul-template/dedup/13b480604c2c493b8da89e442d25e537/data | |
consul-template/dedup/13b480604c2c493b8da89e442d25e537/lock | |
consul-template/dedup/358eac03dac8061944c4426726f89c81/data | |
consul-template/dedup/358eac03dac8061944c4426726f89c81/lock | |
consul-template/dedup/541d4ec9f2ff806f1966a4ef1cea5445/data | |
consul-template/dedup/5eda753ec260f3adc77434795661495d/data | |
consul-template/dedup/5eda753ec260f3adc77434795661495d/lock | |
consul-template/dedup/642a563a08c3846c94e9dc330e4f567d/data | |
consul-template/dedup/8a60476666203be6d7ea9abe573a8e71/data | |
consul-template/dedup/9ab87531cf83f93a888b9f870ba839be/data | |
consul-template/dedup/c1f7b79ba4e52bbe0b777dcad43b7cc1/data | |
consul-template/dedup/e5c8dfe0ddd89506499562e98d6532cf/data | |
consul-template/dedup/e5c8dfe0ddd89506499562e98d6532cf/lock | |
----------------------------------------------------- | |
#### Cleanup ... | |
./test.sh: line 16: 85696 Killed: 9 consul agent -server -bootstrap -data-dir "$PWD/test_consul_data" -bind 127.0.0.1 -ui >&consul.log | |
#### Running consul... | |
------------ CONSUL KEYS BEFORE ------------- | |
--------------------------------------------- | |
#### Running 10 consul-template instances with different templates... | |
#### Killing all consul-template instances with SIGKILL signal... | |
./test.sh: line 16: 85748 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85750 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85752 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85754 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85756 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85758 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85760 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85762 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85764 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
./test.sh: line 16: 85766 Killed: 9 consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" | |
------------ CONSUL KEYS 5s AFTER CT SIGKILL ---------- | |
consul-template/dedup/11d8a771893de0a94cd5abba78201958/data | |
consul-template/dedup/11d8a771893de0a94cd5abba78201958/lock | |
consul-template/dedup/248888727f8f8b8edb5de5bfd8a8fe0b/data | |
consul-template/dedup/248888727f8f8b8edb5de5bfd8a8fe0b/lock | |
consul-template/dedup/533eac948287e7100c9f066032358f4c/data | |
consul-template/dedup/533eac948287e7100c9f066032358f4c/lock | |
consul-template/dedup/781c5a997d801b6d18f492e032b252b5/data | |
consul-template/dedup/781c5a997d801b6d18f492e032b252b5/lock | |
consul-template/dedup/821282888a0537a0c08382ca597b78fe/data | |
consul-template/dedup/821282888a0537a0c08382ca597b78fe/lock | |
consul-template/dedup/9ca62f962c53560714103e40c6aa5c34/data | |
consul-template/dedup/9ca62f962c53560714103e40c6aa5c34/lock | |
consul-template/dedup/ac6a1f3ad345cede26b2ed9aaacc80ef/data | |
consul-template/dedup/ac6a1f3ad345cede26b2ed9aaacc80ef/lock | |
consul-template/dedup/b54c8fa565616afff003dd1124dcd6fa/data | |
consul-template/dedup/b54c8fa565616afff003dd1124dcd6fa/lock | |
consul-template/dedup/e03e55cb7218d1137e92f6ffd0769777/data | |
consul-template/dedup/e03e55cb7218d1137e92f6ffd0769777/lock | |
consul-template/dedup/f22ad0b4909b681dddb807ac58e60fe5/data | |
consul-template/dedup/f22ad0b4909b681dddb807ac58e60fe5/lock | |
----------------------------------------------------- | |
------------ CONSUL KEYS 30s AFTER CT SIGKILL --------- | |
consul-template/dedup/11d8a771893de0a94cd5abba78201958/data | |
consul-template/dedup/248888727f8f8b8edb5de5bfd8a8fe0b/data | |
consul-template/dedup/533eac948287e7100c9f066032358f4c/data | |
consul-template/dedup/781c5a997d801b6d18f492e032b252b5/data | |
consul-template/dedup/821282888a0537a0c08382ca597b78fe/data | |
consul-template/dedup/9ca62f962c53560714103e40c6aa5c34/data | |
consul-template/dedup/ac6a1f3ad345cede26b2ed9aaacc80ef/data | |
consul-template/dedup/b54c8fa565616afff003dd1124dcd6fa/data | |
consul-template/dedup/e03e55cb7218d1137e92f6ffd0769777/data | |
consul-template/dedup/f22ad0b4909b681dddb807ac58e60fe5/data | |
----------------------------------------------------- | |
#### Cleanup ... | |
./test.sh: line 16: 85738 Killed: 9 consul agent -server -bootstrap -data-dir "$PWD/test_consul_data" -bind 127.0.0.1 -ui >&consul.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Euo pipefail | |
killall -9 consul consul-template &> /dev/null | |
rm -rf test_consul_data || : | |
trap 'killall -9 consul consul-template ||:; rm -rf test_consul_data' EXIT | |
do_test() { | |
local SIG="$1" | |
echo "#### Running consul..." | |
consul agent -server -bootstrap -data-dir "$PWD/test_consul_data" -bind 127.0.0.1 -ui &> consul.log & | |
sleep 5 | |
list_kv() { | |
consul kv export consul-template \ | |
| grep -oE 'consul-template/[^\"]+' \ | |
| sort | |
} | |
echo "------------ CONSUL KEYS BEFORE -------------" | |
list_kv | |
echo "---------------------------------------------" | |
echo "#### Running 10 consul-template instances with different templates..." | |
for i in {1..10}; do | |
cat <<EOF > "template$i.ctmpl" | |
{{ keyOrDefault "$RANDOM" "$RANDOM" }} | |
EOF | |
consul-template -kill-signal=SIGTERM -template "$PWD/template$i.ctmpl:$PWD/template$i" -dedup 2>&1 > "ct$i.log" & | |
done | |
sleep 10 | |
echo "#### Killing all consul-template instances with $SIG signal..." | |
killall "-$SIG" consul-template | |
sleep 5 | |
echo "------------ CONSUL KEYS 5s AFTER CT $SIG ----------" | |
list_kv | |
echo "-----------------------------------------------------" | |
sleep 25 | |
echo "------------ CONSUL KEYS 30s AFTER CT $SIG ---------" | |
list_kv | |
echo "-----------------------------------------------------" | |
echo "#### Cleanup ..." | |
killall -9 consul consul-template &> /dev/null | |
rm -rf test_consul_data || : | |
} | |
do_test SIGTERM | |
do_test SIGKILL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hashicorp/consul-template#1158