|
0 |
Description: Disable tests that rely on test tarballs
|
|
1 |
The test tarballs are not included in the crate on crates.io and hence are not
|
|
2 |
included in the Debian package. I figure that it is better to run some of the
|
|
3 |
tests than none of the tests.
|
|
4 |
Author: Peter Michael Green <plugwash@debian.org>
|
|
5 |
|
|
6 |
--- rust-tar-0.4.37.orig/tests/all.rs
|
|
7 |
+++ rust-tar-0.4.37/tests/all.rs
|
|
8 |
@@ -33,7 +33,7 @@ mod header;
|
|
9 |
|
|
10 |
/// test that we can concatenate the simple.tar archive and extract the same entries twice when we
|
|
11 |
/// use the ignore_zeros option.
|
|
12 |
-#[test]
|
|
13 |
+/*#[test]
|
|
14 |
fn simple_concat() {
|
|
15 |
let bytes = tar!("simple.tar");
|
|
16 |
let mut archive_bytes = Vec::new();
|
|
17 |
@@ -76,9 +76,9 @@ fn simple_concat() {
|
|
18 |
|
|
19 |
names
|
|
20 |
}
|
|
21 |
-}
|
|
22 |
+}*/
|
|
23 |
|
|
24 |
-#[test]
|
|
25 |
+/*#[test]
|
|
26 |
fn header_impls() {
|
|
27 |
let mut ar = Archive::new(Cursor::new(tar!("simple.tar")));
|
|
28 |
let hn = Header::new_old();
|
|
29 |
@@ -91,9 +91,9 @@ fn header_impls() {
|
|
30 |
let h2b = h2.as_bytes();
|
|
31 |
assert!(h1b[..] == h2b[..] && h2b[..] != hnb[..])
|
|
32 |
}
|
|
33 |
-}
|
|
34 |
+}*/
|
|
35 |
|
|
36 |
-#[test]
|
|
37 |
+/*#[test]
|
|
38 |
fn header_impls_missing_last_header() {
|
|
39 |
let mut ar = Archive::new(Cursor::new(tar!("simple_missing_last_header.tar")));
|
|
40 |
let hn = Header::new_old();
|
|
41 |
@@ -106,9 +106,9 @@ fn header_impls_missing_last_header() {
|
|
42 |
let h2b = h2.as_bytes();
|
|
43 |
assert!(h1b[..] == h2b[..] && h2b[..] != hnb[..])
|
|
44 |
}
|
|
45 |
-}
|
|
46 |
+}*/
|
|
47 |
|
|
48 |
-#[test]
|
|
49 |
+/*#[test]
|
|
50 |
fn reading_files() {
|
|
51 |
let rdr = Cursor::new(tar!("reading_files.tar"));
|
|
52 |
let mut ar = Archive::new(rdr);
|
|
53 |
@@ -127,7 +127,7 @@ fn reading_files() {
|
|
54 |
assert_eq!(s, "b\nb\nb\nb\nb\nb\nb\nb\nb\nb\nb\n");
|
|
55 |
|
|
56 |
assert!(entries.next().is_none());
|
|
57 |
-}
|
|
58 |
+}*/
|
|
59 |
|
|
60 |
#[test]
|
|
61 |
fn writing_files() {
|
|
62 |
@@ -203,7 +203,7 @@ fn large_filename() {
|
|
63 |
assert!(entries.next().is_none());
|
|
64 |
}
|
|
65 |
|
|
66 |
-#[test]
|
|
67 |
+/*#[test]
|
|
68 |
fn reading_entries() {
|
|
69 |
let rdr = Cursor::new(tar!("reading_files.tar"));
|
|
70 |
let mut ar = Archive::new(rdr);
|
|
71 |
@@ -223,7 +223,7 @@ fn reading_entries() {
|
|
72 |
t!(b.read_to_string(&mut s));
|
|
73 |
assert_eq!(s, "b\nb\nb\nb\nb\nb\nb\nb\nb\nb\nb\n");
|
|
74 |
assert!(entries.next().is_none());
|
|
75 |
-}
|
|
76 |
+}*/
|
|
77 |
|
|
78 |
fn check_dirtree(td: &TempDir) {
|
|
79 |
let dir_a = td.path().join("a");
|
|
80 |
@@ -234,16 +234,16 @@ fn check_dirtree(td: &TempDir) {
|
|
81 |
assert!(fs::metadata(&file_c).map(|m| m.is_file()).unwrap_or(false));
|
|
82 |
}
|
|
83 |
|
|
84 |
-#[test]
|
|
85 |
+/*#[test]
|
|
86 |
fn extracting_directories() {
|
|
87 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
88 |
let rdr = Cursor::new(tar!("directory.tar"));
|
|
89 |
let mut ar = Archive::new(rdr);
|
|
90 |
t!(ar.unpack(td.path()));
|
|
91 |
check_dirtree(&td);
|
|
92 |
-}
|
|
93 |
+}*/
|
|
94 |
|
|
95 |
-#[test]
|
|
96 |
+/*#[test]
|
|
97 |
fn extracting_duplicate_file_fail() {
|
|
98 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
99 |
let path_present = td.path().join("a");
|
|
100 |
@@ -263,9 +263,9 @@ fn extracting_duplicate_file_fail() {
|
|
101 |
"unpack() should have returned an error of kind {:?}, returned Ok",
|
|
102 |
std::io::ErrorKind::AlreadyExists
|
|
103 |
)
|
|
104 |
-}
|
|
105 |
+}*/
|
|
106 |
|
|
107 |
-#[test]
|
|
108 |
+/*#[test]
|
|
109 |
fn extracting_duplicate_file_succeed() {
|
|
110 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
111 |
let path_present = td.path().join("a");
|
|
112 |
@@ -275,9 +275,9 @@ fn extracting_duplicate_file_succeed() {
|
|
113 |
let mut ar = Archive::new(rdr);
|
|
114 |
ar.set_overwrite(true);
|
|
115 |
t!(ar.unpack(td.path()));
|
|
116 |
-}
|
|
117 |
+}*/
|
|
118 |
|
|
119 |
-#[test]
|
|
120 |
+/*#[test]
|
|
121 |
#[cfg(unix)]
|
|
122 |
fn extracting_duplicate_link_fail() {
|
|
123 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
124 |
@@ -298,9 +298,9 @@ fn extracting_duplicate_link_fail() {
|
|
125 |
"unpack() should have returned an error of kind {:?}, returned Ok",
|
|
126 |
std::io::ErrorKind::AlreadyExists
|
|
127 |
)
|
|
128 |
-}
|
|
129 |
+}*/
|
|
130 |
|
|
131 |
-#[test]
|
|
132 |
+/*#[test]
|
|
133 |
#[cfg(unix)]
|
|
134 |
fn extracting_duplicate_link_succeed() {
|
|
135 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
136 |
@@ -311,9 +311,9 @@ fn extracting_duplicate_link_succeed() {
|
|
137 |
let mut ar = Archive::new(rdr);
|
|
138 |
ar.set_overwrite(true);
|
|
139 |
t!(ar.unpack(td.path()));
|
|
140 |
-}
|
|
141 |
+}*/
|
|
142 |
|
|
143 |
-#[test]
|
|
144 |
+/*#[test]
|
|
145 |
#[cfg(all(unix, feature = "xattr"))]
|
|
146 |
fn xattrs() {
|
|
147 |
// If /tmp is a tmpfs, xattr will fail
|
|
148 |
@@ -326,9 +326,9 @@ fn xattrs() {
|
|
149 |
|
|
150 |
let val = xattr::get(td.path().join("a/b"), "user.pax.flags").unwrap();
|
|
151 |
assert_eq!(val.unwrap(), "epm".as_bytes());
|
|
152 |
-}
|
|
153 |
+}*/
|
|
154 |
|
|
155 |
-#[test]
|
|
156 |
+/*#[test]
|
|
157 |
#[cfg(all(unix, feature = "xattr"))]
|
|
158 |
fn no_xattrs() {
|
|
159 |
// If /tmp is a tmpfs, xattr will fail
|
|
160 |
@@ -343,7 +343,7 @@ fn no_xattrs() {
|
|
161 |
xattr::get(td.path().join("a/b"), "user.pax.flags").unwrap(),
|
|
162 |
None
|
|
163 |
);
|
|
164 |
-}
|
|
165 |
+}*/
|
|
166 |
|
|
167 |
#[test]
|
|
168 |
fn writing_and_extracting_directories() {
|
|
169 |
@@ -436,7 +436,7 @@ fn append_dir_all_does_not_work_on_non_d
|
|
170 |
assert!(result.is_err());
|
|
171 |
}
|
|
172 |
|
|
173 |
-#[test]
|
|
174 |
+/*#[test]
|
|
175 |
fn extracting_duplicate_dirs() {
|
|
176 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
177 |
let rdr = Cursor::new(tar!("duplicate_dirs.tar"));
|
|
178 |
@@ -445,7 +445,7 @@ fn extracting_duplicate_dirs() {
|
|
179 |
|
|
180 |
let some_dir = td.path().join("some_dir");
|
|
181 |
assert!(fs::metadata(&some_dir).map(|m| m.is_dir()).unwrap_or(false));
|
|
182 |
-}
|
|
183 |
+}*/
|
|
184 |
|
|
185 |
#[test]
|
|
186 |
fn unpack_old_style_bsd_dir() {
|
|
187 |
@@ -584,7 +584,7 @@ fn extracting_malicious_tarball() {
|
|
188 |
.unwrap_or(false));
|
|
189 |
}
|
|
190 |
|
|
191 |
-#[test]
|
|
192 |
+/*#[test]
|
|
193 |
fn octal_spaces() {
|
|
194 |
let rdr = Cursor::new(tar!("spaces.tar"));
|
|
195 |
let mut ar = Archive::new(rdr);
|
|
196 |
@@ -596,7 +596,7 @@ fn octal_spaces() {
|
|
197 |
assert_eq!(entry.header().size().unwrap(), 2);
|
|
198 |
assert_eq!(entry.header().mtime().unwrap(), 0o12440016664);
|
|
199 |
assert_eq!(entry.header().cksum().unwrap(), 0o4253);
|
|
200 |
-}
|
|
201 |
+}*/
|
|
202 |
|
|
203 |
#[test]
|
|
204 |
fn extracting_malformed_tar_null_blocks() {
|
|
205 |
@@ -621,15 +621,15 @@ fn extracting_malformed_tar_null_blocks(
|
|
206 |
assert!(ar.unpack(td.path()).is_ok());
|
|
207 |
}
|
|
208 |
|
|
209 |
-#[test]
|
|
210 |
+/*#[test]
|
|
211 |
fn empty_filename() {
|
|
212 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
213 |
let rdr = Cursor::new(tar!("empty_filename.tar"));
|
|
214 |
let mut ar = Archive::new(rdr);
|
|
215 |
assert!(ar.unpack(td.path()).is_ok());
|
|
216 |
-}
|
|
217 |
+}*/
|
|
218 |
|
|
219 |
-#[test]
|
|
220 |
+/*#[test]
|
|
221 |
fn file_times() {
|
|
222 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
223 |
let rdr = Cursor::new(tar!("file_times.tar"));
|
|
224 |
@@ -643,7 +643,7 @@ fn file_times() {
|
|
225 |
assert_eq!(mtime.nanoseconds(), 0);
|
|
226 |
assert_eq!(atime.unix_seconds(), 1000000000);
|
|
227 |
assert_eq!(atime.nanoseconds(), 0);
|
|
228 |
-}
|
|
229 |
+}*/
|
|
230 |
|
|
231 |
#[test]
|
|
232 |
fn zero_file_times() {
|
|
233 |
@@ -713,7 +713,7 @@ fn nul_bytes_in_path() {
|
|
234 |
assert!(err.to_string().contains("contains a nul byte"));
|
|
235 |
}
|
|
236 |
|
|
237 |
-#[test]
|
|
238 |
+/*#[test]
|
|
239 |
fn links() {
|
|
240 |
let mut ar = Archive::new(Cursor::new(tar!("link.tar")));
|
|
241 |
let mut entries = t!(ar.entries());
|
|
242 |
@@ -724,9 +724,9 @@ fn links() {
|
|
243 |
);
|
|
244 |
let other = t!(entries.next().unwrap());
|
|
245 |
assert!(t!(other.header().link_name()).is_none());
|
|
246 |
-}
|
|
247 |
+}*/
|
|
248 |
|
|
249 |
-#[test]
|
|
250 |
+/*#[test]
|
|
251 |
#[cfg(unix)] // making symlinks on windows is hard
|
|
252 |
fn unpack_links() {
|
|
253 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
254 |
@@ -740,9 +740,9 @@ fn unpack_links() {
|
|
255 |
Path::new("file")
|
|
256 |
);
|
|
257 |
t!(File::open(td.path().join("lnk")));
|
|
258 |
-}
|
|
259 |
+}*/
|
|
260 |
|
|
261 |
-#[test]
|
|
262 |
+/*#[test]
|
|
263 |
fn pax_size() {
|
|
264 |
let mut ar = Archive::new(tar!("pax_size.tar"));
|
|
265 |
let mut entries = t!(ar.entries());
|
|
266 |
@@ -760,9 +760,9 @@ fn pax_size() {
|
|
267 |
|
|
268 |
assert_eq!(entry.header().size().unwrap(), 0);
|
|
269 |
assert_eq!(entry.size(), 4);
|
|
270 |
-}
|
|
271 |
+}*/
|
|
272 |
|
|
273 |
-#[test]
|
|
274 |
+/*#[test]
|
|
275 |
fn pax_simple() {
|
|
276 |
let mut ar = Archive::new(tar!("pax.tar"));
|
|
277 |
let mut entries = t!(ar.entries());
|
|
278 |
@@ -780,18 +780,18 @@ fn pax_simple() {
|
|
279 |
assert_eq!(second.value(), Ok("1453251915.24892486"));
|
|
280 |
assert_eq!(third.key(), Ok("ctime"));
|
|
281 |
assert_eq!(third.value(), Ok("1453146164.953123768"));
|
|
282 |
-}
|
|
283 |
+}*/
|
|
284 |
|
|
285 |
-#[test]
|
|
286 |
+/*#[test]
|
|
287 |
fn pax_path() {
|
|
288 |
let mut ar = Archive::new(tar!("pax2.tar"));
|
|
289 |
let mut entries = t!(ar.entries());
|
|
290 |
|
|
291 |
let first = t!(entries.next().unwrap());
|
|
292 |
assert!(first.path().unwrap().ends_with("aaaaaaaaaaaaaaa"));
|
|
293 |
-}
|
|
294 |
+}*/
|
|
295 |
|
|
296 |
-#[test]
|
|
297 |
+/*#[test]
|
|
298 |
fn pax_linkpath() {
|
|
299 |
let mut ar = Archive::new(tar!("pax2.tar"));
|
|
300 |
let mut links = t!(ar.entries()).skip(3).take(2);
|
|
301 |
@@ -805,7 +805,7 @@ fn pax_linkpath() {
|
|
302 |
let link_name = long_hardlink.link_name().unwrap().unwrap();
|
|
303 |
assert!(link_name.to_str().unwrap().len() > 99);
|
|
304 |
assert!(link_name.ends_with("ccccccccccccccc"));
|
|
305 |
-}
|
|
306 |
+}*/
|
|
307 |
|
|
308 |
#[test]
|
|
309 |
fn long_name_trailing_nul() {
|
|
310 |
@@ -880,7 +880,7 @@ fn encoded_long_name_has_trailing_nul()
|
|
311 |
assert!(header_name.starts_with(b"././@LongLink\x00"));
|
|
312 |
}
|
|
313 |
|
|
314 |
-#[test]
|
|
315 |
+/*#[test]
|
|
316 |
fn reading_sparse() {
|
|
317 |
let rdr = Cursor::new(tar!("sparse.tar"));
|
|
318 |
let mut ar = Archive::new(rdr);
|
|
319 |
@@ -928,9 +928,9 @@ fn reading_sparse() {
|
|
320 |
assert!(s[0x2fa0 + 6..0x4000].chars().all(|x| x == '\u{0}'));
|
|
321 |
|
|
322 |
assert!(entries.next().is_none());
|
|
323 |
-}
|
|
324 |
+}*/
|
|
325 |
|
|
326 |
-#[test]
|
|
327 |
+/*#[test]
|
|
328 |
fn extract_sparse() {
|
|
329 |
let rdr = Cursor::new(tar!("sparse.tar"));
|
|
330 |
let mut ar = Archive::new(rdr);
|
|
331 |
@@ -969,9 +969,9 @@ fn extract_sparse() {
|
|
332 |
assert!(s[0x1000 + 6..0x2fa0].chars().all(|x| x == '\u{0}'));
|
|
333 |
assert_eq!(&s[0x2fa0..0x2fa0 + 6], "world\n");
|
|
334 |
assert!(s[0x2fa0 + 6..0x4000].chars().all(|x| x == '\u{0}'));
|
|
335 |
-}
|
|
336 |
+}*/
|
|
337 |
|
|
338 |
-#[test]
|
|
339 |
+/*#[test]
|
|
340 |
fn sparse_with_trailing() {
|
|
341 |
let rdr = Cursor::new(tar!("sparse-1.tar"));
|
|
342 |
let mut ar = Archive::new(rdr);
|
|
343 |
@@ -983,7 +983,7 @@ fn sparse_with_trailing() {
|
|
344 |
assert_eq!(&s[..0xc], "0MB through\n");
|
|
345 |
assert!(s[0xc..0x100_000].chars().all(|x| x == '\u{0}'));
|
|
346 |
assert_eq!(&s[0x100_000..], "1MB through\n");
|
|
347 |
-}
|
|
348 |
+}*/
|
|
349 |
|
|
350 |
#[test]
|
|
351 |
fn path_separators() {
|
|
352 |
@@ -1153,15 +1153,15 @@ fn tar_directory_containing_symlink_to_d
|
|
353 |
ar.finish().unwrap();
|
|
354 |
}
|
|
355 |
|
|
356 |
-#[test]
|
|
357 |
+/*#[test]
|
|
358 |
fn long_path() {
|
|
359 |
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
|
|
360 |
let rdr = Cursor::new(tar!("7z_long_path.tar"));
|
|
361 |
let mut ar = Archive::new(rdr);
|
|
362 |
assert!(ar.unpack(td.path()).is_ok());
|
|
363 |
-}
|
|
364 |
+}*/
|
|
365 |
|
|
366 |
-#[test]
|
|
367 |
+/*#[test]
|
|
368 |
fn unpack_path_larger_than_windows_max_path() {
|
|
369 |
let dir_name = "iamaprettylongnameandtobepreciseiam91characterslongwhichsomethinkisreallylongandothersdonot";
|
|
370 |
// 183 character directory name
|
|
371 |
@@ -1172,7 +1172,7 @@ fn unpack_path_larger_than_windows_max_p
|
|
372 |
let mut ar = Archive::new(rdr);
|
|
373 |
// should unpack path greater than windows MAX_PATH length of 260 characters
|
|
374 |
assert!(ar.unpack(td.path()).is_ok());
|
|
375 |
-}
|
|
376 |
+}*/
|
|
377 |
|
|
378 |
#[test]
|
|
379 |
fn append_long_multibyte() {
|