Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 075
blob6140a7a6df098b3b8da78108e2a00a3de073a689
1 #! /bin/sh
2 # PCP QA Test No. 075
3 # tests for proper handling of white spaces in pmval and 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
15 host=`hostname`
17 _filter()
19 sed \
20 -e "s/$host/localhost/g" \
21 -e 's/Permission denied/No permission to perform requested operation/'
24 _cmd()
26 echo ""
27 echo "$ $*" | sed -e "s/$remote/REMOTEHOST/"
28 case $#
30 1|2|3)
31 $1 $2 "$3"
34 $1 $2 "$3" "$4"
37 $1 $2 "$3" "$4" "$5"
40 $1 $2 "$3" "$4" "$5" "$6"
43 $1 $2 "$3" "$4" "$5" "$6" "$7"
46 $1 $2 "$3" "$4" "$5" "$6" "$7" "$8"
49 $1 $2 "$3" "$4" "$5" "$6" "$7" "$8" "$9"
51 10)
52 $1 $2 "$3" "$4" "$5" "$6" "$7" "$8" "$9" "$10"
55 echo "Snarf! $* ($# args)"
56 exit 1
58 esac \
59 | _filter
62 _restore_sample_bin()
64 for inst in 300 400 500
66 pmstore -i bin-$inst sample.bin $inst >/dev/null 2>&1
67 done
70 trap "_restore_sample_bin; rm -f $tmp.*; exit" 0 1 2 3 15
72 PMCD_CONNECT_TIMEOUT=30
73 PMCD_REQUEST_TIMEOUT=30
74 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
76 remote=`./getpmcdhosts -L -n 1 -a sample 2>$tmp.out`
77 if [ -z "$remote" ]
78 then
79 cat $tmp.out >$seq.notrun
80 exit
83 # real QA test starts here
84 _cmd pmstore -i bin-300,bin-400,bin-500 sample.bin 500
85 _cmd pmstore -i bin-300,bin-400,bin-500 sample.bin 400
86 _cmd pmstore -i "bin-300 bin-400 bin-500" sample.bin 500
87 _cmd pmstore -i 'bin-300
88 bin-400
89 bin-500' sample.bin 455
90 _cmd pmstore -i "bin-300,bin-400,bin-500" sample.bin 234
91 _cmd pmstore -i 'bin-300,bin-400,bin-500' sample.bin 500
92 _cmd pmstore -i bin-300 bin-400 bin-500 sample.bin 400
93 _cmd pmstore -i bin-300.bin-400.bin-500 sample.bin 400
94 _cmd pmstore -i 'bin-300,bin-400,bin-500' sample.bin
95 _cmd pmstore -i 'bin-300,bin-400,bin-500' -h $remote sample.bin 500
97 _restore_sample_bin
99 _cmd pmval -s 2 -i bin-300,bin-400,bin-500 sample.bin
100 _cmd pmval -i bin-300,bin-400,bin-500 -s 2 sample.bin
101 _cmd pmval -t 0.2 -s 2 -i "bin-300 bin-400 bin-500" sample.bin
102 _cmd pmval -t 0.2 -s 2 -i 'bin-300
103 bin-400
104 bin-500' sample.bin
105 _cmd pmval -i "bin-300,bin-400,bin-500" -s 2 sample.bin
106 _cmd pmval -i 'bin-300,bin-400,bin-500' -s 2 sample.bin
107 _cmd pmval -s 2 -t 0.3 -i bin-300 bin-400 bin-500 sample.bin
108 _cmd pmval -s 2 -t 0.3 -i bin-300.bin-400.bin-500 sample.bin
109 _cmd pmval -i bin-300,bin-400 -s 2 sample.bin
112 # success, all done
113 status=0
114 exit