Last change
on this file since 3725 was 3621, checked in by Bruno Cornec, 8 years ago |
New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.
|
-
Property svn:executable
set to
*
|
File size:
1.4 KB
|
Rev | Line | |
---|
[821] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | # Tests for unzip.
|
---|
| 4 | # Copyright 2006 Rob Landley <rob@landley.net>
|
---|
[2725] | 5 | # Copyright 2006 Glenn McGrath
|
---|
| 6 | # Licensed under GPLv2, see file LICENSE in this source tree.
|
---|
[821] | 7 |
|
---|
[2725] | 8 | . ./testing.sh
|
---|
[821] | 9 |
|
---|
[3621] | 10 | # testing "test name" "commands" "expected result" "file input" "stdin"
|
---|
[821] | 11 | # file input will be file called "input"
|
---|
| 12 | # test can create a file "actual" instead of writing to stdout
|
---|
| 13 |
|
---|
| 14 | # Create a scratch directory
|
---|
| 15 |
|
---|
| 16 | mkdir temp
|
---|
| 17 | cd temp
|
---|
| 18 |
|
---|
| 19 | # Create test file to work with.
|
---|
| 20 |
|
---|
| 21 | mkdir foo
|
---|
| 22 | touch foo/bar
|
---|
| 23 | zip foo.zip foo foo/bar > /dev/null
|
---|
| 24 | rm -f foo/bar
|
---|
| 25 | rmdir foo
|
---|
| 26 |
|
---|
| 27 | # Test that unzipping just foo doesn't create bar.
|
---|
| 28 | testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f foo/bar && echo yes" "yes\n" "" ""
|
---|
| 29 |
|
---|
| 30 | rmdir foo
|
---|
| 31 | rm foo.zip
|
---|
| 32 |
|
---|
[3621] | 33 | # File containing some damaged encrypted stream
|
---|
| 34 | testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
|
---|
| 35 | "Archive: bad.zip
|
---|
| 36 | inflating: ]3j½r«IK-%Ix
|
---|
| 37 | unzip: corrupted data
|
---|
| 38 | unzip: inflate error
|
---|
| 39 | 1
|
---|
| 40 | " \
|
---|
| 41 | "" "\
|
---|
| 42 | begin-base64 644 bad.zip
|
---|
| 43 | UEsDBBQAAgkIAAAAIQA5AAAANwAAADwAAAAQAAcAXTNqwr1ywqtJGxJLLSVJ
|
---|
| 44 | eCkBD0AdKBk8JzQsIj01JC0/ORJQSwMEFAECCAAAAAAhADoAAAAPAAAANgAA
|
---|
| 45 | AAwAAQASw73Ct1DCokohPXQiNjoUNTUiHRwgLT4WHlBLAQIQABQAAggIAAAA
|
---|
| 46 | oQA5AAAANwAAADwAAAAQQAcADAAAACwAMgCAAAAAAABdM2rCvXLCq0kbEkst
|
---|
| 47 | JUl4KQEPQB0oGSY4Cz4QNgEnJSYIPVBLAQIAABQAAggAAAAAIQAqAAAADwAA
|
---|
| 48 | BDYAAAAMAAEADQAAADIADQAAAEEAAAASw73Ct1DKokohPXQiNzA+FAI1HCcW
|
---|
| 49 | NzITNFBLBQUKAC4JAA04Cw0EOhZQSwUGAQAABAIAAgCZAAAAeQAAAAIALhM=
|
---|
| 50 | ====
|
---|
| 51 | "
|
---|
| 52 |
|
---|
| 53 | rm *
|
---|
| 54 |
|
---|
[821] | 55 | # Clean up scratch directory.
|
---|
| 56 |
|
---|
| 57 | cd ..
|
---|
| 58 | rm -rf temp
|
---|
| 59 |
|
---|
| 60 | exit $FAILCOUNT
|
---|
Note:
See
TracBrowser
for help on using the repository browser.