summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test-network: add tests for prefix routesYu Watanabe2020-07-293-0/+125
|
* nspawn: rework how /run/host/ is set upLennart Poettering2020-07-231-4/+17
| | | | | | | | | | | Let's find the right os-release file on the host side, and only mount the one that matters, i.e. /etc/os-release if it exists and /usr/lib/os-release otherwise. Use the fixed path /run/host/os-release for that. Let's also mount /run/host as a bind mount on itself before we set up /run/host, and let's mount it MS_RDONLY after we are done, so that it remains immutable as a whole.
* test-network: add test for duplicated IPv6Token=Yu Watanabe2020-07-221-0/+2
|
* test-network: drop unnecessary sleep() in NetworkdStateFileTests.test_state_fileYu Watanabe2020-07-221-4/+3
|
* Merge pull request #16407 from bluca/verity_reuseLennart Poettering2020-07-221-1/+12
|\ | | | | verity: re-use already open devices if the hashes match
| * verity: re-use already open devices if the hashes matchLuca Boccassi2020-07-211-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening a verity device is an expensive operation. The kernelspace operations are mostly sequential with a global lock held regardless of which device is being opened. In userspace jumps in and out of multiple libraries are required. When signatures are used, there's the additional cryptographic checks. We know when two devices are identical: they have the same root hash. If libcrypsetup returns EEXIST, double check that the hashes are really the same, and that either both or none have a signature, and if everything matches simply remount the already open device. The kernel will do reference counting for us. In order to quickly and reliably discover if a device is already open, change the node naming scheme from '/dev/mapper/major:minor-verity' to '/dev/mapper/$roothash-verity'. Unfortunately libdevmapper is not 100% reliable, so in some case it will say that the device already exists and it is active, but in reality it is not usable. Fallback to an individually-activated unique device name in those cases for robustness.
* | test: adapt test-functions for SUSEElisei Roca2020-07-221-1/+5
|/
* Merge pull request #16353 from yuwata/network-dns-sniZbigniew Jędrzejewski-Szmek2020-07-212-6/+6
|\ | | | | resolve, network: more SNI and port number support
| * test-network: add tests for DNS= with port number and SNIYu Watanabe2020-07-212-6/+6
| |
* | test: run systemd-dissect and systemd-run with log level debug in ↵Luca Boccassi2020-07-211-0/+5
|/ | | | TEST-50-DISSECT
* Merge pull request #16478 from bluca/dissect_testsZbigniew Jędrzejewski-Szmek2020-07-202-13/+113
|\ | | | | Expand TEST-50-DISSECT to cover dm-verity features
| * test: exercise RootImage, RootHash and RootVerity in TEST-50-DISSECTLuca Boccassi2020-07-151-0/+10
| | | | | | | | Run with both the single-filesystem image and the GPT image
| * test: pre-assemble minimal image for TEST-50-DISSECT at build timeLuca Boccassi2020-07-152-19/+27
| | | | | | | | Easier than in the limited VM environment
| * test: exercise systemd-dissect with GPT and verity in TEST-50-DISSECTLuca Boccassi2020-07-152-0/+57
| |
| * test: exercise systemd-dissect --mount in TEST-50-DISSECTLuca Boccassi2020-07-152-6/+31
| |
* | nspawn: mount os-release in two steps to make it read-onlyLuca Boccassi2020-07-161-0/+2
|/ | | | | | | | The kernel interface requires setting up read-only bind-mounts in two steps, the bind first and then a read-only remount. Fix nspawn-mount, and cover this case in the integration test. Fixes #16484
* test-network: wait for addresses are not in tentative stateYu Watanabe2020-07-152-2/+2
|
* test-network: check assigned address is not tentative stateYu Watanabe2020-07-151-0/+6
|
* test-network: set IPv6AcceptRA=no if no dynamic addresses are not requiredYu Watanabe2020-07-1534-0/+53
|
* timer: Adjust calendar timers based on monotonic timer instead of realtimeFilipe Brandenburger2020-07-154-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the RTC time at boot is off in the future by a few days, OnCalendar= timers will be scheduled based on the time at boot. But if the time has been adjusted since boot, the timers will end up scheduled way in the future, which may cause them not to fire as shortly or often as expected. Update the logic so that the time will be adjusted based on monotonic time. We do that by calculating the adjusted manager startup realtime from the monotonic time stored at that time, by comparing that time with the realtime and monotonic time of the current time. Added a test case to validate this works as expected. The test case creates a QEMU virtual machine with the clock 3 days in the future. Then we adjust the clock back 3 days, and test creating a timer with an OnCalendar= for every 15 minutes. We also check the manager startup timestamp from both `systemd-analyze dump` and from D-Bus. Test output without the corresponding code changes that fix the issue: Timer elapse outside of the expected 20 minute window. next_elapsed=1594686119 now=1594426921 time_delta=259198 With the code changes in, the test passes as expected.
* test: Add "finish" rule to .PHONYFilipe Brandenburger2020-07-151-1/+1
|
* meson: do not install testdata when -Dinstall-tests=falseZbigniew Jędrzejewski-Szmek2020-07-141-49/+51
| | | | Fixes #16447.
* test: add test case for multi matches when use "||"gaoyi2020-07-121-0/+11
| | | | Signed-off-by: gaoyi <ymuemc@163.com>
* Merge pull request #16411 from ddstreet/bridge_without_carrier_failsYu Watanabe2020-07-091-4/+2
|\ | | | | Bridge without carrier fails
| * test-netowrk: in test_bridge_configure_without_carrier, avoid strange test ↵Dan Streetman2020-07-081-3/+2
| | | | | | | | | | | | | | | | | | failures For some reason the wait-online is failing intermittently; it's unclear exactly why, but this hopefully avoids the failure for unrelated PR. This is a workaround (not fix) for #16105
| * test-network: don't print networkctl output for passing subtestsDan Streetman2020-07-081-1/+0
| | | | | | | | This just clutters up the logs.
* | Merge pull request #15891 from bluca/host_os_releaseZbigniew Jędrzejewski-Szmek2020-07-082-1/+15
|\ \ | | | | | | Container Interface: expose the host's os-release metadata to nspawn and portable guests
| * | nspawn: implement container host os-release interfaceLuca Boccassi2020-06-232-1/+15
| | |
* | | Merge pull request #16405 from sipraga/masterZbigniew Jędrzejewski-Szmek2020-07-081-0/+2
|\ \ \
| * | | network: add support for MACVLAN source modeAlvin Šipraga2020-07-081-0/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for creating a MACVLAN interface in "source" mode by specifying Mode=source in the [MACVLAN] section of a .netdev file. A list of allowed MAC addresses for the corresponding MACVLAN can also be specified with the SourceMACAddress= option of the [MACVLAN] section. An example .netdev file: [NetDev] Name=macvlan0 Kind=macvlan MACAddress=02:DE:AD:BE:EF:00 [MACVLAN] Mode=source SourceMACAddress=02:AB:AB:AB:AB:01 02:CD:CD:CD:CD:01 SourceMACAddress=02:EF:EF:EF:EF:01 The same keys can also be specified in [MACVTAP] for MACVTAP kinds of interfaces, with the same semantics.
* | | test: bump the TEST-47 sleeps once againFrantisek Sumsal2020-07-081-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several recent failed runs show that the test is still racy in two ways: 1) Sometimes it takes a while before the PID file is created, leading to: ``` [ 10.950540] testsuite-47.sh[308]: ++ cat /leakedtestpid [ 10.959712] testsuite-47.sh[308]: cat: /leakedtestpid: No such file or directory [ 10.959824] testsuite-47.sh[298]: + leaked_pid= ``` 2) Again, sometimes we check the leaked PID before the unit is actually stopped, leading to a false negative: ``` [ 18.099599] testsuite-47.sh[346]: ++ cat /leakedtestpid [ 18.116462] testsuite-47.sh[333]: + leaked_pid=342 [ 18.117101] testsuite-47.sh[333]: + systemctl stop testsuite-47-repro ... [ 20.033907] testsuite-47.sh[333]: + ps -p 342 [ 20.080050] testsuite-47.sh[351]: PID TTY TIME CMD [ 20.080050] testsuite-47.sh[351]: 342 ? 00:00:00 sleep [ 20.082040] testsuite-47.sh[333]: + exit 42 ```
* | Merge pull request #16388 from keszybz/xdg-desktop-fuzz-caseZbigniew Jędrzejewski-Szmek2020-07-072-0/+0
|\ \ | | | | | | xdg-desktop fuzz case
| * | xdg-autostart: avoid quadratic behaviour in strv parsingZbigniew Jędrzejewski-Szmek2020-07-071-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fuzzer test case has a giant line with ";;;;;;;;;;;..." which is turned into a strv of empty strings. Unfortunately, when pushing each string, strv_push() needs to walk the whole array, which leads to quadratic behaviour. So let's use greedy_allocation here and also keep location in the string to avoid iterating. build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812 51.10s user 0.01s system 99% cpu 51.295 total ↓ build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812 0.07s user 0.01s system 96% cpu 0.083 total Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22812. Other minor changes: - say "was already defined" instead of "defined multiple times" to make it clear that we're ignoring this second definition, and not all definitions of the key - unescaping needs to be done also for the last entry
| * | fuzz: add test case that should already be resolvedZbigniew Jędrzejewski-Szmek2020-07-071-0/+0
| | |
* | | core: refresh unit cache when building a transaction if UNIT_NOT_FOUNDLuca Boccassi2020-07-071-0/+27
|/ / | | | | | | | | | | | | | | | | When a command asks to load a unit directly and it is in state UNIT_NOT_FOUND, and the cache is outdated, we refresh it and attempto to load again. Use the same logic when building up a transaction and a dependency in UNIT_NOT_FOUND state is encountered. Update the unit test to exercise this code path.
* | DHCPv4: client add support for DHCP server allow listSusant Sahani2020-07-061-0/+1
| |
* | network: tc: fix n_prio bounds checkVito Caputo2020-07-061-0/+0
| | | | | | | | | | | | Looks like a simple copy and paste error Fixes https://github.com/systemd/systemd/issues/16367
* | test: use KILL instead of SIGKILL in TEST-52-HONORFIRSTSHUTDOWNFrantisek Sumsal2020-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SIG-prefixed signals for `kill` are not POSIX compliant, so on Ubuntu CI (which defaults to dash instead of bash) the TEST-52 contains following error: [ 9693.549638] sh[51]: + systemctl poweroff --no-block [ 9693.553130] systemd-logind[26]: System is powering down. [ 9693.608911] sh[54]: /bin/sh: 1: kill: Illegal option -S This can be reproduced manually as well, either by running dash, or bash in POSIX mode: $ dash -c 'kill -SIGKILL 123' dash: 1: kill: Illegal option -S $ bash --posix -c 'kill -SIGKILL 123' bash: line 0: kill: SIGKILL: invalid signal specification
* | network: tc: rename several settings which take size in bytesYu Watanabe2020-07-025-15/+21
| |
* | test-network: add tests for SR-IOVYu Watanabe2020-07-012-2/+93
| | | | | | | | | | This also adjusts test_sysctl_disable_ipv6(), as rt_trap flag may be added to routes on some environments.
* | network: add MACAddress= setting in [SR-IOV] sectionYu Watanabe2020-07-011-0/+1
| |
* | network: add VLANProtocol= setting in [SR-IOV] sectionYu Watanabe2020-07-011-0/+1
| |
* | network: Introduce SR-IOVSusant Sahani2020-07-011-0/+8
| | | | | | | | | | | | | | | | SR-IOV provides the ability to partition a single physical PCI resource into virtual PCI functions which can then be injected in to a VM. In the case of network VFs, SR-IOV improves north-south n etwork performance (that is, traffic with endpoints outside the host machine) by allowing traffic to bypass the host machine’s network stack.
* | Merge pull request #16313 from yuwata/network-move-ipv6ll-gen-modeZbigniew Jędrzejewski-Szmek2020-06-301-1/+1
|\ \ | | | | | | network: move IPv6LinkLocalAddressGenerationMode= to [Network] section
| * | network: move IPv6LinkLocalAddressGenerationMode= to [Network] sectionYu Watanabe2020-06-301-1/+1
| | | | | | | | | | | | | | | | | | This also moves and renames variables and functions. Follow-ups for a6f1848a2328cf1493f363968d105cc23019af8a.
* | | core: store timestamps of unit load attemptsLuca Boccassi2020-06-302-2/+22
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the system is under heavy load, it can happen that the unit cache is refreshed for an unrelated reason (in the test I simulate this by attempting to start a non-existing unit). The new unit is found and accounted for in the cache, but it's ignored since we are loading something else. When we actually look for it, by attempting to start it, the cache is up to date so no refresh happens, and starting fails although we have it loaded in the cache. When the unit state is set to UNIT_NOT_FOUND, mark the timestamp in u->fragment_loadtime. Then when attempting to load again we can check both if the cache itself needs a refresh, OR if it was refreshed AFTER the last failed attempt that resulted in the state being UNIT_NOT_FOUND. Update the test so that this issue reproduces more often.
* | test: bump the timeout for systemd-hwdb-update.service under ASanFrantisek Sumsal2020-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the hwdb update from a79be2f80777eb80e0d8177f6bccd7615de7ec1a the systemd-hwdb-update service started timing out under ASan when compiled with gcc, as we started tripping over the 3 minutes timeout. This affects only gcc runs, since the current gcc on Arch still suffers from the detect_stack_use_after_return performance penalty[0]. Until the fixed gcc is present in the respective repositories, let's bump the timeout to 4 minutes, as we might not be able to upgrade right away, due to systemd/systemd#16199. Before the hwdb update: [ 7958.292540] systemd[63]: systemd-hwdb-update.service: Executing: /usr/bin/time systemd-hwdb update [ 7958.304005] systemd[1]: systemd-journald.service: Got notification message from PID 44 (FDSTORE=1) [ 7958.314434] systemd[1]: systemd-journald.service: Added fd 3 (n/a) to fd store. [ 8008.520082] systemd[1]: systemd-journald.service: Got notification message from PID 44 (WATCHDOG=1) [ 8068.520151] systemd[1]: systemd-journald.service: Got notification message from PID 44 (WATCHDOG=1) [ 8125.682843] time[63]: 84.47user 82.92system 2:47.50elapsed 99%CPU (0avgtext+0avgdata 811512maxresident)k [ 8125.682843] time[63]: 0inputs+19680outputs (0major+25000853minor)pagefaults 0swaps After the hwdb update: [ 6215.491958] systemd[63]: systemd-hwdb-update.service: Executing: /usr/bin/time systemd-hwdb update [ 6215.503380] systemd[1]: systemd-journald.service: Got notification message from PID 44 (FDSTORE=1) [ 6215.514172] systemd[1]: systemd-journald.service: Added fd 3 (n/a) to fd store. [ 6329.392918] systemd[1]: systemd-journald.service: Got notification message from PID 44 (WATCHDOG=1) [ 6394.920205] time[63]: 89.48user 89.98system 2:59.55elapsed 99%CPU (0avgtext+0avgdata 812764maxresident)k [ 6394.920205] time[63]: 0inputs+20568outputs (0major+27318354minor)pagefaults 0swaps [0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94910
* | Add quotes for -nGaoyi2020-06-261-1/+1
| | | | | | | | | | | | | | According to SC2070, -n doesn't work with unquoted arguments https://github.com/koalaman/shellcheck/wiki/SC2070 Signed-off-by: Gaoyi <ymuemc@163.com>
* | Merge pull request #16275 from yuwata/network-deprecate-netdevsimZbigniew Jędrzejewski-Szmek2020-06-251-3/+0
|\ \ | | | | | | network: deprecate netdevsim support
| * | test-network: remove unused configYu Watanabe2020-06-251-3/+0
| | |