Lines Matching +full:- +full:- +full:test +full:- +full:dir
3 [ -f testing.sh ] && . testing.sh
20 TAR='tar c --owner root --group root --mtime @1234567890'
23 # gnu/dammit does more) so look at first N 512-byte frames when
27 if [ -n "$TARHD" ]; then
29 mkfifo xxd-pipe
30 xxd <xxd-pipe & pid=$!
31 tee xxd-pipe | head -c $(($1*512)) | sha1sum | sed "s/ .*//"
32 rm xxd-pipe
35 head -c $(($1*512)) | sha1sum | sed "s/ .*//"
49 "-rw-rw-r-- root/root 0 2009-02-13 23:31 file\n" "" ""
54 testing "pass user" "tar -c --owner nobody --group root --mtime @0 file | LST" \
55 "-rw-rw-r-- nobody/root 0 1970-01-01 00:00 file\n" "" ""
57 # absence of a good portable way to test for the existence of a named group.)
59 testing "pass group" "tar c --owner root --group nobody --mtime @0 file | LST" \
60 "-rw-rw-r-- root/nobody 0 1970-01-01 00:00 file\n" "" ""
62 touch -t 198701231234.56 file
64 "tar c --owner root --group root file | LST --full-time" \
65 "-rw-rw-r-- root/root 0 1987-01-23 12:34:56 file\n" "" ""
68 "tar c --owner root --group root --mode a+x file | LST --full-time" \
69 "-rwxrwxr-x root/root 0 1987-01-23 12:34:56 file\n" "" ""
71 mkdir dir
72 testing "create dir" "$TAR dir | SUM 3" \
75 testing "pass dir" "$TAR dir | LST" \
76 "drwxrwxr-x root/root 0 2009-02-13 23:31 dir/\n" "" ""
78 # note: does _not_ include dir entry in archive, just file
79 touch dir/file
80 testing "create file in dir" "$TAR dir/file | SUM 3" \
84 testing "create dir and dir/file" "$TAR dir | SUM 3" \
87 testing "pass dir/file" "$TAR dir | LST" \
88 …"drwxrwxr-x root/root 0 2009-02-13 23:31 dir/\n-rw-rw-r-- root/root 0 2009-02-13 23:31 dir/file\n"…
90 echo boing > dir/that
91 testing "tar C" "$TAR -C dir that | SUM 3" \
95 ln -s ../name.././.. dir/link
96 testing "create symlink" "$TAR dir/link | SUM 3" \
100 ln dir/file dir/hardlink
101 testing "create hardlink" "$TAR dir/file dir/hardlink | SUM 3" \
104 ln dir/link dir/hlink
105 testing "create hardlink to symlink" "$TAR dir/link dir/hlink | SUM 3" \
108 skipnot mkfifo dir/fifo
109 testing "create dir/fifo" "$TAR dir/fifo | SUM 3" \
112 # test L and K records
115 touch dir/${LONG:1:96} dir/${LONG:1:97}
116 testing "create long fname" "$TAR dir/${LONG:1:97} dir/${LONG:1:96} | SUM 3" \
119 ln -s dir/${LONG:1:96} dir/lshort
120 ln -s dir/${LONG:1:97} dir/llong
121 testing "create long symlnk" "$TAR dir/lshort dir/llong | SUM 3" \
124 ln -s $LONG dir/${LONG:5}
125 testing "create long->long" "$TAR dir/${LONG:5} | SUM 7" \
129 ln -s file dir/linkok
130 testing "create symlink" "$TAR dir/linkok | SUM 3" \
133 ln -s /dev/null dir/linknull
134 testing "pass absolute symlink" "$TAR dir/linknull | LST" \
135 "lrwxrwxrwx root/root 0 2009-02-13 23:31 dir/linknull -> /dev/null\n" "" ""
137 ln -s rel/broken dir/relbrok
138 testing "pass broken symlink" "$TAR dir/relbrok | LST" \
139 "lrwxrwxrwx root/root 0 2009-02-13 23:31 dir/relbrok -> rel/broken\n" "" ""
141 ln -s /does/not/exist dir/linkabsbrok
142 testing "pass broken absolute symlink" "$TAR dir/linkabsbrok | LST" \
143 "lrwxrwxrwx root/root 0 2009-02-13 23:31 dir/linkabsbrok -> /does/not/exist\n" \
149 "tar c --mtime @0 /dev/null 2>/dev/null | LST" \
150 "crw-rw-rw- root/root 1,3 1970-01-01 00:00 dev/null\n" "" ""
153 testing "autodetect gzip" 'LST -f "$FILES"/tar/tar.tgz' \
154 "drwxr-x--- enh/eng 0 2017-05-13 01:05 dir/\n-rw-r----- enh/eng 12 2017-05-13 01:05 dir/file\n" \
157 testing "manually specify bz2" 'LST -jf "$FILES"/tar/tar.tbz2' \
158 "drwxr-x--- enh/eng 0 2017-05-13 01:05 dir/\n-rw-r----- enh/eng 12 2017-05-13 01:05 dir/file\n" \
161 skipnot mknod dir/char c 12 34
162 testing "character special" "tar --mtime @0 -cf test.tar dir/char && rm -f dir/char && tar xf test.…
163 "crw-rw---- 1 root root 12, 34 1970-01-01 00:00 dir/char\n" "" ""
165 skipnot mknod dir/block b 23 45
166 testing "block special" "tar --mtime @0 -cf test.tar dir/block && rm -f dir/block && tar xf test.ta…
167 "brw-rw---- 1 root root 23, 45 1970-01-01 00:00 dir/block\n" "" ""
169 skipnot chown nobody dir/file
170 testing "ownership" "$TAR dir/file | SUM 3" \
173 mkdir -p dd/sub/blah &&
174 tar cf test.tar dd/sub/blah &&
175 rm -rf dd/sub &&
176 ln -s ../.. dd/sub || SKIPNEXT=1
178 "tar xf test.tar 2> /dev/null || echo yes ; [ ! -e dd/sub/blah ] && echo yes" \
183 testing "extract dir/file from tar" \
184 "tar xvCf dd $FILES/tar/tar.tar && stat -c '%A %Y %n' dd/dir dd/dir/file" \
185 "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
188 testing "extract dir/file from tgz (autodetect)" \
189 "tar xvCf dd $FILES/tar/tar.tgz && stat -c '%A %Y %n' dd/dir dd/dir/file" \
190 "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
193 toyonly testing "cat tgz | extract dir/file (autodetect)" \
194 "cat $FILES/tar/tar.tgz | tar xvC dd && stat -c '%A %Y %n' dd/dir dd/dir/file" \
195 "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
198 testing "extract dir/file from tbz2 (autodetect)" \
199 "tar xvCf dd $FILES/tar/tar.tbz2 && stat -c '%A %Y %n' dd/dir dd/dir/file" \
200 "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
203 toyonly testing "cat tbz | extract dir/file (autodetect)" \
204 "cat $FILES/tar/tar.tbz2 | tar xvC dd && stat -c '%A %Y %n' dd/dir dd/dir/file" \
205 "dir/\ndir/file\ndrwxr-x--- 1494637555 dd/dir\n-rw-r----- 1494637555 dd/dir/file\n" \
209 testing "sparse without overflow" "$TAR --sparse fweep | SUM 3" \
218 testing "sparse single overflow" "$TAR --sparse fweep | SUM 6" \
227 truncate -s 20m fweep2
229 testing "sparse double overflow" "$TAR --sparse fweep | SUM 7" \
232 tar c --sparse fweep > fweep.tar
234 testing "sparse extract" "tar xf fweep.tar && $TAR --sparse fweep | SUM 4" \
236 testing "sparse tvf" "tar tvf fweep.tar | grep -wq 13172736 && echo right size"\
240 tar c --sparse fweep2 > fweep2.tar
243 "tar xf fweep2.tar && $TAR --sparse fweep2 | SUM 4" \
250 chmod 700 dir
251 tar cpf tar.tgz dir/file
252 #chmod 700 dir
254 #ls -ld dir/file
256 # restore ownership of file, dir, and symlink
262 # exclusion defaults to --no-anchored and --wildcards-match-slash
266 # add dir with no trailing slash
268 # extract dir/file without dir in tarball
270 # --owner --group --numeric-owner
272 # --owner 0 --group 0
276 # // exclusion defaults to --no-anchored and --wildcards-match-slash
278 # tar tv --owner --group --mtime
279 # extract file within dir date correct
288 unset -f LST