mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 11:04:35 +00:00
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:
parent
87c42d5d14
commit
a056519dae
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue