Commit 528cbe37 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: check one end of socketpair with data (v2)

This test fails currently, because these data are not restored.

v2: remove the test from the execution list.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f9ae6d9d
......@@ -33,6 +33,7 @@ TST_NOFILE = \
socket6_udp \
socket_udplite \
socket_aio \
socket_close_data \
packet_sock \
packet_sock_mmap \
sock_filter \
......
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "zdtmtst.h"
const char *test_doc = "Check one end of socketpair with data";
const char *test_author = "Andrew Vagin <avagin@openvz.org";
#define MSG "hello"
int main(int argc, char **argv)
{
int sks[2], ret;
char buf[1024];
test_init(argc, argv);
if (socketpair(PF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0, sks) < 0) {
err("socketpair");
return 1;
}
if (write(sks[1], MSG, sizeof(MSG)) != sizeof(MSG)) {
err("write");
return 1;
}
close(sks[1]);
test_daemon();
test_waitsig();
ret = read(sks[0], buf, sizeof(MSG));
buf[ret > 0 ? ret : 0] = 0;
if (ret != sizeof(MSG)) {
fail("%d: %s", ret, buf);
return 1;
}
pass();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment