test/telemetry: fix error handling for socket
authorCiara Power <ciara.power@intel.com>
Tue, 13 Oct 2020 16:28:20 +0000 (17:28 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 19 Oct 2020 15:01:58 +0000 (17:01 +0200)
commit8b4a23f1152f921fb2de35b3474d9a738cf14b54
tree5e828fc316b39e01ff733f36d47bb909c3a23856
parent1e6a661302393e75c5c220ca3528a8cb2e3d2757
test/telemetry: fix error handling for socket

When the socket connection failed, an error was printed to screen but
the function did not return an error, and continued to try read from the
socket. This is now corrected to close the socket and return -1 when the
connection fails.

Fixes: bd78cf693ebd ("test/telemetry: add unit tests for data to JSON")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
app/test/test_telemetry_data.c