summaryrefslogtreecommitdiff
path: root/src/journal/test-journal.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-10-13 05:19:35 +0200
committerLennart Poettering <lennart@poettering.net>2011-10-13 05:19:35 +0200
commit0ac38b707212e9aa40e25d65ffbae648cc9116f5 (patch)
tree85b591e980896be34196e174a7a8f4217d49a280 /src/journal/test-journal.c
parent250d54b5bee6a46fe1c1626211e3a7e238eda628 (diff)
journal: implementation rotation
Diffstat (limited to 'src/journal/test-journal.c')
-rw-r--r--src/journal/test-journal.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/journal/test-journal.c b/src/journal/test-journal.c
index 7028f11f7c..8dd26bbc32 100644
--- a/src/journal/test-journal.c
+++ b/src/journal/test-journal.c
@@ -20,6 +20,7 @@
***/
#include <fcntl.h>
+#include <unistd.h>
#include "journal-file.h"
#include "log.h"
@@ -33,7 +34,9 @@ int main(int argc, char *argv[]) {
log_set_max_level(LOG_DEBUG);
- assert_se(journal_file_open("test", O_RDWR|O_CREAT, 0666, &f) == 0);
+ unlink("test.journal");
+
+ assert_se(journal_file_open("test.journal", O_RDWR|O_CREAT, 0666, NULL, &f) == 0);
dual_timestamp_get(&ts);
@@ -87,7 +90,12 @@ int main(int argc, char *argv[]) {
assert(journal_file_move_to_entry(f, 10, &o, NULL) == 0);
+ journal_file_rotate(&f);
+ journal_file_rotate(&f);
+
journal_file_close(f);
+ journal_directory_vacuum(".", 3000000, 0);
+
return 0;
}