lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Jun 2018 14:00:42 +0200
From:   Lukas Czerner <lczerner@...hat.com>
To:     linux-ext4@...r.kernel.org
Cc:     Lukas Czerner <lczerner@...hat.com>
Subject: [PATCH] tests: Force inode table initialization for all tests

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@...hat.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(-)

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
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