ip link: add VLAN support
[oweals/busybox.git] / testsuite / cpio.tests
index 42e3ff8dc03444dec758e8bc411591d4e59c6cc1..4cd441a60db48cb4e1587da41e52c9444c14b384 100755 (executable)
@@ -1,9 +1,11 @@
 #!/bin/sh
 # Copyright 2008 by Denys Vlasenko
-# Licensed under GPL v2, see file LICENSE for details.
+# Licensed under GPLv2, see file LICENSE in this source tree.
 
 . ./testing.sh
 
+umask 022
+
 # ls -ln shows date. Need to remove that, it's variable.
 # sed: coalesce spaces
 # cut: remove date
@@ -97,14 +99,14 @@ usr
 " "" ""
 SKIP=
 
-# chown on a link was affecting file, dropping its sgid bits
+# chown on a link was affecting file, dropping its suid/sgid bits
 rm -rf cpio.testdir
-optional FEATURE_CPIO_O
+optional FEATURE_CPIO_O FEATURE_STAT_FORMAT
 mkdir cpio.testdir
 touch cpio.testdir/file
-chmod 6755 cpio.testdir/file  # set the suid/sgid bit
+chmod 6755 cpio.testdir/file  # sets suid/sgid bits
 ln -sf file cpio.testdir/link
-testing "cpio restores sgid bits" \
+testing "cpio restores suid/sgid bits" \
 "cd cpio.testdir && { echo file; echo link; } | cpio -ovHnewc >pack.cpio && rm ???? && cpio -idmvu <pack.cpio 2>/dev/null;
  stat -c '%a %n' file" \
 "\
@@ -114,6 +116,16 @@ link
 " "" ""
 SKIP=
 
+# avoid 'not created: newer or same age file exists' message for directories
+rm -rf cpio.testdir cpio.testdir2 2>/dev/null
+mkdir cpio.testdir
+testing "cpio extracts in existing directory" \
+"$ECHO -ne '$hexdump' | bzcat | cpio -id 2>&1; echo \$?" \
+"\
+1 blocks
+0
+" "" ""
+SKIP=
 
 # Clean up
 rm -rf cpio.testdir cpio.testdir2 2>/dev/null