From: Theodore Ts'o Date: Tue, 7 Jun 2016 16:46:24 +0000 (-0400) Subject: tests: suppress use of libmagic when running the regression test suite X-Git-Tag: v1.43.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=726b21b5d270419e6d8ea0f6d75be0d7455d1e2d;p=thirdparty%2Fe2fsprogs.git tests: suppress use of libmagic when running the regression test suite How libmagic will behave is not necessarily stable across different operating systems of versions of libmagic (or the magic number database). So suppress it to avoid false test failures. Signed-off-by: Theodore Ts'o --- diff --git a/lib/support/plausible.c b/lib/support/plausible.c index fafdcca3c..6f0c4bcb8 100644 --- a/lib/support/plausible.c +++ b/lib/support/plausible.c @@ -248,7 +248,9 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev) } #ifdef HAVE_MAGIC_H - if ((flags & CHECK_FS_EXIST) && magic_library_available()) { + if ((flags & CHECK_FS_EXIST) && + !getenv("E2FSPROGS_LIBMAGIC_SUPPRESS") && + magic_library_available()) { const char *msg; magic_t mag; int has_magic = 0; diff --git a/tests/f_detect_junk/expect b/tests/f_detect_junk/expect index f3300defc..4295886ee 100644 --- a/tests/f_detect_junk/expect +++ b/tests/f_detect_junk/expect @@ -11,13 +11,10 @@ is corrupt, and you might try running e2fsck with an alternate superblock: or e2fsck -b 32768 -test.img contains `PNG image data, 148 x 31, 8-bit/color RGBA, non-interlaced' data *** debugfs test.img: Bad magic number in super-block while opening filesystem -test.img contains `PNG image data, 148 x 31, 8-bit/color RGBA, non-interlaced' data *** tune2fs ../misc/tune2fs: Bad magic number in super-block while trying to open test.img -test.img contains `PNG image data, 148 x 31, 8-bit/color RGBA, non-interlaced' data *** mke2fs Creating filesystem with 16384 1k blocks and 4096 inodes Superblock backups stored on blocks: diff --git a/tests/test_config b/tests/test_config index 7f3915751..547ef4ce9 100644 --- a/tests/test_config +++ b/tests/test_config @@ -39,3 +39,5 @@ E2FSPROGS_SKIP_PROGRESS=yes export E2FSPROGS_SKIP_PROGRESS EXT2FS_NO_MTAB_OK=yes export EXT2FS_NO_MTAB_OK +E2FSPROGS_LIBMAGIC_SUPPRESS=yes +export E2FSPROGS_LIBMAGIC_SUPPRESS