diff options
author | Craig Small <csmall@enc.com.au> | 2013-07-31 21:54:53 +1000 |
---|---|---|
committer | Craig Small <csmall@enc.com.au> | 2013-07-31 21:54:53 +1000 |
commit | b83788993bb2aeb2a6074ac8a2a08d4b9e49102b (patch) | |
tree | e14c71e374d897dacab29c650fc190465d71a1ae /testsuite | |
parent | 151e4f21da47f19ae89829b8b64857b23824e3fa (diff) | |
download | procps-ng-b83788993bb2aeb2a6074ac8a2a08d4b9e49102b.tar.gz |
Conditional test vmstat -p
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/vmstat.test/vmstat.exp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/testsuite/vmstat.test/vmstat.exp b/testsuite/vmstat.test/vmstat.exp index 328e2fc..76ea310 100644 --- a/testsuite/vmstat.test/vmstat.exp +++ b/testsuite/vmstat.test/vmstat.exp @@ -31,9 +31,10 @@ 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+\)\\s+\(\[0-9\]\[0-9\]+\)" $diskstats -> partition -set test "vmstat partition (using $partition)" -spawn $vmstat -p $partition -expect_pass "$test" "^${partition}\\s+reads" -#\\s+read sectors\\s+writes\\s+requested writes" -#\(\\s+\\d+\){4}\\s*$" +if [ regexp "\\s+\\d+\\s+\\d+\\s+\(\[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" +} else { + unsupported "vmstat partition (cannot find partition)" +} |