aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2007-07-18 11:50:53 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-07-18 15:26:07 +0300
commita6fa706fe9e7696b4b2045edf9698c3bac07e3e3 (patch)
treedfa82cf848cd7afb92d6e48c7486a0355eb4b437
parente6b8362298c4c2690065442fc1b38ab0af1cb105 (diff)
Add more information to integrity test error message
When the integrity test encounters a file that does not contain the expected data, it lists the data that it expected to find in terms of writes to the file. Now the test also displays a list of "raw" writes that includes writes that have been truncated away, or completely overwritten by other writes. The test also now displays the pid because it is used as the initial random seed. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
-rw-r--r--tests/fs-tests/integrity/integck.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 62123d5..753a317 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -48,7 +48,9 @@ struct file_info /* Each file has one of these */
{
char *name;
struct dir_info *parent; /* Parent directory */
- struct write_info *writes; /* Record all writes to the file */
+ struct write_info *writes; /* Record accumulated writes to the file */
+ struct write_info *raw_writes;
+ /* Record in order all writes to the file */
struct fd_info *fds; /* All open file descriptors for this file */
off_t length;
int deleted; /* File has been deleted but is still open */
@@ -434,6 +436,21 @@ static void file_info_display(struct file_info *file)
}
fprintf(stderr, " %u writes\n", wcnt);
fprintf(stderr, " ============================================\n");
+ fprintf(stderr, " Raw Write Info:\n");
+ wcnt = 0;
+ w = file->raw_writes;
+ while (w) {
+ fprintf(stderr, " Offset: %u Size: %u Seed: %u"
+ " R.Off: %u\n",
+ (unsigned) w->offset,
+ (unsigned) w->size,
+ (unsigned) w->random_seed,
+ (unsigned) w->random_offset);
+ wcnt += 1;
+ w = w->next;
+ }
+ fprintf(stderr, " %u writes\n", wcnt);
+ fprintf(stderr, " ============================================\n");
}
static struct fd_info *file_open(struct file_info *file)
@@ -510,6 +527,15 @@ static void file_write_info(struct file_info *file,
new_write->size = size;
new_write->random_seed = seed;
+ w = (struct write_info *) malloc(sz);
+ CHECK(w != NULL);
+ memset(w, 0, sz);
+ w->next = file->raw_writes;
+ w->offset = offset;
+ w->size = size;
+ w->random_seed = seed;
+ file->raw_writes = w;
+
/* Insert it into file->writes */
inserted = 0;
end = offset + size;
@@ -1300,6 +1326,7 @@ void integck(void)
/* Make our top directory */
pid = getpid();
+ printf("pid is %u\n", (unsigned) pid);
tests_cat_pid(dir_name, "integck_test_dir_", pid);
if (chdir(dir_name) != -1) {
/* Remove it if it is already there */