lose the generated ps files
[debian/dds2tar] / dds2tar-test.sh
1 #!/bin/sh
2 make
3
4 if test q$TAPE = q ; then export TAPE=/dev/nst0 ; fi
5 case $TAPE in
6 /dev/nst0|/dev/st0) V=`scsi_vendor tape 1` ;;
7 /dev/nst1|/dev/st1) V=`scsi_vendor tape 2` ;;
8 esac
9
10 echo Tape vendor is $V
11 echo =======================
12
13 case $V in
14 HP) B=32 ;;
15 *) B=32 ;;
16 esac
17
18 X="--exclude=index*"
19
20 echo $B
21 echo $X
22
23 #===================1==========================================================
24 echo 'dds2tar-test  1>' make
25 make
26
27 #===================2==========================================================
28 echo ' '
29 echo 'dds2tar-test  2>' 'make of?'
30 if test ! -x ./dds2tar ; then exit 1 ; fi
31
32 #===================3==========================================================
33 echo ' '
34 echo 'dds2tar-test  3>' creating soft links
35 ln -sf ./dds2tar ./dds2index
36 ln -sf ./dds2tar ./mt-dds
37
38 #===================4==========================================================
39 echo ' '
40 echo 'dds2tar-test  4>' creating soft and hard links
41 ln -s dds2tar dds2tar-test-tape-link-soft
42 ln dds2tar dds2tar-test-tape-link-hard
43
44 #===================5==========================================================
45 echo ' '
46 echo 'dds2tar-test  5>' tar c .
47 tar c $X .
48
49 #===================6==========================================================
50 echo ' '
51 echo 'dds2tar-test  6>' tar -c --label dds2tar -b $B ... .
52 tar --label dds2tar --record-file index-of-tar $X -R -v -c -b $B .
53
54 I=`grep 'number of the file' index-of-tar | cut -c 38-43`
55 if test q"$I" = q ; then I=1 ; fi 
56 if test $I = 0 ; then exit 1 ; fi
57 I=`expr $I - 1`
58 echo file number of the archive written is $I
59 if test "$I" = "" ; then exit 1 ; fi
60
61 #===================7==========================================================
62 echo ' '
63 echo 'dds2tar-test  7>' tar -c . ...
64 tar --record-file index-of-tar-v -v -R -v -c -b $B $X .
65
66 #===================8==========================================================
67 echo ' '
68 echo 'dds2tar-test  8>' mt rewind \; mt fsf $I
69 mt rewind ; mt fsf $I
70
71 #===================9==========================================================
72 echo ' '
73 echo 'dds2tar-test  9>' mt-dds tell
74 ./mt-dds tell
75
76 #==================10==========================================================
77 echo ' '
78 echo 'dds2tar-test 10>' mt-dds label
79 ./mt-dds label
80
81 #==================11==========================================================
82 echo ' '
83 echo 'dds2tar-test 11>' mt-dds
84 ./mt-dds
85
86 #==================12==========================================================
87 echo ' '
88 echo 'dds2tar-test 12>' dds2index
89 ./dds2index -t index-of-dds2index
90
91 #==================13==========================================================
92 echo ' '
93 echo 'dds2tar-test 13>' find '*tape*' using index-of-tar
94 ./dds2tar -t index-of-tar '*tape*' | tar fvt -
95
96 #==================14==========================================================
97 echo ' '
98 echo 'dds2tar-test 14>' find '*tape*' using index-of-tar-v
99 ./dds2tar -t index-of-tar-v '*tape*' | tar fvt -
100
101 #==================15==========================================================
102 echo ' '
103 echo 'dds2tar-test 15>' find '*tape*' using index-of-dds2index
104 ./dds2tar -t index-of-dds2index '*tape*' | tar vft -
105
106 #==================16==========================================================
107 echo ' '
108 echo 'dds2tar-test 16>' dds2tar -t index-of-tar --body Changes '|wc -c'
109 ./dds2tar -t index-of-tar --body Changes | wc -c
110 ls -l Changes
111
112 #==================17==========================================================
113 echo 'dds2tar-test 17>' mt rewind \; mt fsf $I
114 mt rewind ; mt fsf $I
115
116 #==================18==========================================================
117 echo ' '
118 echo 'dds2tar-test 18>mt-dds'
119 mt-dds
120
121 #==================19==========================================================
122 echo ' '
123 echo 'dds2tar-test 19> mt-dds tell >'index-of-tar-t
124 mt-dds tell >index-of-tar-t
125
126 #==================20==========================================================
127 echo ' '
128 echo 'dds2tar-test 20> tar tR >>' index-of-tar-t
129 tar tR >> index-of-tar-t
130
131 #==================21==========================================================
132 echo ' '
133 echo 'dds2tar-test 21>' grep -v "'loc        '" '< index-of-tar-t > index-of-tar-t2'
134 grep -v 'loc        ' < index-of-tar-t > index-of-tar-t2
135
136 #==================22==========================================================
137 echo 'dds2tar-test 22>' mt rewind \; mt fsf $I
138 mt rewind ; mt fsf $I
139
140 #==================23==========================================================
141 echo 'dds2tar-test 23>' find '*tape*' using index-of-tar-t2 and mt-dds
142 echo 'dda2tar-test 23>' ./dds2tar '`mt-dds`' -t index-of-tar-t2 "'*tape*' | tar bvft 1 -"
143 ./dds2tar `mt-dds` -v -t index-of-tar-t2 '*tape*' | tar bvft 1 -
144
145 #==================24==========================================================
146 echo 'dds2tar-test 24>' mt rewind \; mt fsf $I
147 mt rewind ; mt fsf $I
148
149 #==================25==========================================================
150 echo 'dds2tar-test 25>' removing links
151 /bin/rm dds2tar-test-tape-link-soft
152 /bin/rm dds2tar-test-tape-link-hard
153