]> granicus.if.org Git - procps-ng/commitdiff
tests: fix dejagnu pwdx and vmstat checks
authorSami Kerola <kerolasa@iki.fi>
Thu, 9 Feb 2012 20:18:14 +0000 (21:18 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 11 Feb 2012 20:42:21 +0000 (21:42 +0100)
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
9d47cb0c38137581a46951fb7c6fa2a1dc8c24cf

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>
testsuite/pwdx.test/pwdx.exp
testsuite/vmstat.test/vmstat.exp

index 0ca0b1523fee3c69d925c6b1e9c694db635d708c..b86631f01340226dc6e1b9d84c58d5cdf0b15dd6 100644 (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"
index bd42bf8e0939131889b6cf7d65c797bab8919b5d..328e2fc5bdf27445a70973cc7ff1b39c757f30a2 100644 (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"