Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 122
blob00f67cbb0a5ea5c3c320d1be37a120c90858e02d
1 #! /bin/sh
2 # PCP QA Test No. 122
3 # arg parsing botches for
4 # pmtrace -h host -v value tag
5 # pmtrace -D ...
7 # Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
8 #
10 seq=`basename $0`
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
14 . ./common.product
15 . ./common.filter
16 . ./common.check
18 status=0 # success is the default!
19 $sudo rm -rf $tmp.*
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 rm -f $seq.full
24 # stolen from getpmcdhosts
26 check=`echo a | od -x 2>&1 | sed -e 's/^0[^ ]* *//' -e 's/ //g' -e '/^$/d'`
27 case "$check"
29 0a61)
30 # little, want big
32 want=big
33 echo "I am little endian, looking for pmtrace PMDA on a big endian platform" >>$seq.full
35 610a)
36 # big, want little
38 want=little
39 echo "I am big endian, looking for pmtrace PMDA on a little endian platform" >>$seq.full
42 echo "Arrgh ... od -x returned something odd ($check)"
43 echo a | od -x
44 status=1
45 exit
47 esac
49 # find the trace PMDA running somewhere else with tho other endianess
51 host=`./getpmcdhosts -L -n 1 -a trace -e $want`
52 if [ -z "$host" ]
53 then
54 echo "Cannot find $want endian host running pmdatrace" >$seq.notrun
55 exit
57 echo "remote host: $host" >>$seq.full
59 # real QA test starts here
60 for val in 42 1234.5678 -3.14132
62 pmtrace -h $host -v $val "qa/$seq-value"
63 pminfo -h $host -f trace.observe.value | grep "qa/$seq-value"
64 done
66 # success, all done
67 exit