summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-20 16:01:05 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-22 14:29:53 +0300
commit0b2d8813cb2b7344d8dbc35c1d56f525562a221f (patch)
tree3766cc456b39759a7f653a384a042484819bfdca
parent25ab8a45f76ac3bfeaeccf04c48781a752edbe28 (diff)
fs-tests: integck: refuse R/O file-system
Refuse to test the file-system if it is mounted Read-only. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--tests/fs-tests/integrity/integck.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index e6f5b3b..136be09 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -2681,10 +2681,15 @@ int main(int argc, char *argv[])
random_name_buf = malloc(fsinfo.max_name_len + 1);
CHECK(random_name_buf != NULL);
+ /* Refuse the file-system if it is mounted R/O */
+ if (fsinfo.mount_flags & MS_RDONLY) {
+ ret = -1;
+ errmsg("the file-system is mounted read-only");
+ goto out_free;
+ }
+
/* Do the actual test */
ret = integck();
- if (ret)
- return EXIT_FAILURE;
close_open_files();
free_fs_info(top_dir);
@@ -2692,10 +2697,11 @@ int main(int argc, char *argv[])
free(top_dir->entry);
free(top_dir);
+out_free:
free(random_name_buf);
free(fsinfo.mount_point);
free(fsinfo.fstype);
free(fsinfo.fsdev);
free(fsinfo.test_dir);
- return EXIT_SUCCESS;
+ return ret ? EXIT_FAILURE : EXIT_SUCCESS;
}