aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/dtrace/test/tst
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2017-05-22 20:34:51 +0000
committerMark Johnston <markj@FreeBSD.org>2017-05-22 20:34:51 +0000
commitb4a3f67bd60014b398bd3b9e28aa759bff11703c (patch)
treee67bdf0a341e6c58157a41cda8c0ec18bde6f337 /cddl/contrib/opensolaris/cmd/dtrace/test/tst
parent18982e8fb02cc2a6361a82e527bee59c5f09e991 (diff)
downloadsrc-b4a3f67bd60014b398bd3b9e28aa759bff11703c.tar.gz
src-b4a3f67bd60014b398bd3b9e28aa759bff11703c.zip
Add a little helper program for tst.exitcore.ksh.
sleep(1) is capsicumized, which means that we cannot rely on it to dump core as required by the test. MFC after: 1 week Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=318680
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace/test/tst')
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh12
2 files changed, 39 insertions, 9 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c
new file mode 100644
index 000000000000..e72b5770b723
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2017 Mark Johnston <markj@FreeBSD.org>
+ */
+
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+
+ for (;;)
+ sleep(1);
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh
index 867e4ffdf1eb..59094e3da37f 100644
--- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh
@@ -52,7 +52,7 @@ script()
/curpsinfo->pr_ppid == $child &&
execargs == "$longsleep" && args[0] != CLD_DUMPED/
{
- printf("Child process could did dump core.");
+ printf("Child process could not dump core.");
exit(1);
}
EOF
@@ -62,10 +62,9 @@ sleeper()
{
while true; do
$longsleep &
- /bin/sleep 1
+ /bin/sleep 1
kill -SEGV $!
done
- /bin/rm -f $corefile
}
if [ $# != 1 ]; then
@@ -74,8 +73,7 @@ if [ $# != 1 ]; then
fi
dtrace=$1
-longsleep="/bin/sleep 10000"
-corefile=/tmp/sleep.core
+longsleep="./tst.exitcore.exe"
sleeper &
child=$!
@@ -83,10 +81,6 @@ child=$!
script
status=$?
-#pstop $child
-#pkill -P $child
kill $child
-#prun $child
-/bin/rm -f $corefile
exit $status