Move reachability test from starting instances to dna protocol tests

This commit is contained in:
Jeremy Lakeman 2012-07-18 19:35:47 +09:30
parent 7678ce8915
commit be857316dc
2 changed files with 14 additions and 2 deletions

View File

@ -487,7 +487,7 @@ instances_see_each_other() {
[ $I = $J ] && continue
local logvar=LOG${I#+}
local sidvar=SID${J#+}
if ! grep "PEER REACHABLE, sid=${!sidvar}" "${!logvar}"; then
if ! grep "ADD OVERLAY NODE sid=${!sidvar}" "${!logvar}"; then
return 1
fi
done

View File

@ -21,11 +21,23 @@
source "${0%/*}/../testframework.sh"
source "${0%/*}/../testdefs.sh"
is_reachable() {
local sidvar=SID${1#+}
if ! grep "PEER REACHABLE, sid=${!sidvar}" "$instance_servald_log"; then
return 1
fi
echo "PEER REACHABLE, sid=${!sidvar} from $SID"
return 0
}
setup() {
setup_servald
assert_no_servald_processes
start_servald_instances +A +B
set_instance +B
wait_until --sleep=0.25 is_reachable +A
set_instance +A
wait_until --sleep=0.25 is_reachable +B
}
teardown() {
@ -47,7 +59,7 @@ configure_servald_server() {
executeOk_servald config set debug.mdprequests Yes
}
doc_MultiServer="Start three servald servers with dummy interface"
doc_MultiServer="Start three servald servers with dummy interfaces"
setup_MultiServer() {
setup_servald
assert_no_servald_processes