diff options
author | markj <markj@FreeBSD.org> | 2015-01-31 22:38:43 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2015-01-31 22:38:43 +0000 |
commit | a3e668fe3502c48647f5ef166ecc4990e351524e (patch) | |
tree | c232131915baf757eb854c5b0b686a870a8d76b0 /cddl/contrib/opensolaris/cmd/dtrace/test | |
parent | d753fb3dbaa67d99b421f2d6ab1339792665b437 (diff) | |
download | FreeBSD-src-a3e668fe3502c48647f5ef166ecc4990e351524e.zip FreeBSD-src-a3e668fe3502c48647f5ef166ecc4990e351524e.tar.gz |
Fix some proc provider tests:
* Avoid hard-coding program paths, except when it's necessary in order to
override the use of a shell builtin.
* Translate struct proc through psinfo_t so that we can access process
arguments via the pr_psargs field of psinfo_t.
* Replace uses of pstop and prun with kill(1).
MFC after: 1 week
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace/test')
3 files changed, 14 insertions, 12 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh index a81ddf9..5b94840 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh @@ -37,7 +37,8 @@ script() $dtrace -s /dev/stdin <<EOF proc:::signal-discard /args[1]->p_pid == $child && - args[1]->pr_psargs == "$longsleep" && args[2] == SIGHUP/ + xlate<psinfo_t *>(args[1])->pr_psargs == "$longsleep" && + args[2] == SIGHUP/ { exit(0); } @@ -48,7 +49,7 @@ killer() { while true; do sleep 1 - /usr/bin/kill -HUP $child + kill -HUP $child done } @@ -58,7 +59,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -longsleep="/usr/bin/sleep 10000" +longsleep="/bin/sleep 10000" /usr/bin/nohup $longsleep & child=$! diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh index 8040ade..86bef76 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh @@ -48,7 +48,7 @@ sleeper() { while true; do $longsleep & - /usr/bin/sleep 1 + sleep 1 kill -9 $! done } @@ -59,7 +59,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -longsleep="/usr/bin/sleep 10000" +longsleep="/bin/sleep 10000" sleeper & child=$! @@ -67,9 +67,9 @@ child=$! script status=$? -pstop $child +kill -STOP $child pkill -P $child kill $child -prun $child +kill -CONT $child exit $status diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh index 1caafcc..cb30eae 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh @@ -37,7 +37,8 @@ script() $dtrace -s /dev/stdin <<EOF proc:::signal-send /execname == "kill" && curpsinfo->pr_ppid == $child && - args[1]->pr_psargs == "$longsleep" && args[2] == SIGUSR1/ + xlate<psinfo_t *>(args[1])->pr_psargs == "$longsleep" && + args[2] == SIGUSR1/ { /* * This is guaranteed to not race with signal-handle. @@ -58,7 +59,7 @@ sleeper() while true; do $longsleep & sleep 1 - /usr/bin/kill -USR1 $! + kill -USR1 $! done } @@ -68,7 +69,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -longsleep="/usr/bin/sleep 10000" +longsleep="/bin/sleep 10000" sleeper & child=$! @@ -76,9 +77,9 @@ child=$! script status=$? -pstop $child +kill -STOP $child pkill -P $child kill $child -prun $child +kill -CONT $child exit $status |