docs: tweak formatting in pmrep(1) archive folio example
[pcp.git] / qa / 217
blob1c94fe5bc7fc356baebaf198abe6eda3f9b77a24
1 #! /bin/sh
2 # PCP QA Test No. 217
3 # check mkaf and pmafm, after file(1) not used
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 rm -f $seq.out $seq.full
17 if [ $PCP_VER -lt 30600 ]
18 then
19 # V1 archives supported
20 LIST="archives/951127.23.01.0 archives/960624.08.17.0 archives/ace.0 tmparch/bar.0 archives/bigace.0 tmparch/bigbin.0 archives/bug.0 tmparch/dodgey-all.0 tmparch/dodgey-mixed.0 tmparch/dodgey-some.0 tmparch/foo.0 tmparch/interp.0 archives/mirage.0 tmparch/mv-bar.0 tmparch/mv-bigbin.0 tmparch/mv-foo.0 tmparch/mv-interp.0 tmparch/truncbin.0"
21 ln $seq.out.1 $seq.out
22 else
23 # no support for V1 archives
24 LIST="archives/951127.23.01_v2.0 archives/960624.08.17_v2.0 archives/ace_v2.0 tmparch/bar.0 archives/bigace_v2.0 tmparch/bigbin.0 archives/bug_v2.0 tmparch/dodgey-all.0 tmparch/dodgey-mixed.0 tmparch/dodgey-some.0 tmparch/foo.0 tmparch/interp.0 archives/mirage.0 tmparch/mv-bar.0 tmparch/mv-bigbin.0 tmparch/mv-foo.0 tmparch/mv-interp.0 tmparch/truncbin.0"
25 ln $seq.out.2 $seq.out
28 tmp=/var/tmp/$$"_pmafm"
29 $sudo rm -rf $tmp $tmp.*
31 status=0
32 trap "rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
34 _filter()
36 host=`hostname`
37 tee -a $here/$seq.full \
38 | sed \
39 -e '/^Created:/{
40 s/'"$host"'/HOSTNAME/
41 s/ at .*/ at DATE/
42 }' \
43 -e "s;`pwd`;<initial-path>/qa;" \
44 -e '/^Creator:/{
45 s/mkaf/MKAF_OR_CHART/
46 s/kmchart/MKAF_OR_CHART/
47 s/pmchart/MKAF_OR_CHART/
48 }' \
49 | $PCP_AWK_PROG '
50 $1 == "Archive:" { if ($3 ~ /bar$/ || $3 ~ /bigbin$/ ||
51 $3 ~ /dodgey/ || $3 ~ /foo$/ ||
52 $3 ~ /interp$/ || $3 ~ /truncbin$/)
53 $2 = "HOSTNAME"
54 # Host Basename
56 printf "%-16s%-24s%s\n",$1,$2,$3
57 next
59 { print }'
63 # fake out the old pcp/qa/src directory structure
65 mkdir -p $tmp/src
66 for arch in $LIST
68 pat=`echo $arch | sed -e 's/0$/*/'`
69 cp $pat $tmp/src
70 done
71 cd $tmp
72 echo "tmp=$tmp" >>$here/$seq.full
73 echo "pwd: `pwd`" >>$here/$seq.full
74 ( echo "src dir ..."; ls src ) >>$here/$seq.full
76 HERE=`pwd`
77 ABSLIST=""
78 RELLIST=""
79 for i in $LIST
81 ABSLIST="$ABSLIST $HERE/$i"
82 RELLIST="$RELLIST $i"
83 done
86 # real QA test starts here
87 echo "=== relative names ==="
88 cd src
89 echo $LIST | sed -e 's/ /\
90 /g' | sed -e 's;^.*/;;' >$tmp.tmp
91 mkaf `cat $tmp.tmp` >tmp.af
92 _filter <tmp.af
93 rm -f $tmp.tmp
94 echo
95 pmafm tmp.af check
96 rm -f tmp.af
97 cd ..
99 echo
100 echo "=== absolute pathnames ==="
101 echo $ABSLIST | sed -e 's/ /\
102 /g' | sed -e 's;/archives/;/src/;' -e 's;/tmparch/;/src/;' >$tmp.tmp
103 mkaf `cat $tmp.tmp` >tmp.af
104 rm -f $tmp.tmp
105 _filter <tmp.af
106 echo
107 pmafm tmp.af check 2>&1 | sed -e "s;`pwd`;<initial-path>/qa;"
108 rm -f tmp.af
110 echo
111 echo "=== relative names, down one dir ==="
112 echo $RELLIST | sed -e 's/ /\
113 /g' | sed -e 's;^.*/;src/;' >$tmp.tmp
114 mkaf `cat $tmp.tmp` >tmp.af
115 rm -f $tmp.tmp
116 _filter <tmp.af
117 echo
118 pmafm tmp.af check
119 rm -f tmp.af
121 # all done
122 exit