diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-04-06 11:10:30 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-04-06 11:10:30 +0000 |
commit | 650fe63467e693990cf357c51b74db3278088a56 (patch) | |
tree | 660b1fb0e4d7f99802a85cdd00166fafbf3132dc /testsuite/mv | |
parent | 39396b95fc7c46bfa29ec576357fb7f8e755762c (diff) | |
download | busybox-w32-650fe63467e693990cf357c51b74db3278088a56.tar.gz busybox-w32-650fe63467e693990cf357c51b74db3278088a56.tar.bz2 busybox-w32-650fe63467e693990cf357c51b74db3278088a56.zip |
Kill off the old 'tests' stuff. Write a ton of new tests for the
'testsuite' dir. Fix a bunch of broken tests. Fix the testsuite
'runtest' script so it actually reports all failures and provides
meaningful feedback.
-Erik
Diffstat (limited to 'testsuite/mv')
-rw-r--r-- | testsuite/mv/mv-files-to-dir | 16 | ||||
-rw-r--r-- | testsuite/mv/mv-follows-links | 4 | ||||
-rw-r--r-- | testsuite/mv/mv-moves-empty-file | 4 | ||||
-rw-r--r-- | testsuite/mv/mv-moves-hardlinks | 4 | ||||
-rw-r--r-- | testsuite/mv/mv-moves-large-file | 4 | ||||
-rw-r--r-- | testsuite/mv/mv-moves-small-file | 4 | ||||
-rw-r--r-- | testsuite/mv/mv-moves-symlinks | 6 | ||||
-rw-r--r-- | testsuite/mv/mv-moves-unreadable-files | 5 | ||||
-rw-r--r-- | testsuite/mv/mv-preserves-hard-links | 6 | ||||
-rw-r--r-- | testsuite/mv/mv-preserves-links | 5 | ||||
-rw-r--r-- | testsuite/mv/mv-refuses-mv-dir-to-subdir | 23 | ||||
-rw-r--r-- | testsuite/mv/mv-removes-source-file | 4 |
12 files changed, 85 insertions, 0 deletions
diff --git a/testsuite/mv/mv-files-to-dir b/testsuite/mv/mv-files-to-dir new file mode 100644 index 000000000..c8eaba88e --- /dev/null +++ b/testsuite/mv/mv-files-to-dir | |||
@@ -0,0 +1,16 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > file2 | ||
3 | ln -s file2 link1 | ||
4 | mkdir dir1 | ||
5 | touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3 | ||
6 | mkdir there | ||
7 | busybox mv file1 file2 link1 dir1 there | ||
8 | test -f there/file1 | ||
9 | test -f there/file2 | ||
10 | test -f there/dir1/file3 | ||
11 | test -L there/link1 | ||
12 | test xfile2 = x`readlink there/link1` | ||
13 | test ! -e file1 | ||
14 | test ! -e file2 | ||
15 | test ! -e link1 | ||
16 | test ! -e dir1/file3 | ||
diff --git a/testsuite/mv/mv-follows-links b/testsuite/mv/mv-follows-links new file mode 100644 index 000000000..1fb355b81 --- /dev/null +++ b/testsuite/mv/mv-follows-links | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | ln -s foo bar | ||
3 | busybox mv bar baz | ||
4 | test -f baz | ||
diff --git a/testsuite/mv/mv-moves-empty-file b/testsuite/mv/mv-moves-empty-file new file mode 100644 index 000000000..48afca4d5 --- /dev/null +++ b/testsuite/mv/mv-moves-empty-file | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/mv/mv-moves-hardlinks b/testsuite/mv/mv-moves-hardlinks new file mode 100644 index 000000000..eaa8215a4 --- /dev/null +++ b/testsuite/mv/mv-moves-hardlinks | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | ln foo bar | ||
3 | busybox mv bar baz | ||
4 | test ! -f bar -a -f baz | ||
diff --git a/testsuite/mv/mv-moves-large-file b/testsuite/mv/mv-moves-large-file new file mode 100644 index 000000000..77d088ff1 --- /dev/null +++ b/testsuite/mv/mv-moves-large-file | |||
@@ -0,0 +1,4 @@ | |||
1 | dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/mv/mv-moves-small-file b/testsuite/mv/mv-moves-small-file new file mode 100644 index 000000000..065c7f1e9 --- /dev/null +++ b/testsuite/mv/mv-moves-small-file | |||
@@ -0,0 +1,4 @@ | |||
1 | echo I WANT > foo | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||
diff --git a/testsuite/mv/mv-moves-symlinks b/testsuite/mv/mv-moves-symlinks new file mode 100644 index 000000000..c413af07c --- /dev/null +++ b/testsuite/mv/mv-moves-symlinks | |||
@@ -0,0 +1,6 @@ | |||
1 | touch foo | ||
2 | ln -s foo bar | ||
3 | busybox mv bar baz | ||
4 | test -f foo | ||
5 | test ! -e bar | ||
6 | test -L baz | ||
diff --git a/testsuite/mv/mv-moves-unreadable-files b/testsuite/mv/mv-moves-unreadable-files new file mode 100644 index 000000000..bc9c3133c --- /dev/null +++ b/testsuite/mv/mv-moves-unreadable-files | |||
@@ -0,0 +1,5 @@ | |||
1 | touch foo | ||
2 | chmod a-r foo | ||
3 | busybox mv foo bar | ||
4 | test ! -e foo | ||
5 | test -f bar | ||
diff --git a/testsuite/mv/mv-preserves-hard-links b/testsuite/mv/mv-preserves-hard-links new file mode 100644 index 000000000..b3ba3aa29 --- /dev/null +++ b/testsuite/mv/mv-preserves-hard-links | |||
@@ -0,0 +1,6 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS | ||
2 | touch foo | ||
3 | ln foo bar | ||
4 | mkdir baz | ||
5 | busybox mv foo bar baz | ||
6 | test baz/foo -ef baz/bar | ||
diff --git a/testsuite/mv/mv-preserves-links b/testsuite/mv/mv-preserves-links new file mode 100644 index 000000000..ea565d2f1 --- /dev/null +++ b/testsuite/mv/mv-preserves-links | |||
@@ -0,0 +1,5 @@ | |||
1 | touch foo | ||
2 | ln -s foo bar | ||
3 | busybox mv bar baz | ||
4 | test -L baz | ||
5 | test xfoo = x`readlink baz` | ||
diff --git a/testsuite/mv/mv-refuses-mv-dir-to-subdir b/testsuite/mv/mv-refuses-mv-dir-to-subdir new file mode 100644 index 000000000..7c572c4f8 --- /dev/null +++ b/testsuite/mv/mv-refuses-mv-dir-to-subdir | |||
@@ -0,0 +1,23 @@ | |||
1 | echo file number one > file1 | ||
2 | echo file number two > file2 | ||
3 | ln -s file2 link1 | ||
4 | mkdir dir1 | ||
5 | touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3 | ||
6 | mkdir there | ||
7 | busybox mv file1 file2 link1 dir1 there | ||
8 | test -f there/file1 | ||
9 | test -f there/file2 | ||
10 | test -f there/dir1/file3 | ||
11 | test -L there/link1 | ||
12 | test xfile2 = x`readlink there/link1` | ||
13 | test ! -e file1 | ||
14 | test ! -e file2 | ||
15 | test ! -e link1 | ||
16 | test ! -e dir1/file3 | ||
17 | set +e | ||
18 | busybox mv there there/dir1 | ||
19 | if [ $? != 0 ] ; then | ||
20 | exit 0; | ||
21 | fi | ||
22 | |||
23 | exit 1; | ||
diff --git a/testsuite/mv/mv-removes-source-file b/testsuite/mv/mv-removes-source-file new file mode 100644 index 000000000..48afca4d5 --- /dev/null +++ b/testsuite/mv/mv-removes-source-file | |||
@@ -0,0 +1,4 @@ | |||
1 | touch foo | ||
2 | busybox mv foo bar | ||
3 | test ! -e foo | ||
4 | test -f bar | ||