btrfs-progs: tests: Fix mount fail of 013-extent-tree-rebuild
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 1 Sep 2015 12:40:13 +0000 (14:40 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 1 Sep 2015 12:53:16 +0000 (14:53 +0200)
commitd4c4443c2dc417b5ad8d3da8971e1c1996d7b1ed
tree3c4c20cabfdc93aa8ef21ceecf6a373ba6c78d48
parent421e41df492f838b9b78db7bfae1315f1f7c7336
btrfs-progs: tests: Fix mount fail of 013-extent-tree-rebuild

mount command in old system can not add "-o loop" option automatically
for loop device, and make following test failed:
  # ./fsck-tests.sh
  ...
    [TEST]   013-extent-tree-rebuild
  failed: mount /data/btrfsprogs/tests/test.img /data/btrfsprogs/tests/mnt
  test failed for case 013-extent-tree-rebuild

Considering that $TEST_DEV can be block or loop device, we need determine
our mount option in a condition for both case.

This patch create a wrapper function for above request, to solve current
problem in 013-extent-tree-rebuild, and support similar request in future.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
tests/fsck-tests/013-extent-tree-rebuild/test.sh