summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* tests: more precise negative check for dnsmasq log (#4982)Martin Pitt2016-12-261-2/+2
| | | | | | | 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
* resolved: correctly handle non-address RR types with /etc/hosts lookups (#4808)Martin Pitt2016-12-221-0/+55
| | | | | | | | | | | | | | | 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
* test: check that we can boot with broken machine-idEvgeny Vereshchagin2016-12-131-0/+1
|
* sd-id128: id128_write overwrites target fileEvgeny Vereshchagin2016-12-131-1/+2
|
* machine-id-setup: `--print --commit` respects the --root optionEvgeny Vereshchagin2016-12-131-0/+11
|
* core: machine_id_setup overwrites broken machine-idEvgeny Vereshchagin2016-12-132-0/+116
|
* Merge pull request #4771 from keszybz/udev-property-orderingMartin Pitt2016-12-122-1/+56
|\ | | | | Udev property ordering
| * hwdb: improve and test syntax error messagesZbigniew Jędrzejewski-Szmek2016-12-012-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * hwdb-test: properly print error output from systemd-hwdb updateZbigniew Jędrzejewski-Szmek2016-12-011-2/+8
| | | | | | | | | | | | | | | | | | | | 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
* | network: support negation in matching patterns (#4809)David Michael2016-12-071-8/+46
| |
* | nspawn: don't hide --bind=/tmp/* mounts (#4824)Evgeny Vereshchagin2016-12-051-0/+10
| | | | | | Fixes #4789
* | Merge pull request #4228 from dm0-/coreos-1554Zbigniew Jędrzejewski-Szmek2016-12-021-47/+188
|\ \ | | | | | | networkd: support marking links unmanaged
| * | networkd: support marking links unmanagedDavid Michael2016-12-011-0/+116
| | |
| * | networkd-test: define a utility class to simplify testsDavid Michael2016-12-011-47/+72
| |/
* | python: use raw strings for regexp patternsZbigniew Jędrzejewski-Szmek2016-12-012-16/+16
| | | | | | | | | | 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.
* | python: adjust imports, indentation, unused variables following pylint adviceZbigniew Jędrzejewski-Szmek2016-12-012-3/+3
| |
* | test: retry checking for transient hostname in hostnamectl (#4769)Martin Pitt2016-11-301-2/+11
|/ | | | | | | | 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
* Use python3 explicitly in all python scriptsFelipe Sateler2016-11-282-1/+2
|
* test: make transient hostname tests fail verbosely (#4754)Martin Pitt2016-11-281-12/+37
| | | | | | | | | 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.
* tests: add hwdb parsing testMartin Pitt2016-11-241-0/+43
| | | | | 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.
* networkd: allow networkd to set the timezone in timedatedMartin Pitt2016-11-231-2/+30
| | | | | | | | | | | | | | | | | 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 ☺ ).
* Merge pull request #4701 from martinpitt/networkd-polkitLennart Poettering2016-11-211-4/+52
|\ | | | | hostnamed: allow networkd to set the transient hostname
| * tests: check transient hostname with and without static hostnameMartin Pitt2016-11-211-2/+30
| | | | | | | | We expect a static hostname to win over a transient one, so test both cases.
| * hostnamed: allow networkd to set the transient hostnameMartin Pitt2016-11-201-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * test: clean up "dummy0" interface after each test case in networkd-test.pyMartin Pitt2016-11-201-0/+2
| |
* | Merge pull request #4691 from keszybz/test-suite-fixesEvgeny Vereshchagin2016-11-201-0/+3
|\ \ | |/ |/| Test suite fixes
| * test-functions: also add qemu define for ppc64Zbigniew Jędrzejewski-Szmek2016-11-191-0/+3
| |
* | Merge pull request #4395 from s-urbaniak/rw-supportLennart Poettering2016-11-181-10/+27
|\ \ | |/ |/| nspawn: R/W support for /sysfs, /proc, and /proc/sys/net
| * tests/TEST-13-NSPAWN-SMOKE: add SYSTEMD_NSPAWN_API_VFS_WRITABLEEvgeny Vereshchagin2016-11-181-10/+27
| | | | | | | | https://github.com/systemd/systemd/pull/4395
* | Merge pull request #4658 from endocode/djalal/sandbox-various-fixes-v1Djalal Harouni2016-11-154-0/+28
|\ \ | | | | | | core: improve the logic that implies no new privileges and documentation fixes
| * | test: add tests for RestrictNamespaces=Djalal Harouni2016-11-154-0/+28
| | |
* | | tests: add UNIFIED_CGROUP_HIERARCHY=[default|hybrid] (#4675)Evgeny Vereshchagin2016-11-151-3/+25
|/ / | | | | | | This will simplify testing a bit. Mainly for https://github.com/systemd/systemd/pull/4670
* | tests: fix kernel/initrd searching (Arch)Evgeny Vereshchagin2016-11-111-3/+20
|/ | | | | | | | | | 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
* tests: use less aggressive systemctl --wait timeout in TEST-03-JOBS (#4606)Martin Pitt2016-11-071-1/+1
| | | | | | | | | | | 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
* test: test DynamicUser= with SupplementaryGroups=Djalal Harouni2016-11-031-0/+8
|
* test: test DynamicUser= with a fixed userDjalal Harouni2016-11-032-0/+17
|
* tests: add test that journald keeps fds over termination by signalEvgeny Vereshchagin2016-11-011-0/+8
| | | | This test fails before previous commit, and passes with it.
* test: lets add more tests to cover SupplementaryGroups= cases.Djalal Harouni2016-10-243-0/+23
|
* Merge pull request #4372 from evverx/fix-synced-cgroup-hierarchy-permsZbigniew Jędrzejewski-Szmek2016-10-233-162/+4
|\
| * tests/TEST-13-NSPAWN-SMOKE: remove an expected failure checkEvgeny Vereshchagin2016-10-233-162/+4
| | | | | | | | | | https://github.com/systemd/systemd/issues/4352 has been fixed So, we don't need this workaround anymore
* | test: add more tests for SupplementaryGroups=Djalal Harouni2016-10-232-0/+17
| |
* | test: Add simple test for supplementary groupsDjalal Harouni2016-10-231-0/+7
|/
* tests: add smoke test for systemd-nspawnEvgeny Vereshchagin2016-10-174-0/+345
| | | | | | | | | | | | | | | | | | | Basically, this test runs: ``` systemd-nspawn --register=no -D "$_root" -b systemd-nspawn --register=no -D "$_root" --private-network -b systemd-nspawn --register=no -D "$_root" -U -b systemd-nspawn --register=no -D "$_root" --private-network -U -b ``` and exports the `UNIFIED_CGROUP_HIERARCHY=[yes|no]`, `SYSTEMD_NSPAWN_USE_CGNS=[yes|no]` Inspired by * systemd#3589 (comment) * systemd#4372 (comment) * systemd#4223 (comment) * systemd#1555 and so on :-)
* test: add test to make sure that ProtectKernelModules=yes disconnect mount ↵Djalal Harouni2016-10-121-0/+7
| | | | propagation
* test: add test to make sure that CAP_SYS_RAWIO was removed on PrivateDevices=yesDjalal Harouni2016-10-122-0/+14
|
* test: add capability tests for ProtectKernelModules=Djalal Harouni2016-10-122-0/+14
| | | | This just adds capabilities test.
* systemctl: Add --wait option to wait until started units terminate againMartin Pitt2016-10-011-0/+28
| | | | Fixes #3830
* resolved: don't query domain-limited DNS servers for other domains (#3621)Martin Pitt2016-09-301-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | DNS servers which have route-only domains should only be used for the specified domains. Routing queries about other domains there is a privacy violation, prone to fail (as that DNS server was not meant to be used for other domains), and puts unnecessary load onto that server. Introduce a new helper function dns_server_limited_domains() that checks if the DNS server should only be used for some selected domains, i. e. has some route-only domains without "~.". Use that when determining whether to query it in the scope, and when writing resolv.conf. Extend the test_route_only_dns() case to ensure that the DNS server limited to ~company does not appear in resolv.conf. Add test_route_only_dns_all_domains() to ensure that a server that also has ~. does appear in resolv.conf as global name server. These reproduce #3420. Add a new test_resolved_domain_restricted_dns() test case that verifies that domain-limited DNS servers are only being used for those domains. This reproduces #3421. Clarify what a "routing domain" is in the manpage. Fixes #3420 Fixes #3421
* test: make sure that {readonly|inaccessible|readwrite}paths disconnect mount ↵Djalal Harouni2016-09-273-0/+21
| | | | | | propagation Better safe.
* test: add tests for simple ReadOnlyPaths= caseDjalal Harouni2016-09-271-0/+7
|