pmrep: fix archive end time reporting
[pcp.git] / qa / 015
blobde81c492755531db7e8b114a4cfe40d1072e33d0
1 #! /bin/sh
2 # PCP QA Test No. 015
3 # exercise pmstore
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
14 . ./common.check
16 trap "rm -f $tmp.*; exit" 0 1 2 3 15
18 # real QA test starts here
19 for type in long longlong float double string aggregate
21 for val in 123 123.456 1e10 9.87654321e40 0xdeadbeef 0x100000000 0xdeadbeefcafefeed zoo
23 echo ""
24 echo "stuff \"$val\" into sampledso.$type.write_me"
25 # Note: for long data, using strtol() and strtoll() need to
26 # worry about the sign bit ...
27 # -0x21524111 is 0xdeadbeef
28 # -0x2152411035010113 is 0xdeadbeefcafefeed
29 if [ $type = long -a "$val" = 0xdeadbeef ]
30 then
31 val=-0x21524111
32 elif [ $type = longlong -a "$val" = 0xdeadbeefcafefeed ]
33 then
34 val=-0x2152411035010113
35 elif [ $type = aggregate -a "$val" = 0xdeadbeefcafefeed ]
36 then
37 val=-0x2152411035010113
40 if pmstore sampledso.$type.write_me $val
41 then
42 pminfo -f sampledso.$type.write_me \
43 | sed -e '/^$/d'
45 done
46 done 2>&1 \
47 | sed \
48 -e 's/old value=.* new value=/old value=? new value=/' \
49 -e '/sampledso.aggregate/s/new value=.*\[/new value=XXX [/' \
50 | $PCP_AWK_PROG '
51 /sampledso.aggregate/ { gotagg=1; print; next }
52 gotagg && /value/ { gotagg=0; sub(/value.*\[/, "value XXX["); print; next }
53 {print}'