diff options
Diffstat (limited to 'release/src/router/busybox/testsuite/cp')
16 files changed, 68 insertions, 1 deletions
diff --git a/release/src/router/busybox/testsuite/cp/cp-RHL-does_not_preserve-links b/release/src/router/busybox/testsuite/cp/cp-RHL-does_not_preserve-links new file mode 100644 index 00000000..eed6c3ec --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-RHL-does_not_preserve-links @@ -0,0 +1,6 @@ +mkdir a +>a/file +ln -s file a/link +busybox cp -RHL a b +test ! -L b/link +#sh </dev/tty >/dev/tty 2>&1 diff --git a/release/src/router/busybox/testsuite/cp/cp-a-files-to-dir b/release/src/router/busybox/testsuite/cp/cp-a-files-to-dir new file mode 100644 index 00000000..abdbdf77 --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-a-files-to-dir @@ -0,0 +1,15 @@ +echo file number one > file1 +echo file number two > file2 +ln -s file2 link1 +mkdir dir1 +# why??? +#touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3 +mkdir there +busybox cp -a file1 file2 link1 dir1 there +test -f there/file1 +test -f there/file2 +test ! -s there/dir1/file3 +test -L there/link1 +test xfile2 = x`readlink there/link1` +test ! dir1/file3 -ot there/dir1/file3 +test ! dir1/file3 -nt there/dir1/file3 diff --git a/release/src/router/busybox/testsuite/cp/cp-a-preserves-links b/release/src/router/busybox/testsuite/cp/cp-a-preserves-links new file mode 100644 index 00000000..0c0cd965 --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-a-preserves-links @@ -0,0 +1,5 @@ +touch foo +ln -s foo bar +busybox cp -a bar baz +test -L baz +test xfoo = x`readlink baz` diff --git a/release/src/router/busybox/testsuite/cp/cp-copies-empty-file b/release/src/router/busybox/testsuite/cp/cp-copies-empty-file index ad25aa12..ad25aa12 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-copies-empty-file +++ b/release/src/router/busybox/testsuite/cp/cp-copies-empty-file diff --git a/release/src/router/busybox/testsuite/cp/cp-copies-large-file b/release/src/router/busybox/testsuite/cp/cp-copies-large-file index c2225c6d..c2225c6d 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-copies-large-file +++ b/release/src/router/busybox/testsuite/cp/cp-copies-large-file diff --git a/release/src/router/busybox/testsuite/cp/cp-copies-small-file b/release/src/router/busybox/testsuite/cp/cp-copies-small-file index d52a887c..d52a887c 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-copies-small-file +++ b/release/src/router/busybox/testsuite/cp/cp-copies-small-file diff --git a/release/src/router/busybox/testsuite/cp/cp-d-files-to-dir b/release/src/router/busybox/testsuite/cp/cp-d-files-to-dir new file mode 100644 index 00000000..9571a567 --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-d-files-to-dir @@ -0,0 +1,11 @@ +echo file number one > file1 +echo file number two > file2 +touch file3 +ln -s file2 link1 +mkdir there +busybox cp -d file1 file2 file3 link1 there +test -f there/file1 +test -f there/file2 +test ! -s there/file3 +test -L there/link1 +test xfile2 = x`readlink there/link1` diff --git a/release/src/router/busybox/testsuite/cp/cp-dev-file b/release/src/router/busybox/testsuite/cp/cp-dev-file new file mode 100644 index 00000000..055f0d9e --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-dev-file @@ -0,0 +1,2 @@ +busybox cp /dev/null foo +test -f foo diff --git a/release/src/router/busybox/testsuite/cp/cp-dir-create-dir b/release/src/router/busybox/testsuite/cp/cp-dir-create-dir new file mode 100644 index 00000000..a8d7b50a --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-dir-create-dir @@ -0,0 +1,4 @@ +mkdir bar +touch bar/baz +busybox cp -R bar foo +test -f foo/baz diff --git a/release/src/router/busybox/testsuite/cp/cp-dir-existing-dir b/release/src/router/busybox/testsuite/cp/cp-dir-existing-dir new file mode 100644 index 00000000..4c788ba7 --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-dir-existing-dir @@ -0,0 +1,5 @@ +mkdir bar +touch bar/baz +mkdir foo +busybox cp -R bar foo +test -f foo/bar/baz diff --git a/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file b/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file index 68c57672..e17e8e66 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file +++ b/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file @@ -1,4 +1,11 @@ touch foo chmod a-r foo -busybox cp foo bar +set +e +if test `id -u` = 0; then + # run as user with nonzero uid + setuidgid 1 busybox cp foo bar +else + busybox cp foo bar +fi +set -e test ! -f bar diff --git a/release/src/router/busybox/testsuite/cp/cp-files-to-dir b/release/src/router/busybox/testsuite/cp/cp-files-to-dir new file mode 100644 index 00000000..fdb81916 --- /dev/null +++ b/release/src/router/busybox/testsuite/cp/cp-files-to-dir @@ -0,0 +1,11 @@ +echo file number one > file1 +echo file number two > file2 +touch file3 +ln -s file2 link1 +mkdir there +busybox cp file1 file2 file3 link1 there +test -f there/file1 +test -f there/file2 +test ! -s there/file3 +test -f there/link1 +cmp there/file2 there/link1 diff --git a/release/src/router/busybox/testsuite/cp/cp-follows-links b/release/src/router/busybox/testsuite/cp/cp-follows-links index 2d9f05e9..2d9f05e9 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-follows-links +++ b/release/src/router/busybox/testsuite/cp/cp-follows-links diff --git a/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links b/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links index 4de7b85d..4de7b85d 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links +++ b/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links diff --git a/release/src/router/busybox/testsuite/cp/cp-preserves-links b/release/src/router/busybox/testsuite/cp/cp-preserves-links index a5269e8d..301dc5fd 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-preserves-links +++ b/release/src/router/busybox/testsuite/cp/cp-preserves-links @@ -2,3 +2,4 @@ touch foo ln -s foo bar busybox cp -d bar baz test -L baz +test xfoo = x`readlink baz` diff --git a/release/src/router/busybox/testsuite/cp/cp-preserves-source-file b/release/src/router/busybox/testsuite/cp/cp-preserves-source-file index f0f5065f..f0f5065f 100755..100644 --- a/release/src/router/busybox/testsuite/cp/cp-preserves-source-file +++ b/release/src/router/busybox/testsuite/cp/cp-preserves-source-file |