From 7d075fbc34ae269f50e1add516c2d909b602fed6 Mon Sep 17 00:00:00 2001
From: Dan McDonald <danmcd@mnx.io>
Date: Thu, 26 Jan 2023 11:58:04 -0500
Subject: [PATCH 07/12] Actually add signalfd to list of tests

---
 usr/src/pkg/manifests/system-test-ostest.p5m  |  5 +++-
 usr/src/test/os-tests/tests/Makefile          |  3 +-
 .../test/os-tests/tests/signalfd/basic_args.c |  6 +---
 .../test/os-tests/tests/signalfd/basic_read.c |  6 +---
 usr/src/test/os-tests/tests/signalfd/common.c |  4 ---
 usr/src/test/os-tests/tests/signalfd/common.h | 29 +++++++++++++++++++
 6 files changed, 37 insertions(+), 16 deletions(-)
 create mode 100644 usr/src/test/os-tests/tests/signalfd/common.h

diff --git a/usr/src/pkg/manifests/system-test-ostest.p5m b/usr/src/pkg/manifests/system-test-ostest.p5m
index f0c61d7872..fa48fe98f2 100644
--- a/usr/src/pkg/manifests/system-test-ostest.p5m
+++ b/usr/src/pkg/manifests/system-test-ostest.p5m
@@ -15,7 +15,7 @@
 # Copyright 2020 Joyent, Inc.
 # Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
 # Copyright 2021 Tintri by DDN, Inc. All rights reserved.
-# Copyright 2022 Oxide Computer Company
+# Copyright 2023 Oxide Computer Company
 # Copyright 2022 MNX Cloud, Inc.
 #
 
@@ -126,6 +126,9 @@ file path=opt/os-tests/tests/secflags/secflags_syscall mode=0555
 file path=opt/os-tests/tests/secflags/secflags_truss mode=0555
 file path=opt/os-tests/tests/secflags/secflags_zonecfg mode=0555
 file path=opt/os-tests/tests/secflags/stacky mode=0555
+dir  path=opt/os-tests/tests/signalfd
+file path=opt/os-tests/tests/signalfd/basic_args mode=0555
+file path=opt/os-tests/tests/signalfd/basic_read mode=0555
 dir  path=opt/os-tests/tests/sigqueue
 file path=opt/os-tests/tests/sigqueue/sigqueue_queue_size mode=0555
 dir  path=opt/os-tests/tests/sockfs
diff --git a/usr/src/test/os-tests/tests/Makefile b/usr/src/test/os-tests/tests/Makefile
index 613dd50f8c..0dd9745590 100644
--- a/usr/src/test/os-tests/tests/Makefile
+++ b/usr/src/test/os-tests/tests/Makefile
@@ -14,7 +14,7 @@
 # Copyright 2020 Joyent, Inc.
 # Copyright 2021 Tintri by DDN, Inc. All rights reserved.
 # Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
-# Copyright 2022 Oxide Computer Company
+# Copyright 2023 Oxide Computer Company
 #
 
 SUBDIRS_i386 = i386 imc zen_umc
@@ -32,6 +32,7 @@ SUBDIRS =       \
 		regression \
 		sdevfs \
 		secflags \
+		signalfd \
 		sigqueue \
 		sockfs \
 		spoof-ras \
diff --git a/usr/src/test/os-tests/tests/signalfd/basic_args.c b/usr/src/test/os-tests/tests/signalfd/basic_args.c
index 4f564acc20..5231e3be8d 100644
--- a/usr/src/test/os-tests/tests/signalfd/basic_args.c
+++ b/usr/src/test/os-tests/tests/signalfd/basic_args.c
@@ -10,13 +10,9 @@
  */
 
 /*
- * Copyright 2022 Oxide Computer Company
+ * Copyright 2023 Oxide Computer Company
  */
 
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
 #include "common.h"
 
 int
diff --git a/usr/src/test/os-tests/tests/signalfd/basic_read.c b/usr/src/test/os-tests/tests/signalfd/basic_read.c
index 2185b1a003..78d4a004e7 100644
--- a/usr/src/test/os-tests/tests/signalfd/basic_read.c
+++ b/usr/src/test/os-tests/tests/signalfd/basic_read.c
@@ -10,13 +10,9 @@
  */
 
 /*
- * Copyright 2022 Oxide Computer Company
+ * Copyright 2023 Oxide Computer Company
  */
 
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
 #include "common.h"
 
 int
diff --git a/usr/src/test/os-tests/tests/signalfd/common.c b/usr/src/test/os-tests/tests/signalfd/common.c
index 6fc1db4c21..b7c3f52b99 100644
--- a/usr/src/test/os-tests/tests/signalfd/common.c
+++ b/usr/src/test/os-tests/tests/signalfd/common.c
@@ -13,10 +13,6 @@
  * Copyright 2022 Oxide Computer Company
  */
 
-#include <err.h>
-#include <string.h>
-#include <stdlib.h>
-
 #include "common.h"
 
 void
diff --git a/usr/src/test/os-tests/tests/signalfd/common.h b/usr/src/test/os-tests/tests/signalfd/common.h
new file mode 100644
index 0000000000..f432a3d0d6
--- /dev/null
+++ b/usr/src/test/os-tests/tests/signalfd/common.h
@@ -0,0 +1,29 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2023 Oxide Computer Company
+ */
+
+#include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <siginfo.h>
+#include <signal.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/signalfd.h>
+
+extern void test_fail(const char *, ...);
+extern void test_pass(void);
+extern int test_basic_prep(int);
-- 
2.37.1 (Apple Git-137.1)

