]> granicus.if.org Git - procps-ng/commitdiff
vmstat: slabinfo (-m option) test disabled if not readable
authorJim Warner <james.warner@comcast.net>
Fri, 6 Jan 2012 14:49:21 +0000 (08:49 -0600)
committerCraig Small <csmall@enc.com.au>
Fri, 13 Jan 2012 13:04:46 +0000 (00:04 +1100)
The dejagnu tests for slabtop are skipped when "/proc/slabinfo" is
unreadable due to permissions.  This commit provides the same check
for vmstat under its -m (slabinfo) option.

testsuite/vmstat.test/vmstat.exp

index aa1707facc67c137ed7040569c939d6adab4488c..bd42bf8e0939131889b6cf7d65c797bab8919b5d 100644 (file)
@@ -17,10 +17,13 @@ set test "vmstat fork option"
 spawn $vmstat -f
 expect_pass "$test" "^\\s+\\d+ forks\\s*$"
 
+if { [ file readable "/proc/slabinfo" ] == 0 } {
+    unsupported "slabinfo (-m option) test disabled as /proc/slabinfo is unreadable"
+} else {
 set test "vmstat slabinfo (-m option)"
 spawn $vmstat -m
 expect_pass "$test" "^Cache\\s+Num\\s+Total\\s+Size\\s+Pages\\s+\(\[\(\)A-Za-z0-9_-\]+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*\){1,}"
-
+}
 
 set test "vmstat disk information (-d option)"
 spawn $vmstat -d