24.02.2017 19:19, Andrei Borzenkov пишет:
>> How do you create those files reliably? Feel free to add any files to
>> grub-fs-tester. Feel free to commit without tests, we can add tests later.
>>
> 
> I would say, we need to generally create less "nice" test files
> 
> 1. Generate test files that are not exact multiple of filesystem block.
> This would cover squash tail packing and may uncover similar issues in
> other drivers as well.
> 
> 2. Generate sparse files by seeking beyond end of file. We already had
> similar problem with indirect ext* blocks that was not caught by tests.
> We should produce holes both for direct and indirect blocks (we may pick
> common offset or make it fs-specific if necessary).
> 
> 3. We need to produce really small files also to test inlining. Again we
> can pick common size or make it fs-specific.
> 
> Assuming we generate files as described, for squash4 just call it with
> -always-use-fragments to force tail packing. -nopad may be interesting
> as well to stress our driver even more.
> 
> 

Attached patch implements 1 + -always-use-fragments. It reliably causes
squash4 test to fail without my patch. I can change BLOCKCNT for squash4
only, but I think it makes sense to do globally.

sparse files need some tweaking in garbage-gen, will look into it.
From: Andrei Borzenkov <arvidj...@gmail.com>
Subject: [PATCH] grub-fs-tester: improve squash4 tests

1. Make sure files are not multiple of block size. This will ensure tail packing
for squash4 and may also trigger more codes paths in other filesystems.

2. Call mksquashfs with -always-use-fragments to force tail packing.


---
 tests/util/grub-fs-tester.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index f363d6f..a9771f3 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -913,6 +913,8 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
 		*)
 		    BLOCKCNT=5242880;;
 	    esac
+	    # Make sure file is not exact multiple of block size
+	    : $((BLOCKCNT--))
 	    case x"$fs" in
 		x"ntfscomp")
 		    setfattr -h -v 0x00000800 -n system.ntfs_attrib_be "$MNTPOINTRW/$OSDIR";;
@@ -998,8 +1000,8 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE +
 		x"romfs")
 		    genromfs -V "$FSLABEL" -f "${FSIMAGES[0]}" -d "$MASTER" ;;
 		xsquash4_*)
-		    echo mksquashfs "$MASTER" "${FSIMAGES[0]}" -comp "${fs/squash4_/}" -b $BLKSIZE
-		    mksquashfs "$MASTER" "${FSIMAGES[0]}" -comp "${fs/squash4_/}" -b $BLKSIZE ;;
+		    echo mksquashfs "$MASTER" "${FSIMAGES[0]}" -always-use-fragments -nopad -comp "${fs/squash4_/}" -b $BLKSIZE
+		    mksquashfs "$MASTER" "${FSIMAGES[0]}" -always-use-fragments -nopad -comp "${fs/squash4_/}" -b $BLKSIZE ;;
 		x"bfs")
 		    sleep 1
 		    fusermount -u "$MNTPOINTRW"
-- 
tg: (892dfbe..) u/squash4-tests (depends on: master)
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to