From bf0df4cba7dfbc276a74887be82b29b80b5488c7 Mon Sep 17 00:00:00 2001 From: Jiaheng Hu Date: Sat, 22 Aug 2020 00:13:35 +0000 Subject: sys/linux: mount btrfs tests Add several unit tests that mount different versions of btrfs images, and the .sh file that generates these tests. --- tools/create_btrfs_image.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tools/create_btrfs_image.sh (limited to 'tools') 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 + -- cgit mrf-deployment