chiark / gitweb /
Revert "socket: add support for TCP fast Open"
[elogind.git] / src / journal / test-journal.c
index 534fd28fa69a54e5c3472512667069af74a773a8..6025d04ba4c18a7d53037824ec839b91c28a3aef 100644 (file)
@@ -22,7 +22,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <systemd/sd-journal.h>
+#include "systemd/sd-journal.h"
 
 #include "log.h"
 #include "journal-file.h"
@@ -126,7 +126,7 @@ static void test_non_empty(void) {
         if (arg_keep)
                 log_info("Not removing %s", t);
         else {
-                journal_directory_vacuum(".", 3000000, 0, 0, NULL);
+                journal_directory_vacuum(".", 3000000, 0, NULL);
 
                 assert_se(rm_rf_dangerous(t, false, true, false) >= 0);
         }
@@ -165,15 +165,24 @@ static void test_empty(void) {
         if (arg_keep)
                 log_info("Not removing %s", t);
         else {
-                journal_directory_vacuum(".", 3000000, 0, 0, NULL);
+                journal_directory_vacuum(".", 3000000, 0, NULL);
 
                 assert_se(rm_rf_dangerous(t, false, true, false) >= 0);
         }
+
+        journal_file_close(f1);
+        journal_file_close(f2);
+        journal_file_close(f3);
+        journal_file_close(f4);
 }
 
 int main(int argc, char *argv[]) {
         arg_keep = argc > 1;
 
+        /* journal_file_open requires a valid machine id */
+        if (access("/etc/machine-id", F_OK) != 0)
+                return EXIT_TEST_SKIP;
+
         test_non_empty();
         test_empty();