summaryrefslogtreecommitdiff
path: root/tests/fs-tests
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-20 16:08:30 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-22 14:29:53 +0300
commit497ff2cea3749c4b3829b285cc7ce57ed47abf6e (patch)
tree98bca4cfcafd0c48ae3952e6251f7ba3f57f9257 /tests/fs-tests
parent0b2d8813cb2b7344d8dbc35c1d56f525562a221f (diff)
fs-tests: integck: iterate for ever in case of power cut testing
If the test runs in power-cut testing mode, do not exit in case of EROFS error - but instead re-mount and start again. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests/fs-tests')
-rw-r--r--tests/fs-tests/integrity/integck.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 136be09..6de4a42 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -2689,7 +2689,27 @@ int main(int argc, char *argv[])
}
/* Do the actual test */
- ret = integck();
+ while (1) {
+ ret = integck();
+ /*
+ * Iterate forever only in case of power-cut emulation testing.
+ */
+ if (!args.power_cut_mode)
+ break;
+ if (ret && errno != EROFS)
+ break;
+
+ /*
+ * The file-system became read-only and we are in power cut
+ * testing mode. Re-mount the file-system and re-start the
+ * test.
+ */
+ close_open_files();
+ free_fs_info(top_dir);
+ ret = remount_tested_fs();
+ if (ret)
+ break;
+ }
close_open_files();
free_fs_info(top_dir);