diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-06-14 20:42:57 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-06-14 20:42:57 +0000 |
commit | 7d7a99ca6e7ee92dcd29be4ea8e7b0563ca024eb (patch) | |
tree | 672d4d34162d111ef8166bfdb45d3cad28545bd4 /tests | |
parent | d6ff3328a280c7ea475daa52e8ae4d181c599506 (diff) | |
download | busybox-w32-7d7a99ca6e7ee92dcd29be4ea8e7b0563ca024eb.tar.gz busybox-w32-7d7a99ca6e7ee92dcd29be4ea8e7b0563ca024eb.tar.bz2 busybox-w32-7d7a99ca6e7ee92dcd29be4ea8e7b0563ca024eb.zip |
Integrate Tomi Ollila's telnet. Costs 3k. :)
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@648 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cp_tests.mk | 133 |
1 files changed, 80 insertions, 53 deletions
diff --git a/tests/cp_tests.mk b/tests/cp_tests.mk index 2082d7386..1dc4c5ac4 100644 --- a/tests/cp_tests.mk +++ b/tests/cp_tests.mk | |||
@@ -14,7 +14,13 @@ clean:: cp_clean | |||
14 | cp_clean: | 14 | cp_clean: |
15 | - rm -rf cp_tests cp_*.{gnu,bb} cp | 15 | - rm -rf cp_tests cp_*.{gnu,bb} cp |
16 | 16 | ||
17 | cp_tests: cp_clean cp | 17 | cp_tests: cp_clean cp check_exists check_simple_cp check_cp_symlnk \ |
18 | check_cp_symlink_w_a check_cp_files_to_dir check_cp_files_to_dir_w_d \ | ||
19 | check_cp_files_to_dir_w_p check_cp_files_to_dir_w_p_and_d \ | ||
20 | check_cp_dir_to_dir_wo_a check_cp_dir_to_dir_w_a \ | ||
21 | check_cp_dir_to_dir_w_a_take_two | ||
22 | |||
23 | check_exists: | ||
18 | @echo; | 24 | @echo; |
19 | @echo "No output from diff means busybox cp is functioning properly."; | 25 | @echo "No output from diff means busybox cp is functioning properly."; |
20 | @echo "Some tests might show timestamp differences that are Ok."; | 26 | @echo "Some tests might show timestamp differences that are Ok."; |
@@ -27,6 +33,7 @@ cp_tests: cp_clean cp | |||
27 | @echo; | 33 | @echo; |
28 | mkdir cp_tests; | 34 | mkdir cp_tests; |
29 | 35 | ||
36 | check_simple_cp: | ||
30 | @echo Copy a file to a copy of the file; | 37 | @echo Copy a file to a copy of the file; |
31 | @echo ------------------------------; | 38 | @echo ------------------------------; |
32 | cd cp_tests; \ | 39 | cd cp_tests; \ |
@@ -52,6 +59,7 @@ cp_tests: cp_clean cp | |||
52 | @echo; | 59 | @echo; |
53 | rm -rf cp_tests/*; | 60 | rm -rf cp_tests/*; |
54 | 61 | ||
62 | check_cp_symlnk: | ||
55 | @echo; echo Copy a file pointed to by a symlink; | 63 | @echo; echo Copy a file pointed to by a symlink; |
56 | @echo ------------------------------; | 64 | @echo ------------------------------; |
57 | cd cp_tests; \ | 65 | cd cp_tests; \ |
@@ -84,6 +92,7 @@ cp_tests: cp_clean cp | |||
84 | @echo; | 92 | @echo; |
85 | rm -rf cp_tests/* | 93 | rm -rf cp_tests/* |
86 | 94 | ||
95 | check_cp_symlink_w_a: | ||
87 | @echo; echo Copy a symlink, useing the -a switch.; | 96 | @echo; echo Copy a symlink, useing the -a switch.; |
88 | @echo ------------------------------; | 97 | @echo ------------------------------; |
89 | cd cp_tests; \ | 98 | cd cp_tests; \ |
@@ -115,38 +124,8 @@ cp_tests: cp_clean cp | |||
115 | @echo; | 124 | @echo; |
116 | rm -rf cp_tests/*; | 125 | rm -rf cp_tests/*; |
117 | 126 | ||
118 | @echo; echo Copy a directory into another directory with the -a switch; | ||
119 | @echo ------------------------------; | ||
120 | cd cp_tests; \ | ||
121 | mkdir here there; \ | ||
122 | echo A file > here/afile; \ | ||
123 | mkdir here/adir; \ | ||
124 | touch here/adir/afileinadir; \ | ||
125 | ln -s $$(pwd) here/alink; | ||
126 | |||
127 | @echo; | ||
128 | cd cp_tests; \ | ||
129 | ls -lR . > ../cp_a_dir_dir.gnu; \ | ||
130 | ${GCP} -a here/ there/; \ | ||
131 | ls -lR . >> ../cp_a_dir_dir.gnu; | ||
132 | |||
133 | @echo; | ||
134 | rm -rf cp_tests/there/*; | ||
135 | |||
136 | sleep 1; | ||
137 | |||
138 | @echo; | ||
139 | cd cp_tests; \ | ||
140 | ls -lR . > ../cp_a_dir_dir.bb; \ | ||
141 | ${BCP} -a here/ there/; \ | ||
142 | ls -lR . >> ../cp_a_dir_dir.bb; | ||
143 | |||
144 | @echo; | ||
145 | diff -u cp_a_dir_dir.gnu cp_a_dir_dir.bb; | ||
146 | |||
147 | @echo; | ||
148 | rm -rf cp_tests/*; | ||
149 | 127 | ||
128 | check_cp_files_to_dir: | ||
150 | # Copy a set of files to a directory. | 129 | # Copy a set of files to a directory. |
151 | @echo; echo Copy a set of files to a directory.; | 130 | @echo; echo Copy a set of files to a directory.; |
152 | @echo ------------------------------; | 131 | @echo ------------------------------; |
@@ -174,6 +153,7 @@ cp_tests: cp_clean cp | |||
174 | @echo; | 153 | @echo; |
175 | rm -rf cp_tests/*; | 154 | rm -rf cp_tests/*; |
176 | 155 | ||
156 | check_cp_files_to_dir_w_d: | ||
177 | # Copy a set of files to a directory with the -d switch. | 157 | # Copy a set of files to a directory with the -d switch. |
178 | @echo; echo Copy a set of files to a directory with the -d switch.; | 158 | @echo; echo Copy a set of files to a directory with the -d switch.; |
179 | @echo ------------------------------; | 159 | @echo ------------------------------; |
@@ -203,6 +183,7 @@ cp_tests: cp_clean cp | |||
203 | @echo; | 183 | @echo; |
204 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | 184 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; |
205 | 185 | ||
186 | check_cp_files_to_dir_w_p: | ||
206 | # Copy a set of files to a directory with the -p switch. | 187 | # Copy a set of files to a directory with the -p switch. |
207 | @echo; echo Copy a set of files to a directory with the -p switch.; | 188 | @echo; echo Copy a set of files to a directory with the -p switch.; |
208 | @echo ------------------------------; | 189 | @echo ------------------------------; |
@@ -234,6 +215,8 @@ cp_tests: cp_clean cp | |||
234 | @echo; | 215 | @echo; |
235 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | 216 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; |
236 | 217 | ||
218 | |||
219 | check_cp_files_to_dir_w_p_and_d: | ||
237 | @echo; echo Copy a set of files to a directory with -p and -d switches. | 220 | @echo; echo Copy a set of files to a directory with -p and -d switches. |
238 | @echo ------------------------------; | 221 | @echo ------------------------------; |
239 | cd cp_tests; \ | 222 | cd cp_tests; \ |
@@ -264,6 +247,37 @@ cp_tests: cp_clean cp | |||
264 | @echo; | 247 | @echo; |
265 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; | 248 | rm -rf cp_tests/{afile{1,2},symlink1,there1}; |
266 | 249 | ||
250 | check_cp_dir_to_dir_wo_a: | ||
251 | # Copy a directory to another directory, without the -a switch. | ||
252 | @echo; echo Copy a directory to another directory, without the -a switch. | ||
253 | @echo ------------------------------; | ||
254 | @echo There should be an error message about cannot cp a dir to a subdir of itself. | ||
255 | cd cp_tests; \ | ||
256 | touch a b c; \ | ||
257 | mkdir adir; \ | ||
258 | ls -lR . > ../cp_a_star_adir.gnu; \ | ||
259 | ${GCP} -a * adir; \ | ||
260 | ls -lR . >> ../cp_a_star_adir.gnu; | ||
261 | |||
262 | @echo | ||
263 | @echo There should be an error message about cannot cp a dir to a subdir of itself. | ||
264 | cd cp_tests; \ | ||
265 | rm -rf adir; \ | ||
266 | mkdir adir; \ | ||
267 | ls -lR . > ../cp_a_star_adir.bb; \ | ||
268 | ${BCP} -a * adir; \ | ||
269 | ls -lR . >> ../cp_a_star_adir.bb; | ||
270 | |||
271 | @echo; | ||
272 | diff -u cp_a_star_adir.gnu cp_a_star_adir.bb; | ||
273 | |||
274 | # Done | ||
275 | @echo; | ||
276 | rm -rf cp_tests; | ||
277 | @echo; echo Done. | ||
278 | |||
279 | |||
280 | check_cp_dir_to_dir_w_a: | ||
267 | @echo; echo Copy a directory into another directory with the -a switch. | 281 | @echo; echo Copy a directory into another directory with the -a switch. |
268 | @echo ------------------------------; | 282 | @echo ------------------------------; |
269 | cd cp_tests; \ | 283 | cd cp_tests; \ |
@@ -298,30 +312,43 @@ cp_tests: cp_clean cp | |||
298 | @echo; | 312 | @echo; |
299 | rm -rf cp_tests/dir{a,b}; | 313 | rm -rf cp_tests/dir{a,b}; |
300 | 314 | ||
301 | # Copy a directory to another directory, without the -a switch. | 315 | |
302 | @echo; echo Copy a directory to another directory, without the -a switch. | 316 | check_cp_dir_to_dir_w_a_take_two: |
317 | @echo; echo Copy a directory into another directory with the -a switch; | ||
303 | @echo ------------------------------; | 318 | @echo ------------------------------; |
304 | @echo There should be an error message about cannot cp a dir to a subdir of itself. | 319 | mkdir -p cp_tests/gnu; \ |
305 | cd cp_tests; \ | 320 | mkdir -p cp_tests/bb; \ |
306 | touch a b c; \ | 321 | cd cp_tests; \ |
307 | mkdir adir; \ | 322 | mkdir here there; \ |
308 | ls -lR . > ../cp_a_star_adir.gnu; \ | 323 | echo A file > here/afile; \ |
309 | ${GCP} -a * adir; \ | 324 | mkdir here/adir; \ |
310 | ls -lR . >> ../cp_a_star_adir.gnu; | 325 | touch here/adir/afileinadir; \ |
326 | ln -s $$(pwd) here/alink; | ||
311 | 327 | ||
312 | @echo | 328 | @echo; |
313 | @echo There should be an error message about cannot cp a dir to a subdir of itself. | 329 | cd cp_tests/gnu; \ |
314 | cd cp_tests; \ | 330 | ls -lR . > ../../cp_a_dir_dir.gnu; \ |
315 | rm -rf adir; \ | 331 | ${GCP} -a here/ there/; \ |
316 | mkdir adir; \ | 332 | ls -lR . >> ../../cp_a_dir_dir.gnu; |
317 | ls -lR . > ../cp_a_star_adir.bb; \ | ||
318 | ${BCP} -a * adir; \ | ||
319 | ls -lR . >> ../cp_a_star_adir.bb; | ||
320 | 333 | ||
321 | @echo; | 334 | @echo; |
322 | diff -u cp_a_star_adir.gnu cp_a_star_adir.bb; | 335 | rm -rf cp_tests/there/*; |
336 | |||
337 | sleep 1; | ||
323 | 338 | ||
324 | # Done | ||
325 | @echo; | 339 | @echo; |
326 | rm -rf cp_tests; | 340 | cd cp_tests/bb; \ |
327 | @echo; echo Done. | 341 | ls -lR . > ../../cp_a_dir_dir.bb; \ |
342 | ${BCP} -a here/ there/; \ | ||
343 | ls -lR . >> ../../cp_a_dir_dir.bb; | ||
344 | |||
345 | @echo; | ||
346 | echo "Erik 1" | ||
347 | diff -u cp_a_dir_dir.gnu cp_a_dir_dir.bb; | ||
348 | echo "Erik 2" | ||
349 | |||
350 | @echo; | ||
351 | echo "Erik 3" | ||
352 | rm -rf cp_tests/*; | ||
353 | |||
354 | |||