As it turned out thanks to Yan Yang some ONAP services tend to
return a propr JDWP handshake as a part of their error message.
Let's filter out those services by checking number of lines returned
by the server. We expect that proper JDWP handshake won't be longer
than a single line.
Issue-ID: SECCOM-231
Change-Id: I4b8950ebdf5fe118ec5f2dd5f4de583211784fb2
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
# 10s timeout to avoid hangs when service doesn't answer at all
local response=`nc -w 10 $ip $port <<<$jdwp_challenge | tr '\0' '\n'`
- if [[ $response == *"$jdwp_response"* ]]; then
+ local n_response_lines=`echo "$response" | wc -l`
+ if [[ "$n_response_lines" -le 1 ]] && [[ $response == *"$jdwp_response"* ]]; then
return 0
fi