8b4a23f115
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>