btrfs-progs: send-utils: remove unused functions path_cat and path_cat3
[platform/upstream/btrfs-progs.git] / tests / mkfs-tests / 016-rootdir-bad-symbolic-link / test.sh
1 #!/bin/bash
2 # Regression test for mkfs.btrfs --rootdir with dangling symlink (points to
3 # non-existing location)
4 #
5 # Since mkfs.btrfs --rootdir will just create symbolic link rather than
6 # follow it, we shouldn't hit any problem
7
8 source "$TEST_TOP/common"
9
10 check_prereq mkfs.btrfs
11 prepare_test_dev
12
13 tmp=$(mktemp -d --tmpdir btrfs-progs-mkfs.rootdirXXXXXXX)
14
15 non_existing="/no/such/file$RANDOM$RANDOM"
16
17 if [ -f "$non_existing" ]; then
18         _not_run "Some one created $non_existing, which is not expect to exist"
19 fi
20
21 run_check ln -sf "$non_existing" "$tmp/foobar"
22
23 run_check "$TOP/mkfs.btrfs" -f --rootdir "$tmp" "$TEST_DEV"
24 run_check "$TOP/btrfs" check "$TEST_DEV"
25
26 rm -rf -- "$tmp"