4 # exercise pm[Parse]UnitsStr
6 # Copyright (c) 2014-2015 Red Hat, Inc.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 [ -f $PCP_PMDAS_DIR/cifs
/pmdacifs
] || _notrun
"cifs pmda not installed"
19 status
=0 # success is the default!
20 $sudo rm -rf $tmp.
* $seq.full
21 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
32 echo "Arrgh .. $up is missing. Need to"
33 echo " $ cd src; make"
34 echo "in a git tree containg the PCP source and then try again."
41 # real QA test starts here
44 $up scan |
tee -a $seq.full
46 $up tuple
0 0 0 1 1 1 # scales without dims
49 $up parse
"-/2" # bad floating point
50 $up parse
"2eg" # bad floating point
52 $up parse
"5 ms / 3 sec"
53 # following set covers all keywords
54 $up parse
"nanoseconds^-8 bytes count x 10^-8 / nanosecond^-7 byte count x 10^-7"
55 $up parse
"NANOSEC kBytes^-6 count x 10^-6 / nS kByte^-5 count x 10^-5"
56 $up parse
"microseconds mbytes count x 10^-4^-3 / microsecond^-2 mbyte count x 10^-3"
57 $up parse
"microsec mb^-1 count x 10^-2 / us kb^0 count x 10^-1"
58 $up parse
"kilobytes / kilobyte"
59 $up parse
"megabytes / megabyte"
60 $up parse
"terabytes / terabyte"
61 $up parse
"petabytes / petabyte"
62 $up parse
"exabytes / exabyte"
63 $up parse
"milliseconds^-4 gbytes^-3 count x 10^0 / millisecond^-2 gbyte^-1 count x 10"
64 $up parse
"millisec gb^0 count / ms tbytes count x 10^1^1"
65 $up parse
"seconds^1 tbyte^2 count x 10^2 / second^3 tb^4 count x 10^3"
66 $up parse
"seconds tbyte^6 count x 10^2 / second tb^5 count x 10^3"
67 $up parse
"sec pbytes^8 count x 10^4 / minutes pbyte^7 count x 10^5"
68 $up parse
"minute^9 pb count x 10^5 / min^10 ebytes count x 10^6"
69 $up parse
"hours^11 ebyte count x 10^6 / hour^12 eb count x 10^8"
70 $up parse
"hr^11 space-0^12 / time-0^12 space-1^13"
71 $up parse
"time-1 space-2^14 / time-2 space-3^15"
72 $up parse
"time-3 space-3 / counts time-4 space-4"
73 # can't put time-N (N>5) in both divisor & dividend, because no arithmetic scale exists past HOURS (time-5)
74 $up parse
"time-5 space-5 / space-6"
75 $up parse
"time-6 space-7 / space-8"
76 $up parse
"time-7 space-9 / space-10"
77 $up parse
"time-8 space-11 / space-12"
78 $up parse
"time-9 space-13 / space-14"
79 $up parse
"time-10 space-15 / space-0"
86 $up parse
"count x 10^6"
87 $up parse
"count x 10^6^1"
88 $up parse
"count x 10^1^6"
89 $up parse
"25kb^3/1sec^2" # no whitespace
90 $up parse
"sec^-2 / kb^-3" # negative exponents
91 $up parse
"sec^14 / sec^10" # large intermediate exponents
92 $up parse
"kb kb" # repeated units
93 $up parse
"kb / sec sec" # repeated units
94 $up parse
"millisec / sec" # repeated units
96 $up parse
" / 25" # div by zero
97 $up parse
"25 sec^9" # dimension too high
98 $up parse
"Kbyte^8" # exponent overflow
99 $up parse
"microsec^8" # exponent overflow
100 $up parse
"count x 10^-7^-7 / count x 10^7^7" # exponent overflow