diff options
| author | Jiaheng Hu <jiahengh@google.com> | 2020-08-22 00:13:35 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-09-14 10:56:04 +0200 |
| commit | bf0df4cba7dfbc276a74887be82b29b80b5488c7 (patch) | |
| tree | 562a7806d766a1d0ddb262a65acdda396a8109e5 /tools | |
| parent | dd93b2327c1028852c1129839e5017c479974305 (diff) | |
sys/linux: mount btrfs tests
Add several unit tests that mount different versions of btrfs images, and
the .sh file that generates these tests.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/create_btrfs_image.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/create_btrfs_image.sh b/tools/create_btrfs_image.sh new file mode 100755 index 000000000..de21e6640 --- /dev/null +++ b/tools/create_btrfs_image.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright 2020 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# Currently disabled +# declare -a Op1=("-d raid0 " "-d raid1 " "-d raid5 " "-d raid6 " "-d raid10 " "-d single " "-d dup ") +declare -a Op1=("-M " "") +declare -a Op2=("-O mixed-bg " "-O extref " "-O raid56 " "-O no-holes " "-O raid1c34 ") +declare -a Op3=("-K " "") +declare -a Op4=("--csum crc32c " "--csum xxhash " "--csum sha256 " "--csum blake2 ") +declare -i dex=0 + +dir=`dirname $0` +echo $dir + +for op1 in "${Op1[@]}"; do + for op2 in "${Op2[@]}"; do + for op3 in "${Op3[@]}"; do + for op4 in "${Op4[@]}"; do + echo mkfs.btrfs ${op1}${op2}${op3}${op4} disk.raw + fallocate -l 128M disk.raw + mkfs.btrfs ${op1}${op2}${op3}${op4} disk.raw + go run "$dir/syz-imagegen/imagegen.go" -image=./disk.raw -fs=btrfs > "$dir/../sys/linux/test/syz_image_mount_btrfs_$dex" + rm disk.raw + dex=dex+1 + done + done + done +done + |
