summaryrefslogtreecommitdiff
path: root/tests/fs-tests
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-16 16:57:05 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-20 12:48:42 +0300
commit8a14f3c19fafcd07c5d1cbe1f51f68541aea9eb2 (patch)
tree616a2be14f2d794010892c101a089e4aeb4d13a4 /tests/fs-tests
parent6baa47e6b91363fa6b760d2a5592dc3fd3991b26 (diff)
fs-tests: integck: check direntries in power cut mode
Enable directory entry checking in power cut mode. This means that with this patch integck will check that all directory entries in the file-system were created by integck. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests/fs-tests')
-rw-r--r--tests/fs-tests/integrity/integck.c40
1 files changed, 11 insertions, 29 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index b411a68..1483f62 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -1662,8 +1662,6 @@ static void dir_check(struct dir_info *dir)
int link_count = 2; /* Parent and dot */
struct stat st;
- assert(!args.power_cut_mode);
-
/* Create an array of entries */
sz = sizeof(struct dir_entry_info *);
n = dir->number_of_entries;
@@ -1700,7 +1698,14 @@ static void dir_check(struct dir_info *dir)
}
}
CHECK(closedir(d) == 0);
- CHECK(checked == dir->number_of_entries);
+
+ /*
+ * In power cut mode the file-system may miss some directory entries
+ * because it is possible that they have not reached the media by the
+ * time of the emulated power cut.
+ */
+ if (!args.power_cut_mode)
+ CHECK(checked == dir->number_of_entries);
/* Now check each entry */
entry = dir->first;
@@ -2577,32 +2582,9 @@ static int remount_tested_fs(void)
static void check_tested_fs(void)
{
- /*
- * when we are in power cut mode we can only test files which have not
- * been modified since the last successful 'fsync()'. this is not
- * implemented yet.
- *
- * note, even if we have not encounter any error during the test, we
- * cannot test the file-system. indeed, consider the situation when we
- * have written data to file a. a lot of the data is currently cached
- * and is waiting for write-back. when write-back happens, an emulated
- * power cut may also happen and cause write-back to drop the errored
- * pages. and if we start checking the file a after this, we'll fail as
- * well.
- *
- * and even re-mounting will not help, because re-mounting will cause
- * full sync which may fail and data pages will be dropped, but
- * 'unmount()' will nevertheless succeed, and if we check the
- * file-system after this - the check will fail.
- *
- * and 'sync()' will not help as well since it does not return an
- * error.
- */
- if (!args.power_cut_mode) {
- check_run_no += 1;
- dir_check(top_dir);
- check_deleted_files();
- }
+ check_run_no += 1;
+ dir_check(top_dir);
+ check_deleted_files();
}
/*