3 # Basic workout for pmGetOptions PMAPI interfaces.
5 # Copyright (c) 2014 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 status
=1 # failure is the default!
17 $sudo rm -rf $tmp.
* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
20 # real QA test starts here
21 echo '== Arguments: none'
24 echo '== Arguments: usage (x2)'
25 $here/src
/getoptions
-?
26 $here/src
/getoptions
--help
28 echo '== Arguments: own options (x2)'
29 $here/src
/getoptions
-x -X goodness
30 $here/src
/getoptions
--extra --eXtra goodness
32 echo '== Arguments: own short-only options'
33 $here/src
/getoptions
-y -Y not
35 echo '== Arguments: own long-only options'
36 $here/src
/getoptions
--fubar --foobar eek
38 echo '== Arguments: one archive, all time options (x2)'
39 $here/src
/getoptions
-a archives
/20041125.0 -z \
40 -A "1 minute" -O "@10:10:10" -S "@10:15" -T "@10:30" \
42 $here/src
/getoptions
--archive archives
/20041125.0 --hostzone \
43 --align "1 minute" --origin "@10:10:10" \
44 --start "@10:15" --finish "@10:30" $here/src
/getoptions
46 echo '== Arguments: one host (x2)'
47 $here/src
/getoptions
-h foo.bar.com
-t 1sec
-s 5
48 $here/src
/getoptions
--host foo.bar.com
--interval 1sec
--samples 5
50 echo '== Arguments: environment variables only'
51 PM_OPTFLAG_ENV_ONLY
=true PCP_HOST
=pcp.org
$here/src
/getoptions
-h non.org
53 echo '== Arguments: host, interval and samples env vars'
54 PCP_HOST
=pcp.org PCP_INTERVAL
="2 seconds" PCP_SAMPLES
=5 $here/src
/getoptions
56 echo '== Arguments: host list env var'
57 PCP_HOST_LIST
=foo.com
,bar.org
$here/src
/getoptions
59 echo '== Arguments: archive, time window env vars'
60 PCP_ARCHIVE
=archives
/20041125.0 PCP_HOSTZONE
=true \
61 PCP_ALIGN
="1 minute" PCP_ORIGIN
="@10:10:10" \
62 PCP_START_TIME
="@10:15" PCP_FINISH_TIME
="@10:30" $here/src
/getoptions
64 echo '== Arguments: archive list env var'
65 PCP_ARCHIVE_LIST
=foo
,bar
,moo
$here/src
/getoptions
67 echo '== Arguments: one archive env var'
68 PCP_ARCHIVE
=foo
$here/src
/getoptions
70 echo '== Arguments: timezone env var'
71 PCP_TIMEZONE
=UTC
$here/src
/getoptions
73 echo '== Arguments: hostzone env var'
74 PCP_HOSTZONE
=true
$here/src
/getoptions
76 echo '== Arguments: gui port env var (x2)'
77 PCP_GUIPORT
=42 $here/src
/getoptions
78 PCP_GUIPORT
=/tmp
/socket
$here/src
/getoptions
80 echo '== Arguments: gui mode env var'
81 PCP_GUIFLAG
=true
$here/src
/getoptions
83 echo '== Arguments: allow mixed hosts and archives'
84 PM_OPTFLAG_MIXED
=true PCP_HOST
=acme.com PCP_ARCHIVE
=log
$here/src
/getoptions
86 echo '== Arguments: hosts file'
87 echo foo.bar.com
> $tmp.hosts
88 echo acme.com
>> $tmp.hosts
89 PM_OPTFLAG_MULTI
=true
$here/src
/getoptions
-H $tmp.hosts