test-journal-verify.c revision 0284adc6a60ce0af1107cb0b50041a65d731f39e
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2012 Lennart Poettering
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/>.
***/
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include "util.h"
#include "log.h"
#include "journal-file.h"
#include "journal-verify.h"
#define N_ENTRIES 6000
#define RANDOM_RANGE 77
char t[] = "/tmp/journal-XXXXXX";
unsigned n;
JournalFile *f;
log_info("Generating...");
assert_se(journal_file_open("test.journal", O_RDWR|O_CREAT, 0666, true, true, NULL, NULL, NULL, &f) == 0);
for (n = 0; n < N_ENTRIES; n++) {
struct dual_timestamp ts;
char *test;
}
log_info("Verifying...");
assert_se(journal_file_open("test.journal", O_RDONLY, 0666, false, false, NULL, NULL, NULL, &f) == 0);
log_info("Exiting...");
assert_se(rm_rf_dangerous(t, false, true, false) >= 0);
return 0;
}