mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 01:42:18 +00:00
fixed "timeout from MDP server" errors in node info output.
added extra tests for node info.
This commit is contained in:
parent
a4d575d87a
commit
8977142a30
@ -1158,7 +1158,7 @@ int overlay_mdp_send(overlay_mdp_frame *mdp,int flags,int timeout_ms)
|
||||
mdp->packetTypeAndFlags=MDP_ERROR;
|
||||
mdp->error.error=1;
|
||||
snprintf(mdp->error.message,128,"Timeout waiting for reply to MDP packet (packet was successfully sent).");
|
||||
return WHY("Timeout waiting for server response");
|
||||
return -1; /* WHY("Timeout waiting for server response"); */
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,4 +126,44 @@ test_DNASpecificLookup() {
|
||||
assertStdoutGrep --matches=1 "^sid://$SIDB/5550001:5550001:Agent B Smith$"
|
||||
}
|
||||
|
||||
doc_DNANodeInfoLocalResolution="'node info' auto-resolves for local identities"
|
||||
setup_DNANodeInfoLocalResolution() {
|
||||
setup
|
||||
}
|
||||
test_DNANodeInfoLocalResolution() {
|
||||
setup_servald_instances
|
||||
set_instance A
|
||||
|
||||
# node info for a local identity returns DID/Name since it is free, even
|
||||
# if it isn't asked for.
|
||||
executeOk_servald node info $SIDA
|
||||
assertStdoutLineCount '==' 1
|
||||
assertStdoutGrep --matches=1 "Agent A Smith"
|
||||
assertStdoutGrep --matches=0 "did-not-resolved"
|
||||
}
|
||||
|
||||
doc_DNANodeInfoRemoteResolution="'node info' for remote identities"
|
||||
setup_DNANodeInfoRemoteResolution() {
|
||||
setup
|
||||
}
|
||||
test_DNANodeInfoRemoteResolution() {
|
||||
setup_servald_instances
|
||||
set_instance A
|
||||
|
||||
# if resolvedid is not specified for a remote identity, then don't resolve
|
||||
# it.
|
||||
executeOk_servald node info $SIDB
|
||||
assertStdoutLineCount '==' 1
|
||||
assertStdoutGrep --matches=0 "Agent B Smith"
|
||||
assertStdoutGrep --matches=1 "did-not-resolved"
|
||||
|
||||
# But if it resolvedid is specified, then do resolve it using DNA
|
||||
executeOk_servald node info $SIDB resolvedid
|
||||
assertStdoutLineCount '==' 1
|
||||
assertStdoutGrep --matches=1 "Agent B Smith"
|
||||
assertStdoutGrep --matches=0 "did-not-resolved"
|
||||
|
||||
}
|
||||
|
||||
|
||||
runTests "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user