#! /bin/sh
# PCP QA Test No. 079
# exercise -z, -Z and -S for pmclient
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard filters
. ./common.product
. ./common.filter
. ./common.check

trap "rm -f $tmp.*; exit 0" 0 1 2 3 15

# need a constant archive for this ...
#
ARCH=archives/moomba.client

_filter()
{
    sed -e "s;$PCP_DOC_DIR;\$PCP_DOC_DIR;"
}

# real QA test starts here

# Skip ... Header 12 bytes
# plus Label fluff ... magic(4) + pid(4) + start(4)
#
echo "Dump hostname & TZ ..."
# od(1) format is not quite consistent, hence the final sed
#
dd bs=1 skip=24 count=104 if=$ARCH.0 2>/dev/null \
| od -c \
| sed -e 's/  */ /g' -e 's/  *$//'

echo ""
TZ=EST-10
export TZ
echo "Local time, TZ=$TZ"
pmclient -a $ARCH | _filter

echo ""
echo "-Z UTC"
pmclient -a $ARCH -Z UTC | _filter

echo ""
echo "-Z PDT8"
pmclient -a $ARCH -Z PDT8 | _filter

echo ""
echo "local time at collection host"
pmclient -a $ARCH -z | _filter

echo ""
echo "and again, but skip 15 seconds"
pmclient -a $ARCH -S 15 -z | _filter
