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 test_expect_success
'get foo/snapshot/master.zip' '
42 cgit_url "foo/snapshot/master.zip" >tmp
45 test_expect_success
'check HTML headers (zip)' '
47 grep "Content-Type: application/x-zip" &&
50 grep "Content-Disposition: inline; filename=.master.zip."
53 test_expect_success
'strip off the header lines (zip)' '
54 strip_headers <tmp >master.zip
57 if test -n "$(which unzip 2>/dev/null)"; then
60 say
'Skipping ZIP validation tests: unzip not found'
63 test_expect_success UNZIP
'verify zip format' '
67 test_expect_success UNZIP
'unzip' '
72 test_expect_success UNZIP
'count files (zip)' '
74 test_line_count = 5 output
77 test_expect_success UNZIP
'verify unzipped file-5' '
78 grep "^5$" master/file-5 &&
79 test_line_count = 1 master/file-5