diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp index d7bf86ac..562fff0b 100644 --- a/testsuite/config/unix.exp +++ b/testsuite/config/unix.exp @@ -224,6 +224,18 @@ proc kill_testshm_proc { } { kill_process $testshmproc_pid } +proc make_schedbatch_proc { nice_val } { + global schedbatch_proc_pid topdir + set schedbatch_path "${topdir}testsuite/test-schedbatch" + + set schedbatch_proc_pid [ spawn $schedbatch_path $nice_val ] +} + +proc kill_schedbatch_proc { } { + global schedbatch_proc_pid + kill_process $schedbatch_proc_pid +} + proc kill_testproc { } { global testproc_path testproc1_pid testproc2_pid diff --git a/testsuite/ps.test/ps_personality.exp b/testsuite/ps.test/ps_personality.exp index f873a193..da55e1d3 100644 --- a/testsuite/ps.test/ps_personality.exp +++ b/testsuite/ps.test/ps_personality.exp @@ -15,4 +15,4 @@ foreach { pers match } $pers_match { spawn $ps expect_pass "$test" $match } - +set env(PS_PERSONALITY) "" diff --git a/testsuite/ps.test/ps_sched_batch.exp b/testsuite/ps.test/ps_sched_batch.exp index ff948db2..ad5f30f1 100644 --- a/testsuite/ps.test/ps_sched_batch.exp +++ b/testsuite/ps.test/ps_sched_batch.exp @@ -2,10 +2,12 @@ # check the ps SCHED_BATCH scheduler policy output # set ps "${topdir}src/ps/pscommand" -set schedbatch "${topdir}testsuite/test-schedbatch" -spawn $schedbatch 18 +set nice_val 18 +make_schedbatch_proc $nice_val set test "ps SCHED_BATCH scheduler" -spawn $ps --no-header -o comm,cls,nice -a -expect_pass "$test" "(?n)^test-schedbatch\\s+B\\s+18\\r?\$" +spawn $ps --no-header -o comm,cls,nice -ax +expect_pass "$test" "(?n)^test-schedbatch\\s+B\\s+$nice_val\\r?\$" + +kill_schedbatch_proc