summaryrefslogtreecommitdiff
path: root/src/journal/test-journal-verify.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-20 15:59:33 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-20 15:59:33 +0200
commitf7fab8a5ae7a3b378040203821383f5a8fc91126 (patch)
tree27cff2a90b66f0e2ff4300c01de981233c8e8598 /src/journal/test-journal-verify.c
parenta2e99cdf94a8a0350ff13b241de07f34c015b1fc (diff)
journal: fix tag ordering check
Diffstat (limited to 'src/journal/test-journal-verify.c')
-rw-r--r--src/journal/test-journal-verify.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/journal/test-journal-verify.c b/src/journal/test-journal-verify.c
index 4e6c119b6d..ed6e21dc0c 100644
--- a/src/journal/test-journal-verify.c
+++ b/src/journal/test-journal-verify.c
@@ -108,7 +108,8 @@ int main(int argc, char *argv[]) {
log_info("Verifying...");
assert_se(journal_file_open("test.journal", O_RDONLY, 0666, true, true, NULL, NULL, NULL, &f) == 0);
- journal_file_print_header(f);
+ /* journal_file_print_header(f); */
+ journal_file_dump(f);
assert_se(journal_file_verify(f, verification_key, &from, &to, &total, true) >= 0);
@@ -120,21 +121,21 @@ int main(int argc, char *argv[]) {
}
journal_file_close(f);
- log_info("Toggling bits...");
+ if (verification_key) {
+ log_info("Toggling bits...");
- assert_se(stat("test.journal", &st) >= 0);
+ assert_se(stat("test.journal", &st) >= 0);
- for (p = 240*8; p < ((uint64_t) st.st_size * 8); p ++) {
- bit_toggle("test.journal", p);
+ for (p = 38448*8+0; p < ((uint64_t) st.st_size * 8); p ++) {
+ bit_toggle("test.journal", p);
- log_info("[ %llu+%llu]", (unsigned long long) p / 8, (unsigned long long) p % 8);
+ log_info("[ %llu+%llu]", (unsigned long long) p / 8, (unsigned long long) p % 8);
- if (raw_verify("test.journal", verification_key) >= 0) {
- log_notice(ANSI_HIGHLIGHT_RED_ON ">>>> %llu (bit %llu) can be toggled without detection." ANSI_HIGHLIGHT_OFF, (unsigned long long) p / 8, (unsigned long long) p % 8);
- sleep(1);
- }
+ if (raw_verify("test.journal", verification_key) >= 0)
+ log_notice(ANSI_HIGHLIGHT_RED_ON ">>>> %llu (bit %llu) can be toggled without detection." ANSI_HIGHLIGHT_OFF, (unsigned long long) p / 8, (unsigned long long) p % 8);
- bit_toggle("test.journal", p);
+ bit_toggle("test.journal", p);
+ }
}
log_info("Exiting...");