summaryrefslogtreecommitdiff
path: root/qa/250
blob: fb32df820d7278b5fa96e0bf3eb2f668795e53a1 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#! /bin/sh
# PCP QA Test No. 250
# Rebuild -u should be idempotent in this case
#
# 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

rm -f $seq.out
if [ $PCP_PLATFORM = irix ]
then
    ln $seq.out.irix $seq.out
elif [ $PCP_PLATFORM = linux -o $PCP_PLATFORM = darwin -o $PCP_PLATFORM = solaris ]
then
    if [ $PCP_VER -lt 3600 ]
    then
	ln $seq.out.linux $seq.out
    else
	ln $seq.out.3 $seq.out
    fi
else
    _notrun "Need qualified output for $PCP_PLATFORM"
fi

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

_copy_Rebuild()
{
    scr_src=$PCP_VAR_DIR/pmns/
    cp $scr_src/Rebuild $1
    if [ -f $scr_src/Xlate-irix-names ]
    then
	cp $scr_src/Xlate-irix-names $1
    fi
}

_filter()
{
    sed \
	-e "s;$tmp;TMP;g"
}

_remove_rebuild()
{
    rm -f $1/Rebuild 
    if [ -f $1/Xlate-irix-names ]
    then
	rm -f $1/Xlate-irix-names
    fi
}

# real QA test starts here
mkdir $tmp
cd $tmp

cat >irix-root <<End-of-File
	irix
End-of-File

cat >irix-pmns <<End-of-File
irix {
	bar
	foo
}
irix.foo {
	one	1:1:1
	two	1:1:2
	mumble
}
irix.bar {
	three	1:1:3
}
irix.foo.mumble {
	four	1:1:4
}
End-of-File

cat >root <<End-of-File
root {
	irix
	snarf
	ten	10:1:1
}
irix {
	bar
	foo
}
irix.bar {
	three	1:1:3
}
irix.foo.mumble {
	four	1:1:4
}
irix.foo {
	one	1:1:1
	two	1:1:2
	mumble
}
snarf {
	eleven 11:1:1
}
End-of-File

pminfo -m -n root | LC_COLLATE=POSIX sort >ref

ls -l root >before
ls >>before

echo "Initial files inventory ..."
touch after
ls

echo
echo "Without root.bin ..."

_copy_Rebuild .
$sudo ./Rebuild -u \
| _filter
_remove_rebuild .

ls -l root >after
ls | sed '/^after$/d' >>after

echo "File state differences ..."
diff before after

echo "PMNS differences ..."
pminfo -m -n root | LC_COLLATE=POSIX sort | diff ref -

if [ $PCP_VER -lt 3600 ]
then
    echo
    echo "With root.bin ..."
    pmnscomp -f -n root root.bin

    rm -f after
    ls -l root root.bin >before
    ls >>before

    _copy_Rebuild .
    $sudo ./Rebuild -u \
    | _filter
    _remove_rebuild .

    ls -l root root.bin >after
    ls | sed '/^after$/d' >>after

    echo "File state differences ..."
    diff before after

    echo "PMNS differences ..."
    pminfo -m -n root | LC_COLLATE=POSIX sort | diff ref -
fi

status=0
exit