From 098e3a2f8fcf17877d00641d58fa3ffeb34e7988 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 3 Aug 2015 10:23:14 +0300 Subject: [PATCH] zdtm: replace sockets03 on socket_dgram_data They should do mostly the same, but the first one checks nothing after c/r. v2: remove sockets03 from Makefile Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- test/zdtm.sh | 2 +- test/zdtm/live/static/Makefile | 1 - test/zdtm/live/static/sockets03.c | 122 ------------------------------ 3 files changed, 1 insertion(+), 124 deletions(-) delete mode 100644 test/zdtm/live/static/sockets03.c diff --git a/test/zdtm.sh b/test/zdtm.sh index 130ef0195..004acfda2 100755 --- a/test/zdtm.sh +++ b/test/zdtm.sh @@ -67,11 +67,11 @@ generate_test_list() static/sockets00 static/sockets01 static/sockets02 - static/sockets03 static/sock_opts00 static/sock_opts01 static/sockets_spair static/sockets_dgram + static/socket_dgram_data static/socket_queues static/deleted_unix_sock static/sk-unix-unconn diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile index 46a4a86a1..c57308802 100644 --- a/test/zdtm/live/static/Makefile +++ b/test/zdtm/live/static/Makefile @@ -56,7 +56,6 @@ TST_NOFILE = \ pstree \ sockets01 \ sockets02 \ - sockets03 \ sockets_spair \ socket_queues \ socket_queues02 \ diff --git a/test/zdtm/live/static/sockets03.c b/test/zdtm/live/static/sockets03.c deleted file mode 100644 index b81ae4671..000000000 --- a/test/zdtm/live/static/sockets03.c +++ /dev/null @@ -1,122 +0,0 @@ -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "zdtmtst.h" - -const char *test_doc = "Test that we only send one copy of the queue to a dgram socket"; -const char *test_author = "Tycho Andersen \n"; - -/* - * /tmp here because as in sockets_dgram, some environments can't handle more - * than 108 characters for this path. - */ -#define CLIENT1_PATH "/tmp/client1" -#define CLIENT2_PATH "/tmp/client2" -#define SERVER_PATH "/tmp/server" - -int main(int argc, char *argv[]) -{ - int server, client, ret = 1, i; - struct sockaddr_un name; - pid_t pid = 0; - - test_init(argc, argv); - - name.sun_family = AF_UNIX; - server = socket(AF_UNIX, SOCK_DGRAM, 0); - if (server < 0) { - err("socket"); - goto out; - } - - strcpy(name.sun_path, SERVER_PATH); - if (bind(server, &name, sizeof(name)) < 0) { - err("bind"); - goto out; - } - - pid = fork(); - if (pid < 0) { - err("fork"); - goto out; - } - - client = socket(AF_UNIX, SOCK_DGRAM, 0); - if (client < 0) { - err("client socket"); - goto out; - } - - if (pid == 0) { - strcpy(name.sun_path, CLIENT1_PATH); - if (bind(client, &name, sizeof(name)) < 0) { - err("client bind"); - exit(1); - } - - strcpy(name.sun_path, SERVER_PATH); - if (connect(client, &name, sizeof(name)) < 0) { - err("connect"); - exit(1); - } - - if (write(client, "child-send", 10) != 10) { - err("write"); - exit(1); - } - while (1) - sleep(1000); - } - - strcpy(name.sun_path, CLIENT2_PATH); - if (bind(client, &name, sizeof(name)) < 0) { - err("client bind"); - goto out; - } - - strcpy(name.sun_path, SERVER_PATH); - if (connect(client, &name, sizeof(name)) < 0) { - err("connect"); - goto out; - } - - for (i = 0; i < 9; i++) { - /* - * fill the send queue with the other process; 9 messages - * because the default for sysctl.max_dgram_qlen is 10 on most - * systems, and we already sent one above. - */ - if (write(client, "parent-send", 11) != 11) { - err("write"); - goto out; - } - } - - test_daemon(); - test_waitsig(); - - pass(); - - ret = 0; - -out: - if (pid > 0) - kill(pid, SIGKILL); - unlink(CLIENT1_PATH); - unlink(CLIENT2_PATH); - unlink(SERVER_PATH); - - return ret; -}