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
|
#!/bin/sh -x
set -e
TMP=./tmp
PATH=$PATH:/usr/bin/X11
export PATH
umask 022
if test ! -d $TMP; then
mkdir $TMP
fi
cd $TMP;
#test 1: try some silly mkdir, chmod, chown commands
# and see if we get the same tar file as I
# did when I created the lot as RealRoot:
rm -rf tar
mkdir tar
cd tar
LIST="1 2 3 4 5 6 fjsdk 1289 vn.34.654l."
CLIST=1,2,3,4,5,6,fjsdk,1289,vn.34.654l.
for f in $LIST; do
mkdir -p $f/$f/$f.hello
touch $f/$f/file
done
#do some mv/rm stuff.
#The "mv" part used to confuse fakeroot_0.0-6
# (inodes weren't removed from cache)
FILES=`eval echo {mv,rm}.{$CLIST}`
touch $FILES
chown sys:sys $FILES
for f in $LIST; do
mv mv.$f gone
rm rm.$f
done
rm gone
for f in $LIST; do
mkdir -p hello/$f
touch hello/$f/file
touch $f.file
done
chown sys:sys -R 2
chown sys:root -R 3 4
chmod u+xs -R 2
chmod u+s 5
echo "0123456789012" > hello/hello
chmod 0 hello hello/* #tar/hello/vn.34.654l./{,file}
cd ..
rm -f tartest.tar.gz
uudecode ../tartest.tar.gz.uue
tar -czf faketar.tar.gz tar
../compare-tar tartest.tar.gz faketar.tar.gz
#test 2: try to unpack, pack the tar archive, and
# see if the result is the same archive
# (yes, I've created bugs that would past test1, but
# not test2)
rm -rf tar
tar -xzf tartest.tar.gz
tar -czf tartest.test.tar.gz tar
../compare-tar tartest.tar.gz tartest.test.tar.gz
#Would like to do this, but fakedebug doens't generate stdout (yet), so
#I cannot do this yet.
#
#rm -rf tar tmp-1 tmp-2 *.tar.gz
#if test "`../../fakedebug`"; then
# echo "Outout of fakedebug isn't zero, after cleaning up everything:"
# ../../fakedebug
# exit 1
#fi
|