Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/testsuite
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (9 years ago)
- Location:
- branches/3.3
- Files:
-
- 11 added
- 1 deleted
- 24 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/testsuite/ar.tests
r2725 r3621 16 16 "" \ 17 17 "" 18 rm test.a 18 rm test.a 2>/dev/null 19 19 20 20 testing "ar replaces things in archives" \ -
branches/3.3/mindi-busybox/testsuite/awk.tests
r3232 r3621 25 25 26 26 # 4294967295 = 0xffffffff 27 testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n" 27 testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4294967295\n" "" "\n" 28 29 # we were testing for a non-empty body when deciding if a function was 30 # defined or not. The testcase below caused: 31 # awk: cmd. line:8: Call to undefined function 32 prg=' 33 function empty_fun(count) { 34 # empty 35 } 36 END { 37 i=1 38 print "L" i "\n" 39 empty_fun(i + i + ++i) 40 print "L" i "\n" 41 }' 42 testing "awk handles empty function f(arg){}" \ 43 "awk '$prg'" \ 44 "L1\n\nL2\n\n" \ 45 "" "" 46 47 prg=' 48 function outer_fun() { 49 return 1 50 } 51 END { 52 i=1 53 print "L" i "\n" 54 i += outer_fun() 55 print "L" i "\n" 56 }' 57 testing "awk properly handles function from other scope" \ 58 "awk '$prg'" \ 59 "L1\n\nL2\n\n" \ 60 "" "" 61 62 prg=' 63 END { 64 i=1 65 print "L" i "\n" 66 i + trigger_error_fun() 67 print "L" i "\n" 68 }' 69 testing "awk properly handles undefined function" \ 70 "awk '$prg' 2>&1" \ 71 "L1\n\nawk: cmd. line:5: Call to undefined function\n" \ 72 "" "" 73 74 28 75 optional DESKTOP 29 testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4 .29497e+09\n" "" "\n"30 testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2 .14748e+09\n" "" "\n"76 testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" 77 testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n" 31 78 testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n" 32 79 SKIP= … … 223 270 "a:b c:d\ne:f g:h" 224 271 272 optional FEATURE_AWK_LIBM 273 testing "awk large integer" \ 274 "awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'" \ 275 "2147483647 2147483647 0 2147483648 2147483648 0\n" \ 276 "" "" 277 SKIP= 278 279 testing "awk length(array)" \ 280 "awk 'BEGIN{ A[1]=2; A[\"qwe\"]=\"asd\"; print length(A)}'" \ 281 "2\n" \ 282 "" "" 283 284 testing "awk length()" \ 285 "awk '{print length; print length(); print length(\"qwe\"); print length(99+9)}'" \ 286 "3\n3\n3\n3\n" \ 287 "" "qwe" 288 289 testing "awk -f and ARGC" \ 290 "awk -f - input" \ 291 "re\n2\n" \ 292 "do re mi\n" \ 293 '{print $2; print ARGC;}' \ 294 295 optional FEATURE_AWK_GNU_EXTENSIONS 296 testing "awk -e and ARGC" \ 297 "awk -e '{print \$2; print ARGC;}' input" \ 298 "re\n2\n" \ 299 "do re mi\n" \ 300 "" 301 SKIP= 302 303 # The examples are in fact not valid awk programs (break/continue 304 # can only be used inside loops). 305 # But we do accept them outside of loops. 306 # We had a bug with misparsing "break ; else" sequence. 307 # Test that *that* bug is fixed, using simplest possible scripts: 308 testing "awk break" \ 309 "awk -f - 2>&1; echo \$?" \ 310 "0\n" \ 311 "" \ 312 'BEGIN { if (1) break; else a = 1 }' 313 testing "awk continue" \ 314 "awk -f - 2>&1; echo \$?" \ 315 "0\n" \ 316 "" \ 317 'BEGIN { if (1) continue; else a = 1 }' 318 225 319 # testing "description" "command" "result" "infile" "stdin" 226 320 -
branches/3.3/mindi-busybox/testsuite/busybox.tests
r2725 r3621 6 6 7 7 . ./testing.sh 8 9 ln -s `which busybox` unknown 10 11 testing "busybox as unknown name" "./unknown 2>&1" \ 12 "unknown: applet not found\n" "" "" 13 rm unknown 14 15 # We need busybox --help to be enabled for the rest of tests 16 test x"$CONFIG_BUSYBOX" = x"y" \ 17 || { echo "SKIPPED: busybox --help"; exit 0; } 8 18 9 19 HELPDUMP=`true | busybox 2>&1 | cat` … … 39 49 rm busybox-suffix 40 50 41 ln -s `which busybox` unknown42 43 testing "busybox as unknown name" "./unknown 2>&1" \44 "unknown: applet not found\n" "" ""45 rm unknown46 47 51 exit $FAILCOUNT -
branches/3.3/mindi-busybox/testsuite/bzcat.tests
r3232 r3621 2 2 3 3 FAILCOUNT=0 4 5 ext=bz26 4 7 5 bb="busybox " … … 11 9 unset LANG 12 10 unset LANGUAGE 11 12 hello_Z() { 13 # Compressed "HELLO\n" 14 $ECHO -ne "\x1f\x9d\x90\x48\x8a\x30\x61\xf2\x44\x01" 15 } 13 16 14 17 hello_gz() { … … 26 29 } 27 30 28 prep() { 29 rm -f t* 30 hello_$ext >t1.$ext 31 hello_$ext >t2.$ext 32 } 31 for ext in \ 32 `test x"$CONFIG_GUNZIP" = x"y" && echo gz` \ 33 `test x"$CONFIG_BUNZIP2" = x"y" && echo bz2` \ 34 `test x"$CONFIG_UNCOMPRESS" = x"y" && echo Z` 35 do 36 prep() { 37 rm -f t1.$ext t2.$ext t_actual 38 hello_$ext >t1.$ext 39 hello_$ext >t2.$ext 40 } 33 41 34 check() {35 36 37 echo "PASS: $1"38 39 echo "FAIL: $1"40 FAILCOUNT=$((FAILCOUNT + 1))41 42 }42 check() { 43 eval $2 >t_actual 2>&1 44 if $ECHO -ne "$expected" | cmp - t_actual; then 45 echo "PASS: $1" 46 else 47 echo "FAIL: $1" 48 FAILCOUNT=$((FAILCOUNT + 1)) 49 fi 50 } 43 51 44 mkdir testdir 2>/dev/null 45 ( 46 cd testdir || { echo "cannot cd testdir!"; exit 1; } 47 48 expected="HELLO\nok\n" 49 prep; check "bzcat: dont delete src" "${bb}bzcat t2.bz2; test -f t2.bz2 && echo ok" 50 51 ) 52 rm -rf testdir 53 52 mkdir testdir 2>/dev/null 53 ( 54 cd testdir || { echo "cannot cd testdir!"; exit 1; } 55 expected="HELLO\nok\n" 56 prep 57 check "zcat: dont delete $ext src" "${bb}zcat t2.$ext; test -f t2.$ext && echo ok" 58 exit $FAILCOUNT 59 ) 60 FAILCOUNT=$? 61 rm -rf testdir 62 done 54 63 55 64 … … 60 69 61 70 # testing "test name" "command" "expected result" "file input" "stdin" 71 72 ## bzip algorithm 62 73 63 74 # "input" file is bzipped file with "a\n" data … … 80 91 "\x42\x5a\x68\x39\x17\x72\x45\x38\x50\x90\x00\x00\x00\x00" "" 81 92 93 ## compress algorithm 94 95 # "input" file is compressed (.Z) file with "a\n" data 96 test x"$CONFIG_UNCOMPRESS" = x"y" && \ 97 testing "zcat can print many files" \ 98 "$ECHO -ne '$hexdump' | zcat input input; echo \$?" \ 99 "\ 100 a 101 a 102 0 103 " "\ 104 \x1f\x9d\x90\x61\x14\x00\ 105 " "" 106 107 # "input" file is compressed (.Z) zero byte file 108 test x"$CONFIG_UNCOMPRESS" = x"y" && \ 109 testing "zcat can handle compressed zero-length (.Z) files" \ 110 "$ECHO -ne '$hexdump' | zcat input input; echo \$?" \ 111 "0\n" \ 112 "\x1f\x9d\x90\x00" "" 113 82 114 83 115 -
branches/3.3/mindi-busybox/testsuite/date/date-works
r2725 r3621 32 32 test x"$dt" = x"Sat Jan 2 03:04:05" 33 33 34 dt=`busybox date -d 01231133` 35 dt=`echo "$dt" | cut -b5-19` 36 test x"$dt" = x"Jan 23 11:33:00" 34 # date (GNU coreutils) 8.17 doesn't accept 01231133 either: 35 # date: invalid date '01231133' 36 #dt=`busybox date -d 01231133` 37 #dt=`echo "$dt" | cut -b5-19` 38 #test x"$dt" = x"Jan 23 11:33:00" 37 39 38 40 dt=`busybox date -d 200001231133` -
branches/3.3/mindi-busybox/testsuite/date/date-works-1
r2725 r3621 42 42 # date (GNU coreutils) 6.10 reports: 43 43 # date: invalid date '01231133' 44 dt=`busybox date -d 01231133 +%c`45 dt=`echo "$dt" | cut -b5-19`46 test x"$dt" = x"Jan 23 11:33:00"44 #dt=`busybox date -d 01231133 +%c` 45 #dt=`echo "$dt" | cut -b5-19` 46 #test x"$dt" = x"Jan 23 11:33:00" 47 47 48 48 # date (GNU coreutils) 6.10 reports: -
branches/3.3/mindi-busybox/testsuite/diff.tests
r2725 r3621 45 45 "stdin" 46 46 47 testing "diff of empty file against stdin" \ 48 "diff -u - input | $TRIM_TAB" \ 49 "\ 50 --- - 51 +++ input 52 @@ -1 +0,0 @@ 53 -a 54 " \ 55 "" \ 56 "a\n" 57 47 58 testing "diff of empty file against nonempty one" \ 48 59 "diff -u - input | $TRIM_TAB" \ … … 88 99 "\nb\n\n" 89 100 101 testing "diff -B ignores blank single line change" \ 102 'diff -qB - input; echo $?' \ 103 "0\n" \ 104 "\n1\n" \ 105 "1\n" 106 107 testing "diff -B does not ignore non-blank single line change" \ 108 'diff -qB - input; echo $?' \ 109 "Files - and input differ\n1\n" \ 110 "0\n" \ 111 "1\n" 112 90 113 testing "diff always takes context from old file" \ 91 114 "diff -ub - input | $TRIM_TAB" \ -
branches/3.3/mindi-busybox/testsuite/du/du-k-works
r3232 r3621 3 3 dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null 4 4 dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null 5 # ext4 on images <512M gives 81kb 6 # ext3 on images <512M gives 83kb 7 # a bsd system reportedly gives 82kb 5 8 test x"`busybox du -k .`" = x"80 ." \ 9 -o x"`busybox du -k .`" = x"81 ." \ 10 -o x"`busybox du -k .`" = x"82 ." \ 11 -o x"`busybox du -k .`" = x"83 ." \ 6 12 -o x"`busybox du -k .`" = x"84 ." \ 7 13 -o x"`busybox du -k .`" = x"88 ." -
branches/3.3/mindi-busybox/testsuite/du/du-l-works
r2725 r3621 7 7 dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null 8 8 test x"`busybox du -l .`" = x"144 ." \ 9 -o x"`busybox du -l .`" = x"146 ." \ 9 10 -o x"`busybox du -l .`" = x"148 ." \ 10 11 -o x"`busybox du -l .`" = x"152 ." \ -
branches/3.3/mindi-busybox/testsuite/du/du-m-works
r2725 r3621 2 2 3 3 dd if=/dev/zero of=file bs=1M count=1 2>/dev/null 4 test x"`busybox du -m .`" = x"1 ."4 test x"`busybox du -m file`" = x"1 file" -
branches/3.3/mindi-busybox/testsuite/grep.tests
r3232 r3621 83 83 "two\nthree\n0\n" "tw\ntwo\nthree\n" "tw.\nthr\n" 84 84 85 # -x (whole line match) 86 testing "grep -x (full match)" "grep -x foo input ; echo \$?" \ 87 "foo\n0\n" "foo\n" "" 88 testing "grep -x (partial match 1)" "grep -x foo input ; echo \$?" \ 89 "1\n" "foo bar\n" "" 90 testing "grep -x (partial match 2)" "grep -x foo input ; echo \$?" \ 91 "1\n" "bar foo\n" "" 92 testing "grep -x -F (full match)" "grep -x -F foo input ; echo \$?" \ 93 "foo\n0\n" "foo\n" "" 94 testing "grep -x -F (partial match 1)" "grep -x -F foo input ; echo \$?" \ 95 "1\n" "foo bar\n" "" 96 testing "grep -x -F (partial match 2)" "grep -x -F foo input ; echo \$?" \ 97 "1\n" "bar foo\n" "" 98 85 99 optional FEATURE_GREP_EGREP_ALIAS 86 100 testing "grep -E supports extended regexps" "grep -E fo+" "foo\n" "" \ … … 128 142 "" 129 143 144 testing "grep -w doesn't stop on 1st mismatch" \ 145 "grep -w foo input" \ 146 "foop foo\n" \ 147 "foop foo\n" \ 148 "" 149 150 testing "grep -w ^str doesn't match str not at the beginning" \ 151 "grep -w ^str input" \ 152 "" \ 153 "strstr\n" \ 154 "" 155 156 testing "grep -w ^ doesn't hang" \ 157 "grep -w ^ input" \ 158 "" \ 159 "anything\n" \ 160 "" 161 162 testing "grep -w word doesn't match wordword" \ 163 "grep -w word input" \ 164 "" \ 165 "wordword\n" \ 166 "" 167 168 testing "grep -w word match second word" \ 169 "grep -w word input" \ 170 "bword,word\n""wordb,word\n""bwordb,word\n" \ 171 "bword,word\n""wordb,word\n""bwordb,word\n" \ 172 "" 173 174 # -r on symlink to dir should recurse into dir 175 mkdir -p grep.testdir/foo 176 echo bar > grep.testdir/foo/file 177 ln -s foo grep.testdir/symfoo 178 testing "grep -r on symlink to dir" \ 179 "grep -r . grep.testdir/symfoo" \ 180 "grep.testdir/symfoo/file:bar\n" \ 181 "" "" 182 rm -Rf grep.testdir 183 184 # But -r on dir/symlink_to_dir should not recurse into symlink_to_dir 185 mkdir -p grep.testdir/foo 186 echo bar > grep.testdir/foo/file 187 ln -s foo grep.testdir/symfoo 188 testing "grep -r on dir/symlink to dir" \ 189 "grep -r . grep.testdir" \ 190 "grep.testdir/foo/file:bar\n" \ 191 "" "" 192 rm -Rf grep.testdir 193 130 194 # testing "test name" "commands" "expected result" "file input" "stdin" 131 195 # file input will be file called "input" -
branches/3.3/mindi-busybox/testsuite/hostid/hostid-works
r2725 r3621 1 1 h=x$(busybox hostid) 2 2 # Is $h a sequence of hex numbers? 3 x="${h//[0123456789abcdef]/x}" 4 x="${x//xxx/x}" 5 x="${x//xxx/x}" 6 x="${x//xxx/x}" 7 x="${x//xx/x}" 8 test x"$x" = x"x" 3 case "$h" in 4 x*[!0-9a-f]*) false;; 5 *) true;; 6 esac -
branches/3.3/mindi-busybox/testsuite/makedevs.tests
r2725 r3621 26 26 mkdir makedevs.testdir 27 27 28 optional FEATURE_MAKEDEVS_TABLE FEATURE_FIND_NOT FEATURE_FIND_TYPE FEATURE_LS_RECURSIVE FEATURE_LS_SORTFILES 28 optional FEATURE_MAKEDEVS_TABLE FEATURE_FIND_NOT FEATURE_FIND_TYPE FEATURE_LS_RECURSIVE FEATURE_LS_SORTFILES FEATURE_LS_TIMESTAMPS 29 29 testing "makedevs -d ../makedevs.device_table.txt ." \ 30 30 "(cd makedevs.testdir && makedevs -d ../makedevs.device_table.txt . 2>&1); -
branches/3.3/mindi-busybox/testsuite/md5sum.tests
r2725 r3621 31 31 while test $n -le 999; do 32 32 echo "$text" | head -c $n | "$sum" 33 : $((n++))33 n=$(($n+1)) 34 34 done | "$sum" 35 35 )` 36 36 37 37 if test x"$result" = x"$expected -"; then 38 39 38 echo "PASS: $sum" 39 exit 0 40 40 fi 41 41 -
branches/3.3/mindi-busybox/testsuite/mdev.tests
r3232 r3621 169 169 rm -rf mdev.testdir/dev/* 170 170 echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf 171 optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH 171 optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH ASH_BUILTIN_ECHO 172 172 testing "mdev command" \ 173 173 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; -
branches/3.3/mindi-busybox/testsuite/pwd/pwd-prints-working-directory
r821 r3621 1 test $(pwd) = $(busybox pwd) 1 # shell's $PWD may leave symlinks unresolved. 2 # "pwd" may be a built-in and have the same problem. 3 # External pwd _can't_ have that problem (current dir on Unix is physical). 4 test $(`which pwd`) = $(busybox pwd) -
branches/3.3/mindi-busybox/testsuite/readlink.tests
r2725 r3621 22 22 optional FEATURE_READLINK_FOLLOW 23 23 24 testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$PWD/$TESTFILE\n" "" "" 25 testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$PWD/$TESTFILE\n" "" "" 24 # shell's $PWD may leave symlinks unresolved. 25 # "pwd" may be a built-in and have the same problem. 26 # External pwd _can't_ have that problem (current dir on Unix is physical). 27 pwd=`which pwd` 28 pwd=`$pwd` 29 testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$pwd/$TESTFILE\n" "" "" 30 testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$pwd/$TESTFILE\n" "" "" 26 31 testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" "" 27 testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$ PWD/$TESTFILE\n" "" ""32 testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$pwd/$TESTFILE\n" "" "" 28 33 29 34 -
branches/3.3/mindi-busybox/testsuite/sed.tests
r3232 r3621 136 136 testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \ 137 137 "one\ntwo" "" 138 test x"$SKIP_KNOWN_BUGS" = x"" && {139 138 testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \ 140 139 "woot\nwoo\n" "" "woot" 141 } 140 testing "sed append autoinserts newline 2" "sed -e '/oot/a woo' - input" \ 141 "woot\nwoo\nboot\nwoo\n" "boot" "woot" 142 testing "sed append autoinserts newline 3" "sed -e '/oot/a woo' -i input && cat input" \ 143 "boot\nwoo\n" "boot" "" 142 144 testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \ 143 145 "woo\nwoot" "" "woot" … … 155 157 "sed -ne 's/woo/bang/p' input -" "a bang\nb bang" "a woo\nb woo" \ 156 158 "c no\nd no" 157 test x"$SKIP_KNOWN_BUGS" = x"" && {158 159 testing "sed clusternewline" \ 159 160 "sed -e '/one/a 111' -e '/two/i 222' -e p input -" \ 160 161 "one\none\n111\n222\ntwo\ntwo" "one" "two" 161 }162 162 testing "sed subst+write" \ 163 163 "sed -e 's/i/z/' -e 'woutputw' input -; $ECHO -n X; cat outputw" \ … … 278 278 ' 279 279 280 testing "sed a cmd understands \\n,\\t,\\r" \ 281 "sed '/1/a\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ 282 "\ 283 line1 284 \t\rzero 285 one\\\\ntwo\\ 286 three 287 " "" "line1\n" 288 289 testing "sed i cmd understands \\n,\\t,\\r" \ 290 "sed '/1/i\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ 291 "\ 292 \t\rzero 293 one\\\\ntwo\\ 294 three 295 line1 296 " "" "line1\n" 297 280 298 # first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges 281 299 testing "sed with N skipping lines past ranges on next cmds" \ … … 311 329 "qwerty_\n" "" "qwerty\n" 312 330 331 testing "sed /\$_in_regex/ should not match newlines, only end-of-line" \ 332 "sed ': testcont; /\\\\$/{ =; N; b testcont }'" \ 333 "\ 334 this is a regular line 335 2 336 line with \\ 337 continuation 338 more regular lines 339 5 340 line with \\ 341 continuation 342 " \ 343 "" "\ 344 this is a regular line 345 line with \\ 346 continuation 347 more regular lines 348 line with \\ 349 continuation 350 " 351 352 testing "sed s///NUM test" \ 353 "sed -e 's/a/b/2; s/a/c/g'" \ 354 "cb\n" "" "aa\n" 355 356 testing "sed /regex/,N{...} addresses work" \ 357 "sed /^2/,2{d}" \ 358 "1\n3\n4\n5\n" \ 359 "" \ 360 "1\n2\n3\n4\n5\n" 361 362 testing "sed /regex/,+N{...} addresses work" \ 363 "sed /^2/,+2{d}" \ 364 "1\n5\n" \ 365 "" \ 366 "1\n2\n3\n4\n5\n" 367 368 testing "sed /regex/,+N{...} -i works" \ 369 "cat - >input2; sed /^4/,+2{d} -i input input2; echo \$?; cat input input2; rm input2" \ 370 "0\n""1\n2\n3\n7\n8\n""1\n2\n7\n8\n" \ 371 "1\n2\n3\n4\n5\n6\n7\n8\n" \ 372 "1\n2\n4\n5\n6\n7\n8\n" \ 373 374 # GNU sed 4.2.1 would also accept "/^4/,+{d}" with the same meaning, we don't 375 testing "sed /regex/,+0{...} -i works" \ 376 "cat - >input2; sed /^4/,+0{d} -i input input2; echo \$?; cat input input2; rm input2" \ 377 "0\n""1\n2\n3\n5\n6\n7\n8\n""1\n2\n5\n6\n7\n8\n" \ 378 "1\n2\n3\n4\n5\n6\n7\n8\n" \ 379 "1\n2\n4\n5\n6\n7\n8\n" \ 380 381 # GNU sed 4.2.1 would also accept "/^4/,+d" with the same meaning, we don't 382 testing "sed /regex/,+0<cmd> -i works" \ 383 "cat - >input2; sed /^4/,+0d -i input input2; echo \$?; cat input input2; rm input2" \ 384 "0\n""1\n2\n3\n5\n6\n7\n8\n""1\n2\n5\n6\n7\n8\n" \ 385 "1\n2\n3\n4\n5\n6\n7\n8\n" \ 386 "1\n2\n4\n5\n6\n7\n8\n" \ 387 388 testing "sed 's///w FILE'" \ 389 "sed 's/qwe/ZZZ/wz'; cat z; rm z" \ 390 "123\nZZZ\nasd\n""ZZZ\n" \ 391 "" \ 392 "123\nqwe\nasd\n" 393 313 394 # testing "description" "commands" "result" "infile" "stdin" 314 395 -
branches/3.3/mindi-busybox/testsuite/sort.tests
r2725 r3621 48 48 " "$data" "" 49 49 50 test x"$SKIP_KNOWN_BUGS" = x"" && {51 # Busybox is definitely doing these wrong. FIXME52 50 testing "sort key range with numeric option and global reverse" \ 53 51 "sort -k2,3n -r input" \ … … 66 64 egg 1 2 papyrus 67 65 " "$data" "" 68 }69 66 70 67 testing "sort key range with two -k options" "sort -k 2,2n -k 1,1r input" "\ … … 102 99 " "" 103 100 101 testing "sort with non-default leading delim 4" "sort -t: -k1,1 input" "\ 102 a:b 103 a/a:a 104 " "\ 105 a/a:a 106 a:b 107 " "" 108 109 testing "sort with ENDCHAR" "sort -t. -k1,1.1 -k2 input" "\ 110 ab.1 111 aa.2 112 " "\ 113 aa.2 114 ab.1 115 " "" 116 117 testing "glibc build sort" "sort -t. -k 1,1 -k 2n,2n -k 3 input" "\ 118 GLIBC_2.1 119 GLIBC_2.1.1 120 GLIBC_2.2 121 GLIBC_2.2.1 122 GLIBC_2.10 123 GLIBC_2.20 124 GLIBC_2.21 125 " "\ 126 GLIBC_2.21 127 GLIBC_2.1.1 128 GLIBC_2.2.1 129 GLIBC_2.2 130 GLIBC_2.20 131 GLIBC_2.10 132 GLIBC_2.1 133 " "" 134 135 testing "glibc build sort unique" "sort -u -t. -k 1,1 -k 2n,2n -k 3 input" "\ 136 GLIBC_2.1 137 GLIBC_2.1.1 138 GLIBC_2.2 139 GLIBC_2.2.1 140 GLIBC_2.10 141 GLIBC_2.20 142 GLIBC_2.21 143 " "\ 144 GLIBC_2.10 145 GLIBC_2.2.1 146 GLIBC_2.1.1 147 GLIBC_2.20 148 GLIBC_2.2 149 GLIBC_2.1 150 GLIBC_2.21 151 " "" 152 104 153 testing "sort -u should consider field only when discarding" "sort -u -k2 input" "\ 105 154 a c -
branches/3.3/mindi-busybox/testsuite/tar.tests
r3232 r3621 16 16 # testing "test name" "script" "expected result" "file input" "stdin" 17 17 18 testing "Empty file is not a tarball" '\ 19 tar xvf - 2>&1; echo $? 20 ' "\ 21 tar: short read 22 1 23 " \ 24 "" "" 25 SKIP= 26 27 optional FEATURE_SEAMLESS_GZ GUNZIP 28 # In NOMMU case, "invalid magic" message comes from gunzip child process. 29 # Otherwise, it comes from tar. 30 # Need to fix output up to avoid false positive. 31 testing "Empty file is not a tarball.tar.gz" '\ 32 { tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic" 33 ' "\ 34 tar: short read 35 1 36 " \ 37 "" "" 38 SKIP= 39 40 testing "Two zeroed blocks is a ('truncated') empty tarball" '\ 41 dd if=/dev/zero bs=512 count=2 2>/dev/null | tar xvf - 2>&1; echo $? 42 ' "\ 43 0 44 " \ 45 "" "" 46 SKIP= 47 48 testing "Twenty zeroed blocks is an empty tarball" '\ 49 dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $? 50 ' "\ 51 0 52 " \ 53 "" "" 54 SKIP= 55 56 # "tar cf test.tar input input_dir/ input_hard1 input_hard2 input_hard1 input_dir/ input": 57 # GNU tar 1.26 records as hardlinks: 58 # input_hard2 -> input_hard1 59 # input_hard1 -> input_hard1 (!!!) 60 # input_dir/file -> input_dir/file 61 # input -> input 62 # As of 1.24.0, we don't record last two: for them, nlink==1 63 # and we check for "hardlink"ness only files with nlink!=1 64 # We also don't use "hrw-r--r--" notation for hardlinks in "tar tv" listing. 18 65 optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES 19 66 testing "tar hardlinks and repeated files" '\ … … 27 74 tar cf test.tar input input_dir/ input_hard1 input_hard2 input_hard1 input_dir/ input 28 75 tar tvf test.tar | sed "s/.*[0-9] input/input/" 76 rm -rf input_dir 29 77 tar xf test.tar 2>&1 30 78 echo Ok: $? … … 157 205 # Had a bug where on extract autodetect first "switched off" -z 158 206 # and then failed to recognize .tgz extension 159 optional FEATURE_TAR_CREATE FEATURE_SEAMLESS_GZ 207 optional FEATURE_TAR_CREATE FEATURE_SEAMLESS_GZ GUNZIP 160 208 testing "tar extract tgz" "\ 161 209 dd count=1 bs=1M if=/dev/zero of=F0 2>/dev/null … … 209 257 SKIP= 210 258 259 # attack.tar.bz2 has symlink pointing to a system file 260 # followed by a regular file with the same name 261 # containing "root::0:0::/root:/bin/sh": 262 # lrwxrwxrwx root/root passwd -> /tmp/passwd 263 # -rw-r--r-- root/root passwd 264 # naive tar implementation may end up creating the symlink 265 # and then writing into it. 266 # The correct implementation unlinks target before 267 # creating the second file. 268 # We test that /tmp/passwd remains empty: 269 optional UUDECODE FEATURE_TAR_AUTODETECT FEATURE_SEAMLESS_BZ2 270 testing "tar does not extract into symlinks" "\ 271 >>/tmp/passwd && uudecode -o input && tar xf input 2>&1 && rm passwd; cat /tmp/passwd; echo \$? 272 " "\ 273 0 274 " \ 275 "" "\ 276 begin-base64 644 attack.tar.bz2 277 QlpoOTFBWSZTWRVn/bIAAKt7hMqwAEBAAP2QAhB0Y96AAACACCAAlISgpqe0 278 po0DIaDynqAkpDRP1ANAhiYNSPR8VchKhAz0AK59+DA6FcMKBggOARIJdVHL 279 DGllrjs20ATUgR1HmccBX3EhoMnpMJaNyggmxgLDMz54lBnBTJO/1L1lbMS4 280 l4/V8LDoe90yiWJhOJvIypgEfxdyRThQkBVn/bI= 281 ==== 282 " 283 SKIP= 284 # And same with -k 285 optional UUDECODE FEATURE_TAR_AUTODETECT FEATURE_SEAMLESS_BZ2 286 testing "tar -k does not extract into symlinks" "\ 287 >>/tmp/passwd && uudecode -o input && tar xf input -k 2>&1 && rm passwd; cat /tmp/passwd; echo \$? 288 " "\ 289 tar: can't open 'passwd': File exists 290 0 291 " \ 292 "" "\ 293 begin-base64 644 attack.tar.bz2 294 QlpoOTFBWSZTWRVn/bIAAKt7hMqwAEBAAP2QAhB0Y96AAACACCAAlISgpqe0 295 po0DIaDynqAkpDRP1ANAhiYNSPR8VchKhAz0AK59+DA6FcMKBggOARIJdVHL 296 DGllrjs20ATUgR1HmccBX3EhoMnpMJaNyggmxgLDMz54lBnBTJO/1L1lbMS4 297 l4/V8LDoe90yiWJhOJvIypgEfxdyRThQkBVn/bI= 298 ==== 299 " 300 SKIP= 301 211 302 212 303 cd .. && rm -rf tar.tempdir || exit 1 -
branches/3.3/mindi-busybox/testsuite/test.tests
r2725 r3621 77 77 "" "" 78 78 79 testing "test '!' = '!': should be true (0)" \ 80 "busybox test '!' = '!'; echo \$?" \ 81 "0\n" \ 82 "" "" 83 84 testing "test '(' = '(': should be true (0)" \ 85 "busybox test '(' = '('; echo \$?" \ 86 "0\n" \ 87 "" "" 88 89 testing "test '!' '!' = '!': should be false (1)" \ 90 "busybox test '!' '!' = '!'; echo \$?" \ 91 "1\n" \ 92 "" "" 93 94 testing "test '!' '(' = '(': should be false (1)" \ 95 "busybox test '!' '(' = '('; echo \$?" \ 96 "1\n" \ 97 "" "" 98 79 99 exit $FAILCOUNT -
branches/3.3/mindi-busybox/testsuite/testing.sh
r3232 r3621 57 57 SKIP= 58 58 while test "$1"; do 59 if test x"${OPTIONFLAGS/*:$1:*/y}" != x"y"; then60 SKIP=161 return62 fi59 case "${OPTIONFLAGS}" in 60 *:$1:*) ;; 61 *) SKIP=1; return ;; 62 esac 63 63 shift 64 64 done -
branches/3.3/mindi-busybox/testsuite/unzip.tests
r2725 r3621 8 8 . ./testing.sh 9 9 10 # testing "test name" " options" "expected result" "file input" "stdin"10 # testing "test name" "commands" "expected result" "file input" "stdin" 11 11 # file input will be file called "input" 12 12 # test can create a file "actual" instead of writing to stdout … … 31 31 rm foo.zip 32 32 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 33 55 # Clean up scratch directory. 34 56 -
branches/3.3/mindi-busybox/testsuite/which/which-uses-default-path
r821 r3621 1 BUSYBOX=$( type -pbusybox)1 BUSYBOX=$(command -v busybox) 2 2 SAVED_PATH=$PATH 3 3 unset PATH
Note:
See TracChangeset
for help on using the changeset viewer.