Commit graph

20 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
35a5b281ad tests: add workaround for pre-232 system returning EINVAL on some flags 2016-09-22 20:44:25 -04:00
Zbigniew Jędrzejewski-Szmek
177ac6d894 tests: skip fdstore tests if not implemented
Should fix #12.
2016-09-22 07:49:07 -04:00
Zbigniew Jędrzejewski-Szmek
9e0d797ba7 journal: convert seek_realtime argument to microseconds
This somewhat breaks backwards compatibility, but not for the
previously documented arguments: floats are now interpreted
differently, but ints and datetime.datetime objects are interpreted
the same as before. But the documentation clearly stated that only
ints and datetime.datetime objects were allowed.

This makes seek_realtime match seek_monotonic and other functions
which take time and follows the principle of least surprise.

Fixes #21.
2016-09-21 20:16:37 -04:00
Zbigniew Jędrzejewski-Szmek
5211952348 tests: use a context manager, skip new functions if missing 2016-09-21 15:32:58 -04:00
Zbigniew Jędrzejewski-Szmek
02b9432e73 reader: add SD_JOURNAL_OS_ROOT and rework flag passing
Let's pass any flags through to the journal functions without checking
validity. Those functions do their own checking, so there's no need to
second-guess.

The semantics for _Reader(flags=0) are a bit changed:
before, this would be transformed into sd_journal_open(SD_J_LOCAL_ONLY).
Now, this results in sd_journal_open(0). Previous behaviour should be
achieved by not specifying the flags at all.
This change is necessary, because previously it was not possible to
pass flags=0 to sd_journal_open(0), i.e. it was not possible to "merge"
journals through the Python interface.

Similarly, Reader(flags=0) now means to open all journals, and
Reader(flags=None) is the same as Reader(flags=LOCAL_ONLY).
2016-09-21 15:32:58 -04:00
Zbigniew Jędrzejewski-Szmek
dadcd3d723 journal: allow sd_journal_open_directory_fd to be used 2016-09-21 15:32:58 -04:00
Zbigniew Jędrzejewski-Szmek
814cdb9d6a tests: check enumerate_fields, has_runtime_fiels, has_persistent_files 2016-09-20 09:38:18 -04:00
Ville Skyttä
947f782886 Spelling fixes 2016-05-21 08:47:00 +03:00
Mike Gilbert
87a9d64550 test_daemon: Define a default value for SO_PASSCRED
The socket module seems to be missing this in python2.7.
2016-01-20 19:08:02 -05:00
Zbigniew Jędrzejewski-Szmek
8ccd64789a tests: mirror is-systemd-running test from systemd 2015-10-28 10:02:53 -04:00
Zbigniew Jędrzejewski-Szmek
f83f19b3bd Python2 does not have ConnectionError 2015-10-27 00:07:18 -04:00
Zbigniew Jędrzejewski-Szmek
a947f32b31 tests: add tests for notify() 2015-10-26 23:38:58 -04:00
Zbigniew Jędrzejewski-Szmek
1d8f5f26df tests: work around bug in sd_is_mq
The fix was committed in v226-362-g0260d1d542.
2015-10-25 16:50:59 -04:00
Zbigniew Jędrzejewski-Szmek
173c2a89b2 tests: add simplistic tests for Reader matches
It would be nice to run those tests against fake journal files
with the right content to actually test the matches. But those
tests are still useful because they test that the interface
works as expected.
2015-09-16 12:43:06 +02:00
Zbigniew Jędrzejewski-Szmek
bbbc6e8a92 tests: add tests for Reader initialization 2015-09-17 11:53:45 +02:00
Zbigniew Jędrzejewski-Szmek
5bf468dca1 tests: start adding tests for JournalHandler 2015-09-17 11:53:45 +02:00
Zbigniew Jędrzejewski-Szmek
085db21e5e tests: add more tests for socket functions 2015-09-06 18:54:55 +02:00
Zbigniew Jędrzejewski-Szmek
0cf0cf7e42 tests: daemon.booted 2015-09-05 14:18:32 +02:00
Zbigniew Jędrzejewski-Szmek
2e115f3c4f tests: daemon.listen_fds 2015-09-05 14:18:23 +02:00
Zbigniew Jędrzejewski-Szmek
a93828172f tests: add first test
This is based on the code in https://github.com/systemd/python-systemd/pull/4
by Jacek Konieczny <j.konieczny@eggsoft.pl>.
2015-08-07 11:49:56 -04:00