tests: fix dejagnu pwdx and vmstat checks

The pwdx check expected error message, which where in use for only
short period of time.  The old message was put in place in commit
9d47cb0c38

The vmstat issue was triggered by 'sr0' cdrom device, which gives
following unexpected output.  Fix simply ignores partitions which has
zero activity.  Besides such partitions probably would not apply as
good candidate of -p option anyway.

$ vmstat -p sr0
Partition was not found

Reported-By: Moritz Muehlenhoff <jmm@debian.org>
Bug-Debian: http://bugs.debian.org/656508
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-02-09 21:18:14 +01:00
parent ce1410a51a
commit 4d8f9522a7
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\."
# Run pwdx with pid 0 which is invalid
set test "pwdx pid 0 should be invalid"
spawn $pwdx 0
expect_pass "$test" "^0: No such process"
expect_pass "$test" "\(lt-\)\?pwdx\: invalid process id\: 0"
# Run pwdx with existing pid
set test "pwdx finds sleep in cwd"

View File

@ -31,7 +31,7 @@ expect_pass "$test" "^disk\[ -\]+reads\[ -\]+writes\[ -\]+IO\[ -\]+\\s+total\\s+
# Need a partition
set diskstats [ exec cat /proc/diskstats ]
regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)" $diskstats -> partition
regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)\\s+\(\[0-9\]\[0-9\]+\)" $diskstats -> partition
set test "vmstat partition (using $partition)"
spawn $vmstat -p $partition
expect_pass "$test" "^${partition}\\s+reads"