summaryrefslogtreecommitdiff
path: root/src/journal/test-journal-interleaving.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use PROJECT_FILE instead of __FILE__Zbigniew Jędrzejewski-Szmek2019-07-041-1/+1
| | | | This replaces the internal uses of __FILE__ with the new macro.
* test-journal: move tests to /var/tmp/ and set FS_NOCOW_FLv242-rc3Lennart Poettering2019-04-041-6/+14
| | | | | | | | The journal files might not be tiny hence let's write them to /var/tmp/ instead of /tmp. Also, let's turn on NOCOW on the files, as these tests might apparently be slow on btrfs. Fixes: #12210
* tree-wide: use IOVEC_MAKE() at many placesLennart Poettering2018-11-271-3/+3
|
* Drop copyright for Marius VollmerZbigniew Jędrzejewski-Szmek2018-10-311-3/+0
| | | | Ack in #9320.
* tests: use a helper function to parse environment and open loggingZbigniew Jędrzejewski-Szmek2018-09-141-1/+1
| | | | | The advantages are that we save a few lines, and that we can override logging using environment variables in more test executables.
* tests: add helper to unify skipping a test and exitingZbigniew Jędrzejewski-Szmek2018-09-141-6/+4
|
* test: log when skipping tests in more casesYu Watanabe2018-09-131-1/+3
| | | | Follow-up for the previous commit.
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-141-1/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-2/+2
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* journal: allow boot_id to be passed to journal_append_entry()Zbigniew Jędrzejewski-Szmek2018-05-311-1/+1
| | | | | In this commit, this is done only in testing code, i.e. there is no functional change apart from tests.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* journal: provide compress_threshold_bytes parameterAlex Gartrell2018-03-201-4/+4
| | | | | | Previously the compression threshold was hardcoded to 512, which meant that smaller values wouldn't be compressed. This left some storage savings on the table, so instead, we make that number tunable.
* basic/macros: rename noreturn into _noreturn_ (#8456)Franck Bui2018-03-151-1/+1
| | | | | | | | | | | | "noreturn" is reserved and can be used in other header files we include: [ 16s] In file included from /usr/include/gcrypt.h:30:0, [ 16s] from ../src/journal/journal-file.h:26, [ 16s] from ../src/journal/journal-vacuum.c:31: [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); Here we include grcrypt.h (which in turns include gpg-error.h) *after* we "noreturn" was defined in macro.h.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* tests: get rid of strerrorZbigniew Jędrzejewski-Szmek2016-09-131-4/+3
|
* sd-journal: add API for opening journal files or directories by fdLennart Poettering2016-04-251-4/+4
| | | | | | | Also, expose this via the "journalctl --file=-" syntax for STDIN. This feature remains undocumented though, as it is probably not too useful in real-life as this still requires fds that support mmaping and seeking, i.e. does not work for pipes, for which reading from STDIN is most commonly used.
* journal: defer journal closes on rotateVito Caputo2016-02-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | When we rotate journals, we must set offline and close the current one, but don't generally need to wait for this to complete. Instead, we'll initiate an asynchronous offline via journal_file_set_offline(oldfile, false), and add the file to a per-server set of deferred closes to be closed later when they won't block. There's one complication however; journal_file_open() via journal_file_verify_header() assumes that any writable journal in the online state is the product of an unclean shutdown or other form of corruption. Thus there's a need for journal_file_open() to be aware of deferred closes and synchronize with their completion when opening preexisting journals for writing. To facilitate this the deferred closes set is supplied to the journal_file_open() function where the deferred closes may be closed synchronously before verifying the header in such circumstances.
* journal: add void cast to journal_file_close() callsVito Caputo2016-02-191-1/+1
|
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-1/+1
| | | | Sort the includes accoding to the new coding style.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering2015-10-271-1/+3
|
* journal: rework vacuuming logicLennart Poettering2015-10-021-2/+2
| | | | | | | | | | | | | | | Implement a maximum limit on number of journal files to keep around. Enforcing a limit is useful on this since our performance when viewing pays a heavy penalty for each journal file to interleve. This setting is turned on now by default, and set to 100. Also, actully implement what 348ced909724a1331b85d57aede80a102a00e428 promised: use whatever we find on disk at startup as lower bound on how much disk space we can use. That commit introduced some provisions to implement this, but actually never did. This also adds "journalctl --vacuum-files=" to vacuum files on disk by their number explicitly.
* journal: make sure the clock increases strict monotonicLennart Poettering2015-06-171-0/+9
| | | | | | Let's work around crappy clocks in test-journal-interleaving.c too. This does the same as 98d2a5341788b49e82d628dfdc2e241af6d70dcd but for test-journal-interlaving.c rather than test-journal-stream.c.
* util: rework rm_rf() logicLennart Poettering2015-04-061-4/+4
| | | | | | | | - Move to its own file rm-rf.c - Change parameters into a single flags parameter - Remove "honour sticky" logic, it's unused these days
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-1/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* tests: use assert_se instead of assertRonny Chevalier2015-01-221-17/+17
| | | | Otherwise they can be optimized away with -DNDEBUG
* log: rearrange log function namingLennart Poettering2014-11-271-3/+3
| | | | | | | | | | - Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
* journalctl: add new --vacuum-size= and --vacuum-time= commands to clean up ↵Lennart Poettering2014-11-031-2/+2
| | | | | | | journal files based on a size/time limit This is equivalent to the effect of SystemMaxUse= and RetentionSec=, however can be invoked directly instead of implicitly.
* Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek2014-07-311-1/+1
| | | | | | In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
* journald: do not free space when disk space runs lowZbigniew Jędrzejewski-Szmek2014-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Before, journald would remove journal files until both MaxUse= and KeepFree= settings would be satisfied. The first one depends (if set automatically) on the size of the file system and is constant. But the second one depends on current use of the file system, and a spike in disk usage would cause journald to delete journal files, trying to reach usage which would leave 15% of the disk free. This behaviour is surprising for the user who doesn't expect his logs to be purged when disk usage goes above 85%, which on a large disk could be some gigabytes from being full. In addition attempting to keep 15% free provides an attack vector where filling the disk sufficiently disposes of almost all logs. Instead, obey KeepFree= only as a limit on adding additional files. When replacing old files with new, ignore KeepFree=. This means that if journal disk usage reached some high point that at some later point start to violate the KeepFree= constraint, journald will not add files to go above this point, but it will stay (slightly) below it. When journald is restarted, it forgets the previous maximum usage value, and sets the limit based on the current usage, so if disk remains to be filled, journald might use one journal-file-size less on each restart, if restarts happen just after rotation. This seems like a reasonable compromise between implementation complexity and robustness.
* _noreturn_ --> noreturn for C11 compatShawn Landden2013-12-171-1/+1
| | | | also define noreturn w/o <stdnoreturn.h>
* tests: fix some memory leaks in testsLennart Poettering2013-10-091-17/+12
|
* Remove six unused variables and add annotationZbigniew Jędrzejewski-Szmek2013-09-171-1/+1
| | | | clang FTW!
* test: Make testing work on systems without or old systemdHolger Hans Peter Freyther2013-08-221-0/+4
| | | | | | | | | | | | | | * Introduce a macro to conditionally execute tests. This avoids skipping the entire test if some parts require systemd * Skip the journal tests when no /etc/machine-id is present * Change test-catalog to load the catalog from the source directory of systemd. * /proc/PID/comm got introduced in v2.6.33 but travis is still using v2.6.32. * Enable make check and make distcheck on the travis build * Use -D"CATALOG_DIR=STR($(abs_top_srcdir)/catalog)" as a STRINGIY would result in the path '/home/ich/source/linux' to be expanded to '/home/ich/source/1' as linux is defined to 1.
* tests: add testcase for duplicate seqnumsZbigniew Jędrzejewski-Szmek2013-06-101-14/+115
|
* tests: add testcase for skipping-entries-on-direction-change-bugMarius Vollmer2013-06-101-0/+198
This test case failed until a3e6f050de8. Taken from https://bugs.freedesktop.org/show_bug.cgi?id=65255.