summaryrefslogtreecommitdiff
path: root/qa/214
blob: 60acfcbc57d78f79dbedf940a1618a2bd1c193d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/sh
# PCP QA Test No. 214
# Check timzone of the output archive from pmlogextract.
#
# Copyright (c) 2009 Silicon Graphics, Inc.  All Rights Reserved.
#

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

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

if pmlogextract -\? 2>&1 | grep -q .-f
then
    :
else
    echo "No -f option for pmlogextract to select output timezone" >$seq.notrun
    exit
fi

status=0	# success is the default!
$sudo rm -rf $tmp.*
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

_filter()
{
    sed -e '/PID for pmlogger/d'
}

# real QA test starts here

infiles=`echo src/tzchange*.0 | sed -e 's/\.0//g'`
for file in $infiles
do
    echo "=== $file ==="
    pmdumplog -L -z $file | _filter
    echo
done

for xxx in 1 2 3 4 5
do
    case "$xxx"
    in
	1)	# all 6 archives, 3 timezones
		files="$infiles"
		;;
	2)	# 3 archives, 3 timezones
		files="`ls src/tzchange*.0 | sed -e '/\.meta/d' -e '/\.index/d' | grep '.-a' | tr '\012' ' ' | sed -e 's/  *$//'`"
		;;
	3)	# 2 archives, 2 timezones
		files="`ls src/tzchange*.0 | sed -e '/\.meta/d' -e '/\.index/d' | grep '.-a' | sed -e 2q | tr '\012' ' ' | sed -e 's/  *$//'`"
		;;
	4)	# 1 archive, 1 timezone
		files="`ls src/tzchange*.0 | sed -e '/\.meta/d' -e '/\.index/d' | grep '.-a' | sed -e 1q | tr '\012' ' ' | sed -e 's/  *$//'`"
		;;
	5)	# 2 archives, 1 timezone
		files="`ls src/tzchange*.0 | sed -e '/\.meta/d' -e '/\.index/d' | grep '.-11' | sed -e 2q | tr '\012' ' ' | sed -e 's/  *$//'`"
		;;
    esac

    for arg in "" "-f"
    do
	echo
	echo "=== pmlogextract $arg $files ==="
	rm -f $tmp.*
	pmlogextract -z $arg $files $tmp
	pmdumplog -L -z $tmp | _filter
    done
done

# success, all done
exit