Magellan Linux

Contents of /trunk/mkinitrd-magellan/busybox/testsuite/tar.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: 1068 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 #!/bin/sh
2 # Copyright 2009 by Denys Vlasenko
3 # Licensed under GPL v2, see file LICENSE for details.
4
5 . ./testing.sh
6
7 mkdir tempdir && cd tempdir || exit 1
8
9 # testing "test name" "script" "expected result" "file input" "stdin"
10
11 testing "tar hardlinks and repeated files" "\
12 rm -rf input_* test.tar 2>/dev/null
13 >input_hard1
14 ln input_hard1 input_hard2
15 mkdir input_dir
16 >input_dir/file
17 tar cf test.tar input input_dir/ input_hard1 input_hard2 input_hard1 input_dir/ input
18 tar tvf test.tar | sed 's/.*[0-9] input/input/'
19 tar xf test.tar 2>&1 && echo Ok
20 " "\
21 input
22 input_dir/
23 input_dir/file
24 input_hard1
25 input_hard2 -> input_hard1
26 input_hard1 -> input_hard1
27 input_dir/
28 input_dir/file
29 input
30 Ok
31 " \
32 "" ""
33
34 testing "tar --overwrite" "\
35 rm -rf input_* test.tar 2>/dev/null
36 ln input input_hard
37 tar cf test.tar input_hard
38 echo WRONG >input
39 # --overwrite opens 'input_hard' without unlinking,
40 # thus 'input_hard' still linked to 'input' and we write 'Ok' into it
41 tar xf test.tar --overwrite 2>&1 && cat input
42 " "\
43 Ok
44 " \
45 "Ok\n" ""
46
47 cd .. && rm -rf tempdir || exit 1
48
49 exit $FAILCOUNT

Properties

Name Value
svn:executable *