]> arthur.barton.de Git - bup.git/blob - t/test-meta.sh
Move tree comparison to t/compare-trees; compare content by default.
[bup.git] / t / test-meta.sh
1 #!/usr/bin/env bash
2 . wvtest.sh
3
4 TOP="$(pwd)"
5 export BUP_DIR="$TOP/buptest.tmp"
6
7 bup()
8 {
9     "$TOP/bup" "$@"
10 }
11
12 hardlink-sets()
13 {
14     "$TOP/t/hardlink-sets" "$@"
15 }
16
17 # Very simple metadata tests -- create a test tree then check that bup
18 # meta can reproduce the metadata correctly (according to bup xstat)
19 # via create, extract, start-extract, and finish-extract.  The current
20 # tests are crude, and this does not fully test devices, varying
21 # users/groups, acls, attrs, etc.
22
23 genstat()
24 {
25     (
26         export PATH="$TOP:$PATH" # pick up bup
27         # Skip atime (test elsewhere) to avoid the observer effect.
28         find . | sort | xargs bup xstat --exclude-fields ctime,atime,size
29     )
30 }
31
32 actually-root()
33 {
34     test "$(whoami)" == root -a -z "$FAKEROOTKEY"
35 }
36
37 force-delete()
38 {
39     if ! actually-root; then
40         rm -rf "$@"
41     else
42         # Go to greater lengths to deal with any test detritus.
43         for f in "$@"; do
44             test -e "$@" || continue
45             chattr -fR = "$@" || true
46             setfacl -Rb "$@"
47             rm -r "$@"
48         done
49     fi
50 }
51
52 test-src-create-extract()
53 {
54     # Test bup meta create/extract for ./src -> ./src-restore.
55     # Also writes to ./src-stat and ./src-restore-stat.
56     (
57         (cd src && WVPASS genstat) > src-stat
58         WVPASS bup meta --create --recurse --file src.meta src
59         # Test extract.
60         force-delete src-restore
61         mkdir src-restore
62         cd src-restore
63         WVPASS bup meta --extract --file ../src.meta
64         WVPASS test -d src
65         (cd src && genstat >../../src-restore-stat) || WVFAIL
66         WVPASS diff -U5 ../src-stat ../src-restore-stat
67         # Test start/finish extract.
68         force-delete src
69         WVPASS bup meta --start-extract --file ../src.meta
70         WVPASS test -d src
71         WVPASS bup meta --finish-extract --file ../src.meta
72         (cd src && genstat >../../src-restore-stat) || WVFAIL
73         WVPASS diff -U5 ../src-stat ../src-restore-stat
74     )
75 }
76
77 test-src-save-restore()
78 {
79     # Test bup save/restore metadata for ./src -> ./src-restore.  Also
80     # writes to ./src.bup.  Note that for now this just tests the
81     # restore below src/, in order to avoid having to worry about
82     # operations that require root (like chown /home).
83     (
84         set -x
85         rm -rf src.bup
86         mkdir src.bup
87         export BUP_DIR=$(pwd)/src.bup
88         WVPASS bup init
89         WVPASS bup index src
90         WVPASS bup save -t -n src src
91         # Test extract.
92         force-delete src-restore
93         mkdir src-restore
94         WVPASS bup restore -C src-restore "/src/latest$(pwd)/"
95         WVPASS test -d src-restore/src
96         WVPASS "$TOP/t/compare-trees" -c src/ src-restore/src/
97         rm -rf src.bup
98         set +x
99     )
100 }
101
102 universal-cleanup()
103 {
104     if ! actually-root; then return 0; fi
105     cd "$TOP"
106     umount "$TOP/bupmeta.tmp/testfs" || true
107     umount "$TOP/bupmeta.tmp/testfs-limited" || true
108 }
109
110 universal-cleanup
111 trap universal-cleanup EXIT
112
113 setup-test-tree()
114 (
115     set -e
116     force-delete "$BUP_DIR"
117     force-delete "$TOP/bupmeta.tmp"
118     mkdir -p "$TOP/bupmeta.tmp/src"
119     cp -pPR Documentation cmd lib t "$TOP/bupmeta.tmp"/src
120
121     # Add some hard links for the general tests.
122     (
123         cd "$TOP/bupmeta.tmp"/src
124         touch hardlink-target
125         ln hardlink-target hardlink-1
126         ln hardlink-target hardlink-2
127         ln hardlink-target hardlink-3
128     )
129
130     # Regression test for metadata sort order.  Previously, these two
131     # entries would sort in the wrong order because the metadata
132     # entries were being sorted by mangled name, but the index isn't.
133     dd if=/dev/zero of="$TOP/bupmeta.tmp"/src/foo bs=1k count=33
134     touch -d 2011-11-11 "$TOP/bupmeta.tmp"/src/foo
135     touch -d 2011-12-12 "$TOP/bupmeta.tmp"/src/foo-bar
136
137     t/mksock "$TOP/bupmeta.tmp/src/test-socket" || true
138 ) || WVFAIL
139
140 # Use the test tree to check bup meta.
141 WVSTART 'meta --create/--extract'
142 (
143     setup-test-tree
144     cd "$TOP/bupmeta.tmp"
145     test-src-create-extract
146
147     # Test a top-level file (not dir).
148     touch src-file
149     WVPASS bup meta -cf src-file.meta src-file
150     mkdir dest
151     cd dest
152     WVPASS bup meta -xf ../src-file.meta
153 )
154
155 # Use the test tree to check bup save/restore metadata.
156 WVSTART 'metadata save/restore (general)'
157 (
158     setup-test-tree
159     cd "$TOP/bupmeta.tmp"
160     test-src-save-restore
161 )
162
163 setup-hardlink-test()
164 {
165     (
166         cd "$TOP/bupmeta.tmp"
167         rm -rf src src.bup
168         mkdir src src.bup
169         WVPASS bup init
170     )
171 }
172
173 hardlink-test-run-restore()
174 {
175     force-delete src-restore
176     mkdir src-restore
177     WVPASS bup restore -C src-restore "/src/latest$(pwd)/"
178     WVPASS test -d src-restore/src
179 }
180
181 # Test hardlinks more carefully.
182 WVSTART 'metadata save/restore (hardlinks)'
183 (
184     set -e
185     set -x
186     export BUP_DIR="$TOP/bupmeta.tmp/src.bup"
187     force-delete "$TOP/bupmeta.tmp"
188     mkdir -p "$TOP/bupmeta.tmp"
189
190     cd "$TOP/bupmeta.tmp"
191
192     # Test trivial case - single hardlink.
193     setup-hardlink-test
194     (
195         cd "$TOP/bupmeta.tmp"/src
196         touch hardlink-target
197         ln hardlink-target hardlink-1
198     )
199     WVPASS bup index src
200     WVPASS bup save -t -n src src
201     hardlink-test-run-restore
202     WVPASS "$TOP/t/compare-trees" -c src/ src-restore/src/
203
204     # Test hardlink changes between index runs.
205     #
206     setup-hardlink-test
207     cd "$TOP/bupmeta.tmp"/src
208     touch hardlink-target-a
209     touch hardlink-target-b
210     ln hardlink-target-a hardlink-b-1
211     ln hardlink-target-a hardlink-a-1
212     cd ..
213     WVPASS bup index -vv src
214     rm src/hardlink-b-1
215     ln src/hardlink-target-b src/hardlink-b-1
216     WVPASS bup index -vv src
217     WVPASS bup save -t -n src src
218     hardlink-test-run-restore
219     echo ./src/hardlink-a-1 > hardlink-sets.expected
220     echo ./src/hardlink-target-a >> hardlink-sets.expected
221     echo >> hardlink-sets.expected
222     echo ./src/hardlink-b-1 >> hardlink-sets.expected
223     echo ./src/hardlink-target-b >> hardlink-sets.expected
224     (cd src-restore && hardlink-sets .) > hardlink-sets.restored
225     WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
226
227     # Test hardlink changes between index and save -- hardlink set [a
228     # b c d] changes to [a b] [c d].  At least right now bup should
229     # notice and recreate the latter.
230     setup-hardlink-test
231     cd "$TOP/bupmeta.tmp"/src
232     touch a
233     ln a b
234     ln a c
235     ln a d
236     cd ..
237     WVPASS bup index -vv src
238     rm src/c src/d
239     touch src/c
240     ln src/c src/d
241     WVPASS bup save -t -n src src
242     hardlink-test-run-restore
243     echo ./src/a > hardlink-sets.expected
244     echo ./src/b >> hardlink-sets.expected
245     echo >> hardlink-sets.expected
246     echo ./src/c >> hardlink-sets.expected
247     echo ./src/d >> hardlink-sets.expected
248     (cd src-restore && hardlink-sets .) > hardlink-sets.restored
249     WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
250
251     # Test that we don't link outside restore tree.
252     setup-hardlink-test
253     cd "$TOP/bupmeta.tmp"
254     mkdir src/a src/b
255     touch src/a/1
256     ln src/a/1 src/b/1
257     WVPASS bup index -vv src
258     WVPASS bup save -t -n src src
259     force-delete src-restore
260     mkdir src-restore
261     WVPASS bup restore -C src-restore "/src/latest$(pwd)/src/a/"
262     WVPASS test -e src-restore/1
263     echo -n > hardlink-sets.expected
264     (cd src-restore && hardlink-sets .) > hardlink-sets.restored
265     WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
266
267     # Test that we do link within separate sub-trees.
268     setup-hardlink-test
269     cd "$TOP/bupmeta.tmp"
270     mkdir src/a src/b
271     touch src/a/1
272     ln src/a/1 src/b/1
273     WVPASS bup index -vv src/a src/b
274     WVPASS bup save -t -n src src/a src/b
275     hardlink-test-run-restore
276     echo ./src/a/1 > hardlink-sets.expected
277     echo ./src/b/1 >> hardlink-sets.expected
278     (cd src-restore && hardlink-sets .) > hardlink-sets.restored
279     WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
280 )
281
282 WVSTART 'meta --edit'
283 (
284     force-delete "$TOP/bupmeta.tmp"
285     mkdir "$TOP/bupmeta.tmp"
286     cd "$TOP/bupmeta.tmp"
287     mkdir src
288     WVPASS bup meta -cf src.meta src
289
290     WVPASS bup meta --edit --set-uid 0 src.meta | WVPASS bup meta -tvvf - \
291         | WVPASS grep -qE '^uid: 0'
292     WVPASS bup meta --edit --set-uid 1000 src.meta | WVPASS bup meta -tvvf - \
293         | WVPASS grep -qE '^uid: 1000'
294
295     WVPASS bup meta --edit --set-gid 0 src.meta | WVPASS bup meta -tvvf - \
296         | WVPASS grep -qE '^gid: 0'
297     WVPASS bup meta --edit --set-gid 1000 src.meta | WVPASS bup meta -tvvf - \
298         | WVPASS grep -qE '^gid: 1000'
299
300     WVPASS bup meta --edit --set-user foo src.meta | WVPASS bup meta -tvvf - \
301         | WVPASS grep -qE '^user: foo'
302     WVPASS bup meta --edit --set-user bar src.meta | WVPASS bup meta -tvvf - \
303         | WVPASS grep -qE '^user: bar'
304     WVPASS bup meta --edit --unset-user src.meta | WVPASS bup meta -tvvf - \
305         | WVPASS grep -qE '^user:'
306     WVPASS bup meta --edit --set-user bar --unset-user src.meta \
307         | WVPASS bup meta -tvvf - | WVPASS grep -qE '^user:'
308     WVPASS bup meta --edit --unset-user --set-user bar src.meta \
309         | WVPASS bup meta -tvvf - | WVPASS grep -qE '^user: bar'
310
311     WVPASS bup meta --edit --set-group foo src.meta | WVPASS bup meta -tvvf - \
312         | WVPASS grep -qE '^group: foo'
313     WVPASS bup meta --edit --set-group bar src.meta | WVPASS bup meta -tvvf - \
314         | WVPASS grep -qE '^group: bar'
315     WVPASS bup meta --edit --unset-group src.meta | WVPASS bup meta -tvvf - \
316         | WVPASS grep -qE '^group:'
317     WVPASS bup meta --edit --set-group bar --unset-group src.meta \
318         | WVPASS bup meta -tvvf - | WVPASS grep -qE '^group:'
319     WVPASS bup meta --edit --unset-group --set-group bar src.meta \
320         | WVPASS bup meta -tvvf - | grep -qE '^group: bar'
321 )
322
323 # Test ownership restoration (when not root or fakeroot).
324 (
325     if test "$(whoami)" == root; then
326         exit 0
327     fi
328
329     WVSTART 'metadata (restoration of ownership)'
330     force-delete "$TOP/bupmeta.tmp"
331     mkdir "$TOP/bupmeta.tmp"
332     cd "$TOP/bupmeta.tmp"
333     touch src
334     WVPASS bup meta -cf src.meta src
335
336     mkdir dest
337     cd dest
338     # Make sure we don't change (or try to change) the user when not root.
339     WVPASS bup meta --edit --set-user root ../src.meta | WVPASS bup meta -x
340     WVPASS bup xstat src | WVPASS grep -qvE '^user: root'
341     rm -rf src
342     WVPASS bup meta --edit --unset-user --set-uid 0 ../src.meta \
343         | WVPASS bup meta -x
344     WVPASS bup xstat src | grep -qvE '^user: root'
345
346     # Make sure we can restore one of the user's groups.
347     last_group="$(python -c 'import os,grp; \
348       print grp.getgrgid(os.getgroups()[0])[0]')"
349     rm -rf src
350     WVPASS bup meta --edit --set-group "$last_group" ../src.meta \
351         | WVPASS bup meta -x
352     WVPASS bup xstat src | WVPASS grep -qE "^group: $last_group"
353
354     # Make sure we can restore one of the user's gids.
355     user_gids="$(id -G)"
356     last_gid="$(echo ${user_gids/* /})"
357     rm -rf src
358     WVPASS bup meta --edit --unset-group --set-gid "$last_gid" ../src.meta \
359         | WVPASS bup meta -x
360     WVPASS bup xstat src | WVPASS grep -qE "^gid: $last_gid"
361
362     # Test --numeric-ids (gid).
363     rm -rf src
364     current_gidx=$(bup meta -tvvf ../src.meta | grep -e '^gid:')
365     WVPASS bup meta --edit --set-group "$last_group" ../src.meta \
366         | WVPASS bup meta -x --numeric-ids
367     new_gidx=$(bup xstat src | grep -e '^gid:')
368     WVPASSEQ "$current_gidx" "$new_gidx"
369
370     # Test that restoring an unknown user works.
371     unknown_user=$("$TOP"/t/unknown-owner --user)
372     rm -rf src
373     current_uidx=$(bup meta -tvvf ../src.meta | grep -e '^uid:')
374     WVPASS bup meta --edit --set-user "$unknown_user" ../src.meta \
375         | WVPASS bup meta -x
376     new_uidx=$(bup xstat src | grep -e '^uid:')
377     WVPASSEQ "$current_uidx" "$new_uidx"
378
379     # Test that restoring an unknown group works.
380     unknown_group=$("$TOP"/t/unknown-owner --group)
381     rm -rf src
382     current_gidx=$(bup meta -tvvf ../src.meta | grep -e '^gid:')
383     WVPASS bup meta --edit --set-group "$unknown_group" ../src.meta \
384         | WVPASS bup meta -x
385     new_gidx=$(bup xstat src | grep -e '^gid:')
386     WVPASSEQ "$current_gidx" "$new_gidx"
387 )
388
389 # Test ownership restoration (when root or fakeroot).
390 (
391     if test "$(whoami)" != root; then
392         exit 0
393     fi
394
395     WVSTART 'metadata (restoration of ownership as root)'
396     force-delete "$TOP/bupmeta.tmp"
397     mkdir "$TOP/bupmeta.tmp"
398     cd "$TOP/bupmeta.tmp"
399     touch src
400     chown 0:0 src # In case the parent dir is sgid, etc.
401     WVPASS bup meta -cf src.meta src
402
403     mkdir dest
404     chmod 700 dest # so we can't accidentally do something insecure
405     cd dest
406
407     # Make sure we can restore a uid.
408     WVPASS bup meta --edit --unset-user --set-uid 42 ../src.meta \
409         | WVPASS bup meta -x
410     WVPASS bup xstat src | WVPASS grep -qE '^uid: 42'
411
412     # Make sure we can restore a gid.
413     WVPASS bup meta --edit --unset-group --set-gid 42 ../src.meta \
414         | WVPASS bup meta -x
415     WVPASS bup xstat src | WVPASS grep -qE '^gid: 42'
416
417     some_user=$("$TOP"/t/some-owner --user)
418     some_group=$("$TOP"/t/some-owner --group)
419
420     # Try to restore a user (and see that user trumps uid when uid is not 0).
421     WVPASS bup meta --edit --set-uid 42 --set-user "$some_user" ../src.meta \
422         | WVPASS bup meta -x
423     WVPASS bup xstat src | WVPASS grep -qE "^user: $some_user"
424
425     # Try to restore a group (and see that group trumps gid when gid is not 0).
426     WVPASS bup meta --edit --set-gid 42 --set-group "$some_group" ../src.meta \
427         | WVPASS bup meta -x
428     WVPASS bup xstat src | WVPASS grep -qE "^group: $some_user"
429
430     # Make sure a uid of 0 trumps a non-root user.
431     WVPASS bup meta --edit --set-user "$some_user" ../src.meta \
432         | WVPASS bup meta -x
433     WVPASS bup xstat src | WVPASS grep -qvE "^user: $some_user"
434     WVPASS bup xstat src | WVPASS grep -qE "^uid: 0"
435
436     # Make sure a gid of 0 trumps a non-root group.
437     WVPASS bup meta --edit --set-group "$some_user" ../src.meta \
438         | WVPASS bup meta -x
439     WVPASS bup xstat src | WVPASS grep -qvE "^group: $some_group"
440     WVPASS bup xstat src | WVPASS grep -qE "^gid: 0"
441
442     # Test --numeric-ids (gid).  Note the name 'root' is not handled
443     # specially, so we use that here as the test group name.  We
444     # assume that the root group's gid is never 42.
445     rm -rf src
446     WVPASS bup meta --edit --set-group root --set-gid 42 ../src.meta \
447         | WVPASS bup meta -x --numeric-ids
448     new_gidx=$(bup xstat src | grep -e '^gid:')
449     WVPASSEQ "$new_gidx" 'gid: 42'
450
451     # Test --numeric-ids (uid).  Note the name 'root' is not handled
452     # specially, so we use that here as the test user name.  We assume
453     # that the root user's uid is never 42.
454     rm -rf src
455     WVPASS bup meta --edit --set-user root --set-uid 42 ../src.meta \
456         | WVPASS bup meta -x --numeric-ids
457     new_uidx=$(bup xstat src | grep -e '^uid:')
458     WVPASSEQ "$new_uidx" 'uid: 42'
459
460     # Test that restoring an unknown user works.
461     unknown_user=$("$TOP"/t/unknown-owners --user)
462     rm -rf src
463     WVPASS bup meta --edit --set-uid 42 --set-user "$unknown_user" ../src.meta \
464         | WVPASS bup meta -x
465     new_uidx=$(bup xstat src | grep -e '^uid:')
466     WVPASSEQ "$new_uidx" 'uid: 42'
467
468     # Test that restoring an unknown group works.
469     unknown_group=$("$TOP"/t/unknown-owners --group)
470     rm -rf src
471     WVPASS bup meta --edit \
472         --set-gid 42 --set-group "$unknown_group" ../src.meta \
473         | WVPASS bup meta -x
474     new_gidx=$(bup xstat src | grep -e '^gid:')
475     WVPASSEQ "$new_gidx" 'gid: 42'
476 )
477
478 # Root-only tests that require an FS with all the trimmings: ACLs,
479 # Linux attr, Linux xattr, etc.
480 if actually-root; then
481     (
482         set -e
483         # Some cleanup handled in universal-cleanup() above.
484         # These tests are only likely to work under Linux for now
485         # (patches welcome).
486         [[ $(uname) =~ Linux ]] || exit 0
487
488         WVSTART 'meta - general (as root)'
489         setup-test-tree
490         cd "$TOP/bupmeta.tmp"
491
492         umount testfs || true
493         dd if=/dev/zero of=testfs.img bs=1M count=32
494         mke2fs -F -j -m 0 testfs.img
495         mkdir testfs
496         mount -o loop,acl,user_xattr testfs.img testfs
497         # Hide, so that tests can't create risks.
498         chown root:root testfs
499         chmod 0700 testfs
500
501         umount testfs-limited || true
502         dd if=/dev/zero of=testfs-limited.img bs=1M count=32
503         mkfs -t vfat testfs-limited.img
504         mkdir testfs-limited
505         mount -o loop,uid=root,gid=root,umask=0077 \
506             testfs-limited.img testfs-limited
507
508         #cp -a src testfs/src
509         cp -pPR src testfs/src
510         (cd testfs && test-src-create-extract)
511
512         WVSTART 'meta - atime (as root)'
513         force-delete testfs/src
514         mkdir testfs/src
515         (
516             mkdir testfs/src/foo
517             touch testfs/src/bar
518             PYTHONPATH="$TOP/lib" \
519                 python -c "from bup import xstat; \
520                 x = xstat.timespec_to_nsecs((42, 0));\
521                    xstat.utime('testfs/src/foo', (x, x));\
522                    xstat.utime('testfs/src/bar', (x, x));"
523             cd testfs
524             WVPASS bup meta -v --create --recurse --file src.meta src
525             bup meta -tvf src.meta
526             # Test extract.
527             force-delete src-restore
528             mkdir src-restore
529             cd src-restore
530             WVPASS bup meta --extract --file ../src.meta
531             WVPASSEQ "$(bup xstat --include-fields=atime src/foo)" "atime: 42"
532             WVPASSEQ "$(bup xstat --include-fields=atime src/bar)" "atime: 42"
533             # Test start/finish extract.
534             force-delete src
535             WVPASS bup meta --start-extract --file ../src.meta
536             WVPASS test -d src
537             WVPASS bup meta --finish-extract --file ../src.meta
538             WVPASSEQ "$(bup xstat --include-fields=atime src/foo)" "atime: 42"
539             WVPASSEQ "$(bup xstat --include-fields=atime src/bar)" "atime: 42"
540         )
541
542         WVSTART 'meta - Linux attr (as root)'
543         force-delete testfs/src
544         mkdir testfs/src
545         (
546             touch testfs/src/foo
547             mkdir testfs/src/bar
548             chattr +acdeijstuADST testfs/src/foo
549             chattr +acdeijstuADST testfs/src/bar
550             (cd testfs && test-src-create-extract)
551             # Test restoration to a limited filesystem (vfat).
552             (
553                 WVPASS bup meta --create --recurse --file testfs/src.meta \
554                     testfs/src
555                 force-delete testfs-limited/src-restore
556                 mkdir testfs-limited/src-restore
557                 cd testfs-limited/src-restore
558                 WVFAIL bup meta --extract --file ../../testfs/src.meta 2>&1 \
559                     | WVPASS grep -e '^Linux chattr:' \
560                     | WVPASS python -c \
561                       'import sys; exit(not len(sys.stdin.readlines()) == 2)'
562             )
563         )
564
565         WVSTART 'meta - Linux xattr (as root)'
566         force-delete testfs/src
567         mkdir testfs/src
568         (
569             touch testfs/src/foo
570             mkdir testfs/src/bar
571             attr -s foo -V bar testfs/src/foo
572             attr -s foo -V bar testfs/src/bar
573             (cd testfs && test-src-create-extract)
574
575             # Test restoration to a limited filesystem (vfat).
576             (
577                 WVPASS bup meta --create --recurse --file testfs/src.meta \
578                     testfs/src
579                 force-delete testfs-limited/src-restore
580                 mkdir testfs-limited/src-restore
581                 cd testfs-limited/src-restore
582                 WVFAIL bup meta --extract --file ../../testfs/src.meta 2>&1 \
583                     | WVPASS grep -e '^xattr\.set:' \
584                     | WVPASS python -c \
585                       'import sys; exit(not len(sys.stdin.readlines()) == 2)'
586             )
587         )
588
589         WVSTART 'meta - POSIX.1e ACLs (as root)'
590         force-delete testfs/src
591         mkdir testfs/src
592         (
593             touch testfs/src/foo
594             mkdir testfs/src/bar
595             setfacl -m u:root:r testfs/src/foo
596             setfacl -m u:root:r testfs/src/bar
597             (cd testfs && test-src-create-extract)
598
599             # Test restoration to a limited filesystem (vfat).
600             (
601                 WVPASS bup meta --create --recurse --file testfs/src.meta \
602                     testfs/src
603                 force-delete testfs-limited/src-restore
604                 mkdir testfs-limited/src-restore
605                 cd testfs-limited/src-restore
606                 WVFAIL bup meta --extract --file ../../testfs/src.meta 2>&1 \
607                     | WVPASS grep -e '^POSIX1e ACL applyto:' \
608                     | WVPASS python -c \
609                       'import sys; exit(not len(sys.stdin.readlines()) == 2)'
610             )
611         )
612     )
613 fi
614
615 exit 0