sys/linux: add mount f2fs test

Add several unit tests that mount different versions of  f2fs image, and
the .sh file that generates these tests.
This commit is contained in:
Jiaheng Hu 2020-08-12 15:13:13 +00:00 committed by Dmitry Vyukov
parent 8a9bdb4a7e
commit 84b0c3d8f6
25 changed files with 52 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

28
tools/create_f2fs_image.sh Executable file
View File

@ -0,0 +1,28 @@
#!/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.
declare -a Op1=("-a 0 " "-a 1 ")
declare -a Op2=("-s 1 " "-s 2 ")
declare -a Op3=("-m " "")
declare -a Op4=("-O encrypt " "-O compression " "")
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.f2fs ${op1}${op2}${op3}${op4} disk.raw
fallocate -l 64M disk.raw
mkfs.f2fs "${op1}${op2}${op3}${op4}" disk.raw
go run "$dir/syz-imagegen/imagegen.go" -image=./disk.raw -fs=f2fs > "$dir/../sys/linux/test/syz_image_mount_f2fs_$dex"
rm disk.raw
dex=dex+1
done
done
done
done