btrfs-progs: tests: Test fs on image files is correctly recognised

This ensures that 'btrfs filesystem show' can correctly identify a
filesystem on a newly created local file.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2019-05-16 16:12:50 +03:00 committed by David Sterba
parent fac44aba04
commit ea4d99157c
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash
# test for 'filesystem show' on fresh local file
source "$TEST_TOP/common"
check_prereq mkfs.btrfs
check_prereq btrfs
IMAGE=$(mktemp -u btrfs-XXXXXX.img)
run_check truncate -s3g "$IMAGE"
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$IMAGE"
run_check $SUDO_HELPER "$TOP/btrfs" filesystem show "$IMAGE"
rm -f "$IMAGE"