]> granicus.if.org Git - procps-ng/commitdiff
Reduced partition type check
authorCraig Small <csmall@enc.com.au>
Tue, 27 May 2014 10:49:16 +0000 (20:49 +1000)
committerCraig Small <csmall@enc.com.au>
Tue, 27 May 2014 10:49:16 +0000 (20:49 +1000)
vmstat -p checks used to fail on systems with odd
partition tables, including some Debian buildd servers.
This change limits what sort of test partitions are used,
otherwise the test is skipped.

There probably are other valid partitions, these can be added
later, if known.

testsuite/vmstat.test/vmstat.exp

index f470afc3eb829c5038b07d61efbf9bb8259a11e9..35ffddb8e5c87a220caadb8db0678d753e67c38f 100644 (file)
@@ -38,7 +38,7 @@ set diskstats [ exec cat /proc/diskstats ]
 if { [ file readable "/sys/block" ] == 0 }  {
     unsupported "vmstat partition /sys/block not readable"
 } else {
-  if [ regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)\\s+\[0-9\]\[0-9\]+" $diskstats line partition == 1 ] {
+  if [ regexp "\\s+\\d+\\s+\\d+\\s+\((?:hd|sd|vd)\[a-z\]\\d+\)\\s+\[0-9\]\[0-9\]+" $diskstats line partition == 1 ] {
       set test "vmstat partition (using $partition)"
       spawn $vmstat -p $partition
       expect_pass "$test" "^${partition}\\s+reads"