aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2021-10-27 22:34:41 -0700
committerGarrett D'Amore <garrett@damore.org>2021-11-02 22:56:39 -0700
commitc42f32722447cc52810b25decee634210f09d70e (patch)
tree0e3c460138b619f2f9bad2476d5f474c20edbd6e /src/platform/posix
parentdb3d5562e723a6d2e4efd190bd3f1360126f5b10 (diff)
downloadnng-c42f32722447cc52810b25decee634210f09d70e.tar.gz
nng-c42f32722447cc52810b25decee634210f09d70e.tar.bz2
nng-c42f32722447cc52810b25decee634210f09d70e.zip
fixes #1346 windows ipc winsec fails frequently in CI/CD
Diffstat (limited to 'src/platform/posix')
-rw-r--r--src/platform/posix/CMakeLists.txt3
-rw-r--r--src/platform/posix/posix_ipcwinsec_test.c31
2 files changed, 34 insertions, 0 deletions
diff --git a/src/platform/posix/CMakeLists.txt b/src/platform/posix/CMakeLists.txt
index 02a8cb53..7b619fa2 100644
--- a/src/platform/posix/CMakeLists.txt
+++ b/src/platform/posix/CMakeLists.txt
@@ -105,4 +105,7 @@ if (NNG_PLATFORM_POSIX)
else ()
nng_sources(posix_rand_urandom.c)
endif ()
+
+ nng_test(posix_ipcwinsec_test)
+
endif () \ No newline at end of file
diff --git a/src/platform/posix/posix_ipcwinsec_test.c b/src/platform/posix/posix_ipcwinsec_test.c
new file mode 100644
index 00000000..934eeea9
--- /dev/null
+++ b/src/platform/posix/posix_ipcwinsec_test.c
@@ -0,0 +1,31 @@
+//
+// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+//
+// 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.
+//
+#include <nng/nng.h>
+#include <nuts.h>
+
+void
+test_ipc_win_sec(void)
+{
+ char address[64];
+ nng_stream_listener *l;
+ int x;
+
+ nuts_scratch_addr("ipc", sizeof(address), address);
+ NUTS_PASS(nng_stream_listener_alloc(&l, address));
+ NUTS_FAIL(nng_stream_listener_set_ptr(
+ l, NNG_OPT_IPC_SECURITY_DESCRIPTOR, &x),
+ NNG_ENOTSUP);
+ nng_stream_listener_free(l);
+}
+
+NUTS_TESTS = {
+ { "ipc security descriptor", test_ipc_win_sec },
+ { NULL, NULL },
+};