aboutsummaryrefslogtreecommitdiff
path: root/testsuite/tar.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tar.tests')
-rwxr-xr-xtestsuite/tar.tests38
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
18testing "Empty file is not a tarball" '\
19tar xvf - 2>&1; echo $?
20' "\
21tar: short read
221
23" \
24"" ""
25SKIP=
26
27optional 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.
31testing "Empty file is not a tarball.tar.gz" '\
32{ tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic"
33' "\
34tar: short read
351
36" \
37"" ""
38SKIP=
39
40testing "Two zeroed blocks is a ('truncated') empty tarball" '\
41dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $?
42' "\
430
44" \
45"" ""
46SKIP=
47
48testing "Twenty zeroed blocks is an empty tarball" '\
49dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $?
50' "\
510
52" \
53"" ""
54SKIP=
55
18optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES 56optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES
19testing "tar hardlinks and repeated files" '\ 57testing "tar hardlinks and repeated files" '\
20rm -rf input_* test.tar 2>/dev/null 58rm -rf input_* test.tar 2>/dev/null