1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

2394 Commits

Author SHA1 Message Date
Frantisek Sumsal
140557021a test: don't install test-network-generator-conversion.sh w/o networkd
otherwise TEST-02 will fail:

```
=== Failed test log ===
--- test-network-generator-conversion.sh begin ---
+ [[ -n '' ]]
+ [[ -x /usr/lib/systemd/systemd-network-generator ]]
+ [[ -x /lib/systemd/systemd-network-generator ]]
+ exit 1
--- test-network-generator-conversion.sh end ---
```

Before:
```
$ meson build -Dnetworkd=false -Dinstall-tests=true
$ ninja -C build
$ DESTDIR=$PWD/test-install ninja -C build install
$ find test-install/ -name test-network-generator-conversion.sh
test-install/usr/lib/systemd/tests/test-network-generator-conversion.sh
```

After:
```
$ find test-install/ -name test-network-generator-conversion.sh
<no output>
```
2021-10-20 22:04:45 +01:00
Frantisek Sumsal
0b5fe54ff5 test: collect coverage in a couple more codepaths
Otherwise we'd miss coverage from TEST-{02,24,61}, since they don't go
through the "standard" `check_result_common` hook.

Follow-up to 7bf20e48bd.
2021-10-20 16:46:58 +01:00
Dimitri Papadopoulos
ba669952b2 Typos found by codespell 2021-10-20 22:20:18 +09:00
Yu Watanabe
a4a1385e07 test-network: cleanup dnsmasq related file on setup
Just for safety.
2021-10-20 03:49:05 +09:00
Yu Watanabe
888f57c11c test-network: drop pid_file argument from stop_dnsmasq() 2021-10-20 03:49:05 +09:00
Yu Watanabe
ed08ed4a45 test-network: use constant variables in dnsmasq command 2021-10-20 03:49:05 +09:00
Zbigniew Jędrzejewski-Szmek
721700df3c TEST-06-SELINUX: add the usual spdx license header to policy files 2021-10-18 09:43:18 +02:00
Zbigniew Jędrzejewski-Szmek
1d9a1215e8 gitattributes: introduce and use "generated" attribute
I want to mark some files to be ignored for licensing purposes,
e.g. output from fuzzers and other samples. By using the gitattribute
machinery for this we don't need to design a custom protocol:

$ git check-attr generated test/test-sysusers/unhappy-*
test/test-sysusers/unhappy-1.expected-err: generated: set
test/test-sysusers/unhappy-1.input: generated: unspecified
test/test-sysusers/unhappy-2.expected-err: generated: set
test/test-sysusers/unhappy-2.input: generated: unspecified
test/test-sysusers/unhappy-3.expected-err: generated: set
test/test-sysusers/unhappy-3.input: generated: unspecified
2021-10-18 09:42:55 +02:00
Zbigniew Jędrzejewski-Szmek
546e57f51b gitattributes: mark more files as "binary"
This way we know that we shouldn't look for a spdx header in them.
2021-10-18 09:40:35 +02:00
Zbigniew Jędrzejewski-Szmek
d632e6fe3b tests: use !/usr/bin/env bash consistently
This adjustment was last done in f96bc66901,
but it seems some files were missed and some were added later.
2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
7b3cec95db tests: add spdx headers to scripts and Makefiles 2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
22d3cfe54c tests: add spdx license header to test unit/link/network/conf files
Those are all consumed by our parser, so they all support comments.
I was considering whether they should have a license header at all,
but in the end I decided to add it because those files are often created
by copying parts of real unit files. And if the real ones have a license,
then those might as well. It's easier to add it than to make an exception.
2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
7b84e701a8 gitattributes: mark fuzz inputs that are pure binary as such
We also have a bunch of files that have some bytes and a lot
of text, like the journal export format. For those, it is still quite
useful when the tools try to diff them, so let's not mark those.
2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
6b292fa17b
Merge pull request #20996 from yuwata/udevadm-trigger-debug
test: show debug and verbose message
2021-10-15 09:44:59 +02:00
Zbigniew Jędrzejewski-Szmek
df618f259a
Merge pull request #20987 from yuwata/sd-dhcp6-enum-cleanups
sd-dhcp6-client: enum cleanups
2021-10-13 08:25:37 +02:00
Yu Watanabe
6870cf0729 test: show debug and verbose message 2021-10-13 12:58:24 +09:00
Anita Zhang
0b4f8d9498 core: serialize device cgroup bpf progs across daemon-reload/reexec
Follows what was done in b57d752326 and
adds a test that verifies the device BPF program is not detached during
reload/reexec.
2021-10-13 11:13:56 +09:00
Yu Watanabe
308d01f3c4 network: do not request RAPID_COMMIT option
The option must not be included in OPTION_REQUEST option.
See the "Client ORO" field in
https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#dhcpv6-parameters-2

