summaryrefslogtreecommitdiff
path: root/i/pc104/initrd/conf/busybox/testsuite/mv
diff options
context:
space:
mode:
Diffstat (limited to 'i/pc104/initrd/conf/busybox/testsuite/mv')
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir16
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir23
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file4
13 files changed, 88 insertions, 0 deletions
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir
new file mode 100644
index 0000000..c8eaba8
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir
@@ -0,0 +1,16 @@
+echo file number one > file1
+echo file number two > file2
+ln -s file2 link1
+mkdir dir1
+touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+mkdir there
+busybox mv file1 file2 link1 dir1 there
+test -f there/file1
+test -f there/file2
+test -f there/dir1/file3
+test -L there/link1
+test xfile2 = x`readlink there/link1`
+test ! -e file1
+test ! -e file2
+test ! -e link1
+test ! -e dir1/file3
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links
new file mode 100644
index 0000000..1fb355b
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links
@@ -0,0 +1,4 @@
+touch foo
+ln -s foo bar
+busybox mv bar baz
+test -f baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file
new file mode 100644
index 0000000..48afca4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file
@@ -0,0 +1,4 @@
+touch foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file
new file mode 100644
index 0000000..edb4c37
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file
@@ -0,0 +1,3 @@
+touch foo
+busybox mv foo bar
+test ! -f foo -a -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks
new file mode 100644
index 0000000..eaa8215
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks
@@ -0,0 +1,4 @@
+touch foo
+ln foo bar
+busybox mv bar baz
+test ! -f bar -a -f baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file
new file mode 100644
index 0000000..77d088f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file
@@ -0,0 +1,4 @@
+dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file
new file mode 100644
index 0000000..065c7f1
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file
@@ -0,0 +1,4 @@
+echo I WANT > foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks
new file mode 100644
index 0000000..c413af0
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks
@@ -0,0 +1,6 @@
+touch foo
+ln -s foo bar
+busybox mv bar baz
+test -f foo
+test ! -e bar
+test -L baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files
new file mode 100644
index 0000000..bc9c313
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files
@@ -0,0 +1,5 @@
+touch foo
+chmod a-r foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links
new file mode 100644
index 0000000..b3ba3aa
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links
@@ -0,0 +1,6 @@
+# FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS
+touch foo
+ln foo bar
+mkdir baz
+busybox mv foo bar baz
+test baz/foo -ef baz/bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links
new file mode 100644
index 0000000..ea565d2
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links
@@ -0,0 +1,5 @@
+touch foo
+ln -s foo bar
+busybox mv bar baz
+test -L baz
+test xfoo = x`readlink baz`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir
new file mode 100644
index 0000000..7c572c4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir
@@ -0,0 +1,23 @@
+echo file number one > file1
+echo file number two > file2
+ln -s file2 link1
+mkdir dir1
+touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+mkdir there
+busybox mv file1 file2 link1 dir1 there
+test -f there/file1
+test -f there/file2
+test -f there/dir1/file3
+test -L there/link1
+test xfile2 = x`readlink there/link1`
+test ! -e file1
+test ! -e file2
+test ! -e link1
+test ! -e dir1/file3
+set +e
+busybox mv there there/dir1
+if [ $? != 0 ] ; then
+ exit 0;
+fi
+
+exit 1;
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file
new file mode 100644
index 0000000..48afca4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file
@@ -0,0 +1,4 @@
+touch foo
+busybox mv foo bar
+test ! -e foo
+test -f bar