From b89e2dcd3cce936fadcbdd7a59f0e643cd4dde6e Mon Sep 17 00:00:00 2001 From: James Shubin Date: Thu, 17 Jan 2019 19:18:05 -0500 Subject: [PATCH] test: Add a three host variant of the empty etcd test --- test/shell/etcd-three-hosts.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 test/shell/etcd-three-hosts.sh diff --git a/test/shell/etcd-three-hosts.sh b/test/shell/etcd-three-hosts.sh new file mode 100755 index 00000000..e73f5553 --- /dev/null +++ b/test/shell/etcd-three-hosts.sh @@ -0,0 +1,33 @@ +#!/bin/bash -e + +# run empty graphs, we're just testing etcd clustering +$timeout --kill-after=210s 180s "$MGMT" run --hostname h1 --tmp-prefix empty & +pid1=$! +sleep 15s # let it startup + +$timeout --kill-after=210s 180s "$MGMT" run --hostname h2 --seeds http://127.0.0.1:2379 --client-urls http://127.0.0.1:2381 --server-urls http://127.0.0.1:2382 --tmp-prefix empty & +pid2=$! +sleep 15s + +$timeout --kill-after=210s 180s "$MGMT" run --hostname h3 --seeds http://127.0.0.1:2379 --client-urls http://127.0.0.1:2383 --server-urls http://127.0.0.1:2384 --tmp-prefix empty & +pid3=$! +sleep 15s + +$(sleep 15s && kill -SIGINT $pid3)& # send ^C to exit 3rd mgmt +wait $pid3 +e=$? +if [ $e -ne 0 ]; then + exit $e +fi + +$(sleep 15s && kill -SIGINT $pid2)& # send ^C to exit 2nd mgmt +wait $pid2 +e=$? +if [ $e -ne 0 ]; then + exit $e +fi + +$(sleep 15s && kill -SIGINT $pid1)& # send ^C to exit 1st mgmt +wait $pid1 # get exit status +# if pid1 exits because of a timeout, then it blocked, and this is a bug! +exit $?