Create test process

For the test suite, procps used to use sleep which would just
create a process or two to test the tools against.  Some setups
coreutils creates all programs including sleep into one blob which
means a lot of the tests fail, see issue #2

procps has its own sleep program now.
This commit is contained in:
Craig Small
2015-06-13 15:04:31 +10:00
parent 26955dd02a
commit 420cd9c7c2
7 changed files with 116 additions and 118 deletions

View File

@ -28,101 +28,5 @@ set test "pkill signal option order"
spawn $pkill -e $testproc_comm -0
expect_pass "$test" "^$testproc_comm killed \\(pid $testproc1_pid\\)\\s+$testproc_comm killed \\(pid $testproc2_pid\\)\\s*$"
# In Debian only
#set test "pkill counts 2 test pids"
#spawn $pkill -c $testproc
#expect_pass "$test" "^2\\s*"
set test "pkill with matching gid"
#spawn $pkill -G $gid $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill with not matching gid"
#spawn $pkill -G $not_gid $testproc
#expect_blank $test
untested "$test"
set test "pkill with process name"
#spawn $pkill -l $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc\\s+$testproc2_pid\\s+$testproc\\s*$"
untested "$test"
set test "pkill find newest test pid"
#spawn $pkill -n $testproc
#expect_pass "$test" "^$testproc2_pid\\s*$"
untested "$test"
set test "pkill find oldest test pid"
#spawn $pkill -o $testproc
#expect_pass "$test" "^$testproc1_pid\\s*$"
untested "$test"
set test "pkill matches with parent pid"
#spawn $pkill -P $mypid $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill doesn't match with bogus parent pid"
#spawn $pkill -P $not_ppid $testproc
#expect_blank "$test"
untested "$test"
set test "pkill matches with its own sid"
#spawn $pkill -s $sleep1_sid $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill doesn't match with bogus sid"
#spawn $pkill -s 1 $testproc
#expect_blank "$test"
untested "$test"
set test "pkill matches on tty"
#spawn $pkill -t $tty $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill doesn't match with bogus tty"
#spawn $pkill -t glass $testproc
#expect_blank "$test"
untested "$test"
set test "pkill with matching euid"
#spawn $pkill -u $uid $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill with not matching euid"
#spawn $pkill -u $not_uid $testproc
#expect_blank $test
untested "$test"
set test "pkill with matching uid"
#spawn $pkill -U $uid $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill with not matching uid"
#spawn $pkill -U $not_uid $testproc
#expect_blank $test
untested "$test"
set test "pkill matches on substring"
#spawn $pkill $testproc_trim
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill matches full string with exact"
#spawn $pkill -x $testproc
#expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$"
untested "$test"
set test "pkill does not match substring with exact"
#spawn $pkill -x $testproc_trim
#expect_blank $test
untested "$test"
# Cleanup
kill_testproc