summaryrefslogtreecommitdiff
path: root/testsuite/pgrep.test
diff options
context:
space:
mode:
authorCraig Small <csmall@enc.com.au>2015-05-09 17:48:12 +1000
committerCraig Small <csmall@enc.com.au>2015-05-09 17:48:12 +1000
commit4050148a4533e8a79cef0d7dcd0c058d78c48a31 (patch)
tree5111d58cea4cf183adffba17a70e92c3eec2b627 /testsuite/pgrep.test
parentc7abb6a6ed67fa970051bca2d2f2596b7118b888 (diff)
downloadprocps-ng-4050148a4533e8a79cef0d7dcd0c058d78c48a31.tar.gz
Fix some sched and tty tests
The ps sched test has been disabled. There are too many odd build farms this fails in strange ways. Other odd build farms have no tty and so some tests check for no tty and skip if not found.
Diffstat (limited to 'testsuite/pgrep.test')
-rw-r--r--testsuite/pgrep.test/pgrep.exp11
1 files changed, 7 insertions, 4 deletions
diff --git a/testsuite/pgrep.test/pgrep.exp b/testsuite/pgrep.test/pgrep.exp
index 152b6ec..1c6cec6 100644
--- a/testsuite/pgrep.test/pgrep.exp
+++ b/testsuite/pgrep.test/pgrep.exp
@@ -9,8 +9,7 @@ set not_uid [ expr { $uid + 1 } ]
set gid [ exec id -g ]
set not_gid [ expr { $gid + 1 } ]
set ps "${topdir}ps/pscommand"
-set raw_tty [ exec tty ]
-regexp "/dev/(.+)" $raw_tty > tty
+set tty [ get_tty ]
set test "pgprep with no arguments"
spawn $pgrep
@@ -80,8 +79,12 @@ spawn $pgrep -s 1 $testproc_comm
expect_blank "$test"
set test "pgrep matches on tty"
-spawn $pgrep -t $tty $testproc_comm
-expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+if { $tty == "" } {
+ untested "$test"
+} else {
+ spawn $pgrep -t $tty $testproc_comm
+ expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
+}
set test "pgrep doesn't match with bogus tty"
spawn $pgrep -t glass $testproc_comm