3 # exercise pmParseMetricSpec
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 status
=1 # failure is the default!
17 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 src
/parsemetricspec
"sample$1" 1 default_arch
24 src
/parsemetricspec
"sample$1" 0 default_host
26 src
/parsemetricspec
"my_arch/sample$1" 1 default_arch
28 src
/parsemetricspec
"my_host:sample$1" 0 default_host
30 src
/parsemetricspec
"other_host:sample$1" 1 default_arch
32 src
/parsemetricspec
"/other/arch/sample$1" 0 default_host
34 src
/parsemetricspec
"@:sample$1" 0 default_host
37 # real QA test starts here
38 echo "=== No instance and no error cases ==="
42 echo "=== One instance and no error cases ==="
46 echo "=== Multiple instances and no error cases ==="
50 echo "=== Some whitespace cases ==="
52 src
/parsemetricspec
" my_host : sample [ one , two , three ] " 0 default_host
54 src
/parsemetricspec
"my_arch / sample [singular]" 1 default_arch
57 echo "=== Miscellaneous cases ==="
59 src
/parsemetricspec
"../../relative/pathname/myarch/metric" 0 default_host
61 src
/parsemetricspec
"metric.a.b.c.d[]" 0 default_host
63 src
/parsemetricspec
"/full/pathname/myarch/metric[fumble mumble]" 0 default_host
65 src
/parsemetricspec
"./myarch/metric[fumble,,mumble]" 0 default_host
67 src
/parsemetricspec
'foo["instance with strange chars :/,[]\""]' 0 default_host
69 src
/parsemetricspec
'20080424:12:05/disk.dev.total["sda1"]' 0 default_host
71 src
/parsemetricspec
'20080424:12:05/disk.all.total' 0 default_host
74 echo "=== Some odd cases (incorrectly used to be classified as errors) ==="
76 src
/parsemetricspec
"one/two:three" 0 default_host
78 src
/parsemetricspec
"foo:bar/fumble[mumble]" 0 default_host
81 echo "=== Some error cases ==="
83 src
/parsemetricspec
"foo/bar[fumble]mumble" 0 default_host
85 src
/parsemetricspec foo
: 0 default_host
87 src
/parsemetricspec
:badhost
0 default_host
89 src
/parsemetricspec bad
/arch
/ 0 default_host
91 src
/parsemetricspec
'/bad/arch/[' 0 default_host
93 src
/parsemetricspec
'norsqb[' 0 default_host
95 src
/parsemetricspec
'nolsqb-instance]' 0 default_host
97 src
/parsemetricspec
'metric["noclosingquote' 0 default_host
99 src
/parsemetricspec
'metric["noclosingquote]' 0 default_host
101 src
/parsemetricspec
'metric["noclosing]"' 0 default_host
103 src
/parsemetricspec
'metric["ends in backslash\' 0 default_host