diff options
Diffstat (limited to 'testsuite/tar.tests')
-rwxr-xr-x | testsuite/tar.tests | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/tar.tests b/testsuite/tar.tests index 7927020c1..4929f4e49 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests | |||
@@ -15,6 +15,44 @@ mkdir tar.tempdir && cd tar.tempdir || exit 1 | |||
15 | 15 | ||
16 | # testing "test name" "script" "expected result" "file input" "stdin" | 16 | # testing "test name" "script" "expected result" "file input" "stdin" |
17 | 17 | ||
18 | testing "Empty file is not a tarball" '\ | ||
19 | tar xvf - 2>&1; echo $? | ||
20 | ' "\ | ||
21 | tar: short read | ||
22 | 1 | ||
23 | " \ | ||
24 | "" "" | ||
25 | SKIP= | ||
26 | |||
27 | optional FEATURE_SEAMLESS_GZ | ||
28 | # In NOMMU case, "invalid magic" message comes from gunzip child process. | ||
29 | # Otherwise, it comes from tar. | ||
30 | # Need to fix output up to avoid false positive. | ||
31 | testing "Empty file is not a tarball.tar.gz" '\ | ||
32 | { tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic" | ||
33 | ' "\ | ||
34 | tar: short read | ||
35 | 1 | ||
36 | " \ | ||
37 | "" "" | ||
38 | SKIP= | ||
39 | |||
40 | testing "Two zeroed blocks is a ('truncated') empty tarball" '\ | ||
41 | dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $? | ||
42 | ' "\ | ||
43 | 0 | ||
44 | " \ | ||
45 | "" "" | ||
46 | SKIP= | ||
47 | |||
48 | testing "Twenty zeroed blocks is an empty tarball" '\ | ||
49 | dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $? | ||
50 | ' "\ | ||
51 | 0 | ||
52 | " \ | ||
53 | "" "" | ||
54 | SKIP= | ||
55 | |||
18 | optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES | 56 | optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES |
19 | testing "tar hardlinks and repeated files" '\ | 57 | testing "tar hardlinks and repeated files" '\ |
20 | rm -rf input_* test.tar 2>/dev/null | 58 | rm -rf input_* test.tar 2>/dev/null |