Commit Graph
522 Commits
Author SHA1 Message Date
Yu Watanabe 073ad7ed1f test-network: wait for a while if manual policy is always-{up,down}
If wait_operstate() is called super quickly after ip command, then the
up/down state may not be changed and propagated to networkd, and
wait_operstate() mistakenly pass with the previous state.

To avoid such situation, wait for a while to make networkd actually
detect the interface brought up/down.
2022-01-28 07:29:37 +09:00
Yu Watanabe ebb5036ff2 test-network: dummy interface is initially down when activation policy is manual 2022-01-28 07:17:08 +09:00
Yu Watanabe cfbdc4387f test-network: wait for the link is activated
This fixes the following race:
1. when a dummy interface is created, it is initially down state,
2. hence, wait_operstate() may pass before the link is activated,
3. and the ip command bring up the interface before the activation,
4. and networkd activates, that is, brings down the interface,
5. thus, next wait_operstate() timedout, as it waits for the interface up.

To fix the race, let's wait the link is activated, before enter the loop
of wait_operstate().

Fixes #22267.
2022-01-28 07:02:03 +09:00
Yu Watanabe b67f3d73b0 test-network: always cleanup the testing environment
Previously, if a subtest fail, then the cleanup process does not run,
and affects the subsequent tests.
2022-01-28 06:59:52 +09:00
Yu Watanabe 1e8e9730d2 test-network: add testcases for configuring SR-IOV by .link file 2022-01-19 15:00:53 +09:00
Yu Watanabe a03ff4c0fe test-network: split out SR-IOV test to new class 2022-01-19 15:00:53 +09:00
Yu Watanabe 0eed039c92 test-network: silence check for alternative names 2022-01-19 15:00:53 +09:00
Yu Watanabe 902bbdc4b6 network: use scope link for direct unicast routes by default
Strictly speaking, this breaks the backward compatibility, but I guess
in most cases people already sets Scope=link for such routes.

This behavior matches with how 'ip route' command adds such route by
default.

Prompted by https://twitter.com/jplitza/status/1480500562391179270.
2022-01-13 22:46:52 +00:00
Yu Watanabe 14b451f20a test-network: add testcase for invalid AllowedIPs= 2021-12-31 02:31:12 +09:00
Yu Watanabe 49ad8da779 test-network: add testcase for vxlan local address auto selection 2021-12-25 15:32:06 +09:00
Yu Watanabe 7726526cc6 Merge pull request #21648 from yuwata/network-tunnel-local-automatic-address-selection
network: tunnel: automatic local address selection
2021-12-25 15:05:13 +09:00
Yu Watanabe 6a936c9c9a test-network: add tests for renewing/rebinding lease 2021-12-18 10:09:07 +09:00
Yu Watanabe 2616b5285f test-network: introduce dump_dnsmasq_log_file() 2021-12-18 10:09:07 +09:00
Yu Watanabe 4862fb693d test-network: use dnsmasq for testing DHCP4-6RD 2021-12-18 10:09:07 +09:00
Yu Watanabe f56af3b4c8 test-network: use --bind-interfaces option for dnsmasq
Also make the interface name and router address configurable.
2021-12-18 10:09:07 +09:00
Yu Watanabe fe87807eaa network: dhcp-pd: do not stack 6rd sit tunnel 2021-12-18 10:09:07 +09:00
Yu Watanabe 2347b6b94e test-network: wait for veth99 being configured
As the address, which should be kept, may not be just removed yet.
Let's check that the address is actually kept.
2021-12-17 00:14:30 +09:00
Yu Watanabe da7d684825 test-network: add testcase for automatic tunnel local address selection 2021-12-12 14:11:38 +09:00
Yu Watanabe 42592d0ad4 test-network: support the case that the default config files are not installed yet 2021-12-07 20:33:20 +09:00
Yu Watanabe 84cc85f983 test-network: add test for 6rd 2021-12-07 20:33:20 +09:00
Yu Watanabe a27588d4e7 network: dhcp-pd: rename [DHCPv6PrefixDelegation] -> [DHCPPrefixDelegation]
This just changes the names of settings, variables, functions, files, and so on.
No functionality is changed.

Preparation for supporting 6rd.
2021-12-07 20:30:30 +09:00
Yu Watanabe ab0c82d9f7 network: dhcp6pd: assign addresses in the delegated prefix instead of a subnet prefix /64 on upstream interface 2021-12-07 19:46:37 +09:00
Yu Watanabe 45aa0e841b network,udev: do not adjust local assignment bit of specified MAC address
People often assigns the MAC address of the enslaved interface to e.g.
bridge interface. So, the local assignment bit should not be adjusted.

