aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-08-19 14:45:31 -0700
committerRob Landley <rob@landley.net>2020-08-21 05:17:13 -0500
commitfa1af3b085ccbf9aacf423e12f69e04a41dcd1a7 (patch)
tree42223a073ca263e44890d934c1553cbd849d577e /tests
parentc88d3b8bfa339a00a42187529a87085ca68b5a1f (diff)
downloadtoybox-fa1af3b085ccbf9aacf423e12f69e04a41dcd1a7.tar.gz
cpio: fixes for Android kernel build.
Allow -pd to work by changing -p from an option that takes an argument to an option that implies there will be an argument (that is, `-pd x` is `-p -d x` with x being the directory for -p, rather than `-p d x` with d being the directory, as we previously interpreted it). Fix -d (aka --make-directories) to not be a no-op. Previously we acted as if this was always on. Accept --quiet and effectively just ignore it, since toybox cpio doesn't seem to produce any output that --quiet would suppress.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cpio.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/cpio.test b/tests/cpio.test
index 7231ba0f..11b3a5bf 100755
--- a/tests/cpio.test
+++ b/tests/cpio.test
@@ -29,6 +29,12 @@ testing "archive length" "cpio -o -H newc|dd ibs=2 skip=291 count=5 2>/dev/null"
testing "archive magic" "cpio -o -H newc|dd ibs=2 count=3 2>/dev/null" "070701" "" "a\n"
# check name length (8 bytes before the empty "crc")
testing "name length" "cpio -o -H newc|dd ibs=2 skip=47 count=4 2>/dev/null" "00000002" "" "a\n"
+testing "-t" "cpio -o -H newc|cpio -it" "a\nbb\n" "" "a\nbb"
+testing "-t --quiet" "cpio -o -H newc|cpio -it --quiet" "a\nbb\n" "" "a\nbb"
+mkdir out
+testing "-p" "cpio -p out && find out | sort" "out\nout/a\nout/bb\n" "" "a\nbb"
+rm -rf out
+testing "-pd" "cpio -pd out && find out | sort" "out\nout/a\nout/bb\n" "" "a\nbb"
rm a bb ccc dddd
# archive dangling symlinks and empty files even if we cannot open them