Sun, 20 Jul 2008 21:39:39 -0400
Move more common extraction/listing functionality into BaseExtractor.
I noticed that a lot of the extract_archive/get_filenames implementations
were the same two lines of code: a pipe and a run_pipes. Short as it is,
there's no reason to keep repeating that two-line incantation, so I moved
this basic pattern into BaseExtractor.
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
1 | - name: basic .tar |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
2 | filenames: test-1.23.tar |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
3 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
4 | tar -xf $1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
5 | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
6 | - name: basic .tar.gz |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
7 | filenames: test-1.23.tar.gz |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
8 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
9 | tar -zxf $1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
10 | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
11 | - name: basic .tar.bz2 |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
12 | filenames: test-1.23.tar.bz2 |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
13 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
14 | mkdir test-1.23 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
15 | cd test-1.23 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
16 | tar -jxf ../$1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
17 | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
18 | - name: basic .zip |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
19 | filenames: test-1.23.zip |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
20 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
21 | mkdir test-1.23 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
22 | cd test-1.23 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
23 | unzip -q ../$1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
24 | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
25 | - name: basic .deb |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
26 | filenames: test-1.23_all.deb |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
27 | baseline: | |
29
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
28 | mkdir test-1.23 |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
29 | cd test-1.23 |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
30 | ar p ../$1 data.tar.gz | tar -zx |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
31 | |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
32 | - name: basic .gem |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
33 | filenames: test-1.23.gem |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
34 | baseline: | |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
35 | mkdir test-1.23 |
29
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
36 | cd test-1.23 |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
37 | tar -xOf ../$1 data.tar.gz | tar -zx |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
38 | |
31
c3a2760d1c3a
[svn] Refactor actions (extract the archive, vs. list the contents) into their
brett
parents:
30
diff
changeset
|
39 | - name: basic .7z |
c3a2760d1c3a
[svn] Refactor actions (extract the archive, vs. list the contents) into their
brett
parents:
30
diff
changeset
|
40 | filenames: test-1.23.7z |
c3a2760d1c3a
[svn] Refactor actions (extract the archive, vs. list the contents) into their
brett
parents:
30
diff
changeset
|
41 | baseline: | |
c3a2760d1c3a
[svn] Refactor actions (extract the archive, vs. list the contents) into their
brett
parents:
30
diff
changeset
|
42 | 7z x $1 |
c3a2760d1c3a
[svn] Refactor actions (extract the archive, vs. list the contents) into their
brett
parents:
30
diff
changeset
|
43 | |
34
a8f875e02c83
[svn] Add support for LZMA compression. Holy crap that was easy.
brett
parents:
33
diff
changeset
|
44 | - name: basic .lzma |
a8f875e02c83
[svn] Add support for LZMA compression. Holy crap that was easy.
brett
parents:
33
diff
changeset
|
45 | filenames: test-1.23.tar.lzma |
a8f875e02c83
[svn] Add support for LZMA compression. Holy crap that was easy.
brett
parents:
33
diff
changeset
|
46 | baseline: | |
a8f875e02c83
[svn] Add support for LZMA compression. Holy crap that was easy.
brett
parents:
33
diff
changeset
|
47 | lzcat $1 | tar -x |
a8f875e02c83
[svn] Add support for LZMA compression. Holy crap that was easy.
brett
parents:
33
diff
changeset
|
48 | |
76
705642fcb92c
Give extraction stderr more context, and suppress normal cpio stderr junk.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
71
diff
changeset
|
49 | - name: basic .cpio |
705642fcb92c
Give extraction stderr more context, and suppress normal cpio stderr junk.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
71
diff
changeset
|
50 | filenames: test-1.23.cpio |
705642fcb92c
Give extraction stderr more context, and suppress normal cpio stderr junk.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
71
diff
changeset
|
51 | baseline: | |
705642fcb92c
Give extraction stderr more context, and suppress normal cpio stderr junk.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
71
diff
changeset
|
52 | cpio -i --make-directories <$1 |
705642fcb92c
Give extraction stderr more context, and suppress normal cpio stderr junk.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
71
diff
changeset
|
53 | antigrep: blocks? |
705642fcb92c
Give extraction stderr more context, and suppress normal cpio stderr junk.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
71
diff
changeset
|
54 | |
29
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
55 | - name: .deb metadata |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
56 | filenames: test-1.23_all.deb |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
57 | options: --metadata |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
58 | baseline: | |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
59 | mkdir test-1.23 |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
60 | cd test-1.23 |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
61 | ar p ../$1 control.tar.gz | tar -zx |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
62 | |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
63 | - name: .gem metadata |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
64 | filenames: test-1.23.gem |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
65 | options: -m |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
66 | baseline: | |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
67 | tar -xOf $1 metadata.gz | zcat > test-1.23.gem-metadata.txt |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
68 | cleanup: rm -f test-1.23.gem-metadata.txt |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
69 | posttest: | |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
70 | if [ "x`cat test-1.23.gem-metadata.txt`" != "xhi" ]; then exit 1; fi |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
71 | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
72 | - name: recursion and permissions |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
73 | filenames: test-recursive-badperms.tar.bz2 |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
74 | options: -n -r |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
75 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
76 | mkdir test-recursive-badperms |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
77 | cd test-recursive-badperms |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
78 | tar -jxf ../$1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
79 | mkdir test-badperms |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
80 | cd test-badperms |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
81 | tar -xf ../test-badperms.tar |
23
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
82 | chmod 700 testdir |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
83 | posttest: | |
29
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
84 | if [ "x`cat test-recursive-badperms/test-badperms/testdir/testfile`" != \ |
5fad99c17221
[svn] Add support for Ruby Gems, and extracting metadata from .deb/.gem files.
brett
parents:
28
diff
changeset
|
85 | "xhey" ]; then exit 1; fi |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
86 | |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
87 | - name: decompressing gz |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
88 | directory: inside-dir |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
89 | filenames: ../test-text.gz |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
90 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
91 | zcat $1 >test-text |
22
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
92 | posttest: | |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
93 | if [ "x`cat test-text`" != "xhi" ]; then exit 1; fi |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
94 | |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
95 | - name: decompressing bz2 |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
96 | directory: inside-dir |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
97 | filenames: ../test-text.bz2 |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
98 | baseline: | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
99 | bzcat $1 >test-text |
22
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
100 | posttest: | |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
101 | if [ "x`cat test-text`" != "xhi" ]; then exit 1; fi |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
102 | |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
103 | - name: decompression with -r |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
104 | directory: inside-dir |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
105 | filenames: ../test-text.gz |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
106 | options: -n -r |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
107 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
108 | zcat $1 >test-text |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
109 | |
16
29794d4d41aa
[svn] There's now an entirely new object hierarchy for handlers, because the
brett
parents:
15
diff
changeset
|
110 | - name: decompression with -fr |
29794d4d41aa
[svn] There's now an entirely new object hierarchy for handlers, because the
brett
parents:
15
diff
changeset
|
111 | directory: inside-dir |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
112 | filenames: ../test-text.gz |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
113 | options: -n -fr |
16
29794d4d41aa
[svn] There's now an entirely new object hierarchy for handlers, because the
brett
parents:
15
diff
changeset
|
114 | baseline: | |
29794d4d41aa
[svn] There's now an entirely new object hierarchy for handlers, because the
brett
parents:
15
diff
changeset
|
115 | zcat $1 >test-text |
29794d4d41aa
[svn] There's now an entirely new object hierarchy for handlers, because the
brett
parents:
15
diff
changeset
|
116 | |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
117 | - name: overwrite protection |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
118 | filenames: test-1.23.tar.bz2 |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
119 | baseline: | |
30
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
120 | mkdir test-1.23.1 |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
121 | cd test-1.23.1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
122 | tar -jxf ../$1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
123 | prerun: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
124 | mkdir test-1.23 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
125 | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
126 | - name: overwrite option |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
127 | filenames: test-1.23.tar.bz2 |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
128 | options: -n -o |
14
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
129 | baseline: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
130 | cd test-1.23 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
131 | tar -jxf ../$1 |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
132 | prerun: | |
6f9e1bb59719
[svn] Add support for just decompressing files that are compressed. So, if you
brett
parents:
diff
changeset
|
133 | mkdir test-1.23 |
15
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
134 | |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
135 | - name: flat option |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
136 | directory: inside-dir |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
137 | filenames: ../test-1.23.tar.bz2 |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
138 | options: -n -f |
15
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
139 | baseline: | |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
140 | tar -jxf $1 |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
141 | |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
142 | - name: flat recursion and permissions |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
143 | directory: inside-dir |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
144 | filenames: ../test-recursive-badperms.tar.bz2 |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
145 | options: -n -fr |
15
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
146 | baseline: | |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
147 | tar -jxf $1 |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
148 | tar -xf test-badperms.tar |
22
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
149 | chmod 700 testdir |
15
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
150 | posttest: | |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
151 | if [ "x`cat testdir/testfile`" != "xhey" ]; then exit 1; fi |
28dbd52a8bb8
[svn] Add a -f/--flat option, which will extract the archive contents into the
brett
parents:
14
diff
changeset
|
152 | |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
153 | - name: no files |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
154 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
155 | grep: "[Uu]sage" |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
156 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
157 | - name: bad file |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
158 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
159 | filenames: nonexistent-file.tar |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
160 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
161 | - name: not an archive |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
162 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
163 | filenames: tests.yml |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
164 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
165 | - name: bad options |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
166 | options: -n --nonexistent-option |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
167 | filenames: test-1.23.tar |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
168 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
169 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
170 | - name: --version |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
171 | options: -n --version |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
172 | grep: ersion \d+\.\d+ |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
173 | filenames: test-1.23.tar |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
174 | baseline: | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
175 | exit 0 |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
176 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
177 | - name: one good archive of many |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
178 | filenames: tests.yml test-1.23.tar nonexistent-file.tar |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
179 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
180 | baseline: | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
181 | tar -xf $2 |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
182 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
183 | - name: silence |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
184 | filenames: tests.yml |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
185 | options: -n -qq |
17
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
186 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
187 | antigrep: . |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
188 | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
189 | - name: can't write to directory |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
190 | directory: inside-dir |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
191 | filenames: ../test-1.23.tar |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
192 | error: true |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
193 | grep: ERROR |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
194 | antigrep: Traceback |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
195 | prerun: | |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
196 | chmod 500 . |
481a2b4be471
[svn] Lots of tests for various boundary cases, and slightly better handling for
brett
parents:
16
diff
changeset
|
197 | |
19 | 198 | - name: list contents of one file |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
199 | options: -n -l |
19 | 200 | filenames: test-1.23.tar |
201 | output: | | |
202 | test-1.23/ | |
203 | test-1.23/1/ | |
204 | test-1.23/1/2/ | |
205 | test-1.23/1/2/3 | |
206 | test-1.23/a/ | |
207 | test-1.23/a/b | |
208 | test-1.23/foobar | |
209 | ||
210 | - name: list contents of multiple files | |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
211 | options: -n --table |
19 | 212 | filenames: test-1.23_all.deb test-1.23.zip |
213 | output: | | |
214 | test-1.23_all.deb: | |
215 | 1/ | |
216 | 1/2/ | |
217 | 1/2/3 | |
218 | a/ | |
219 | a/b | |
220 | foobar | |
221 | ||
222 | test-1.23.zip: | |
223 | 1/2/3 | |
224 | a/b | |
225 | foobar | |
226 | ||
227 | - name: list contents of compressed file | |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
228 | options: -n -t |
19 | 229 | filenames: test-text.gz |
230 | output: test-text | |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
231 | |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
232 | - name: default behavior with one directory (gz) |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
233 | options: -n |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
234 | filenames: test-onedir.tar.gz |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
235 | baseline: | |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
236 | mkdir test-onedir |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
237 | cd test-onedir |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
238 | tar -zxf ../$1 |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
239 | |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
240 | - name: one directory extracted inside another (gz) |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
241 | options: "" |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
242 | filenames: test-onedir.tar.gz |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
243 | grep: one directory |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
244 | input: i |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
245 | baseline: | |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
246 | mkdir test-onedir |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
247 | cd test-onedir |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
248 | tar -zxf ../$1 |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
249 | |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
250 | - name: one directory extracted with rename (gz) |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
251 | options: "" |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
252 | filenames: test-onedir.tar.gz |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
253 | input: r |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
254 | baseline: | |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
255 | tar -zxf $1 |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
256 | mv test test-onedir |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
257 | |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
258 | - name: one directory extracted here (gz) |
20
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
259 | options: "" |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
260 | filenames: test-onedir.tar.gz |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
261 | input: h |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
262 | baseline: | |
69c93c3e6972
[svn] If the archive contains one directory with the "wrong" name, ask the user
brett
parents:
19
diff
changeset
|
263 | tar -zxf $1 |
21
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
264 | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
265 | - name: default behavior with one directory (bz2) |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
266 | options: -n |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
267 | filenames: test-onedir.tar.gz |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
268 | baseline: | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
269 | mkdir test-onedir |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
270 | cd test-onedir |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
271 | tar -zxf ../$1 |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
272 | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
273 | - name: one directory extracted inside another (bz2) |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
274 | options: "" |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
275 | filenames: test-onedir.tar.gz |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
276 | input: i |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
277 | baseline: | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
278 | mkdir test-onedir |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
279 | cd test-onedir |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
280 | tar -zxf ../$1 |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
281 | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
282 | - name: one directory extracted with rename (bz2) |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
283 | options: "" |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
284 | filenames: test-onedir.tar.gz |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
285 | input: r |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
286 | baseline: | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
287 | tar -zxf $1 |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
288 | mv test test-onedir |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
289 | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
290 | - name: one directory extracted here (bz2) |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
291 | options: "" |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
292 | filenames: test-onedir.tar.gz |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
293 | input: h |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
294 | baseline: | |
fd3e10410040
[svn] Do some tests with a .tar.bz2 as well as a .tar.gz. I thought there were
brett
parents:
20
diff
changeset
|
295 | tar -zxf $1 |
22
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
296 | |
38
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
297 | - name: default behavior with one file |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
298 | options: -n |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
299 | filenames: test-onefile.tar.gz |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
300 | baseline: | |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
301 | mkdir test-onefile |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
302 | cd test-onefile |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
303 | tar -zxf ../$1 |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
304 | |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
305 | - name: one file extracted inside a directory |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
306 | options: "" |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
307 | filenames: test-onefile.tar.gz |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
308 | input: i |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
309 | grep: one file |
38
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
310 | baseline: | |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
311 | mkdir test-onefile |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
312 | cd test-onefile |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
313 | tar -zxf ../$1 |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
314 | |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
315 | - name: one file extracted with rename, with Expected text |
38
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
316 | options: "" |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
317 | filenames: test-onefile.tar.gz |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
318 | input: r |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
319 | grep: "Expected: test-onefile" |
38
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
320 | baseline: | |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
321 | tar -zxOf $1 >test-onefile |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
322 | |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
323 | - name: one file extracted here, with Actual text |
38
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
324 | options: "" |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
325 | filenames: test-onefile.tar.gz |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
326 | input: h |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
327 | grep: " Actual: test-text" |
38
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
328 | baseline: | |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
329 | tar -zxf $1 |
f637b9d24c21
[svn] Some more tests to make sure we always do the right thing in the
brett
parents:
35
diff
changeset
|
330 | |
22
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
331 | - name: bomb with preceding dot in the table |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
332 | filenames: test-dot-first-bomb.tar.gz |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
333 | options: "" |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
334 | antigrep: one entry |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
335 | baseline: | |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
336 | mkdir test-dot-first-bomb |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
337 | cd test-dot-first-bomb |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
338 | tar -zxf ../$1 |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
339 | |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
340 | - name: one directory preceded by dot in the table |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
341 | filenames: test-dot-first-onedir.tar.gz |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
342 | options: "" |
65
0aea49161478
Make the wording on the One Entry question a little clearer.
Brett Smith <brett@brettcsmith.org>
parents:
62
diff
changeset
|
343 | grep: "Actual: (./)?dir/" |
22
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
344 | input: h |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
345 | baseline: | |
b240777ae53e
[svn] Improve the way we check archive contents. If all the entries look like
brett
parents:
21
diff
changeset
|
346 | tar -zxf $1 |
23
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
347 | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
348 | - name: two one-item archives with different answers |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
349 | filenames: test-onedir.tar.gz test-onedir.tar.gz |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
350 | options: "" |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
351 | input: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
352 | h |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
353 | r |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
354 | baseline: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
355 | tar -zxf $1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
356 | mv test test-onedir |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
357 | tar -zxf $1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
358 | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
359 | - name: interactive recursion (always) |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
360 | filenames: test-recursive-badperms.tar.bz2 test-recursive-badperms.tar.bz2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
361 | options: "" |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
362 | input: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
363 | i |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
364 | a |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
365 | i |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
366 | baseline: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
367 | extract() { |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
368 | mkdir test-recursive-badperms$2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
369 | cd test-recursive-badperms$2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
370 | tar -jxf ../$1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
371 | mkdir test-badperms |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
372 | cd test-badperms |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
373 | tar -xf ../test-badperms.tar |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
374 | chmod 700 testdir |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
375 | cd ../.. |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
376 | } |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
377 | extract $1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
378 | extract $1 .1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
379 | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
380 | - name: interactive recursion (once) |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
381 | filenames: test-recursive-badperms.tar.bz2 test-recursive-badperms.tar.bz2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
382 | options: "" |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
383 | input: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
384 | i |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
385 | o |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
386 | i |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
387 | n |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
388 | baseline: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
389 | mkdir test-recursive-badperms |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
390 | cd test-recursive-badperms |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
391 | tar -jxf ../$1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
392 | mkdir test-badperms |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
393 | cd test-badperms |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
394 | tar -xf ../test-badperms.tar |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
395 | chmod 700 testdir |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
396 | cd ../.. |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
397 | mkdir test-recursive-badperms.1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
398 | cd test-recursive-badperms.1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
399 | tar -jxf ../$1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
400 | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
401 | - name: interactive recursion (never) |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
402 | filenames: test-recursive-badperms.tar.bz2 test-recursive-badperms.tar.bz2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
403 | options: "" |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
404 | input: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
405 | i |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
406 | v |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
407 | i |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
408 | baseline: | |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
409 | extract() { |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
410 | mkdir test-recursive-badperms$2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
411 | cd test-recursive-badperms$2 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
412 | tar -jxf ../$1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
413 | cd .. |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
414 | } |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
415 | extract $1 |
039dd321a7d0
[svn] If an archive contains other archives, and the user didn't specify that
brett
parents:
22
diff
changeset
|
416 | extract $1 .1 |
30
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
417 | |
47 | 418 | - name: recursion in subdirectories here |
419 | filenames: test-deep-recursion.tar | |
420 | options: "" | |
421 | input: | | |
422 | h | |
423 | o | |
70
48d2421a3178
Tweak wording of recursion question, and TODO.
Brett Smith <brett@brettcsmith.org>
parents:
69
diff
changeset
|
424 | grep: "contains 2 other archive file\(s\), out of 2 file\(s\)" |
47 | 425 | baseline: | |
426 | tar -xf $1 | |
427 | cd subdir | |
428 | zcat test-text.gz > test-text | |
429 | cd subsubdir | |
430 | zcat test-text.gz > test-text | |
431 | ||
432 | - name: recursion in subdirectories with rename | |
433 | filenames: test-deep-recursion.tar | |
434 | options: "" | |
435 | input: | | |
436 | r | |
437 | o | |
438 | grep: "contains 2" | |
439 | baseline: | | |
440 | tar -xf $1 | |
441 | mv subdir test-deep-recursion | |
442 | cd test-deep-recursion | |
443 | zcat test-text.gz > test-text | |
444 | cd subsubdir | |
445 | zcat test-text.gz > test-text | |
446 | ||
447 | - name: recursion in subdirectories inside new dir | |
448 | filenames: test-deep-recursion.tar | |
449 | options: "" | |
450 | input: | | |
451 | i | |
452 | o | |
453 | grep: "contains 2" | |
454 | baseline: | | |
455 | mkdir test-deep-recursion | |
456 | cd test-deep-recursion | |
457 | tar -xf ../$1 | |
458 | cd subdir | |
459 | zcat test-text.gz > test-text | |
460 | cd subsubdir | |
461 | zcat test-text.gz > test-text | |
462 | ||
30
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
463 | - name: extracting file with bad extension |
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
464 | filenames: test-1.23.bin |
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
465 | prerun: cp ${1}test-1.23.tar.gz ${1}test-1.23.bin |
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
466 | cleanup: rm -f ${1}test-1.23.bin |
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
467 | baseline: | |
1015bbd6dc5e
[svn] If we can't figure out what the file is by mimetype, try using the file
brett
parents:
29
diff
changeset
|
468 | tar -zxf $1 |
33
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
469 | |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
470 | - name: extracting file with misleading extension |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
471 | filenames: trickery.tar.gz |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
472 | prerun: cp ${1}test-1.23.zip ${1}trickery.tar.gz |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
473 | cleanup: rm -f ${1}trickery.tar.gz |
78
978307ec7d11
Don't show errors from failed extractors unless they all fail.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
76
diff
changeset
|
474 | antigrep: . |
33
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
475 | baseline: | |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
476 | mkdir trickery |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
477 | cd trickery |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
478 | unzip -q ../$1 |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
479 | |
79
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
480 | - name: listing file with misleading extension |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
481 | options: -l |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
482 | filenames: trickery.tar.gz |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
483 | prerun: cp ${1}test-1.23.zip ${1}trickery.tar.gz |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
484 | cleanup: rm -f ${1}trickery.tar.gz |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
485 | grep: "^1/2/3$" |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
486 | antigrep: "^dtrx:" |
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
487 | |
39
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
488 | - name: non-archive error |
33
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
489 | filenames: /dev/null |
3547e3124729
[svn] Fix some bugs and make things a little more user-friendly now that we can
brett
parents:
31
diff
changeset
|
490 | error: true |
45
37d555407334
[svn] At work I was getting an unhelpful "No such file or directory" error when I
brett
parents:
41
diff
changeset
|
491 | grep: "not a known archive type" |
39
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
492 | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
493 | - name: no such file error |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
494 | filenames: nonexistent-file.tar.gz |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
495 | error: true |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
496 | grep: "[Nn]o such file" |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
497 | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
498 | - name: no such file error with no extension |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
499 | filenames: nonexistent-file |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
500 | error: true |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
501 | grep: "[Nn]o such file" |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
502 | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
503 | - name: try to extract a directory error |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
504 | filenames: test-directory |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
505 | prerun: mkdir test-directory |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
506 | error: true |
79
9c0cc7aef510
Improve dtrx -l performance on misnamed files, and clean other error messages.
Brett Smith <brettcsmith@brettcsmith.org>
parents:
78
diff
changeset
|
507 | grep: "cannot work with a directory" |
39
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
508 | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
509 | - name: permission denied error |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
510 | filenames: unreadable-file.tar.gz |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
511 | prerun: | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
512 | touch unreadable-file.tar.gz |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
513 | chmod 000 unreadable-file.tar.gz |
47 | 514 | cleanup: rm -f unreadable-file.tar.gz |
39
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
515 | error: true |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
516 | grep: "[Pp]ermission denied" |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
517 | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
518 | - name: permission denied no-pipe file error |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
519 | filenames: unreadable-file.zip |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
520 | prerun: | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
521 | touch unreadable-file.zip |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
522 | chmod 000 unreadable-file.zip |
47 | 523 | cleanup: rm -f unreadable-file.zip |
39
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
524 | error: true |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
525 | grep: "[Pp]ermission denied" |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
526 | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
527 | - name: bad file error |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
528 | filenames: bogus-file.tar.gz |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
529 | prerun: | |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
530 | touch bogus-file.tar.gz |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
531 | cleanup: rm -f bogus-file.tar.gz |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
532 | error: true |
027fcd7ae002
[svn] Improve the error reporting to be more user-friendly, at least in many of
brett
parents:
38
diff
changeset
|
533 | grep: "returned status code [^0]" |
40
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
534 | |
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
535 | - name: try to extract in unwritable directory |
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
536 | directory: unwritable-dir |
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
537 | filenames: ../test-1.23.tar.gz |
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
538 | prerun: chmod 500 . |
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
539 | error: true |
ee6a869f8da1
[svn] Be a little nicer about explaining that we can't extract to the current
brett
parents:
39
diff
changeset
|
540 | grep: "cannot extract here: [Pp]ermission denied" |
41
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
541 | |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
542 | - name: recursive listing is a no-op |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
543 | options: -rl |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
544 | filenames: test-recursive-badperms.tar.bz2 |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
545 | grep: test-badperms.tar |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
546 | antigrep: testdir/ |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
547 | |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
548 | - name: graceful coping when many extraction directories are taken |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
549 | directory: busydir |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
550 | prerun: | |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
551 | mkdir test-1.23 |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
552 | for i in $(seq 1 10); do mkdir test-1.23.$i; done |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
553 | filenames: ../test-1.23.tar.gz |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
554 | grep: "WARNING: extracting" |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
555 | |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
556 | - name: graceful coping when many decompression targets are taken |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
557 | directory: busydir |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
558 | prerun: | |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
559 | touch test-text |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
560 | for i in $(seq 1 10); do touch test-text.$i; done |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
561 | filenames: ../test-text.gz |
e3675644bbb6
[svn] Minor clean-ups. The most important of these is that we now have a better
brett
parents:
40
diff
changeset
|
562 | grep: "WARNING: extracting" |
52
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
563 | |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
564 | - name: output filenames with -v |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
565 | options: -v -n |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
566 | filenames: test-onedir.tar.gz test-text.gz |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
567 | output: | |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
568 | test-onedir.tar.gz: |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
569 | test-onedir/ |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
570 | test-onedir/test/ |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
571 | test-onedir/test/foobar |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
572 | test-onedir/test/quux |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
573 | |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
574 | test-text.gz: |
cf191f957fd0
[svn] Make just one -v print a list of filenames, a la tar.
brett
parents:
47
diff
changeset
|
575 | test-text |
53
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
576 | |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
577 | - name: output filenames with -v and -f |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
578 | options: -nvf |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
579 | directory: busydir |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
580 | filenames: ../test-onedir.tar.gz |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
581 | output: | |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
582 | ../test-onedir.tar.gz: |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
583 | test/ |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
584 | test/foobar |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
585 | test/quux |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
586 | |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
587 | - name: list recursive archives |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
588 | options: "" |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
589 | filenames: test-deep-recursion.tar |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
590 | input: | |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
591 | r |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
592 | l |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
593 | n |
cd853ddb224c
[svn] Add interactive option to list recursive archives when found.
brett
parents:
52
diff
changeset
|
594 | grep: "^test-deep-recursion/subsubdir/test-text\.gz$" |
62
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
595 | |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
596 | - name: partly failed extraction |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
597 | options: -n |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
598 | filenames: test-tar-with-node.tar.gz |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
599 | baseline: | |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
600 | mkdir test-tar-with-node |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
601 | cd test-tar-with-node |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
602 | tar -zxf ../$1 |
17d845dacff5
Deal with partially extracted tarballs.
Brett Smith <brett@brettcsmith.org>
parents:
53
diff
changeset
|
603 | grep: Cannot mknod |
66
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
604 | |
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
605 | - name: flat extraction of one-file archive |
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
606 | directory: inside-dir |
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
607 | options: -f |
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
608 | filenames: ../test-onefile.tar.gz |
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
609 | baseline: tar -zxf $1 |
af0b822b012e
Don't prompt for one entry handling with -f.
Brett Smith <brett@brettcsmith.org>
parents:
65
diff
changeset
|
610 | antigrep: "contains" |
71
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
611 | |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
612 | - name: test recursive extraction of one archive |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
613 | directory: inside-dir |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
614 | options: "" |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
615 | filenames: ../test-one-archive.tar.gz |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
616 | baseline: | |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
617 | tar -zxf $1 |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
618 | zcat test-text.gz >test-text |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
619 | input: | |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
620 | h |
b0290eeb3b7a
Recurse better when the contents were just one file.
Brett Smith <brett@brettcsmith.org>
parents:
70
diff
changeset
|
621 | o |