diff options
author | markj <markj@FreeBSD.org> | 2015-01-31 22:53:18 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2015-01-31 22:53:18 +0000 |
commit | 5fc1c4b8e053f3c5f13943a929163c4f06fd5079 (patch) | |
tree | 261a08643419f3dfd85d7b7659844658eb84fcf1 /cddl/contrib/opensolaris/cmd/dtrace/test/tst/common | |
parent | a3e668fe3502c48647f5ef166ecc4990e351524e (diff) | |
download | FreeBSD-src-5fc1c4b8e053f3c5f13943a929163c4f06fd5079.zip FreeBSD-src-5fc1c4b8e053f3c5f13943a929163c4f06fd5079.tar.gz |
Fix a number of DTrace scripting tests:
* Avoid hard-coding program paths.
* Use -x when searching for oneself in ps(1) output.
* Use the correct keyword (egid instead of pgid) in tst.egid.ksh.
MFC after: 1 week
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace/test/tst/common')
11 files changed, 27 insertions, 27 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh index cc1e6dd..3c493df 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$.d ## Create .d file diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh index 6ec078a..89c6a6a 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh @@ -42,7 +42,7 @@ fi dtrace=$1 -bname=`/usr/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh index afee24f..2397db6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh @@ -43,7 +43,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/usr/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$.d ## Create .d file @@ -77,7 +77,7 @@ fi #Get the groupid of the calling process using ps -groupid=`ps -o pid,pgid | grep "$$ " | awk '{print $2}' 2>/dev/null` +groupid=`ps -x -o pid,egid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get uid of the current process with pid = $$" exit 1 @@ -93,5 +93,5 @@ fi #Cleanup leftovers -/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh index 1b6b9b3..5bdc391 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ ## Create .d file @@ -69,7 +69,7 @@ EOF chmod 555 $dfilename -userid=`ps -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null` +userid=`ps -x -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get uid of the current process with pid = $$" exit 1 @@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh index 332b8e70..0c4e77b 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ ## Create .d file @@ -69,7 +69,7 @@ EOF chmod 555 $dfilename -groupid=`ps -o pid,gid | grep "$$ " | awk '{print $2}' 2>/dev/null` +groupid=`ps -x -o pid,gid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get uid of the current process with pid = $$" exit 1 @@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh index bbd9a53..37613ce 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$.d ## Create .d file @@ -75,12 +75,12 @@ fi #Pass current pid (I mean parent pid for .d script). -$dfilename $$ >/dev/null 2>&1 +$dfilename $$ #>/dev/null 2>&1 if [ $? -ne 0 ]; then print -u2 "Error in executing $dfilename" exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh index 62bc817..e11f1e5 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ ## Create .d file @@ -69,7 +69,7 @@ EOF chmod 555 $dfilename -projectid=`ps -o pid,projid | grep "$$ " | awk '{print $2}' 2>/dev/null` +projectid=`ps -x -o pid,projid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get uid of the current process with pid = $$" exit 1 @@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh index 477ebc0..08a65b2 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ ## Create .d file @@ -69,7 +69,7 @@ EOF chmod 555 $dfilename -sessionid=`ps -o pid,sid | grep "$$ " | awk '{print $2}' 2>/dev/null` +sessionid=`ps -x -o pid,sid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get sid of the current process with pid = $$" exit 1 @@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh index 724bd5f..a8b1ec1 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$.d ## Create .d file diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh index 88b450d..e4de7fb 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ ## Create .d file @@ -69,7 +69,7 @@ EOF chmod 555 $dfilename -taskidval=`ps -o pid,taskid | grep "$$ " | awk '{print $2}' 2>/dev/null` +taskidval=`ps -x -o pid,taskid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get uid of the current process with pid = $$" exit 1 @@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh index fabf0ed..8cd6130 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh @@ -41,7 +41,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -bname=`/bin/basename $0` +bname=`basename $0` dfilename=/var/tmp/$bname.$$ ## Create .d file @@ -69,7 +69,7 @@ EOF chmod 555 $dfilename -userid=`ps -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null` +userid=`ps -x -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null` if [ $? -ne 0 ]; then print -u2 "unable to get uid of the current process with pid = $$" exit 1 @@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then exit 1 fi -#/bin/rm -f $dfilename +rm -f $dfilename exit 0 |