Annotation of /tags/mkinitrd-6_3_1/busybox/testsuite/tar.tests
Parent Directory | Revision Log
Revision 1143 -
(hide annotations)
(download)
Thu Aug 19 12:44:27 2010 UTC (13 years, 10 months ago) by niro
File size: 2933 byte(s)
Thu Aug 19 12:44:27 2010 UTC (13 years, 10 months ago) by niro
File size: 2933 byte(s)
tagged 'mkinitrd-6_3_1'
1 | niro | 984 | #!/bin/sh |
2 | # Copyright 2009 by Denys Vlasenko | ||
3 | # Licensed under GPL v2, see file LICENSE for details. | ||
4 | |||
5 | . ./testing.sh | ||
6 | |||
7 | niro | 1123 | rm -rf tar.tempdir 2>/dev/null |
8 | mkdir tar.tempdir && cd tar.tempdir || exit 1 | ||
9 | niro | 984 | |
10 | # testing "test name" "script" "expected result" "file input" "stdin" | ||
11 | |||
12 | niro | 1123 | optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES |
13 | testing "tar hardlinks and repeated files" '\ | ||
14 | niro | 984 | rm -rf input_* test.tar 2>/dev/null |
15 | >input_hard1 | ||
16 | ln input_hard1 input_hard2 | ||
17 | mkdir input_dir | ||
18 | >input_dir/file | ||
19 | niro | 1123 | chmod -R 644 * |
20 | chmod 755 input_dir | ||
21 | niro | 984 | tar cf test.tar input input_dir/ input_hard1 input_hard2 input_hard1 input_dir/ input |
22 | niro | 1123 | tar tvf test.tar | sed "s/.*[0-9] input/input/" |
23 | tar xf test.tar 2>&1 | ||
24 | echo Ok: $? | ||
25 | ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/" | ||
26 | ' "\ | ||
27 | niro | 984 | input |
28 | input_dir/ | ||
29 | input_dir/file | ||
30 | input_hard1 | ||
31 | input_hard2 -> input_hard1 | ||
32 | input_hard1 -> input_hard1 | ||
33 | input_dir/ | ||
34 | input_dir/file | ||
35 | input | ||
36 | niro | 1123 | Ok: 0 |
37 | -rw-r--r-- input_dir/file | ||
38 | drwxr-xr-x input_dir | ||
39 | -rw-r--r-- input_hard1 | ||
40 | -rw-r--r-- input_hard2 | ||
41 | niro | 984 | " \ |
42 | "" "" | ||
43 | niro | 1123 | SKIP= |
44 | niro | 984 | |
45 | niro | 1123 | optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES |
46 | testing "tar hardlinks mode" '\ | ||
47 | rm -rf input_* test.tar 2>/dev/null | ||
48 | >input_hard1 | ||
49 | chmod 741 input_hard1 | ||
50 | ln input_hard1 input_hard2 | ||
51 | mkdir input_dir | ||
52 | chmod 550 input_dir | ||
53 | ln input_hard1 input_dir | ||
54 | ln input_hard2 input_dir | ||
55 | tar cf test.tar input_* | ||
56 | tar tvf test.tar | sed "s/.*[0-9] input/input/" | ||
57 | tar xf test.tar 2>&1 | ||
58 | echo Ok: $? | ||
59 | ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/" | ||
60 | ' "\ | ||
61 | input_dir/ | ||
62 | input_dir/input_hard1 | ||
63 | input_dir/input_hard2 -> input_dir/input_hard1 | ||
64 | input_hard1 -> input_dir/input_hard1 | ||
65 | input_hard2 -> input_dir/input_hard1 | ||
66 | Ok: 0 | ||
67 | -rwxr----x input_dir/input_hard1 | ||
68 | -rwxr----x input_dir/input_hard2 | ||
69 | dr-xr-x--- input_dir | ||
70 | -rwxr----x input_hard1 | ||
71 | -rwxr----x input_hard2 | ||
72 | " \ | ||
73 | "" "" | ||
74 | SKIP= | ||
75 | |||
76 | optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES | ||
77 | testing "tar symlinks mode" '\ | ||
78 | rm -rf input_* test.tar 2>/dev/null | ||
79 | >input_file | ||
80 | chmod 741 input_file | ||
81 | ln -s input_file input_soft | ||
82 | mkdir input_dir | ||
83 | chmod 550 input_dir | ||
84 | ln input_file input_dir | ||
85 | ln input_soft input_dir | ||
86 | tar cf test.tar input_* | ||
87 | tar tvf test.tar | sed "s/.*[0-9] input/input/" | sort | ||
88 | tar xf test.tar 2>&1 | ||
89 | echo Ok: $? | ||
90 | ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/" | ||
91 | ' "\ | ||
92 | input_dir/ | ||
93 | input_dir/input_file | ||
94 | input_dir/input_soft -> input_file | ||
95 | input_file -> input_dir/input_file | ||
96 | input_soft -> input_dir/input_soft | ||
97 | Ok: 0 | ||
98 | -rwxr----x input_dir/input_file | ||
99 | lrwxrwxrwx input_file | ||
100 | dr-xr-x--- input_dir | ||
101 | -rwxr----x input_file | ||
102 | lrwxrwxrwx input_file | ||
103 | " \ | ||
104 | "" "" | ||
105 | SKIP= | ||
106 | |||
107 | optional FEATURE_TAR_CREATE FEATURE_TAR_LONG_OPTIONS | ||
108 | niro | 984 | testing "tar --overwrite" "\ |
109 | rm -rf input_* test.tar 2>/dev/null | ||
110 | ln input input_hard | ||
111 | tar cf test.tar input_hard | ||
112 | echo WRONG >input | ||
113 | # --overwrite opens 'input_hard' without unlinking, | ||
114 | # thus 'input_hard' still linked to 'input' and we write 'Ok' into it | ||
115 | tar xf test.tar --overwrite 2>&1 && cat input | ||
116 | " "\ | ||
117 | Ok | ||
118 | " \ | ||
119 | "Ok\n" "" | ||
120 | niro | 1123 | SKIP= |
121 | niro | 984 | |
122 | niro | 1123 | cd .. && rm -rf tar.tempdir || exit 1 |
123 | niro | 984 | |
124 | exit $FAILCOUNT |
Properties
Name | Value |
---|---|
svn:executable | * |