zdtm: socket_udp_shutdown: Make the test fail instead of timing out.

When -- after restore -- sockets can't communicate, the test times out
while waiting on recvfrom(). Since the communication is local, send()
works instantaneously - so mark sockets with SOCK_NONBLOCK and report
failure if the message is not received immediately.

Signed-off-by: Michał Mirosław <emmir@google.com>
This commit is contained in:
Michał Mirosław 2023-05-31 15:31:10 +02:00 committed by Andrei Vagin
parent 87c42d5d14
commit a056519dae

View file

@ -28,8 +28,8 @@ int main(int argc, char **argv)
test_init(argc, argv);
sk1 = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
sk2 = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
sk1 = socket(PF_INET, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP);
sk2 = socket(PF_INET, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP);
if (sk1 < 0 || sk2 < 0) {
pr_perror("Can't create socket");
exit(1);