]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/test-journal-init.c
test-journal: move tests to /var/tmp/ and set FS_NOCOW_FL
[thirdparty/systemd.git] / src / journal / test-journal-init.c
index 142da85041f6df4fe6e32cd880f015832fc26a43..d10e61080d23051b1a7c8409ab089bfb513d234a 100644 (file)
@@ -1,37 +1,20 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-/***
-  This file is part of systemd.
-
-  Copyright 2013 Zbigniew JÄ™drzejewski-Szmek
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
+/* SPDX-License-Identifier: LGPL-2.1+ */
 
 #include "sd-journal.h"
 
+#include "chattr-util.h"
 #include "log.h"
 #include "parse-util.h"
 #include "rm-rf.h"
+#include "tests.h"
 #include "util.h"
 
 int main(int argc, char *argv[]) {
         sd_journal *j;
         int r, i, I = 100;
-        char t[] = "/tmp/journal-stream-XXXXXX";
+        char t[] = "/var/tmp/journal-stream-XXXXXX";
 
-        log_set_max_level(LOG_DEBUG);
+        test_setup_logging(LOG_DEBUG);
 
         if (argc >= 2) {
                 r = safe_atoi(argv[1], &I);
@@ -42,6 +25,7 @@ int main(int argc, char *argv[]) {
         log_info("Running %d loops", I);
 
         assert_se(mkdtemp(t));
+        (void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
 
         for (i = 0; i < I; i++) {
                 r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);