This deprecates RapidCommit= setting. Note that sd-dhcp6-client always
sets the RAPID_COMMIT option in the solicit message.
2021-10-13 02:46:24 +09:00
Dimitri John Ledkov
af7fb6831f test: set 5 minute timeout on TEST-11-ISSUE-3166 and TEST-50-DISSECT
When they work they finish quickly in under two minutes on slow machines, when
soft lock ups happen in the nested virt machine each test can run for like 5
hours clogging up CI infrastructure. It's best to fail quicker than that when
qemu or kernel are broken.
2021-10-09 18:31:27 +01:00
Yu Watanabe
6830c3a553
Merge pull request #20778 from yuwata/network-ipv6-token
network: rework IPv6 address generation mode
2021-10-07 23:24:00 +09:00
Luca Boccassi
c9d1c37c93 test: make OpenSSL checks optional in TEST-50-DISSECT
If the packages are built without libssl simply skip the signature
checks.

Oct 06 21:21:32 H systemd[1]: systemd 249.1249.gcc4df1f787.0 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL
...
Oct 06 21:22:21 H systemd[459]: Activation of signed Verity volume worked neither via the kernel nor in userspace, can't activate.

Follow-up for #20691
2021-10-07 08:41:33 +02:00
Luca Boccassi
0cf250022c
Merge pull request #20926 from yuwata/udev-net-wol-sopass
udev/net: introduce WakeOnLanPassword=
2021-10-06 23:36:05 +01:00
Frantisek Sumsal
f415cdb372 test: test udev with a _very_ long device name
Let's attempt to provide some coverage for #16161, #6867, and similar.
2021-10-07 03:17:44 +09:00
Yu Watanabe
d489317f59
Merge pull request #20935 from unusual-thoughts/fix-empty-argv
Fix #20933
2021-10-07 01:53:51 +09:00
Yu Watanabe
d3867133f0 udev/net: introduce WakeOnLanPassword=
Closes #20913.
2021-10-07 01:50:37 +09:00
Yu Watanabe
fe2a8b3d3f test-network: add tests for Token= in [IPv6Prefix] 2021-10-07 01:24:50 +09:00
Yu Watanabe
b48b6bd3b9 test-network: replace deprecated settings 2021-10-07 01:24:50 +09:00
Yu Watanabe
e609cd0694 network: introduce Token= setting in [IPv6Prefix]
Closes #20149.
2021-10-07 01:24:50 +09:00
Yu Watanabe
a73628e647 network: rename IPv6Token= in [Network] -> Token= in [IPv6AcceptRA]
The token is only used by received prefixes through RA.
2021-10-07 01:16:36 +09:00
Iago López Galeiras
e59ccd035c core: add RestrictFileSystems= fragment parser
It takes an allow or deny list of filesystems services should have
access to.
2021-10-06 10:52:14 +02:00
Henri Chain
29500cf8c4 core: fix SIGABRT on empty exec command argv
This verifies that the argv part of any exec_command parameters that
are sent through dbus is not empty at deserialization time.

There is an additional check in service.c service_verify() that again
checks if all exec_commands are correctly populated, after the service
has been loaded, whether through dbus or otherwise.

Fixes #20933.
2021-10-06 00:16:47 +09:00
Anita Zhang
a2ae2ba2ff
Merge pull request #20892 from yuwata/test-network-preferred-lifetime-zero
network: drop and warn duplicated address settings
2021-10-04 18:40:59 -07:00
Luca Boccassi
c82dc15b9f test: create and merge code coverage reports in integration tests
If -Db_coverage=true is used at build time, then ARTIFACT_DIRECTORY/TEST-XX-FOO.coverage-info
files are created with code coverage data, and run-integration-test.sh also
merges them into ARTIFACT_DIRECTORY/merged.coverage-info since the coveralls.io
helpers accept only a single file.
2021-10-04 16:40:49 +01:00
Yu Watanabe
40971657ce test-network: add tests for duplicated address setting
Also, add more tests for PreferredLifetime=0

