File: 121

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (76 lines) | stat: -rwxr-xr-x 1,949 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
# PCP QA Test No. 121
# check that pmlogconf finds new groups, pv 893249
#
# Copyright (c) 2002 Silicon Graphics, Inc.  All Rights Reserved.

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=0	# success is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15


# real QA test starts here
pmlogconf $tmp.in >/dev/null 2>&1
echo "--- default config ---" >>$seq_full
cat $tmp.in >>$seq_full
cp $tmp.in $seq_full.in

# strip comments, access control, empty lines and then strip the groups:
#	disk/summary
#	kernel/bufcache-all to memory/swap
sed <$tmp.in >$tmp.ref \
    -e '/^#$/d' \
    -e '/^# /d' \
    -e '/^\[access\]/d' \
    -e '/^disallow /d' \
    -e '/^allow /d' \
    -e '/^[ 	]*$/d'
cat <<End-of-File >>$tmp.ref

# DO NOT UPDATE THE FILE ABOVE THIS LINE
# Otherwise any changes may be lost the next time pmlogconf is
# used on this file.
#
# It is safe to make additions from here on ...
#
End-of-File

$PCP_AWK_PROG <$tmp.ref >$tmp.tmp '
/^#\+ disk\/summary/	{ state = 1; next }
state == 1 && /^#----/	{ state = 0; next }
/^#\+ kernel\/bufcache-all/		{ state = 2; next }
state == 2 && /^#\+ memory\/swap/{ state = 1; next }
state == 0		{ print }'
cp $tmp.tmp $tmp.in
echo >>$seq_full
echo "--- culled and stripped config ---" >>$seq_full
cat $tmp.in >>$seq_full
cp $tmp.in $seq_full.cull

# now process again ... the diffs should be small
#
echo >>$seq_full
echo "--- pmlogconf ---" >>$seq_full
( echo q; echo y ) | pmlogconf -v $tmp.in >>$seq_full 2>&1

grep Error: $seq_full

echo >>$seq_full
echo "--- final config ---" >>$seq_full
cat $tmp.in >>$seq_full
cp $tmp.in $seq_full.out

echo "Expect few differences ..."
sed -e '/^[ 	]*$/d' $tmp.ref | LC_COLLATE=POSIX sort >$tmp.ref.sort
sed -e '/^[ 	]*$/d' $tmp.in | LC_COLLATE=POSIX sort >$tmp.in.sort
diff $tmp.ref.sort $tmp.in.sort

# success, all done
exit