2017-11-29 08:26:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Regression test for mkfs.btrfs --rootdir on non-existent file.
|
|
|
|
# Expected behavior: it should create a new file if destination doesn't exist
|
|
|
|
# Regression 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs")
|
|
|
|
|
2023-04-19 15:08:41 +00:00
|
|
|
source "$TEST_TOP/common" || exit
|
2017-11-29 08:26:02 +00:00
|
|
|
|
|
|
|
check_prereq mkfs.btrfs
|
|
|
|
|
2021-10-11 13:56:58 +00:00
|
|
|
tmp=$(_mktemp_dir mkfs-rootdir)
|
2017-11-29 08:26:02 +00:00
|
|
|
# we can't use TEST_DEV, a file is needed
|
2021-10-11 13:56:58 +00:00
|
|
|
img=$(_mktemp mkfs-rootdir)
|
2019-12-17 06:36:51 +00:00
|
|
|
run_check "$TOP/mkfs.btrfs" -f --rootdir "$INTERNAL_BIN/Documentation/" "$img"
|
2017-11-29 08:26:02 +00:00
|
|
|
|
|
|
|
rm -rf -- "$img"
|