Skip to content

Commit

Permalink
Fix demo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Feb 19, 2019
1 parent 7a63448 commit 3af05fc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/demo/add-events
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
echo 'Add multiple events...'
go build -o qed ../..
for i in $(seq 0 9); do
./qed -k pepe client add --key $i --value $i -l info
./qed -k test_key client add --key $i --value $i -l info
done
rm -f qed
echo done.
9 changes: 6 additions & 3 deletions tests/demo/incremental-proof
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
# limitations under the License.

case "$1" in
0)
leader)
endpoint=http://localhost:8800
;;
1)
follower1)
endpoint=http://localhost:8081
endpoint=http://localhost:8801
;;
2)
follower2)
endpoint=http://localhost:8082
endpoint=http://localhost:8802
;;
*)
echo "usage: $0 <leader|follower1|follower2>"
Expand All @@ -31,7 +34,7 @@ case "$1" in
esac

go run ../../main.go \
-k pepe \
-k test_key \
client \
--endpoint "$endpoint" \
incremental \
Expand Down
2 changes: 1 addition & 1 deletion tests/demo/query-membership
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case "$1" in
esac

go run ../../main.go \
-k pepe \
-k test_key \
client \
--endpoint "$endpoint" \
membership \
Expand Down
13 changes: 12 additions & 1 deletion tests/demo/start-follower1
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@
# limitations under the License.

echo 'Starting follower #1...'
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8081 --join-addr :8700 --raft-addr :9001 --mgmt-addr :8091 --node-id follower1
go run ../../main.go start \
-k test_key \
-p $(mktemp -d /var/tmp/demo.XXX) \
--keypath /var/tmp/id_ed25519 \
-l debug \
--http-addr :8801 \
--mgmt-addr :8701 \
--metrics-addr :8601 \
--raft-addr :8501 \
--gossip-addr :8401 \
--join-addr :8700 \
--node-id follower1
echo done.
13 changes: 12 additions & 1 deletion tests/demo/start-follower2
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@
# limitations under the License.

echo 'Starting follower #2...'
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8082 --join-addr :8700 --raft-addr :9002 --mgmt-addr :8092 --node-id follower2
go run ../../main.go start \
-k test_key \
-p $(mktemp -d /var/tmp/demo.XXX) \
--raftpath /var/tmp/id_ed25519 \
-l debug \
--http-addr :8802 \
--mgmt-addr :8702 \
--metrics-addr :8602 \
--raft-addr :8502 \
--gossip-addr :8402 \
--join-addr :8700 \
--node-id follower2
echo done.
11 changes: 10 additions & 1 deletion tests/demo/start-leader
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@
echo Create id_ed25519 key
ssh-keygen -t ed25519 -N '' -f /var/tmp/id_ed25519

tdir=$(mktemp -d /var/tmp/demo.XXX)

echo 'Starting leader...'
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8800 --raft-addr :8500 --mgmt-addr :8700
go run ../../main.go start \
-k test_key \
-p ${tdir} \
--keypath /var/tmp/id_ed25519 \
-l debug \
--http-addr :8800 \
--raft-addr :8500 \
--mgmt-addr :8700
echo done.

echo Cleanup...
Expand Down

0 comments on commit 3af05fc

Please sign in to comment.