path: root/tools/testing/vsock/util.h
diff options
authorStefano Garzarella <sgarzare@redhat.com>2019-12-18 19:07:05 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-20 21:09:21 -0800
commit770ce0078cbf97262e86c9cc210684ce3b4266f5 (patch)
tree85e0eea8ad26fec89991c34184144bd5ae8bbf73 /tools/testing/vsock/util.h
parentVSOCK: add AF_VSOCK test cases (diff)
vsock_test: wait for the remote to close the connection
Before check if a send returns -EPIPE, we need to make sure the connection is closed. To do that, we use epoll API to wait EPOLLRDHUP or EPOLLHUP events on the socket. Reported-by: Jorgen Hansen <jhansen@vmware.com> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/vsock/util.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h
index 4df12e4b5ebe..331e945f3ae6 100644
--- a/tools/testing/vsock/util.h
+++ b/tools/testing/vsock/util.h
@@ -36,6 +36,7 @@ unsigned int parse_cid(const char *str);
int vsock_stream_connect(unsigned int cid, unsigned int port);
int vsock_stream_accept(unsigned int cid, unsigned int port,
struct sockaddr_vm *clientaddrp);
+void vsock_wait_remote_close(int fd);
void send_byte(int fd, int expected_ret, int flags);
void recv_byte(int fd, int expected_ret, int flags);
void run_tests(const struct test_case *test_cases,