Observer smoke tests

This commit is contained in:
Adam Harrison committed 2016-03-03 17:48:50 +00:00
1 parent b84ef98de8
commit 268d355cae
2 files changed
+43

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#! /bin/bash
. ./config.sh
start_suite "Observers can't vote"
# Start network that doesn't have enough peers for consensus
weave_on $HOST1 launch --init-peer-count=2
weave_on $HOST2 launch --observer $HOST1
# Check that an allocation times out
assert_raises "timeout 2 cat <( start_container $HOST1 )" 124
# Add another elector
weave_on $HOST3 launch --init-peer-count=2 $HOST2
# Check allocation succeeds
assert_raises "timeout 10 cat <( start_container $HOST1 )"
end_suite
+23
View File
@@ -0,0 +1,23 @@
#! /bin/bash
. ./config.sh
start_suite "Observers can call election"
# Start network with sufficient voters for consensus
weave_on $HOST1 launch --init-peer-count=2
weave_on $HOST2 launch --init-peer-count=2 $HOST1
# Add an observer
weave_on $HOST3 launch --observer $HOST2
# Wait for network to settle; ensure IPAM is idle (blank output = no consensus)
sleep 5
assert "weave_on $HOST1 status ipam" ""
assert "weave_on $HOST2 status ipam" ""
assert "weave_on $HOST3 status ipam" ""
# Check allocation succeeds on observer
assert_raises "timeout 10 cat <( start_container $HOST3 )"
end_suite