~ubuntu-branches/ubuntu/saucy/procps/saucy

« back to all changes in this revision

Viewing changes to testsuite/vmstat.test/vmstat.exp

  • Committer: Package Import Robot
  • Author(s): Oliver Grawert
  • Date: 2012-06-20 13:12:40 UTC
  • mfrom: (2.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20120620131240-923p0d8q88bmk3ac
Tags: 1:3.3.3-2ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/sysctl.d (Ubuntu-specific):
    + 10-console-messages.conf: stop low-level kernel messages on console.
    + 10-kernel-hardening.conf: add the kptr_restrict setting
    + 10-keyboard.conf.powerpc: mouse button emulation on PowerPC.
    + 10-network-security.conf: enable rp_filter and SYN-flood protection.
    + 10-ptrace.conf: describe new PTRACE setting.
    + 10-zeropage.conf: safe mmap_min_addr value for graceful fall-back.
    + README: describe how this directory is supposed to work.
  - debian/upstart (Ubuntu-specific): upstart configuration to replace old
    style sysv init script

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#
 
3
# Dejagnu tests for vmstat - part of procps
 
4
 
 
5
set vmstat "${topdir}vmstat"
 
6
 
 
7
# Run vmstat with no arguments
 
8
set test "vmstat with no arguments"
 
9
spawn $vmstat
 
10
expect_pass "$test" "^procs\[ -\]+memory\[ -\]+swap\[ -\]+io\[ -\]+system\[ -\]+cpu\[ -\]+\\s*r\\s+b\\s+swpd\\s+free\\s+buff\\s+cache\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa\\s*\(\\s+\\d+\){16}\\s*$"
 
11
 
 
12
set test "vmstat with -a flag"
 
13
spawn $vmstat -a
 
14
expect_pass "$test" "^procs\[ -\]+memory\[ -\]+swap\[ -\]+io\[ -\]+system\[ -\]+cpu\[ -\]+\\s*r\\s+b\\s+swpd\\s+free\\s+inact\\s+active\\s+si\\s+so\\s+bi\\s+bo\\s+in\\s+cs us sy id wa\\s*\(\\s+\\d+\){16}\\s*$"
 
15
 
 
16
set test "vmstat fork option"
 
17
spawn $vmstat -f
 
18
expect_pass "$test" "^\\s+\\d+ forks\\s*$"
 
19
 
 
20
if { [ file readable "/proc/slabinfo" ] == 0 } {
 
21
    unsupported "slabinfo (-m option) test disabled as /proc/slabinfo is unreadable"
 
22
} else {
 
23
set test "vmstat slabinfo (-m option)"
 
24
spawn $vmstat -m
 
25
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,}"
 
26
}
 
27
 
 
28
set test "vmstat disk information (-d option)"
 
29
spawn $vmstat -d
 
30
expect_pass "$test" "^disk\[ -\]+reads\[ -\]+writes\[ -\]+IO\[ -\]+\\s+total\\s+merged\\s+sectors\\s+ms\\s+total\\s+merged\\s+sectors\\s+ms\\s+cur\\s+sec\\s+"
 
31
 
 
32
# Need a partition
 
33
set diskstats [ exec cat /proc/diskstats ]
 
34
regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)\\s+\(\[0-9\]\[0-9\]+\)" $diskstats -> partition
 
35
set test "vmstat partition (using $partition)"
 
36
spawn $vmstat -p $partition
 
37
expect_pass "$test" "^${partition}\\s+reads"
 
38
#\\s+read sectors\\s+writes\\s+requested writes"
 
39
#\(\\s+\\d+\){4}\\s*$"