C.f. #20891.
2021-10-04 18:26:35 +09:00
Zbigniew Jędrzejewski-Szmek
8f5bcd615b licensing: add forgotten spdx headers
Those are all "our" files, but we forgot to add the headers,
most likely because of non-standard file extensions.
2021-10-01 14:45:00 +02:00
Yu Watanabe
1924f26d2a
Merge pull request #20777 from benzea/benzea/fix-seccomp-filter
seccomp: Always install filters for native architecture
2021-10-01 15:12:55 +09:00
Michael Biebl
528dd6a423 networkd-test: fix resolved_domain_restricted_dns
megasearch.net was meant to be a non-existing bogus domain, and had been
for a long time. But it seems some domain grabber recently registered
it, and it's an actual thing now:

  $ host megasearch.net
  megasearch.net has address 207.148.248.143

This causes the test to fail randomly.

Use search.example.com instead which yields

  $ host search.example.com
  Host search.example.com not found: 3(NXDOMAIN)

Fixes: #18357
2021-10-01 14:34:00 +09:00
Frantisek Sumsal
e72be068b1 test: use a less restrictive portable profile when running w/ sanitizers
Since f833df3 we now actually use the seccomp rules defined in portable
profiles. However, the default one is too restrictive for sanitizers, as
it blocks certain syscall required by LSan. Mitigate this by using the
'trusted' profile when running TEST-29-PORTABLE under sanitizers.
2021-09-30 14:23:27 +02:00
Frantisek Sumsal
1c3f490f23 test: shellcheck-ify test scripts 2021-09-30 12:12:00 +02:00
Frantisek Sumsal
91c64ad620 test: drop an unused file 2021-09-30 12:11:27 +02:00
Benjamin Berg
e975a94559 test: Add failing/non-failing syscall filter test setting architecture
This adds a high level test verifying that syscall filtering in
combination with a simple architecture filter for the "native"
architecture works fine.
2021-09-30 08:06:25 +09:00
Yu Watanabe
78fac35811
Merge pull request #20823 from mrc0mmand/test-storage-iscsi
test: iSCSI-related udev tests
2021-09-29 23:17:43 +09:00
Anita Zhang
14bb729534 basic/unit-file: don't filter out names starting with dot
Fixes #20859
Reverts 3796bdc55d
2021-09-29 14:42:13 +02:00
Frantisek Sumsal
9cb41c3326 test: iSCSI-related udev tests 2021-09-29 10:05:21 +02:00
Frantisek Sumsal
aedb60043a test: save journals of only failing test cases in TEST-64 2021-09-29 10:05:21 +02:00
Frantisek Sumsal
7074c047c1 test: explicitly report if we fail to install a file into the image 2021-09-29 10:05:21 +02:00
Frantisek Sumsal
f4e64b6e34 test: add an iSCSI helper 2021-09-29 10:05:21 +02:00
Frantisek Sumsal
5f25c30ee8 test: sort the features alphabetically 2021-09-29 10:05:21 +02:00
Lennart Poettering
2c424ee0aa tests: extend TEST-50-DISSECT to look for verity signatures 2021-09-28 17:06:45 +02:00
Albert Brox
5918a93355 core: implement RuntimeMaxDeltaSec directive 2021-09-28 16:46:20 +02:00
alexlzhu
8c35c10d20 core: Add ExecSearchPath parameter to specify the directory relative to which binaries executed by Exec*= should be found
Currently there does not exist a way to specify a path relative to which
all binaries executed by Exec should be found. The only way is to
specify the absolute path.

This change implements the functionality to specify a path relative to which
binaries executed by Exec*= can be found.

