diff mbox series

tests: Force inode table initialization for all tests

Message ID 20180628120042.26138-1-lczerner@redhat.com
State Rejected, archived
Headers show
Series tests: Force inode table initialization for all tests | expand

Commit Message

Lukas Czerner June 28, 2018, noon UTC
Currently, depending on whether or not the ext4 module is loaded into
kernel and what version it is the inode table will, or will not be
initialized when the file system is resized. This is fine in practice,
however in out test suite we need more deterministic behavior.

Set RESIZE2FS_FORCE_ITABLE_INIT environment variable globally for all
tests so that the code doing the inode table initialization is
exercised as well and to make resize2fs output more deterministic.

Change the expected output of r_move_itable_nostride and
r_move_itable_realloc tests that previously failed only when the ext4
module was not laded into kernel.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 tests/r_fixup_lastbg_big/script     | 2 +-
 tests/r_move_itable_nostride/expect | 2 ++
 tests/r_move_itable_realloc/expect  | 2 ++
 tests/test_config                   | 2 ++
 4 files changed, 7 insertions(+), 1 deletion(-)

Comments

Theodore Ts'o June 28, 2018, 5:49 p.m. UTC | #1
On Thu, Jun 28, 2018 at 02:00:42PM +0200, Lukas Czerner wrote:
> Currently, depending on whether or not the ext4 module is loaded into
> kernel and what version it is the inode table will, or will not be
> initialized when the file system is resized. This is fine in practice,
> however in out test suite we need more deterministic behavior.
> 
> Set RESIZE2FS_FORCE_ITABLE_INIT environment variable globally for all
> tests so that the code doing the inode table initialization is
> exercised as well and to make resize2fs output more deterministic.
> 
> Change the expected output of r_move_itable_nostride and
> r_move_itable_realloc tests that previously failed only when the ext4
> module was not laded into kernel.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

This was fixed slightly differently in my tree.  I used a different
default than your patch, but it uses basically the same approach.

	     	  	     	- Ted

commit 74430052bc5b3fffff3330f054849ca829fe24dc (origin/maint)
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Tue Jun 26 09:59:19 2018 -0400

    tests: explicitly force resize2fs's use of lazy (or not)
    
    Resize2fs will not enable lazy_itable if the kernel apparently does
    not support that feature.  This will cause spurious test failures when
    the tests are running on such a system (or where sysfs is not
    mounted).
    
    So for the purposes of the regression test we need to force the use of
    lazy_itable so that the results conform to expected golden output.
    
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff mbox series

Patch

diff --git a/tests/r_fixup_lastbg_big/script b/tests/r_fixup_lastbg_big/script
index 113831b7..a8ff0cac 100755
--- a/tests/r_fixup_lastbg_big/script
+++ b/tests/r_fixup_lastbg_big/script
@@ -15,7 +15,7 @@  $DEBUGFS -R "set_bg 2 flags 0" -w $TMPFILE > /dev/null 2>&1
 $DEBUGFS -R "set_bg 2 checksum 0xd318" -w $TMPFILE > /dev/null 2>&1
 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT
 dd if=/dev/zero of=$TMPFILE bs=1 count=1 seek=$((1024 * 40000)) conv=notrunc >> $OUT 2> /dev/null
-RESIZE2FS_FORCE_ITABLE_INIT=1 $RESIZE2FS_EXE -f -p $TMPFILE >> $OUT 2>&1
+$RESIZE2FS_EXE -f -p $TMPFILE >> $OUT 2>&1
 $DUMPE2FS $TMPFILE 2>&1 | grep -A10 '^Group 2:' >> $OUT
 $E2FSCK -fy $TMPFILE >> $OUT 2>&1
 
diff --git a/tests/r_move_itable_nostride/expect b/tests/r_move_itable_nostride/expect
index 098cbfc5..4976e65e 100644
--- a/tests/r_move_itable_nostride/expect
+++ b/tests/r_move_itable_nostride/expect
@@ -1,6 +1,8 @@ 
 mke2fs -q -F -o Linux -b 1024 -i 1024 -E stride=8192 -t ext4 test.img 1024000
 resize2fs -p test.img 10240000
 Resizing the filesystem on test.img to 100000000 (1k) blocks.
+Begin pass 1 (max = 12082)
+Extending the inode table     ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 Begin pass 2 (max = 2062)
 Relocating blocks             ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 Begin pass 3 (max = 125)
diff --git a/tests/r_move_itable_realloc/expect b/tests/r_move_itable_realloc/expect
index 73b2fef0..1312d954 100644
--- a/tests/r_move_itable_realloc/expect
+++ b/tests/r_move_itable_realloc/expect
@@ -1,6 +1,8 @@ 
 mke2fs -q -F -o Linux -b 1024 -i 1024 -O ^resize_inode -t ext4 test.img 1024000
 resize2fs -p test.img 10240000
 Resizing the filesystem on test.img to 100000000 (1k) blocks.
+Begin pass 1 (max = 12082)
+Extending the inode table     ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 Begin pass 2 (max = 2061)
 Relocating blocks             ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 Begin pass 3 (max = 125)
diff --git a/tests/test_config b/tests/test_config
index 81fbf95e..ae619b55 100644
--- a/tests/test_config
+++ b/tests/test_config
@@ -51,3 +51,5 @@  EXT2FS_NO_MTAB_OK=yes
 export EXT2FS_NO_MTAB_OK
 E2FSPROGS_LIBMAGIC_SUPPRESS=yes
 export E2FSPROGS_LIBMAGIC_SUPPRESS
+RESIZE2FS_FORCE_ITABLE_INIT=1
+export RESIZE2FS_FORCE_ITABLE_INIT