1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

test-execute: simplify the tests for PrivateNetwork=

If an exotic network driver is loaded, there may exist an unexpected
network interface.
This commit is contained in:
Yu Watanabe 2023-03-04 02:47:19 +09:00
parent c63bfd0884
commit c9a2563225
2 changed files with 2 additions and 4 deletions

View File

@ -3,8 +3,7 @@
Description=Test for PrivateNetwork= without mount namespacing
[Service]
ExecStart=/bin/sh -x -c '! ip link | grep -E "^[0-9]+: " | grep -Ev ": (lo|(erspan|gre|gretap|ip_vti|ip6_vti|ip6gre|ip6tnl|sit|tunl)0@.*):"'
ExecStart=/bin/sh -x -c '! ip link | grep -E "^[0-9]+: " | grep -F ": dummy-test-exec:"'
ExecStart=/bin/sh -x -c '! ip link show dummy-test-exec'
ExecStart=/bin/sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
# Without mount namespacing, we can access the dummy-test-exec interface through sysfs
ExecStart=/bin/sh -x -c 'test -d /sys/class/net/dummy-test-exec'

View File

@ -3,8 +3,7 @@
Description=Test for PrivateNetwork= with mount namespacing
[Service]
ExecStart=/bin/sh -x -c '! ip link | grep -E "^[0-9]+: " | grep -Ev ": (lo|(erspan|gre|gretap|ip_vti|ip6_vti|ip6gre|ip6tnl|sit|tunl)0@.*):"'
ExecStart=/bin/sh -x -c '! ip link | grep -E "^[0-9]+: " | grep -F ": dummy-test-exec:"'
ExecStart=/bin/sh -x -c '! ip link show dummy-test-exec'
ExecStart=/bin/sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
# With mount namespacing, we cannot access the dummy-test-exec interface through sysfs.
ExecStart=/bin/sh -x -c 'test ! -e /sys/class/net/dummy-test-exec'