Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 648
blob8ef0f6209d8cf3ecc02fd0a2d5a290379464e6bc
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
58 $here/src/mmv2_instances cats2
59 $here/src/mmv2_instances dogs2
60 $here/src/mmv2_instances mice2
61 $here/src/mmv2_instances film2
63 echo
64 echo "=== validate values ==="
65 if pminfo $iam | LC_COLLATE=POSIX sort >$tmp.names
66 then
67 for name in `cat $tmp.names`
69 pminfo -fdmtT $name | LC_COLLATE=POSIX sort -n
70 done
71 else
72 echo "... failed! ... here is the Install log ..."
73 cat $tmp.out
76 echo
77 echo "=== remove $iam agent ==="
78 $sudo ./Remove >$tmp.out 2>&1
79 _filter_pmda_remove <$tmp.out
81 status=0
82 exit