zsh completions: minor tweaks
[pcp.git] / qa / 299
blob5525d0ac9fc4080784deeabf70ebb7bb72893c43
1 #! /bin/sh
2 # PCP QA Test No. 299
3 # exercise pmParseMetricSpec
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 environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19 _x()
21 echo
22 src/parsemetricspec "sample$1" 1 default_arch
23 echo
24 src/parsemetricspec "sample$1" 0 default_host
25 echo
26 src/parsemetricspec "my_arch/sample$1" 1 default_arch
27 echo
28 src/parsemetricspec "my_host:sample$1" 0 default_host
29 echo
30 src/parsemetricspec "other_host:sample$1" 1 default_arch
31 echo
32 src/parsemetricspec "/other/arch/sample$1" 0 default_host
33 echo
34 src/parsemetricspec "@:sample$1" 0 default_host
37 # real QA test starts here
38 echo "=== No instance and no error cases ==="
41 echo
42 echo "=== One instance and no error cases ==="
43 _x '[singular]'
45 echo
46 echo "=== Multiple instances and no error cases ==="
47 _x '[one,two,three]'
49 echo
50 echo "=== Some whitespace cases ==="
51 echo
52 src/parsemetricspec " my_host : sample [ one , two , three ] " 0 default_host
53 echo
54 src/parsemetricspec "my_arch / sample [singular]" 1 default_arch
56 echo
57 echo "=== Miscellaneous cases ==="
58 echo
59 src/parsemetricspec "../../relative/pathname/myarch/metric" 0 default_host
60 echo
61 src/parsemetricspec "metric.a.b.c.d[]" 0 default_host
62 echo
63 src/parsemetricspec "/full/pathname/myarch/metric[fumble mumble]" 0 default_host
64 echo
65 src/parsemetricspec "./myarch/metric[fumble,,mumble]" 0 default_host
66 echo
67 src/parsemetricspec 'foo["instance with strange chars :/,[]\""]' 0 default_host
68 echo
69 src/parsemetricspec '20080424:12:05/disk.dev.total["sda1"]' 0 default_host
70 echo
71 src/parsemetricspec '20080424:12:05/disk.all.total' 0 default_host
73 echo
74 echo "=== Some odd cases (incorrectly used to be classified as errors) ==="
75 echo
76 src/parsemetricspec "one/two:three" 0 default_host
77 echo
78 src/parsemetricspec "foo:bar/fumble[mumble]" 0 default_host
80 echo
81 echo "=== Some error cases ==="
82 echo
83 src/parsemetricspec "foo/bar[fumble]mumble" 0 default_host
84 echo
85 src/parsemetricspec foo: 0 default_host
86 echo
87 src/parsemetricspec :badhost 0 default_host
88 echo
89 src/parsemetricspec bad/arch/ 0 default_host
90 echo
91 src/parsemetricspec '/bad/arch/[' 0 default_host
92 echo
93 src/parsemetricspec 'norsqb[' 0 default_host
94 echo
95 src/parsemetricspec 'nolsqb-instance]' 0 default_host
96 echo
97 src/parsemetricspec 'metric["noclosingquote' 0 default_host
98 echo
99 src/parsemetricspec 'metric["noclosingquote]' 0 default_host
100 echo
101 src/parsemetricspec 'metric["noclosing]"' 0 default_host
102 echo
103 src/parsemetricspec 'metric["ends in backslash\' 0 default_host
105 # success, all done
106 status=0
107 exit