blob: 2a73fc5117e0354ac2f206e6e45c3b65dc89e81b [file] [log] [blame]
Erik Andersena8991081999-12-29 03:34:00 +00001#!/bin/sh
2
3
4
5rm -rf testdir
6./busybox cp tar.c testdir
7
8if ! eval diff -u tar.c testdir ; then
Erik Andersena8991081999-12-29 03:34:00 +00009 echo "Bummer. File copy failed."
10 exit 0
11else
12 echo "Cool. File copy is ok."
13fi
Erik Andersena8991081999-12-29 03:34:00 +000014
15rm -rf testdir
16mkdir -p testdir/foo
17./busybox cp tar.c testdir/foo
18
19if ! eval diff -u tar.c testdir/foo/tar.c ; then
Erik Andersena8991081999-12-29 03:34:00 +000020 echo "Bummer. File copy to a directory failed."
21 exit 0
22else
23 echo "Cool. File copy to a directory is ok."
24fi
Erik Andersena8991081999-12-29 03:34:00 +000025
26
27rm -rf testdir
28mkdir -p testdir/foo
29./busybox cp tar.c testdir/foo/
30
31if ! eval diff -u tar.c testdir/foo/tar.c ; then
Erik Andersena8991081999-12-29 03:34:00 +000032 echo "Bummer. File copy to a directory w/ a '/' failed."
33 exit 0
34else
35 echo "Cool. File copy to a directory w/ a '/' is ok."
36fi
Erik Andersena8991081999-12-29 03:34:00 +000037
38
39rm -rf testdir X11
40cp -a /etc/X11 .
41./busybox cp -a X11 testdir
42
43if ! eval diff -ur X11 testdir ; then
Erik Andersena8991081999-12-29 03:34:00 +000044 echo "Bummer. Local dir copy failed."
45 exit 0
46else
47 echo "Cool. Local dir copy is ok."
48fi
Erik Andersena8991081999-12-29 03:34:00 +000049
50rm -rf testdir X11
51cp -a /etc/X11 .
52./busybox cp -a X11 testdir/
53
54if ! eval diff -ur X11 testdir ; then
Erik Andersena8991081999-12-29 03:34:00 +000055 echo "Bummer. Local dir copy w/ a '/' failed."
56 exit 0
57else
58 echo "Cool. Local dir copy w/ a '/' is ok."
59fi
Erik Andersena8991081999-12-29 03:34:00 +000060
61rm -rf testdir X11
62cp -a /etc/X11 .
63./busybox cp -a X11/ testdir
64
65if ! eval diff -ur X11 testdir ; then
Erik Andersena8991081999-12-29 03:34:00 +000066 echo "Bummer. Local dir copy w/ a src '/' failed."
67 exit 0
68else
69 echo "Cool. Local dir copy w/ a src '/' is ok."
70fi
Erik Andersena8991081999-12-29 03:34:00 +000071
72rm -rf testdir X11
73cp -a /etc/X11 .
74./busybox cp -a X11/ testdir/
75
76if ! eval diff -ur X11 testdir ; then
Erik Andersena8991081999-12-29 03:34:00 +000077 echo "Bummer. Local dir copy w/ 2x '/'s failed."
78 exit 0
79else
80 echo "Cool. Local dir copy w/ 2x '/'s is ok."
81fi
Erik Andersena8991081999-12-29 03:34:00 +000082
83rm -rf testdir X11
84./busybox cp -a /etc/X11 testdir
85if ! eval diff -ur /etc/X11 testdir ; then
Erik Andersena8991081999-12-29 03:34:00 +000086 echo "Bummer. Remote dir copy failed."
87 exit 0
88else
89 echo "Cool. Remote dir copy is ok."
90fi
Erik Andersena8991081999-12-29 03:34:00 +000091
92
93rm -rf testdir X11
94mkdir -p testdir/foo
95
96./busybox cp -a /etc/X11 testdir/foo
97if ! eval diff -ur /etc/X11 testdir/foo ; then
Erik Andersena8991081999-12-29 03:34:00 +000098 echo "Bummer. Remote dir copy to a directory failed."
99 exit 0
100else
101 echo "Cool. Remote dir copy to a directory is ok."
102fi
Erik Andersena8991081999-12-29 03:34:00 +0000103
104
105rm -rf testdir X11
106mkdir -p testdir/foo
107
108./busybox cp -a /etc/X11 testdir/foo/
109if ! eval diff -ur /etc/X11 testdir/foo ; then
Erik Andersena8991081999-12-29 03:34:00 +0000110 echo "Bummer. Remote dir copy to a directory w/ a '/' failed."
111 exit 0
112else
113 echo "Cool. Remote dir copy to a directory w/ a '/' is ok."
114fi
115
116rm -rf testdir
117
Erik Andersen96e2abd2000-01-07 11:40:44 +0000118
119rm -rf foo bar
120mkdir foo
121mkdir bar
122
123if ! eval ./busybox cp README foo ; then
124 echo "Bummer. cp README foo failed."
125 exit 0
126else
127 echo "Cool. cp README foo is ok."
128fi
129
130if ! eval ./busybox cp foo/README bar ; then
131 echo "Bummer. cp foo/README bar failed."
132 exit 0
133else
134 echo "Cool. cp foo/README bar is ok."
135fi
136
137rm -rf foo bar
138