Closes #6308
2021-09-28 14:52:27 +01:00
Yu Watanabe
94832e6e55 test: also rename {test,fuzz}-lldp.c 2021-09-27 23:55:11 +09:00
Lennart Poettering
49e9218ae3
Merge pull request #20768 from pdmorrow/shutdown_cgroup_ctrl
cgroups: apply StartupAllowedCPUs= and StartupAllowedMemoryNodes= during shutdown
2021-09-27 13:44:54 +02:00
Peter Morrow
1b75e5f343 fuzz: list directives in alphabetical order 2021-09-24 14:43:01 +01:00
Anita Zhang
2b33e41aaf link: connect 5 more properties to ethtool features
Sets up the follow properties and their corresponding ethtool feature:
- ReceiveVLANCTAGHardwareAcceleration == rx-vlan-hw-parse (or rxvlan)
- TransmitVLANCTAGHardwareAcceleration == tx-vlan-hw-insert (or txvlan)
- ReceiveVLANCTAGFilter == rx-vlan-filter
- TransmitVLANSTAGHardwareAcceleration == tx-vlan-stag-hw-insert
- NTupleFilter == rx-ntuple-filter (or ntuple)
2021-09-24 20:40:23 +09:00
Luca Boccassi
3a18c0e5f2
Merge pull request #20806 from fbuihuu/test-make-debug-tools-optional
test: make the installation of the debug tools optional in the image
2021-09-22 12:01:59 +01:00
Franck Bui
9fbb13acbc test: wc is needed by test/units/testsuite-50.sh 2021-09-22 09:04:52 +02:00
Franck Bui
f7d47cc862 test: make the installation of the debug tools optional in the image 2021-09-22 08:37:34 +02:00
Luca Boccassi
71a80dcc0b
Merge pull request #20690 from DaanDeMeyer/oomd-user-services
oom: Support for user services
2021-09-21 15:39:48 +01:00
Daan De Meyer
064a5c1438 oom: Add support for user unit ManagedOOM property updates
Compared to PID1 where systemd-oomd has to be the client to PID1
because PID1 is a more privileged process than systemd-oomd, systemd-oomd
is the more privileged process compared to a user manager so we have
user managers be the client whereas systemd-oomd is now the server.

The same varlink protocol is used between user managers and systemd-oomd
to deliver ManagedOOM property updates. systemd-oomd now sets up a varlink
server that user managers connect to to send ManagedOOM property updates.

We also add extra validation to make sure that non-root senders don't
send updates for cgroups they don't own.

The integration test was extended to repeat the chill/bloat test using
a user manager instead of PID1.
2021-09-20 13:53:11 +01:00
Frantisek Sumsal
26a5ae8e95 test: dump the test output to console as well for easier debugging 2021-09-19 13:46:55 +02:00
Frantisek Sumsal
41187e716d test: regenerate module dependencies after installing all modules 2021-09-19 13:46:55 +02:00
Frantisek Sumsal
abfa9a0e7d test: fix error handling with set -e
Unfortunately, when checking the return/exit code using &&, ||, if,
while, etc., `set -e` is disabled for all nested functions as well,
which leads to incorrectly ignored errors, *sigh*.

Example:

```
set -eu
set -o pipefail

task() {
    echo "task init"
    echo "this should fail"
    false
    nonexistentcommand
    echo "task end (we shouldn't be here)"
}

if ! task; then
    echo >&2 "The task failed"
    exit 1
else
    echo "The task passed"
fi
```

```
$ bash test.sh
task init
this should fail
test.sh: line 10: nonexistentcommand: command not found
task end (we shouldn't be here)
The task passed
$ echo $?
0
```

But without the `if`, everything works "as expected":

```
set -eu
set -o pipefail

task() {
    echo "task init"
    echo "this should fail"
    false
    nonexistentcommand
    echo "task end (we shouldn't be here)"
}

task
```

```
$ bash test.sh
task init
this should fail
$ echo $?
1
```

