mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-08 03:24:13 +00:00
Move functions from testdefs.sh to testdefs_rhizome.sh
... where they should have been in the first place. Also, clean up the RHIZOME HTTP SERVER START log message. Issue #9.
This commit is contained in:
parent
f93e32b4bc
commit
41680ff663
@ -199,7 +199,7 @@ error:
|
||||
return WHY("Failed to start rhizome HTTP server");
|
||||
|
||||
success:
|
||||
INFOF("RHIZOME HTTP SERVER, START port=%d, fd=%d", port, rhizome_server_socket);
|
||||
INFOF("RHIZOME HTTP SERVER, START port=%d fd=%d", port, rhizome_server_socket);
|
||||
rhizome_http_server_port = port;
|
||||
/* Add Rhizome HTTPd server to list of file descriptors to watch */
|
||||
server_alarm.function = rhizome_server_poll;
|
||||
|
17
testdefs.sh
17
testdefs.sh
@ -509,20 +509,3 @@ instances_see_each_other() {
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
rhizome_http_server_started() {
|
||||
local logvar=LOG${1#+}
|
||||
grep 'RHIZOME HTTP SERVER,.*START.*port=[0-9]' "${!logvar}"
|
||||
}
|
||||
|
||||
get_rhizome_server_port() {
|
||||
local _var="$1"
|
||||
local _logvar=LOG${2#+}
|
||||
local _port=$(sed -n -e '/.*RHIZOME HTTP SERVER.*START/{s/.*port=\([0-9]\{1,\}\).*/\1/p;q}' "${!_logvar}")
|
||||
assert --message="instance $2 Rhizome HTTP server port number is known" [ -n "$_port" ]
|
||||
if [ -n "$_var" ]; then
|
||||
eval "$_var=\$_port"
|
||||
tfw_log "$_var=$_port"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
@ -257,3 +257,20 @@ compute_filehash() {
|
||||
[ "${#_hash}" -eq 128 ] || error "file hash incorrect length: $_hash"
|
||||
[ -n "$_var" ] && eval $_var="$_hash"
|
||||
}
|
||||
|
||||
rhizome_http_server_started() {
|
||||
local logvar=LOG${1#+}
|
||||
grep 'RHIZOME HTTP SERVER,.*START.*port=[0-9]' "${!logvar}"
|
||||
}
|
||||
|
||||
get_rhizome_server_port() {
|
||||
local _var="$1"
|
||||
local _logvar=LOG${2#+}
|
||||
local _port=$(sed -n -e '/.*RHIZOME HTTP SERVER.*START/{s/.*port=\([0-9]\{1,\}\).*/\1/p;q}' "${!_logvar}")
|
||||
assert --message="instance $2 Rhizome HTTP server port number is known" [ -n "$_port" ]
|
||||
if [ -n "$_var" ]; then
|
||||
eval "$_var=\$_port"
|
||||
tfw_log "$_var=$_port"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user