Drop unused condition check
[pcp.git] / qa / 148
blob504ae48ff3f62c430bbad6ce2504426d50400f7f
1 #! /bin/sh
2 # PCP QA Test No. 148
3 # validate ipc.shm metric values
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.filter
15 case $PCP_PLATFORM
18 echo "Missing some ipc/shm/sem metrics on PCP_PLATFORM $PCP_PLATFORM" >$seq.notrun
19 echo "$seq: [not run] `cat $seq.notrun`"
20 exit 0
22 esac
24 trap "rm -f $tmp.*; exit 0" 0 1 2 3 15
26 # blow away any residual junk
27 $sudo src/ipcs_clear
30 # real QA test starts here
32 # assumed output format from ipcs -am
33 #IPC status from /dev/kmem as of Wed Mar 26 12:23:47 1997
34 #T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME
35 #Shared Memory:
36 #m 9 0x09e4218f --rw-r----- oracle dba oracle dba 2351167232 6159 15032 12:03:49 12:06:18 15:47:42
38 # build the sed filter from the heading line of the output
40 $sudo ipcs -am >$tmp.out
41 sed -n <$tmp.out >$tmp.sed -e '/NATTCH/{
42 s/./.\\(/
43 s/ID/..\\)/
44 s/CGROUP/&\\(/
45 s/NATTCH/&\\)\\(/
46 s/\(SEGSZ\).*/\1\\).*/
47 s/[A-Z ]/./g
48 s/^/s\//
49 s/$/\/\\1 \\2 \\3\/p/
53 echo 's/ */ /g' >>$tmp.sed
54 echo 's/^ //' >>$tmp.sed
55 echo 's/ $//' >>$tmp.sed
57 grep '^m' $tmp.out \
58 | sed -f $tmp.sed \
59 | LC_COLLATE=POSIX sort >$tmp.ipc
61 pminfo -F ipc.shm.nattch \
62 | sed -n \
63 -e '/ inst /{
64 s/.*\[//
65 s/ .* value / /p
66 }' \
67 | LC_COLLATE=POSIX sort >$tmp.1
69 pminfo -F ipc.shm.segsz \
70 | sed -n \
71 -e '/ inst /{
72 s/.*\[//
73 s/ .* value / /p
74 }' \
75 | LC_COLLATE=POSIX sort >$tmp.2
77 LC_COLLATE=POSIX join $tmp.1 $tmp.2 >$tmp.pcp
79 if diff $tmp.pcp $tmp.ipc
80 then
81 echo "ipc.shm and ipcs agree"
82 else
83 echo "=== ipcs -am ==="
84 $sudo ipcs -am
85 echo "=== summary ==="
86 cat $tmp.ipc
87 echo "=== pminfo -F ==="
88 pminfo -F ipc.shm.nattch ipc.shm.segsz
89 echo "=== summary ==="
90 cat $tmp.pcp
91 echo "Mismatch error: summaries should be identical"
92 exit 1
95 exit 0