summaryrefslogtreecommitdiff
path: root/qa/251
blob: 376170737826985e34431b26d3a75209fb36be55 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#! /bin/sh
# PCP QA Test No. 251
# libpcp for archives with missing volumes
#
# 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

_filter()
{
    sed \
	-e '/host:/s/ [^ ].*/ HOST/' \
	-e '/start:/s/ [^ ].*/ DATE/' \
	-e '/end:/s/ [^ ].*/ DATE/' \
	-e 's/^..:..:..\..../TIMESTAMP   /' \
	-e '/No values available/d'
    if [ "`echo core*`" != "core*" ]
    then
	$PCP_ECHO_PROG $PCP_ECHO_N "Dumped core! ... saved in""$PCP_ECHO_C"
	$sudo rm -f $here/core*
	for c in core*
	do
	    $sudo mv $c $here/$c
	    $PCP_ECHO_PROG $PCP_ECHO_N " $here/$c""$PCP_ECHO_C"
	done
	echo
	touch die
    fi
}

status=1	# failure is the default!
trap "cd $here; rm -rf $tmp; exit \$status" 0 1 2 3 15

# real QA test starts here
mkdir $tmp
cp src/mv-bar.* $tmp
offset=`_arch_start src/mv-bar 0`
cd $tmp

for inst in "bin-100" "bin-100,bin-500,bin-900"
do
    echo
    echo "All volumes present ... $inst ..."
    pmval -O $offset -D128 -t2 -a mv-bar -i $inst sampledso.bin 2>err >out
    egrep 'Skip|Change' err
    _filter <out
    [ -f die ] && exit

    echo
    echo "First volume missing ... $inst ..."
    mv mv-bar.0 foo.0
    pmval -O $offset -D128 -t2 -a mv-bar -i $inst sampledso.bin 2>err >out
    egrep 'Skip|Change' err
    _filter <out
    [ -f die ] && exit
    mv foo.0 mv-bar.0

    echo
    echo "Last volume missing ... $inst ..."
    mv mv-bar.3 foo.3
    pmval -O $offset -D128 -t2 -a mv-bar -i $inst sampledso.bin 2>err >out
    egrep 'Skip|Change' err
    _filter <out
    [ -f die ] && exit
    mv foo.3 mv-bar.3

    echo
    echo "Second volume missing ... $inst ..."
    mv mv-bar.1 foo.1
    pmval -O $offset -D128 -t2 -a mv-bar -i $inst sampledso.bin 2>err >out
    egrep 'Skip|Change' err
    _filter <out
    [ -f die ] && exit
    mv foo.1 mv-bar.1

    echo
    echo "Second last volume missing ... $inst ..."
    mv mv-bar.2 foo.2
    pmval -O $offset -D128 -t2 -a mv-bar -i $inst sampledso.bin 2>err >out
    egrep 'Skip|Change' err
    _filter <out
    [ -f die ] && exit
    mv foo.2 mv-bar.2

    echo
    echo "All volumes but second missing ... $inst ..."
    mv mv-bar.0 foo.0
    mv mv-bar.2 foo.2
    mv mv-bar.3 foo.3
    pmval -O $offset -D128 -t2 -a mv-bar -i $inst sampledso.bin 2>err >out
    egrep 'Skip|Change' err
    _filter <out
    [ -f die ] && exit
    mv foo.0 mv-bar.0
    mv foo.2 mv-bar.2
    mv foo.3 mv-bar.3

done

# success, all done
status=0
exit