pmrep: fix archive end time reporting
[pcp.git] / qa / 648
blob1b94320eaff282849bd34f87ab5af4d4c6f58a78
1 #! /bin/sh
2 # PCP QA Test No. 648
3 # Extended testing of multi-file MMV instances
5 # Copyright (c) 2009 Aconex. 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 status=1
17 username=`id -u -n`
18 MMV_STATS_DIR="$PCP_TMP_DIR/mmv"
20 # for QA the default install for mmv PMDA is as a dso, not a daemon
21 ( echo b && echo dso ) >$tmp.input
23 _cleanup()
25 [ -d $MMV_STATS_DIR.$seq ] && _restore_config $MMV_STATS_DIR
26 _cleanup_pmda mmv $tmp.input
29 _prepare_pmda mmv
30 trap "_cleanup; exit \$status" 0 1 2 3 15
32 # real QA test starts here
33 home="$PCP_PMDAS_DIR"
34 iam=mmv
35 cd "$home/$iam"
36 unset ROOT MAKEFLAGS
38 # move the MMV directory to restore contents later.
39 [ -d $MMV_STATS_DIR ] && _save_config $MMV_STATS_DIR
41 # start from a known starting point
42 $sudo ./Remove >/dev/null 2>&1
44 # create a directory we can write and pcp group can read
45 $sudo rm -rf "$MMV_STATS_DIR"
46 $sudo mkdir -m 755 "$MMV_STATS_DIR"
47 $sudo chown $username "$MMV_STATS_DIR"
48 $sudo chgrp pcp "$MMV_STATS_DIR"
50 echo
51 echo "=== $iam agent installation ==="
52 $sudo ./Install </dev/null >$tmp.out 2>&1
53 _filter_pmda_install <$tmp.out
55 $here/src/mmv_instances cats
56 $here/src/mmv_instances dogs
57 $here/src/mmv_instances mice
59 echo
60 echo "=== validate values ==="
61 if pminfo $iam | LC_COLLATE=POSIX sort >$tmp.names
62 then
63 for name in `cat $tmp.names`
65 pminfo -fdmtT $name | LC_COLLATE=POSIX sort -n
66 done
67 else
68 echo "... failed! ... here is the Install log ..."
69 cat $tmp.out
72 echo
73 echo "=== remove $iam agent ==="
74 $sudo ./Remove >$tmp.out 2>&1
75 _filter_pmda_remove <$tmp.out
77 status=0
78 exit