summaryrefslogtreecommitdiff
path: root/testsuite/pwait.test/pwait.exp
blob: 867f0ff57a99e40f6c3970ba391f97066aa39b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Dejagnu tests for pwait - part of procps
#
set mypid [pid]
set not_ppid [ expr { $mypid + 1 } ]
set pwait "${topdir}pwait"
set uid [ exec id -u ]
set not_uid [ expr { $uid + 1 } ]
set gid [ exec id -g ]
set not_gid [ expr { $gid + 1 } ]

set test "pwait with no arguments"
spawn $pwait
expect_pass "$test" "^\(lt-\)\?pwait: no matching criteria specified\\s*"

make_testproc

set test "pwait with not matching gid"
spawn $pwait -G $not_gid $testproc_comm
expect_blank $test

set test "pwait doesn't match with bogus parent pid"
spawn $pwait -P $not_ppid $testproc_comm
expect_blank "$test"

set test "pwait doesn't match with bogus sid"
spawn $pwait -s -1 $testproc_comm
expect_blank "$test"

set test "pwait doesn't match with bogus tty"
spawn $pwait -t glass $testproc_comm
expect_blank "$test"

set test "pwait with not matching uid"
spawn $pwait -U $not_uid $testproc_comm
expect_blank $test

# Cleanup
kill_testproc