summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2012-01-17libext2fs: display partial path if fs corrupted in ext2fs_get_pathname()Theodore Ts'o4-9/+9
The function ext2fs_get_pathname() used to return EXT2_ET_NO_DIRECTORY if one of the directories in an inode's pathname is not a directory. This is not very useful in an emergency, when the file system is corrupted. This commit will cause ext2fs_get_pathname() to return a partial pathname, which should help system administrators trying to use debugfs to investigate a corrupted file system. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-29Update Release Notes, Changelogs, version.h, etc. for 1.42 releaseTheodore Ts'o1-0/+49
Also fixed depfix.sed Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-28tests: add test case for multiply claimed blocks with bigallocTheodore Ts'o4-0/+77
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-11tests: fix mmp tests on hard 4k devicesEric Sandeen8-46/+46
Several of the mmp tests were failing on an s390 guest because direct IO cannot be done on sub-sector sizes, and they were doing 1k IOs to files on a 4k logical/physical device. A few tests could just be changed to 4k, but others needed fixed up output as well. With this I have all tests passing on s390 again. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-16libext2fs: ext2fs_[set_]file_acl_block needs to check for 64-bit feature flagTheodore Ts'o1-2/+2
The ext2fs_file_acl_block() and ext2fs_set_file_acl_block() needs to only check i_file_acl_high if the 64-bit flag is set. This is needed because otherwise we will run into problems on Hurd systems which actually use that field for h_i_mode_high. This involves an ABI change since we need to pass ext2_filsys to these functions. Fortunately these functions were first included in the 1.42-WIP series, so it's OK for us to change them now. (This is why we have 1.42-WIP releases. :-) Addresses-Sourceforge-Bug: #3379227 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-30e2fsck: avoid unnecessary reboots in some cases when checking the root fsTheodore Ts'o3-15/+5
If e2fsck modifies certain superblock fields which the kernel doesn't look at, mark the superblock as dirty without marking the file system as changed. This will avoid e2fsck signalling the init scripts that a reboot is necessary. This is safe, because the kernel doesn't actually look at these superblock fields. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-28e2fsck: check for invalid bad block inodeTheodore Ts'o4-0/+19
In some cases the bad block inode gets corrupted. If it looks insane, offer to clear it before trying to interpret it does more harm than good. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-25e2fsck: regression tests for INCOMPAT_MMP featureAndreas Dilger12-0/+289
Add tests for the MMP feature - creating a filesystem with mke2fs and MMP enabled, enable/disable MMP with tune2fs, disabling the e2fsck MMP flag with tune2fs after a failed e2fsck, and e2fsck checking and fixing a corrupt MMP block. The MMP tests need to be run from a real disk, not tmpfs, because tmpfs doesn't support O_DIRECT reads, which MMP uses to ensure that reads from the MMP block are not filled from the page cache. Using a local disk does not slow down the tests noticably, since they wait to detect if the MMP block is being modified. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-24tune2fs: kill external journal if device not foundAndreas Dilger1-0/+28
Continue to remove the external journal device even if the device cannot be found. Add a test to verify that the journal device/UUID are actually removed from the superblock. It isn't possible to use a real journal device for testing without loopback devices and such (it must be a block device) and this would invite complexity and failures in the regression test. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18Shorten compile commands run by the build systemTheodore Ts'o4-0/+4
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and this was starting to cause some tools heartburn. It also made "make V=1" almost useless, since trying to following the individual commands run by make was lost in the noise of all of the defines. So fix this by putting the configure-generated defines in lib/config.h and the directory pathnames to lib/dirpaths.h. In addition, clean up some vestigal defines in configure.in and in the Makefiles to further shorten the cc command lines. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-16test_icount: fclose() before exitEric Sandeen1-0/+2
Just to be tidy. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-15tests: Print out list of failed testsLukas Czerner1-1/+9
Currently we need to grep, list or just search for failed tests when running 'make check' which is annoying. This commit simply prints out the list of failed test names at the end of the output. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-15e2fsprogs: Use punch hole as "discard" on regular filesLukas Czerner3-2/+3
If e2fsprogs tools (mke2fs, e2fsck) is run on regular file instead of on block device, we can use punch hole instead of regular discard command which would not work on regular file anyway. This gives us several advantages. First of all when e2fsck is run with '-E discard' parameter it will punch out all ununsed space from the image, hence trimming down the file system image. And secondly, when creating an file system on regular file (with '-E discard' which is default), we can use punch hole to clear the file content, hence we can skip inode table initialization, because reads from sparse area returns zeros. This will result in faster file system creation (without the need to specify lazy_itable_init) and smaller images. This commit also fixes some tests that would fail due to mke2fs showing discard progress, hence the output would differ. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-13mke2fs: Use ext2fs_flush() only onceLukas Czerner2-2/+2
We are doing ext2fs_flush() twice right now at the end of the mke2fs. First by directly calling ext2fs_flush() which is intended to write superblock and fs accounting information. And then it is invoked again when we are calling ext2fs_close(), only this time, because the fs is not dirty, we are writing out only superblock. I think it is bad to call it twice because even when writing only super block it takes some time on bigger file systems and moreover ext2fs_close() can fail without any reasonable explanation for the user. Also ext2fs_flush() is printing out progress and it is confusing for the users. Fix all this by removing the ext2fs_flush() and leaving it all to ext2fs_close(). However we need to introduce new variables to store check interval and max mount count, because fs structure is freed on ext2fs_close() and we really want to print those information as the last info for the user. [ Fixed type mismatch in a printf format statement -tytso] Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-03tests: skip tests that require debugfs if debugfs has not been builtTheodore Ts'o11-5/+62
Avoid lots of tests failing if e2fsprogs is compiled with --disable-debugfs. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-03tests: fix i_e2image so it works with valgrindTheodore Ts'o2-1/+5
Since e2image can be optionally compiled out, we tested to see if e2image was built; but using "test -x $E2IMAGE" fails if e2image is something like "valgrind --simhints=lax-ioctls ../misc/e2image". Define and use $E2IMAGE_EXE, much like we have done with e2undo and resize2fs. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-12tests: add missing m_mkfs_overhead/expectTheodore Ts'o1-0/+1
This file was accidentally dropped during the recent tests /tmp overhual. Re-adding. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-09tests: use /tmp for scratch filesTheodore Ts'o18-66/+94
The /tmp directory is often a memory based file system, and using this can speed up running the regression test suite. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-16e2fsck: fix mysterious "FILE SYSTEM WAS MODIFIED" with no changesTheodore Ts'o7-15/+6
Commit 2a77a784a3 (firest released in e2fsprogs 1.33) compared superblock summary free blocks and inode counts with the allocation bitmap counts before starting the file system check proper, and if they differed, set the superblock and marked it as dirty. If no other file systme changes were required, this would cause a "*** FILE SYSTEM WAS MODIFIED ***" message without any explanation of what e2fsck had changed. We fix this by only setting the superblock summary free block/inodes counts if we are skipping a full check, and in non-preen mode, e2fsck will now print an explicit message stating how the superblock had been updated. In a full check, any updates to the superblock free blocks/inodes fields will be noted in pass5. This change requires changing a few test results (essentially reversing the changes made in commit 2a77a784a3). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-11Merge branch 'maint' into nextTheodore Ts'o1-1/+1
2011-06-11e2fsprogs: ignore generated files for "git status"Andreas Dilger1-1/+1
Ignore files generated by "make" or "make check" in "git status". Ignore backup files from editing files and generated tags files. Delete a temporary file in tests/d_loaddump/script at test cleanup. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11mke2fs: add extent-mapped journal regression testAndreas Dilger2-0/+130
All of the regression tests in e2fsprogs still use a block-mapped journal (if any journal at all). Add a simple regression test that tests extent-mapped journals for both mke2fs and e2fsck. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11mke2fs: add test for large journal with lazy initAndreas Dilger2-0/+579
Add test for internal journal over 4GB in size, using the lazy_journal_init and lazy_itable_init features. Otherwise the filesystem metadata would be too large to reliably run on test systems, and take too long to create/check the filesystem. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-18tests: New i_e2image test to validate image creation/conversionLukas Czerner6-0/+73
This commit adds new regression test called i_e2image which should validate expected behaviour of e2image raw and qcow2 image creation and qcow2 -> raw image conversion. You can run it with "make check" as the rest of regression tests. Testing is performed on three filesystem images with different block sizes (1024, 2048, 4096). It creates raw and qcow2 images from the original and then convert qcow2 image back to raw image. The results are checksummed and compared with pre-prepared results. All md5sums should stay the same and raw image created from original and qcow2 image should be the same as well (just for the record). Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-14mke2fs: Allow specifying reserved_ratio via mke2fs.confAditya Kali1-0/+1
This patch adds support for specifying 'reserved_ratio' (percent blocks reserved for super user, same as '-m' command line option) in mke2fs.conf. It adds profile_get_double function in profile.c that allows reading floating point values from profile files. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20Merge branch 'maint' into nextTheodore Ts'o1-0/+2
Conflicts: misc/mke2fs.conf.5.in
2011-02-20e2fsprogs: enable user namespace xattrs by defaultEric Sandeen1-0/+1
User namespace xattrs are generally useful, and I think extN is the only filesystem requiring a special mount option to enable them, when xattrs are otherwise available. So this change sets that mount option into the defaults, via a mke2fs.conf option. Note that if xattrs are config'd off, this will lead to a mostly-harmless: EXT4-fs (sdc1): (no)user_xattr options not supported message at mount time... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20e2fsprogs: turn off enforced fsck intervals by defaultEric Sandeen1-0/+1
The forced fsck often comes at unexpected and inopportune moments, and even enterprise customers are often caught by surprise when this happens. Because a filesystem with an error condition will be marked as requiring fsck anyway, I submit that the time-based and mount-based checks are not particularly useful, and that administrators can schedule fscks on their own time, or tune2fs the enforced intervals if they so choose. This patch disables the intervals by default, and I've added a new mkfs.conf option to turn on the old behavior of random, unexpected, time-consuming fscks at boot time. ;) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-12-22Merge branch 'maint' into nextTheodore Ts'o2-6/+9
Conflicts: resize/resize2fs.c
2010-12-22libext2fs: Don't use the extended rec_len encoding for standard file systemsTheodore Ts'o2-6/+9
If the file system has a blocksize less than 64k, then don't use the extended rec_len encoding, to be consistent with what the kernel will do. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-13Merge branch 'maint' into nextTheodore Ts'o1-0/+1
Conflicts: e2fsck/pass4.c misc/dumpe2fs.c resize/online.c
2010-11-22Disable lazy inode table initialization when running regression testsTheodore Ts'o1-0/+1
This avoids test failures when running on new kernels that allow lazy itable initialization. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-19Merge branch 'maint' into nextTheodore Ts'o1-1/+1
Conflicts: resize/extent.c
2010-07-05e2freefrag: Fix getopt bug on machines with unsigned charsMike Frysinger1-1/+1
The getopt() function returns an int, not a char. On systems where the default char is unsigned (like ppc), we get weird behavior where -1 is truncated to 0xff but compared to (int)-1. Also fix this same bug for two test programs, test_rel and iscan, which aren't currently used at the moment. Addresses-Gentoo-Bug: #299386 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-06-07Merge branch 'maint' into nextTheodore Ts'o7-2/+94
Conflicts: e2fsck/journal.c e2fsck/pass1.c e2fsck/pass2.c misc/mke2fs.c
2010-05-14tests: Use our own mke2fs.conf fileTheodore Ts'o2-2/+46
Use a standard, fixed mke2fs.conf file so that if downstream distributions want to change the mke2fs.conf which is distributed in the RPM or dpkg file, it won't screw up the regression tests. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-11tests: Add new test f_unused_itableTheodore Ts'o4-0/+39
Add test to make sure e2fsck doesn't end up detaching and sending to lost+found inodes which are in an bg_itable_unused_region (e.g. if there was a power failure and bg_itable_unused wasn't updated because journaling wasn't enabled). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-10e2fsck: Check for cases where EOFBLOCKS_FL is unnecessarily setTheodore Ts'o1-0/+9
Some kernels will crash if EOFBLOCKS_FL is set when it is it not needed, and this if it is left set when it isn't needed, it is a sign of a kernel bug. Addresses-Google-Bug: #2604224 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15Merge branch 'maint' into nextTheodore Ts'o4-0/+20
2010-03-15tests: Add new test f_rehash_dirTheodore Ts'o4-0/+20
Add a new test which tests to make sure e2fsck -D works correctly. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-01-31Merge branch 'maint' into nextTheodore Ts'o10-7/+64
Conflicts: configure lib/ext2fs/alloc_tables.c misc/mke2fs.c
2009-11-29tests: Add new test f_holedir2Theodore Ts'o4-0/+33
This tests e2fsck's handling of both direct and extent-mapped directoris containing holes when the i_size is 0. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29e2fsck: Don't rehash directories which can fit in a single directory blockTheodore Ts'o2-7/+7
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-16e2fsck: Fix duplicate directory entries for non-indexed directoriesTheodore Ts'o4-0/+24
Duplicate directory entries were not necessarily getting found and fixed for non-indexed directories, since we were sorting these directories by inode number, and the duplicate entry code assumed the entries were getting sorted by name or directory name hash. Addresses-Sourceforge-Bug: #2862551 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04Merge branch 'maint' into nextTheodore Ts'o16-960/+968
Conflicts: configure configure.in misc/mke2fs.c
2009-10-04e2fsck: Interpret negative blkcount in file system problem reportsTheodore Ts'o8-960/+960
Non-expert users get confused when they see messages like this: Illegal block #-1 (2291965952) in inode 176. CLEARED. So change it to be something a little bit more understandable: Illegal indirect block (2291965952) in inode 176. CLEARED. Addresses-SourceForge-Bug: #2871782 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04tests: Account for new mke2fs topology informationTheodore Ts'o8-0/+8
The previous commit adds a new line printed by mke2fs with the filesystem/device topology information. Update the regression test's expected output to account for this. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Convert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()Valerie Aurora Henson1-1/+1
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: Nick Dokos <nicholas.dokos@hp.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07Use ext2fs_file_acl_block() instead of using .i_file_acl directlyValerie Aurora Henson1-2/+2
This provides support for 48-bit file acl blocks. Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23libext2fs: create generic numeric progress meters and use themValerie Aurora Henson8-17/+25
With 64-bit file systems, mke2fs can take a long time to do things other than write inode tables. I exported the mke2fs numeric progress meter and used it for allocating group tables and the final file system flush. Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>