diff options
Diffstat (limited to 'tests/t0107-snapshot.sh')
-rwxr-xr-x | tests/t0107-snapshot.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/t0107-snapshot.sh b/tests/t0107-snapshot.sh index a845ad9..84995d1 100755 --- a/tests/t0107-snapshot.sh +++ b/tests/t0107-snapshot.sh | |||
@@ -80,6 +80,48 @@ test_expect_success LZIP 'verify untarred file-5' ' | |||
80 | test_line_count = 1 master/file-5 | 80 | test_line_count = 1 master/file-5 |
81 | ' | 81 | ' |
82 | 82 | ||
83 | if test -n "$(which xz 2>/dev/null)"; then | ||
84 | test_set_prereq XZ | ||
85 | else | ||
86 | say 'Skipping XZ validation tests: xz not found' | ||
87 | fi | ||
88 | |||
89 | test_expect_success XZ 'get foo/snapshot/master.tar.xz' ' | ||
90 | cgit_url "foo/snapshot/master.tar.xz" >tmp | ||
91 | ' | ||
92 | |||
93 | test_expect_success XZ 'check html headers' ' | ||
94 | head -n 1 tmp | | ||
95 | grep "Content-Type: application/x-xz" && | ||
96 | |||
97 | head -n 2 tmp | | ||
98 | grep "Content-Disposition: inline; filename=.master.tar.xz." | ||
99 | ' | ||
100 | |||
101 | test_expect_success XZ 'strip off the header lines' ' | ||
102 | strip_headers <tmp >master.tar.xz | ||
103 | ' | ||
104 | |||
105 | test_expect_success XZ 'verify xz format' ' | ||
106 | xz --test master.tar.xz && | ||
107 | cp master.tar.xz /tmp/. | ||
108 | ' | ||
109 | |||
110 | test_expect_success XZ 'untar' ' | ||
111 | rm -rf master && | ||
112 | tar --xz -xf master.tar.xz | ||
113 | ' | ||
114 | |||
115 | test_expect_success XZ 'count files' ' | ||
116 | ls master/ >output && | ||
117 | test_line_count = 5 output | ||
118 | ' | ||
119 | |||
120 | test_expect_success XZ 'verify untarred file-5' ' | ||
121 | grep "^5$" master/file-5 && | ||
122 | test_line_count = 1 master/file-5 | ||
123 | ' | ||
124 | |||
83 | test_expect_success 'get foo/snapshot/master.zip' ' | 125 | test_expect_success 'get foo/snapshot/master.zip' ' |
84 | cgit_url "foo/snapshot/master.zip" >tmp | 126 | cgit_url "foo/snapshot/master.zip" >tmp |
85 | ' | 127 | ' |