summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-02-15test-journal-importer: add a test case with broken inputZbigniew Jędrzejewski-Szmek
2017-02-15test-journal-importer: new test file to check the newly exported importer codeZbigniew Jędrzejewski-Szmek
Only one test case is added, but it is enough to check basic sanity of the code (single-line and binary fields and trusted fields, allocation and freeing).
2017-02-13test: move resolved test data into test/Martin Pitt
Moe test-resolve's test data from src/resolve/test-data to test/test-resolve/ to be consistent with test/test-{execute,path}/. This will make it easier to make the tests relocatable.
2017-02-12core: skip ReadOnlyPaths= and other permission-related mounts on ↵Lennart Poettering
PermissionsStartOnly= (#5309) ReadOnlyPaths=, ProtectHome=, InaccessiblePaths= and ProtectSystem= are about restricting access and little more, hence they should be disabled if PermissionsStartOnly= is used or ExecStart= lines are prefixed with a "+". Do that. (Note that we will still create namespaces and stuff, since that's about a lot more than just permissions. We'll simply disable the effect of the four options mentioned above, but nothing else mount related.) This also adds a test for this, to ensure this works as intended. No documentation updates, as the documentation are already vague enough to support the new behaviour ("If true, the permission-related execution options…"). We could clarify this further, but I think we might want to extend the switches' behaviour a bit more in future, hence leave it at this for now. Fixes: #5308
2017-02-10test: remove sys.tar.xzDan Streetman
The tarball is no longer needed, as the sys-script.py script creates all the sys/ contents.
2017-02-10test: create sys-script.py scriptDan Streetman
The script contains the contents of all sys/ test files, and creates all dirs/links/files when run. This replaces the sys.tar.xz tarball that contained sys/, so changes to sys files only require a simple commit in git, instead of checking in an entire new tarball for each sys/ change.
2017-02-10test: add script to convert sys/ into sys-script.pyDan Streetman
Instead of keeping all sys/ nodes in a tarball, use a script "sys-script.py" to create all the sys/ entries. This adds a script to create that initial "sys-script.py" script, using an existing sys/ directory, created from the sys.tar.xz contents. The "sys-script.py" can then be edited or recreated later, when any sys/ files are added or modified; the change will be only a patch to the "sys-script.py" script in git, instead of forcing git to store a new binary tarball.
2017-02-09tests: show journal on systemd-resolved.service failures (#5297)Martin Pitt
In networkd-test.py, show resolved's journal on failure, to debug issues like https://github.com/systemd/systemd/pull/5283.
2017-02-07tests: add dropin dependency testsFranck Bui
[zj: tests assertions adjusted to the different logic in which masking of a dependency through one name, does not forbid the dependency being added through another name.]
2017-01-25tests: add tests for SYMLINK containing whitespace in variable (#5158)Dan Streetman
add udev-test.pl tests for whitespace in a substituted variable, to verify the variable whitespace is replaced with underscores. Tests for the change made by commit 0a10235ed453 ("udev-rules: perform whitespace replacement for symlink subst values")
2017-01-17tests: check that we can write to /run/systemd/nspawn/notifyEvgeny Vereshchagin
See https://github.com/systemd/systemd/issues/4944
2017-01-06tests: fix failure of test-execute if /dev/mem is not available (#5028)Michal Sekletar
/dev/mem isn't necessarily available. Recently, I've encountered arm64 systems that didn't provide raw memory access via /dev/mem. Instead, let's use /dev/kmsg since we don't support systems w/o it anyway.
2016-12-26tests: more precise negative check for dnsmasq log (#4982)Martin Pitt
In test_resolved_domain_restricted_dns(), add dot domain separator to negative .lab/.company tests, so that we don't catch these as part of the host name (like "lxc-labjfr"). Caught in PR #4962
2016-12-22resolved: correctly handle non-address RR types with /etc/hosts lookups (#4808)Martin Pitt
Fix wrong condition test in manager_etc_hosts_lookup(), which caused it to return an IPv4 answer when an IPv6 question was asked, and vice versa. Also only return success if we actually found any A or AAAA record. In systemd-resolved.service(8), point out that /etc/hosts mappings only affect address-type lookups, not other types. The test case currently disables DNSSEC in resolved, as there is a bug where "-t MX" fails due to "DNSSEC validation failed" even after "downgrading to non-DNSSEC mode". This should be dropped once that bug gets fixed. Fixes #4801
2016-12-13test: check that we can boot with broken machine-idEvgeny Vereshchagin
2016-12-13sd-id128: id128_write overwrites target fileEvgeny Vereshchagin
2016-12-13machine-id-setup: `--print --commit` respects the --root optionEvgeny Vereshchagin
2016-12-13core: machine_id_setup overwrites broken machine-idEvgeny Vereshchagin
2016-12-12Merge pull request #4771 from keszybz/udev-property-orderingMartin Pitt
Udev property ordering
2016-12-07network: support negation in matching patterns (#4809)David Michael
2016-12-05nspawn: don't hide --bind=/tmp/* mounts (#4824)Evgeny Vereshchagin
Fixes #4789
2016-12-02Merge pull request #4228 from dm0-/coreos-1554Zbigniew Jędrzejewski-Szmek
networkd: support marking links unmanaged
2016-12-01python: use raw strings for regexp patternsZbigniew Jędrzejewski-Szmek
Behaviour is not changed, because "unknown" escapes like \s or \d were not substituted, but it's much nicer to use raw strings to avoid ambiguity.
2016-12-01python: adjust imports, indentation, unused variables following pylint adviceZbigniew Jędrzejewski-Szmek
2016-12-01networkd: support marking links unmanagedDavid Michael
2016-12-01networkd-test: define a utility class to simplify testsDavid Michael
2016-12-01hwdb: improve and test syntax error messagesZbigniew Jędrzejewski-Szmek
Since syntax error are non-fatal, downgrade them to warnings. Use log_syntax to have uniform formatting including the line number. State machine states like DATA and MATCH are internal, user-facing messages should use the names from hwdb(7): match, property, record. Also change "key/value" to "key-value", since there's no alternative here, both parts must be present. [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:2] Property expected, ignoring record with no properties [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:5] Property expected, ignoring record with no properties [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:9] Property expected, ignoring record with no properties [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:11] Key/value pair expected but got " NO_VALUE", ignoring [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:18] Property or empty line expected, got "BAD:7:match at wrong place", ignoring record [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:22] Property or empty line expected, got "BAD:8:match at wrong place", ignoring record [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:23] Match expected but got indented property " Z=z", ignoring line squash! hwdb: improve syntax error messages
2016-12-01hwdb-test: properly print error output from systemd-hwdb updateZbigniew Jędrzejewski-Szmek
Because -e was set, we'd exit immediately when systemd-hwdb failed and the captured error output was never printed. We want to test two things: that 0 is returned, and that nothing is printed to stderr (to catch syntax errors in the hwdb). v2: stop capturing stderr to a variable v3: capture stderr to a variable and test both error types separately
2016-11-30test: retry checking for transient hostname in hostnamectl (#4769)Martin Pitt
Sometimes setting the transient hostname does not happen synchronously, so retry up to five times. It is not yet clear whether this is legitimate behaviour or an underlying bug, but this will at least show whether the wrong transient hostname is just a race condition or permanently wrong. Fixes #4753
2016-11-28Use python3 explicitly in all python scriptsFelipe Sateler
2016-11-28test: make transient hostname tests fail verbosely (#4754)Martin Pitt
This test fails sometimes but it is hard to reproduce, so we need more information what happens. Set journal log level to "debug" for the entirety of networkd-test.py, and show networkd's and hostnamed's journals and the DHCP server log on failure of the two test_transient_hostname* tests. Also sync the journal before querying it to get more precise output. This should help with tracking down issue #4753.
2016-11-24tests: add hwdb parsing testMartin Pitt
This calls the built "systemd-hwdb update" on the source tree's hwdb/ in a temporary directory and verifies that there are no error messages.
2016-11-23networkd: allow networkd to set the timezone in timedatedMartin Pitt
systemd-networkd runs as user "systemd-network" and thus is not privileged to set the timezone acquired from DHCP: systemd-networkd[4167]: test_eth42: Could not set timezone: Interactive authentication required. Similarly to commit e8c0de912, add a polkit rule to grant org.freedesktop.timedate1.set-timezone to the "systemd-network" system user. Move the polkit rules from src/hostname/ to src/network/ to avoid too many small distributed policy snippets (there might be more in the future), as it's easier to specify the privileges for a particular subject in this case. Add NetworkdClientTest.test_dhcp_timezone() test case to verify this (for all people except those in Pacific/Honolulu, there the test doesn't prove anything -- sorry ☺ ).
2016-11-21Merge pull request #4701 from martinpitt/networkd-polkitLennart Poettering
hostnamed: allow networkd to set the transient hostname
2016-11-21tests: check transient hostname with and without static hostnameMartin Pitt
We expect a static hostname to win over a transient one, so test both cases.
2016-11-20Merge pull request #4691 from keszybz/test-suite-fixesEvgeny Vereshchagin
Test suite fixes
2016-11-20hostnamed: allow networkd to set the transient hostnameMartin Pitt
systemd-networkd runs as user "systemd-network" and thus is not privileged to set the transient hostname: systemd-networkd[516]: ens3: Could not set hostname: Interactive authentication required. Standard polkit *.policy files do not have a syntax for granting privileges to a user, so ship a pklocalauthority (for polkit < 106) and a JavaScript rules file (for polkit >= 106) that grants the "systemd-network" system user that privilege. Add DnsmasqClientTest.test_transient_hostname() test to networkd-test.py to cover this. Make do_test() a bit more flexible by interpreting "coldplug==None" as "test sets up the interface by itself". Change DnsmasqClientTest to set up test_eth42 with a fixed MAC address so that we can configure dnsmasq to send a special host name for that. Fixes #4646
2016-11-20test: clean up "dummy0" interface after each test case in networkd-test.pyMartin Pitt
2016-11-19test-functions: also add qemu define for ppc64Zbigniew Jędrzejewski-Szmek
2016-11-18Merge pull request #4395 from s-urbaniak/rw-supportLennart Poettering
nspawn: R/W support for /sysfs, /proc, and /proc/sys/net
2016-11-18tests/TEST-13-NSPAWN-SMOKE: add SYSTEMD_NSPAWN_API_VFS_WRITABLEEvgeny Vereshchagin
https://github.com/systemd/systemd/pull/4395
2016-11-15Merge pull request #4658 from endocode/djalal/sandbox-various-fixes-v1Djalal Harouni
core: improve the logic that implies no new privileges and documentation fixes
2016-11-15tests: add UNIFIED_CGROUP_HIERARCHY=[default|hybrid] (#4675)Evgeny Vereshchagin
This will simplify testing a bit. Mainly for https://github.com/systemd/systemd/pull/4670
2016-11-15test: add tests for RestrictNamespaces=Djalal Harouni
2016-11-11tests: fix kernel/initrd searching (Arch)Evgeny Vereshchagin
We can run sudo make run instead of the sudo make run KERNEL_BIN=/boot/vmlinuz-linux INITRD=/boot/initramfs-linux.img See https://github.com/systemd/systemd/issues/4607
2016-11-07tests: use less aggressive systemctl --wait timeout in TEST-03-JOBS (#4606)Martin Pitt
If the "systemctl start" happens at an "unlucky" time such as 1000.9 seconds and then e. g. runs for 2.6 s (sleep 2 plus the overhead of starting the unit and waiting for it) the END_SEC would be 1003.5s which would round to 1004, making the difference 4. On busier testbeds the overhead apparently can take a bit more than 0.5s. The main point is really that it doesn't wait that much longer, so "-le 4" seems perfectly fine. We allow up to 1.5s in the subsequent "wait5fail" test below too. Fixes #4582
2016-11-03test: test DynamicUser= with SupplementaryGroups=Djalal Harouni
2016-11-03test: test DynamicUser= with a fixed userDjalal Harouni
2016-11-01tests: add test that journald keeps fds over termination by signalEvgeny Vereshchagin
This test fails before previous commit, and passes with it.
2016-10-24test: lets add more tests to cover SupplementaryGroups= cases.Djalal Harouni