Wonderful.
2021-09-19 13:46:55 +02:00
Frantisek Sumsal
b1471e559e test: btrfs-related udev tests 2021-09-19 13:46:49 +02:00
Frantisek Sumsal
677acd2101 test: check symlinks under /dev/mapper by default as well 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
de11005c1a test: use subshells a bit more
to tweak shell flags in specific functions without affecting the rest of
the script.
2021-09-18 20:44:34 +02:00
Frantisek Sumsal
b216501a8e test: cleanup the intermediate disk images 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
70ec7736f8 test: tidy up the feature handling 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
babe935563 test: add a btrfs helper 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
dbc04797c1 test: lower the number of iterations in LVM tests
as some of the operations take a really long time.
2021-09-18 20:44:34 +02:00
Frantisek Sumsal
776fc8c385 test: unify handling of supported "features" 2021-09-17 17:45:39 +02:00
Luca Boccassi
1dcd91ad11
Merge pull request #20758 from yuwata/test-17-udev-cleanups
test: several cleanups for TEST-17-UDEV
2021-09-16 09:45:10 +01:00
Yu Watanabe
2d253d7206
Merge pull request #20721 from mrc0mmand/test-storage-lvm
test: udev/LVM storage tests
2021-09-16 12:39:24 +09:00
Yu Watanabe
a871f3bb54 test: drop unnecessary sleep and 'udevadm settle'
After the triggered events are processed, all symlinks which store
watch handles should be valid.
2021-09-16 06:55:11 +09:00
Yu Watanabe
a9d8bebacd test: use --settle option for udevadm trigger 2021-09-16 06:55:11 +09:00
Yu Watanabe
e70f57796d test: use --settle option for udevadm trigger
Then, we can drop the loops.
This also drops unnecessary `udevadm control --reload`.
2021-09-16 06:55:04 +09:00
Yu Watanabe
9228ecaf8c test: use /dev/null instead of the loop back network interface
It should faster to be processed. So, we can shorten the timeout.
Also, this makes the test use `udevadm trigger`.
2021-09-16 06:46:19 +09:00
Yu Watanabe
26146d82db test: use --settle option for udevadm trigger 2021-09-16 06:39:48 +09:00
Frantisek Sumsal
0203b2e4be test: basic LVM tests 2021-09-15 20:17:50 +02:00
Luca Boccassi
e236711fd7 test: document autopkgtest CI infrastructure 2021-09-15 14:58:38 +02:00
Peter Morrow
88a56dc8d6 fuzz: add StartupAllowedCPUs and StartupAllowedMemoryNodes to directives
Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
2021-09-15 09:52:12 +01:00
Frantisek Sumsal
6df0259732 test: check if all paths passed to helper_check_device_symlinks() are valid 2021-09-14 19:15:13 +02:00
Frantisek Sumsal
a0560b93ea test: make helper_check_device_symlinks() less verbose 2021-09-14 19:15:13 +02:00
Frantisek Sumsal
df72bd45f3 test: handle arbitrary paths in helper_check_device_symlinks() 2021-09-14 19:15:13 +02:00
Frantisek Sumsal
4999f3688f test: add an LVM helper 2021-09-14 19:15:13 +02:00
Frantisek Sumsal
e3d9a2e74f test: install dmevent service and socket 2021-09-14 19:15:13 +02:00
Frantisek Sumsal
bac05644a7 test: specify the rootfs by label
otherwise the boot might fail when attaching multiple SATA devices to
the VM.
2021-09-14 19:15:13 +02:00
Yu Watanabe
e47bcb7d0b network: do not use RouteTable= in [DHCPv4] section for DHCPv6 routes
We forgot to add RouteTable= in [DHCPv6] section when we split [DHCP]
into two.
2021-09-14 17:51:19 +09:00
Yu Watanabe
8be102f8b8 test-network: kernel treats the lowest IP address as unicast since 5.14
See kernel's 94c821c74bf5fe0c25e09df5334a16f98608db90.
2021-09-13 21:41:16 +02:00
Frantisek Sumsal
35497c7c33 test: coverage for #19946 2021-09-12 18:55:58 +02:00
Frantisek Sumsal
d430e451c9 test: make sure all symlinks under /dev/disk/ are valid 2021-09-12 18:52:56 +02:00
Frantisek Sumsal
d0cbad16c5 test: add a basic multipath test + failover 2021-09-12 18:38:42 +02:00
Frantisek Sumsal
9e7c3bd48c test: add a multipath helper 2021-09-12 18:38:42 +02:00
Frantisek Sumsal
e205ae0d9c test: use one call to install necessary modules 2021-09-12 18:38:42 +02:00
Anita Zhang
7417f06187 test: tweak parameters for TEST-55-OOMD
Pressure remains > 1% after a kill for some time and could cause
testchill to get killed. Bumping the limit from 1% to 20% should help
with this.

Fixes #20118
2021-09-12 19:16:18 +09:00
Frantisek Sumsal
39e1753673 test: rename dracut_install to image_install
The `dracut_install` is a misnomer, since the systemd integration test
suite is based on the original dracut's test suite, and not all the
references to dracut has been edited out. Let's fix that.
2021-09-08 22:41:20 +09:00
Luca Boccassi
7728f6aa81 test: rename TEST-63-ANALYZE to solve conflict
Two PRs adding TEST-63-* were merged more or less at the
same time, and we missed the conflict.
2021-09-08 10:12:03 +09:00
Frantisek Sumsal
f2204ac27d test: udev storage tests 2021-09-08 04:31:24 +09:00
Kyle Laker
c1e6f21556
systemd-analyze: use config value in RestrictNamespaces id (#20645)
For most fields, the text shown by `.id` is the value that should be set
in the unit file; however, for RestrictNamespaces, it is not. Changing
this to show the actual text makes it more clear to a user what the
actual change that needs to be made to the unit file is.
2021-09-06 17:33:16 +02:00
Yu Watanabe
05403363ca tree-wide: fix typo 2021-09-05 09:09:13 +02:00