From 52408ba30c0d2babeab27eae9bf5e91b0d61c8cd Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 23 Nov 2024 18:24:33 -0800 Subject: Remove the ipc legacy test - everything is covered in the new suite. --- tests/CMakeLists.txt | 1 - tests/ipc.c | 79 ---------------------------------------------------- 2 files changed, 80 deletions(-) delete mode 100644 tests/ipc.c (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2fcc331e..a42dd23a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -129,7 +129,6 @@ add_nng_test(files 5) add_nng_test1(httpclient 60 NNG_SUPP_HTTP) add_nng_test1(httpserver 30 NNG_SUPP_HTTP) add_nng_test(inproc 5) -add_nng_test(ipc 5) add_nng_test(ipcsupp 10) add_nng_test(multistress 60) add_nng_test(nonblock 60) diff --git a/tests/ipc.c b/tests/ipc.c deleted file mode 100644 index 6ea0830c..00000000 --- a/tests/ipc.c +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright 2021 Staysail Systems, Inc. -// Copyright 2018 Capitar IT Group BV -// Copyright 2018 Devolutions -// -// This software is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// found online at https://opensource.org/licenses/MIT. -// - -#ifdef _WIN32 -#else -#include -#ifdef NNG_HAVE_GETPEERUCRED -#include -#endif -#endif - -#include -#include - -#include "convey.h" -#include "trantest.h" - -// IPC tests. -static int -check_props(nng_msg *msg) -{ - nng_pipe p; - size_t z; - nng_sockaddr la; - nng_sockaddr ra; - uint64_t id; - - p = nng_msg_get_pipe(msg); - So(nng_pipe_id(p) > 0); - So(nng_pipe_get_addr(p, NNG_OPT_LOCADDR, &la) == 0); - So(la.s_family == NNG_AF_IPC); - // untyped - So(nng_pipe_get_addr(p, NNG_OPT_REMADDR, &ra) == 0); - So(ra.s_family == NNG_AF_IPC); - - So(nng_pipe_get_size(p, NNG_OPT_REMADDR, &z) == NNG_EBADTYPE); - -#ifdef _WIN32 - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_UID, &id) == NNG_ENOTSUP); - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_GID, &id) == NNG_ENOTSUP); - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_ZONEID, &id) == - NNG_ENOTSUP); - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == 0); - So(id == GetCurrentProcessId()); -#else - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_UID, &id) == 0); - So(id == (uint64_t) getuid()); - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_GID, &id) == 0); - So(id == (uint64_t) getgid()); - -#if defined(NNG_HAVE_SOPEERCRED) || defined(NNG_HAVE_GETPEERUCRED) || \ - (defined(NNG_HAVE_LOCALPEERCRED) && defined(NNG_HAVE_LOCALPEERPID)) - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == 0); - So(id == (uint64_t) getpid()); -#else - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_PID, &id) == NNG_ENOTSUP); -#endif - -#ifdef NNG_HAVE_GETPEERUCRED - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_ZONEID, &id) == 0); - So(id == (uint64_t) getzoneid()); -#else - So(nng_pipe_get_uint64(p, NNG_OPT_IPC_PEER_ZONEID, &id) == - NNG_ENOTSUP); -#endif -#endif - return (0); -} - -TestMain("IPC Transport", - { trantest_test_extended("ipc:///tmp/nng_ipc_test_%u", check_props); }) -- cgit v1.2.3-70-g09d2