cpio: add ownership (-R) test cases
authorAaro Koskinen <aaro.koskinen@iki.fi>
Wed, 2 Nov 2016 22:25:05 +0000 (00:25 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 4 Nov 2016 21:32:46 +0000 (22:32 +0100)
Add ownership (-R) test cases.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
testsuite/cpio.tests

index 4cd441a60db48cb4e1587da41e52c9444c14b384..d44c95b102f2276abc249131c436c715f4f6b27a 100755 (executable)
@@ -127,6 +127,30 @@ testing "cpio extracts in existing directory" \
 " "" ""
 SKIP=
 
+testing "cpio uses by default uid/gid" \
+"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
+"\
+$user/$group
+0
+" "" ""
+SKIP=
+
+testing "cpio -R with create" \
+"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
+"\
+1234/5678
+0
+" "" ""
+SKIP=
+
+testing "cpio -R with extract" \
+"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
+"\
+8765/4321
+0
+" "" ""
+SKIP=
+
 # Clean up
 rm -rf cpio.testdir cpio.testdir2 2>/dev/null