Magellan Linux

Contents of /trunk/mkinitrd-magellan/busybox/testsuite/bzcat.tests

Parent Directory Parent Directory | Revision Log Revision Log


Revision 984 - (show annotations) (download)
Sun May 30 11:32:42 2010 UTC (13 years, 11 months ago) by niro
File size: 1008 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 #!/bin/sh
2
3 ext=bz2
4
5 bb="busybox "
6
7 unset LC_ALL
8 unset LC_MESSAGES
9 unset LANG
10 unset LANGUAGE
11
12 hello_gz() {
13 # Gzipped "HELLO\n"
14 #_________________________ vvv vvv vvv vvv - mtime
15 $ECHO -ne "\x1f\x8b\x08\x00\x85\x1d\xef\x45\x02\x03\xf3\x70\xf5\xf1\xf1\xe7"
16 $ECHO -ne "\x02\x00\x6e\xd7\xac\xfd\x06\x00\x00\x00"
17 }
18
19 hello_bz2() {
20 # Bzipped "HELLO\n"
21 $ECHO -ne "\x42\x5a\x68\x39\x31\x41\x59\x26\x53\x59\x5b\xb8\xe8\xa3\x00\x00"
22 $ECHO -ne "\x01\x44\x00\x00\x10\x02\x44\xa0\x00\x30\xcd\x00\xc3\x46\x29\x97"
23 $ECHO -ne "\x17\x72\x45\x38\x50\x90\x5b\xb8\xe8\xa3"
24 }
25
26 prep() {
27 rm -f t*
28 hello_$ext >t1.$ext
29 hello_$ext >t2.$ext
30 }
31
32 check() {
33 eval $2 >t_actual 2>&1
34 if $ECHO -ne "$expected" | cmp - t_actual; then
35 echo "PASS: $1"
36 else
37 echo "FAIL: $1"
38 fi
39 }
40
41 mkdir testdir 2>/dev/null
42 (
43 cd testdir || { echo "cannot cd testdir!"; exit 1; }
44
45 expected="HELLO\nok\n"
46 prep; check "bzcat: dont delete src" "${bb}bzcat t2.bz2; test -f t2.bz2 && echo ok"
47
48 )
49 rm -rf testdir