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>
}
/* 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);