1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
|
Description: Disable tests that rely on test tarballs
The test tarballs are not included in the crate on crates.io and hence are not
included in the Debian package. I figure that it is better to run some of the
tests than none of the tests.
Author: Peter Michael Green <plugwash@debian.org>
Index: tar/tests/all.rs
===================================================================
--- tar.orig/tests/all.rs
+++ tar/tests/all.rs
@@ -58,17 +58,17 @@ fn random_cursor_reader<D: AsRef<[u8]>>(
RandomReader::new(Cursor::new(data))
}
-macro_rules! tar {
+/*macro_rules! tar {
($e:expr) => {
&include_bytes!(concat!("archives/", $e))[..]
};
-}
+}*/
mod header;
/// test that we can concatenate the simple.tar archive and extract the same entries twice when we
/// use the ignore_zeros option.
-#[test]
+/*#[test]
fn simple_concat() {
let bytes = tar!("simple.tar");
let mut archive_bytes = Vec::new();
@@ -112,9 +112,9 @@ fn simple_concat() {
names
}
-}
+}*/
-#[test]
+/*#[test]
fn header_impls() {
let mut ar = Archive::new(random_cursor_reader(tar!("simple.tar")));
let hn = Header::new_old();
@@ -127,9 +127,9 @@ fn header_impls() {
let h2b = h2.as_bytes();
assert!(h1b[..] == h2b[..] && h2b[..] != hnb[..])
}
-}
+}*/
-#[test]
+/*#[test]
fn header_impls_missing_last_header() {
let mut ar = Archive::new(random_cursor_reader(tar!("simple_missing_last_header.tar")));
let hn = Header::new_old();
@@ -142,9 +142,9 @@ fn header_impls_missing_last_header() {
let h2b = h2.as_bytes();
assert!(h1b[..] == h2b[..] && h2b[..] != hnb[..])
}
-}
+}*/
-#[test]
+/*#[test]
fn reading_files() {
let rdr = random_cursor_reader(tar!("reading_files.tar"));
let mut ar = Archive::new(rdr);
@@ -163,7 +163,7 @@ fn reading_files() {
assert_eq!(s, "b\nb\nb\nb\nb\nb\nb\nb\nb\nb\nb\n");
assert!(entries.next().is_none());
-}
+}*/
#[test]
fn writing_files() {
@@ -272,6 +272,7 @@ fn large_filename_with_dot_dot_at_100_by
assert!(entries.next().is_none());
}
+/*
fn reading_entries_common<R: Read>(mut entries: Entries<R>) {
let mut a = entries.next().unwrap().unwrap();
assert_eq!(&*a.header().path_bytes(), b"a");
@@ -331,7 +332,9 @@ impl<T: Seek> Seek for LoggingReader<T>
self.inner.seek(pos)
}
}
+*/
+/*
#[test]
fn skipping_entries_with_seek() {
let mut reader = LoggingReader::new(Cursor::new(tar!("reading_files.tar")));
@@ -353,6 +356,7 @@ fn skipping_entries_with_seek() {
assert!(files == files_seekable);
assert!(seekable_reader.read_bytes < reader.read_bytes);
}
+*/
fn check_dirtree(td: &TempDir) {
let dir_a = td.path().join("a");
@@ -363,6 +367,7 @@ fn check_dirtree(td: &TempDir) {
assert!(fs::metadata(&file_c).map(|m| m.is_file()).unwrap_or(false));
}
+/*
#[test]
fn extracting_directories() {
let td = TempBuilder::new().prefix("tar-rs").tempdir().unwrap();
@@ -370,8 +375,9 @@ fn extracting_directories() {
let mut ar = Archive::new(rdr);
ar.unpack(td.path()).unwrap();
check_dirtree(&td);
-}
+}*/
+/*
#[test]
fn extracting_duplicate_file_fail() {
let td = TempBuilder::new().prefix("tar-rs").tempdir().unwrap();
@@ -478,7 +484,7 @@ fn no_xattrs() {
xattr::get(td.path().join("a/b"), "user.pax.flags").unwrap(),
None
);
-}
+}*/
#[test]
fn writing_and_extracting_directories() {
@@ -622,6 +628,7 @@ fn append_dir_all_does_not_work_on_non_d
assert!(result.is_err());
}
+/*
#[test]
fn extracting_duplicate_dirs() {
let td = TempBuilder::new().prefix("tar-rs").tempdir().unwrap();
@@ -631,7 +638,7 @@ fn extracting_duplicate_dirs() {
let some_dir = td.path().join("some_dir");
assert!(fs::metadata(&some_dir).map(|m| m.is_dir()).unwrap_or(false));
-}
+}*/
#[test]
fn unpack_old_style_bsd_dir() {
@@ -781,6 +788,7 @@ fn extracting_malicious_tarball() {
.unwrap_or(false));
}
+/*
#[test]
fn octal_spaces() {
let rdr = random_cursor_reader(tar!("spaces.tar"));
@@ -793,7 +801,7 @@ fn octal_spaces() {
assert_eq!(entry.header().size().unwrap(), 2);
assert_eq!(entry.header().mtime().unwrap(), 0o12440016664);
assert_eq!(entry.header().cksum().unwrap(), 0o4253);
-}
+}*/
#[test]
fn extracting_malformed_tar_null_blocks() {
@@ -820,6 +828,7 @@ fn extracting_malformed_tar_null_blocks(
assert!(ar.unpack(td.path()).is_ok());
}
+/*
#[test]
fn empty_filename() {
let td = TempBuilder::new().prefix("tar-rs").tempdir().unwrap();
@@ -842,7 +851,7 @@ fn file_times() {
assert_eq!(mtime.nanoseconds(), 0);
assert_eq!(atime.unix_seconds(), 1000000000);
assert_eq!(atime.nanoseconds(), 0);
-}
+}*/
#[test]
fn zero_file_times() {
@@ -946,6 +955,7 @@ fn nul_bytes_in_path() {
assert!(err.to_string().contains("contains a nul byte"));
}
+/*
#[test]
fn links() {
let mut ar = Archive::new(random_cursor_reader(tar!("link.tar")));
@@ -1017,7 +1027,7 @@ fn pax_simple() {
assert_eq!(second.value(), Ok("1453251915.24892486"));
assert_eq!(third.key(), Ok("ctime"));
assert_eq!(third.value(), Ok("1453146164.953123768"));
-}
+}*/
#[test]
fn pax_simple_write() {
@@ -1054,6 +1064,7 @@ fn pax_simple_write() {
assert!(entries.next().is_none());
}
+/*
#[test]
fn pax_path() {
let mut ar = Archive::new(random_cursor_reader(tar!("pax2.tar")));
@@ -1077,7 +1088,7 @@ fn pax_linkpath() {
let link_name = long_hardlink.link_name().unwrap().unwrap();
assert!(link_name.to_str().unwrap().len() > 99);
assert!(link_name.ends_with("ccccccccccccccc"));
-}
+}*/
#[test]
fn long_name_trailing_nul() {
@@ -1235,6 +1246,7 @@ fn encoded_long_name_has_trailing_nul()
assert!(header_name.starts_with(b"././@LongLink\x00"));
}
+/*
#[test]
fn reading_sparse() {
let rdr = random_cursor_reader(tar!("sparse.tar"));
@@ -1283,8 +1295,9 @@ fn reading_sparse() {
assert!(s[0x2fa0 + 6..0x4000].chars().all(|x| x == '\u{0}'));
assert!(entries.next().is_none());
-}
+}*/
+/*
#[test]
fn extract_sparse() {
let rdr = random_cursor_reader(tar!("sparse.tar"));
@@ -1362,7 +1375,7 @@ fn sparse_with_trailing() {
assert_eq!(&s[..0xc], "0MB through\n");
assert!(s[0xc..0x100_000].chars().all(|x| x == '\u{0}'));
assert_eq!(&s[0x100_000..], "1MB through\n");
-}
+}*/
#[test]
#[allow(clippy::option_map_unit_fn)]
@@ -1598,14 +1611,16 @@ fn tar_directory_containing_symlink_to_d
ar.finish().unwrap();
}
+/*
#[test]
fn long_path() {
let td = TempBuilder::new().prefix("tar-rs").tempdir().unwrap();
let rdr = random_cursor_reader(tar!("7z_long_path.tar"));
let mut ar = Archive::new(rdr);
assert!(ar.unpack(td.path()).is_ok());
-}
+}*/
+/*
#[test]
fn unpack_path_larger_than_windows_max_path() {
let dir_name = "iamaprettylongnameandtobepreciseiam91characterslongwhichsomethinkisreallylongandothersdonot";
@@ -1620,7 +1635,7 @@ fn unpack_path_larger_than_windows_max_p
let mut ar = Archive::new(rdr);
// should unpack path greater than windows MAX_PATH length of 260 characters
assert!(ar.unpack(td.path()).is_ok());
-}
+}*/
#[test]
fn append_long_multibyte() {
@@ -1806,6 +1821,7 @@ fn ownership_preserving() {
}
}
+/*
#[test]
#[cfg(unix)]
fn pax_and_gnu_uid_gid() {
@@ -1831,7 +1847,7 @@ fn pax_and_gnu_uid_gid() {
assert!(ar.unpack(td.path()).is_err());
}
}
-}
+}*/
#[test]
fn append_data_error_does_not_corrupt_subsequent_entries() {
|