3 test_description
='Verify snapshot'
6 test_expect_success
'get foo/snapshot/master.tar.gz' '
7 cgit_url "foo/snapshot/master.tar.gz" >tmp
10 test_expect_success
'check html headers' '
12 grep "Content-Type: application/x-gzip" &&
15 grep "Content-Disposition: inline; filename=.master.tar.gz."
18 test_expect_success
'strip off the header lines' '
19 strip_headers <tmp >master.tar.gz
22 test_expect_success
'verify gzip format' '
23 gunzip --test master.tar.gz
26 test_expect_success
'untar' '
28 gzip -dc master.tar.gz | tar -xf -
31 test_expect_success
'count files' '
33 test_line_count = 5 output
36 test_expect_success
'verify untarred file-5' '
37 grep "^5$" master/file-5 &&
38 test_line_count = 1 master/file-5
41 if test -n "$(which lzip 2>/dev/null)"; then
44 say
'Skipping LZIP validation tests: lzip not found'
47 test_expect_success LZIP
'get foo/snapshot/master.tar.lz' '
48 cgit_url "foo/snapshot/master.tar.lz" >tmp
51 test_expect_success LZIP
'check html headers' '
53 grep "Content-Type: application/x-lzip" &&
56 grep "Content-Disposition: inline; filename=.master.tar.lz."
59 test_expect_success LZIP
'strip off the header lines' '
60 strip_headers <tmp >master.tar.lz
63 test_expect_success LZIP
'verify lzip format' '
64 lzip --test master.tar.lz
67 test_expect_success LZIP
'untar' '
69 lzip -dc master.tar.lz | tar -xf -
72 test_expect_success LZIP
'count files' '
74 test_line_count = 5 output
77 test_expect_success LZIP
'verify untarred file-5' '
78 grep "^5$" master/file-5 &&
79 test_line_count = 1 master/file-5
82 if test -n "$(which xz 2>/dev/null)"; then
85 say
'Skipping XZ validation tests: xz not found'
88 test_expect_success XZ
'get foo/snapshot/master.tar.xz' '
89 cgit_url "foo/snapshot/master.tar.xz" >tmp
92 test_expect_success XZ
'check html headers' '
94 grep "Content-Type: application/x-xz" &&
97 grep "Content-Disposition: inline; filename=.master.tar.xz."
100 test_expect_success XZ
'strip off the header lines' '
101 strip_headers <tmp >master.tar.xz
104 test_expect_success XZ
'verify xz format' '
105 xz --test master.tar.xz
108 test_expect_success XZ
'untar' '
110 xz -dc master.tar.xz | tar -xf -
113 test_expect_success XZ
'count files' '
114 ls master/ >output &&
115 test_line_count = 5 output
118 test_expect_success XZ
'verify untarred file-5' '
119 grep "^5$" master/file-5 &&
120 test_line_count = 1 master/file-5
123 if test -n "$(which zstd 2>/dev/null)"; then
126 say
'Skipping ZSTD validation tests: zstd not found'
129 test_expect_success ZSTD
'get foo/snapshot/master.tar.zst' '
130 cgit_url "foo/snapshot/master.tar.zst" >tmp
133 test_expect_success ZSTD
'check html headers' '
135 grep "Content-Type: application/x-zstd" &&
138 grep "Content-Disposition: inline; filename=.master.tar.zst."
141 test_expect_success ZSTD
'strip off the header lines' '
142 strip_headers <tmp >master.tar.zst
145 test_expect_success ZSTD
'verify zstd format' '
146 zstd --test master.tar.zst
149 test_expect_success ZSTD
'untar' '
151 zstd -dc master.tar.zst | tar -xf -
154 test_expect_success ZSTD
'count files' '
155 ls master/ >output &&
156 test_line_count = 5 output
159 test_expect_success ZSTD
'verify untarred file-5' '
160 grep "^5$" master/file-5 &&
161 test_line_count = 1 master/file-5
164 test_expect_success
'get foo/snapshot/master.zip' '
165 cgit_url "foo/snapshot/master.zip" >tmp
168 test_expect_success
'check HTML headers (zip)' '
170 grep "Content-Type: application/x-zip" &&
173 grep "Content-Disposition: inline; filename=.master.zip."
176 test_expect_success
'strip off the header lines (zip)' '
177 strip_headers <tmp >master.zip
180 if test -n "$(which unzip 2>/dev/null)"; then
181 test_set_prereq UNZIP
183 say
'Skipping ZIP validation tests: unzip not found'
186 test_expect_success UNZIP
'verify zip format' '
190 test_expect_success UNZIP
'unzip' '
195 test_expect_success UNZIP
'count files (zip)' '
196 ls master/ >output &&
197 test_line_count = 5 output
200 test_expect_success UNZIP
'verify unzipped file-5' '
201 grep "^5$" master/file-5 &&
202 test_line_count = 1 master/file-5