Fixes #21649.
2021-12-07 15:01:04 +09:00
Yu Watanabe 133f65ef2c test-network: start dhcpd after address is assigned 2021-12-06 19:18:55 +09:00
Yu Watanabe 5f7f1f824f test-network: make start_isc_dhcpd() take IP version 2021-12-06 19:18:55 +09:00
Yu Watanabe 6016f1cfbb test-network: re-arrange DHCP6-PD subnet IDs to test searching free subnet ID 2021-12-01 20:35:03 +09:00
Yu Watanabe 6c8d6bdd40 test-network: add testcases for uplink interface detection for RADV with DHCPv6-PD 2021-12-01 20:35:03 +09:00
Yu Watanabe 6387cac3f3 test-network: add tests for creating routes to wireguard's AllowedIPs= 2021-12-01 04:00:16 +09:00
Yu Watanabe 94f0bd624b test-network: add more basic tests for network json formats 2021-11-30 10:03:51 +09:00
Yu Watanabe 007899f43e network/netdev: verify specified MAC address
Drop multicast bit and set local bit of the specified MAC address.

This also makes failure in generating persistent MAC address
non-critical.
2021-11-27 06:39:04 +09:00
Zbigniew Jędrzejewski-Szmek 66a8eddd6d Merge pull request #21360 from yuwata/network-json
network: json: add more information
2021-11-26 11:04:52 +01:00
Yu Watanabe 146726b2f5 test-network: add basic tests of json output 2021-11-25 22:35:35 +09:00
Yu Watanabe a8840714f3 network: make MACAddress= takes hardware address with its length is INFINIBAND_ALEN
Also, the multicast and local bits in the specified MAC address for
ethernet are adjusted.
2021-11-25 22:03:19 +09:00
Yu Watanabe b36caceb88 test-network: check if actually alternative name is set
Fixes #21404.
2021-11-17 12:58:08 +09:00
Yu Watanabe 3e3b0d2a40 test-network: make udevd also generate debugging logs 2021-11-17 08:32:45 +09:00
Yu Watanabe 7a2e124b08 test-network: add testcases for Token=prefixstable with UUID 2021-11-14 13:29:44 +09:00
Yu Watanabe 0b251e8bf9 test-network: add testcases for CAKE settings 2021-11-09 10:58:44 +09:00
Yu Watanabe ab7b261663 Merge pull request #21210 from yuwata/network-dhcp-server-introduce-router-setting
network: dhcp-server: introduce Router= setting to specify router address
2021-11-03 12:41:34 +09:00
Yu Watanabe 32d97330df test-network: add a testcase for Router= setting 2021-11-03 03:15:05 +09:00
Yu Watanabe 0874be35c3 test-network: add test case for MTUBytes= for veth 2021-11-02 12:35:07 +09:00
Yu Watanabe 1ac845ffbe test-network: add more tests for [Address] section 2021-10-28 02:12:34 +09:00
Yu Watanabe 8edcd775e8 test-network: add tests for invalid [IPv6AddressLabel] section 2021-10-28 01:40:19 +09:00
Yu Watanabe 3dfa7311e2 test-network: add tests for invalid IPv6 token 2021-10-28 01:17:14 +09:00
Yu Watanabe caad88a22b test-network: add test cases for DHCPv6 prefix delegation 2021-10-26 20:43:10 +09:00
Yu Watanabe 5b47f35d0e test-network: reconfigure interface instead of restarting networkd 2021-10-26 08:20:29 +09:00
Frantisek Sumsal 035af7adfe test: disable ProtectHome= when collecting coverage as well
Depending on the location of the original build dir, either ProtectHome=
or ProtectSystem= may get in the way when creating the gcov metadata
files.

Follow-up to:
    * 02d7e73013
    * 6c9efba677
2021-10-23 21:27:20 +02:00
Frantisek Sumsal 6c9efba677 test: loosen certain sandbox restrictions when collecting coverage
With `ProtectSystem=strict` gcov is unable to write the *.gcda files
with collected coverage. Let's add a yet another switch to make such
restriction less strict to make gcov happy.

This addresses following errors:
```
...
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/binfmt-util.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/base-filesystem.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/barrier.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/ask-password-api.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/apparmor-util.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/acpi-fpdt.c.gcda:Cannot open
...
```
2021-10-21 17:36:45 +02:00
Frantisek Sumsal dded88acb9 test: wait a bit for the given PID to die if it's still alive
When playing around with the coverage-enabled build I kept hitting
an issue where dnsmasq failed to start because the previous instance was
still shutting down. This should, hopefully, help to mitigate that.
2021-10-21 15:59:57 +02: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