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 tar -xzf master.tar.gz
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 &&
65 cp master.tar.lz /tmp/.
68 test_expect_success LZIP 'untar' '
70 tar --lzip -xf master.tar.lz
73 test_expect_success LZIP 'count files' '
75 test_line_count = 5 output
78 test_expect_success LZIP 'verify untarred file-5' '
79 grep "^5$" master/file-5 &&
80 test_line_count = 1 master/file-5
83 if test -n "$(which xz 2>/dev/null)"; then
86 say 'Skipping XZ validation tests: xz not found'
89 test_expect_success XZ 'get foo/snapshot/master.tar.xz' '
90 cgit_url "foo/snapshot/master.tar.xz" >tmp
93 test_expect_success XZ 'check html headers' '
95 grep "Content-Type: application/x-xz" &&
98 grep "Content-Disposition: inline; filename=.master.tar.xz."
101 test_expect_success XZ 'strip off the header lines' '
102 strip_headers <tmp >master.tar.xz
105 test_expect_success XZ 'verify xz format' '
106 xz --test master.tar.xz &&
107 cp master.tar.xz /tmp/.
110 test_expect_success XZ 'untar' '
112 tar --xz -xf master.tar.xz
115 test_expect_success XZ 'count files' '
116 ls master/ >output &&
117 test_line_count = 5 output
120 test_expect_success XZ 'verify untarred file-5' '
121 grep "^5$" master/file-5 &&
122 test_line_count = 1 master/file-5
125 test_expect_success 'get foo/snapshot/master.zip' '
126 cgit_url "foo/snapshot/master.zip" >tmp
129 test_expect_success 'check HTML headers (zip)' '
131 grep "Content-Type: application/x-zip" &&
134 grep "Content-Disposition: inline; filename=.master.zip."
137 test_expect_success 'strip off the header lines (zip)' '
138 strip_headers <tmp >master.zip
141 if test -n "$(which unzip 2>/dev/null)"; then
142 test_set_prereq UNZIP
144 say 'Skipping ZIP validation tests: unzip not found'
147 test_expect_success UNZIP 'verify zip format' '
151 test_expect_success UNZIP 'unzip' '
156 test_expect_success UNZIP 'count files (zip)' '
157 ls master/ >output &&
158 test_line_count = 5 output
161 test_expect_success UNZIP 'verify unzipped file-5' '
162 grep "^5$" master/file-5 &&
163 test_line_count = 1 master/file-5