6 export BUP_DIR="$TOP/buptest.tmp"
15 "$TOP/t/hardlink-sets" "$@"
20 "$TOP/t/id-other-than" "$@"
23 # Very simple metadata tests -- create a test tree then check that bup
24 # meta can reproduce the metadata correctly (according to bup xstat)
25 # via create, extract, start-extract, and finish-extract. The current
26 # tests are crude, and this does not fully test devices, varying
27 # users/groups, acls, attrs, etc.
32 export PATH="$TOP:$PATH" # pick up bup
33 # Skip atime (test elsewhere) to avoid the observer effect.
34 find . | sort | xargs bup xstat --exclude-fields ctime,atime,size
38 test-src-create-extract()
40 # Test bup meta create/extract for ./src -> ./src-restore.
41 # Also writes to ./src-stat and ./src-restore-stat.
43 (cd src && WVPASS genstat) > src-stat
44 WVPASS bup meta --create --recurse --file src.meta src
46 force-delete src-restore
49 WVPASS bup meta --extract --file ../src.meta
51 (cd src && genstat >../../src-restore-stat) || WVFAIL
52 WVPASS diff -U5 ../src-stat ../src-restore-stat
53 # Test start/finish extract.
55 WVPASS bup meta --start-extract --file ../src.meta
57 WVPASS bup meta --finish-extract --file ../src.meta
58 (cd src && genstat >../../src-restore-stat) || WVFAIL
59 WVPASS diff -U5 ../src-stat ../src-restore-stat
63 test-src-save-restore()
65 # Test bup save/restore metadata for ./src -> ./src-restore. Also
66 # writes to ./src.bup. Note that for now this just tests the
67 # restore below src/, in order to avoid having to worry about
68 # operations that require root (like chown /home).
73 export BUP_DIR=$(pwd)/src.bup
76 WVPASS bup save -t -n src src
78 force-delete src-restore
80 WVPASS bup restore -C src-restore "/src/latest$(pwd)/"
81 WVPASS test -d src-restore/src
82 WVPASS "$TOP/t/compare-trees" -c src/ src-restore/src/
90 if [ $(t/root-status) != root ]; then return 0; fi
92 umount "$TOP/bupmeta.tmp/testfs" || true
93 umount "$TOP/bupmeta.tmp/testfs-limited" || true
97 trap universal-cleanup EXIT
102 force-delete "$BUP_DIR"
103 force-delete "$TOP/bupmeta.tmp"
104 mkdir -p "$TOP/bupmeta.tmp/src"
105 cp -pPR Documentation cmd lib t "$TOP/bupmeta.tmp"/src
107 # Add some hard links for the general tests.
109 cd "$TOP/bupmeta.tmp"/src
110 touch hardlink-target
111 ln hardlink-target hardlink-1
112 ln hardlink-target hardlink-2
113 ln hardlink-target hardlink-3
116 # Add some trivial files for the index, modify, save tests.
118 cd "$TOP/bupmeta.tmp"/src
120 touch volatile/{1,2,3}
123 # Regression test for metadata sort order. Previously, these two
124 # entries would sort in the wrong order because the metadata
125 # entries were being sorted by mangled name, but the index isn't.
126 dd if=/dev/zero of="$TOP/bupmeta.tmp"/src/foo bs=1k count=33
127 touch -t 201111111111 "$TOP/bupmeta.tmp"/src/foo
128 touch -t 201112121111 "$TOP/bupmeta.tmp"/src/foo-bar
130 t/mksock "$TOP/bupmeta.tmp/src/test-socket" || true
133 # Use the test tree to check bup meta.
134 WVSTART 'meta --create/--extract'
137 cd "$TOP/bupmeta.tmp"
138 test-src-create-extract
140 # Test a top-level file (not dir).
142 WVPASS bup meta -cf src-file.meta src-file
145 WVPASS bup meta -xf ../src-file.meta
148 # Use the test tree to check bup save/restore metadata.
149 WVSTART 'metadata save/restore (general)'
152 cd "$TOP/bupmeta.tmp"
153 test-src-save-restore
155 # Test a deeper subdir/ to make sure top-level non-dir metadata is
156 # restored correctly. We need at least one dir and one non-dir at
158 WVPASS test -f src/lib/__init__.py
159 WVPASS test -d src/lib/bup
162 export BUP_DIR=$(pwd)/src.bup
164 touch -t 201111111111 src-restore # Make sure the top won't match.
166 WVPASS bup save -t -n src src
167 force-delete src-restore
168 WVPASS bup restore -C src-restore "/src/latest$(pwd)/src/lib/"
169 touch -t 201211111111 src-restore # Make sure the top won't match.
170 # Check that the only difference is the top dir.
171 $TOP/t/compare-trees -c src/lib/ src-restore/ > tmp-compare-trees
172 WVPASSEQ $(cat tmp-compare-trees | wc -l) 2
173 tail -n +2 tmp-compare-trees | WVPASS grep -qE '^\.d[^ ]+ \./$'
176 # Test that we pull the index (not filesystem) metadata for any
177 # unchanged files whenever we're saving other files in a given
179 WVSTART 'metadata save/restore (using index metadata)'
182 cd "$TOP/bupmeta.tmp"
184 # ...for now -- might be a problem with hardlink restores that was
185 # causing noise wrt this test.
188 # Pause here to keep the filesystem changes far enough away from
189 # the first index run that bup won't cap their index timestamps
190 # (see "bup help index" for more information). Without this
191 # sleep, the compare-trees test below "Bup should *not* pick up
192 # these metadata..." may fail.
198 export BUP_DIR=$(pwd)/src.bup
201 WVPASS bup save -t -n src src
203 force-delete src-restore-1
205 WVPASS bup restore -C src-restore-1 "/src/latest$(pwd)/"
206 WVPASS test -d src-restore-1/src
207 WVPASS "$TOP/t/compare-trees" -c src/ src-restore-1/src/
209 echo "blarg" > src/volatile/1
210 cp -a src/volatile/1 src-restore-1/src/volatile/
213 # Bup should *not* pick up these metadata changes.
216 WVPASS bup save -t -n src src
218 force-delete src-restore-2
220 WVPASS bup restore -C src-restore-2 "/src/latest$(pwd)/"
221 WVPASS test -d src-restore-2/src
222 WVPASS "$TOP/t/compare-trees" -c src-restore-1/src/ src-restore-2/src/
228 setup-hardlink-test()
231 cd "$TOP/bupmeta.tmp"
238 hardlink-test-run-restore()
240 force-delete src-restore
242 WVPASS bup restore -C src-restore "/src/latest$(pwd)/"
243 WVPASS test -d src-restore/src
246 # Test hardlinks more carefully.
247 WVSTART 'metadata save/restore (hardlinks)'
251 export BUP_DIR="$TOP/bupmeta.tmp/src.bup"
252 force-delete "$TOP/bupmeta.tmp"
253 mkdir -p "$TOP/bupmeta.tmp"
255 cd "$TOP/bupmeta.tmp"
257 # Test trivial case - single hardlink.
260 cd "$TOP/bupmeta.tmp"/src
261 touch hardlink-target
262 ln hardlink-target hardlink-1
265 WVPASS bup save -t -n src src
266 hardlink-test-run-restore
267 WVPASS "$TOP/t/compare-trees" -c src/ src-restore/src/
269 # Test the case where the hardlink hasn't changed, but the tree
270 # needs to be saved again. i.e. the save-cmd.py "if hashvalid:"
273 cd "$TOP/bupmeta.tmp"/src
274 echo whatever > something-new
277 WVPASS bup save -t -n src src
278 hardlink-test-run-restore
279 WVPASS "$TOP/t/compare-trees" -c src/ src-restore/src/
281 # Test hardlink changes between index runs.
284 cd "$TOP/bupmeta.tmp"/src
285 touch hardlink-target-a
286 touch hardlink-target-b
287 ln hardlink-target-a hardlink-b-1
288 ln hardlink-target-a hardlink-a-1
290 WVPASS bup index -vv src
292 ln src/hardlink-target-b src/hardlink-b-1
293 WVPASS bup index -vv src
294 WVPASS bup save -t -n src src
295 hardlink-test-run-restore
296 echo ./src/hardlink-a-1 > hardlink-sets.expected
297 echo ./src/hardlink-target-a >> hardlink-sets.expected
298 echo >> hardlink-sets.expected
299 echo ./src/hardlink-b-1 >> hardlink-sets.expected
300 echo ./src/hardlink-target-b >> hardlink-sets.expected
301 (cd src-restore && hardlink-sets .) > hardlink-sets.restored
302 WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
304 # Test hardlink changes between index and save -- hardlink set [a
305 # b c d] changes to [a b] [c d]. At least right now bup should
306 # notice and recreate the latter.
308 cd "$TOP/bupmeta.tmp"/src
314 WVPASS bup index -vv src
318 WVPASS bup save -t -n src src
319 hardlink-test-run-restore
320 echo ./src/a > hardlink-sets.expected
321 echo ./src/b >> hardlink-sets.expected
322 echo >> hardlink-sets.expected
323 echo ./src/c >> hardlink-sets.expected
324 echo ./src/d >> hardlink-sets.expected
325 (cd src-restore && hardlink-sets .) > hardlink-sets.restored
326 WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
328 # Test that we don't link outside restore tree.
330 cd "$TOP/bupmeta.tmp"
334 WVPASS bup index -vv src
335 WVPASS bup save -t -n src src
336 force-delete src-restore
338 WVPASS bup restore -C src-restore "/src/latest$(pwd)/src/a/"
339 WVPASS test -e src-restore/1
340 echo -n > hardlink-sets.expected
341 (cd src-restore && hardlink-sets .) > hardlink-sets.restored
342 WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
344 # Test that we do link within separate sub-trees.
346 cd "$TOP/bupmeta.tmp"
350 WVPASS bup index -vv src/a src/b
351 WVPASS bup save -t -n src src/a src/b
352 hardlink-test-run-restore
353 echo ./src/a/1 > hardlink-sets.expected
354 echo ./src/b/1 >> hardlink-sets.expected
355 (cd src-restore && hardlink-sets .) > hardlink-sets.restored
356 WVPASS diff -u hardlink-sets.expected hardlink-sets.restored
359 WVSTART 'meta --edit'
361 force-delete "$TOP/bupmeta.tmp"
362 mkdir "$TOP/bupmeta.tmp"
363 cd "$TOP/bupmeta.tmp"
365 WVPASS bup meta -cf src.meta src
367 WVPASS bup meta --edit --set-uid 0 src.meta | WVPASS bup meta -tvvf - \
368 | WVPASS grep -qE '^uid: 0'
369 WVPASS bup meta --edit --set-uid 1000 src.meta | WVPASS bup meta -tvvf - \
370 | WVPASS grep -qE '^uid: 1000'
372 WVPASS bup meta --edit --set-gid 0 src.meta | WVPASS bup meta -tvvf - \
373 | WVPASS grep -qE '^gid: 0'
374 WVPASS bup meta --edit --set-gid 1000 src.meta | WVPASS bup meta -tvvf - \
375 | WVPASS grep -qE '^gid: 1000'
377 WVPASS bup meta --edit --set-user foo src.meta | WVPASS bup meta -tvvf - \
378 | WVPASS grep -qE '^user: foo'
379 WVPASS bup meta --edit --set-user bar src.meta | WVPASS bup meta -tvvf - \
380 | WVPASS grep -qE '^user: bar'
381 WVPASS bup meta --edit --unset-user src.meta | WVPASS bup meta -tvvf - \
382 | WVPASS grep -qE '^user:'
383 WVPASS bup meta --edit --set-user bar --unset-user src.meta \
384 | WVPASS bup meta -tvvf - | WVPASS grep -qE '^user:'
385 WVPASS bup meta --edit --unset-user --set-user bar src.meta \
386 | WVPASS bup meta -tvvf - | WVPASS grep -qE '^user: bar'
388 WVPASS bup meta --edit --set-group foo src.meta | WVPASS bup meta -tvvf - \
389 | WVPASS grep -qE '^group: foo'
390 WVPASS bup meta --edit --set-group bar src.meta | WVPASS bup meta -tvvf - \
391 | WVPASS grep -qE '^group: bar'
392 WVPASS bup meta --edit --unset-group src.meta | WVPASS bup meta -tvvf - \
393 | WVPASS grep -qE '^group:'
394 WVPASS bup meta --edit --set-group bar --unset-group src.meta \
395 | WVPASS bup meta -tvvf - | WVPASS grep -qE '^group:'
396 WVPASS bup meta --edit --unset-group --set-group bar src.meta \
397 | WVPASS bup meta -tvvf - | grep -qE '^group: bar'
400 WVSTART 'meta --no-recurse'
403 WVPASS force-delete "$TOP/bupmeta.tmp"
404 WVPASS mkdir "$TOP/bupmeta.tmp"
405 WVPASS cd "$TOP/bupmeta.tmp"
408 WVPASS touch src/foo/{1,2,3}
409 WVPASS bup meta -cf src.meta src
410 WVPASSEQ "$(LC_ALL=C; bup meta -tf src.meta | sort)" "src/
415 WVPASS bup meta --no-recurse -cf src.meta src
416 WVPASSEQ "$(LC_ALL=C; bup meta -tf src.meta | sort)" "src/"
419 # Test ownership restoration (when not root or fakeroot).
421 if [ $(t/root-status) != none ]; then
425 WVSTART 'metadata (restoration of ownership)'
426 force-delete "$TOP/bupmeta.tmp"
427 mkdir "$TOP/bupmeta.tmp"
428 cd "$TOP/bupmeta.tmp"
430 WVPASS bup meta -cf src.meta src
434 # Make sure we don't change (or try to change) the user when not root.
435 WVPASS bup meta --edit --set-user root ../src.meta | WVPASS bup meta -x
436 WVPASS bup xstat src | WVPASS grep -qvE '^user: root'
438 WVPASS bup meta --edit --unset-user --set-uid 0 ../src.meta \
440 WVPASS bup xstat src | grep -qvE '^user: root'
442 # Make sure we can restore one of the user's groups.
443 last_group="$(python -c 'import os,grp; \
444 print grp.getgrgid(os.getgroups()[0])[0]')"
446 WVPASS bup meta --edit --set-group "$last_group" ../src.meta \
448 WVPASS bup xstat src | WVPASS grep -qE "^group: $last_group"
450 # Make sure we can restore one of the user's gids.
452 last_gid="$(echo ${user_gids/* /})"
454 WVPASS bup meta --edit --unset-group --set-gid "$last_gid" ../src.meta \
456 WVPASS bup xstat src | WVPASS grep -qE "^gid: $last_gid"
458 # Test --numeric-ids (gid).
460 current_gidx=$(bup meta -tvvf ../src.meta | grep -e '^gid:')
461 WVPASS bup meta --edit --set-group "$last_group" ../src.meta \
462 | WVPASS bup meta -x --numeric-ids
463 new_gidx=$(bup xstat src | grep -e '^gid:')
464 WVPASSEQ "$current_gidx" "$new_gidx"
466 # Test that restoring an unknown user works.
467 unknown_user=$("$TOP"/t/unknown-owner --user)
469 current_uidx=$(bup meta -tvvf ../src.meta | grep -e '^uid:')
470 WVPASS bup meta --edit --set-user "$unknown_user" ../src.meta \
472 new_uidx=$(bup xstat src | grep -e '^uid:')
473 WVPASSEQ "$current_uidx" "$new_uidx"
475 # Test that restoring an unknown group works.
476 unknown_group=$("$TOP"/t/unknown-owner --group)
478 current_gidx=$(bup meta -tvvf ../src.meta | grep -e '^gid:')
479 WVPASS bup meta --edit --set-group "$unknown_group" ../src.meta \
481 new_gidx=$(bup xstat src | grep -e '^gid:')
482 WVPASSEQ "$current_gidx" "$new_gidx"
485 # Test ownership restoration (when root or fakeroot).
487 if [ $(t/root-status) == none ]; then
491 WVSTART 'metadata (restoration of ownership as root)'
492 force-delete "$TOP/bupmeta.tmp"
493 mkdir "$TOP/bupmeta.tmp"
494 cd "$TOP/bupmeta.tmp"
496 chown 0:0 src # In case the parent dir is sgid, etc.
497 WVPASS bup meta -cf src.meta src
500 chmod 700 dest # so we can't accidentally do something insecure
503 other_uinfo="$(id-other-than --user "$(id -un)")"
504 other_user="${other_uinfo%%:*}"
505 other_uid="${other_uinfo##*:}"
507 other_ginfo="$(id-other-than --group "$(id -gn)")"
508 other_group="${other_ginfo%%:*}"
509 other_gid="${other_ginfo##*:}"
511 # Make sure we can restore a uid (must be in /etc/passwd b/c cygwin).
512 WVPASS bup meta --edit --unset-user --set-uid "$other_uid" ../src.meta \
514 WVPASS bup xstat src | WVPASS grep -qE "^uid: $other_uid"
516 # Make sure we can restore a gid (must be in /etc/group b/c cygwin).
517 WVPASS bup meta --edit --unset-group --set-gid "$other_gid" ../src.meta \
519 WVPASS bup xstat src | WVPASS grep -qE "^gid: $other_gid"
521 other_uinfo2="$(id-other-than --user "$(id -un)" "$other_user")"
522 other_user2="${other_uinfo2%%:*}"
523 other_uid2="${other_uinfo2##*:}"
525 other_ginfo2="$(id-other-than --group "$(id -gn)" "$other_group")"
526 other_group2="${other_ginfo2%%:*}"
527 other_gid2="${other_ginfo2##*:}"
529 # Try to restore a user (and see that user trumps uid when uid is not 0).
530 WVPASS bup meta --edit \
531 --set-uid "$other_uid2" --set-user "$some_user" ../src.meta \
533 WVPASS bup xstat src | WVPASS grep -qE "^user: $some_user"
535 # Try to restore a group (and see that group trumps gid when gid is not 0).
536 WVPASS bup meta --edit \
537 --set-gid "$other_gid2" --set-group "$some_group" ../src.meta \
539 WVPASS bup xstat src | WVPASS grep -qE "^group: $some_user"
541 # Test --numeric-ids (uid). Note the name 'root' is not handled
542 # specially, so we use that here as the test user name. We assume
543 # that the root user's uid is never 42.
545 WVPASS bup meta --edit --set-user root --set-uid "$other_uid" ../src.meta \
546 | WVPASS bup meta -x --numeric-ids
547 new_uidx=$(bup xstat src | grep -e '^uid:')
548 WVPASSEQ "$new_uidx" "uid: $other_uid"
550 # Test --numeric-ids (gid). Note the name 'root' is not handled
551 # specially, so we use that here as the test group name. We
552 # assume that the root group's gid is never 42.
554 WVPASS bup meta --edit --set-group root --set-gid "$other_gid" ../src.meta \
555 | WVPASS bup meta -x --numeric-ids
556 new_gidx=$(bup xstat src | grep -e '^gid:')
557 WVPASSEQ "$new_gidx" "gid: $other_gid"
559 # Test that restoring an unknown user works.
560 unknown_user=$("$TOP"/t/unknown-owners --user)
562 WVPASS bup meta --edit \
563 --set-uid "$other_uid" --set-user "$unknown_user" ../src.meta \
565 new_uidx=$(bup xstat src | grep -e '^uid:')
566 WVPASSEQ "$new_uidx" "uid: $other_uid"
568 # Test that restoring an unknown group works.
569 unknown_group=$("$TOP"/t/unknown-owners --group)
571 WVPASS bup meta --edit \
572 --set-gid "$other_gid" --set-group "$unknown_group" ../src.meta \
574 new_gidx=$(bup xstat src | grep -e '^gid:')
575 WVPASSEQ "$new_gidx" "gid: $other_gid"
577 if ! [[ $(uname) =~ CYGWIN ]]; then
578 # For now, skip these on Cygwin because it doesn't allow
579 # restoring an unknown uid/gid.
581 # Make sure a uid of 0 trumps a non-root user.
582 WVPASS bup meta --edit --set-user "$some_user" ../src.meta \
584 WVPASS bup xstat src | WVPASS grep -qvE "^user: $some_user"
585 WVPASS bup xstat src | WVPASS grep -qE "^uid: 0"
587 # Make sure a gid of 0 trumps a non-root group.
588 WVPASS bup meta --edit --set-group "$some_user" ../src.meta \
590 WVPASS bup xstat src | WVPASS grep -qvE "^group: $some_group"
591 WVPASS bup xstat src | WVPASS grep -qE "^gid: 0"
595 # Root-only tests that require an FS with all the trimmings: ACLs,
596 # Linux attr, Linux xattr, etc.
597 if [ $(t/root-status) == root ]; then
600 # Some cleanup handled in universal-cleanup() above.
601 # These tests are only likely to work under Linux for now
603 [[ $(uname) =~ Linux ]] || exit 0
605 WVSTART 'meta - general (as root)'
607 cd "$TOP/bupmeta.tmp"
609 umount testfs || true
610 dd if=/dev/zero of=testfs.img bs=1M count=32
611 # Make sure we have all the options the chattr test needs
612 # (i.e. create a "normal" ext4 filesystem).
613 WVPASS mke2fs -F -m 0 \
615 -O has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize \
618 mount -o loop,acl,user_xattr testfs.img testfs
619 # Hide, so that tests can't create risks.
620 chown root:root testfs
623 umount testfs-limited || true
624 dd if=/dev/zero of=testfs-limited.img bs=1M count=32
625 mkfs -t vfat testfs-limited.img
627 mount -o loop,uid=root,gid=root,umask=0077 \
628 testfs-limited.img testfs-limited
630 #cp -a src testfs/src
631 cp -pPR src testfs/src
632 (cd testfs && test-src-create-extract)
634 WVSTART 'meta - atime (as root)'
635 force-delete testfs/src
640 PYTHONPATH="$TOP/lib" \
641 python -c "from bup import xstat; \
642 x = xstat.timespec_to_nsecs((42, 0));\
643 xstat.utime('testfs/src/foo', (x, x));\
644 xstat.utime('testfs/src/bar', (x, x));"
646 WVPASS bup meta -v --create --recurse --file src.meta src
647 bup meta -tvf src.meta
649 force-delete src-restore
652 WVPASS bup meta --extract --file ../src.meta
653 WVPASSEQ "$(bup xstat --include-fields=atime src/foo)" "atime: 42"
654 WVPASSEQ "$(bup xstat --include-fields=atime src/bar)" "atime: 42"
655 # Test start/finish extract.
657 WVPASS bup meta --start-extract --file ../src.meta
659 WVPASS bup meta --finish-extract --file ../src.meta
660 WVPASSEQ "$(bup xstat --include-fields=atime src/foo)" "atime: 42"
661 WVPASSEQ "$(bup xstat --include-fields=atime src/bar)" "atime: 42"
665 WVSTART 'meta - Linux attr (as root)'
666 WVPASS force-delete testfs/src
667 WVPASS mkdir testfs/src
669 WVPASS touch testfs/src/foo
670 WVPASS mkdir testfs/src/bar
671 WVPASS chattr +acdeijstuADST testfs/src/foo
672 WVPASS chattr +acdeijstuADST testfs/src/bar
673 (WVPASS cd testfs && WVPASS test-src-create-extract) || exit $?
674 # Test restoration to a limited filesystem (vfat).
676 WVPASS bup meta --create --recurse --file testfs/src.meta \
678 WVPASS force-delete testfs-limited/src-restore
679 WVPASS mkdir testfs-limited/src-restore
680 WVPASS cd testfs-limited/src-restore
681 WVFAIL bup meta --extract --file ../../testfs/src.meta 2>&1 \
682 | WVPASS grep -e '^Linux chattr:' \
684 'import sys; exit(not len(sys.stdin.readlines()) == 3)'
688 # FIXME: skip remaining tests until we fix them.
689 test "$BUP_SKIP_BROKEN_TESTS" && exit 0
692 WVSTART 'meta - Linux xattr (as root)'
693 force-delete testfs/src
698 attr -s foo -V bar testfs/src/foo
699 attr -s foo -V bar testfs/src/bar
700 (cd testfs && test-src-create-extract)
702 # Test restoration to a limited filesystem (vfat).
704 WVPASS bup meta --create --recurse --file testfs/src.meta \
706 force-delete testfs-limited/src-restore
707 mkdir testfs-limited/src-restore
708 cd testfs-limited/src-restore
709 WVFAIL bup meta --extract --file ../../testfs/src.meta 2>&1 \
710 | WVPASS grep -e '^xattr\.set:' \
712 'import sys; exit(not len(sys.stdin.readlines()) == 2)'
716 WVSTART 'meta - POSIX.1e ACLs (as root)'
717 force-delete testfs/src
722 setfacl -m u:root:r testfs/src/foo
723 setfacl -m u:root:r testfs/src/bar
724 (cd testfs && test-src-create-extract)
726 # Test restoration to a limited filesystem (vfat).
728 WVPASS bup meta --create --recurse --file testfs/src.meta \
730 force-delete testfs-limited/src-restore
731 mkdir testfs-limited/src-restore
732 cd testfs-limited/src-restore
733 WVFAIL bup meta --extract --file ../../testfs/src.meta 2>&1 \
734 | WVPASS grep -e '^POSIX1e ACL applyto:' \
736 'import sys; exit(not len(sys.stdin.readlines()) == 2)'