Luca Boccassi
75844b44ee
Merge pull request #22408 from mrc0mmand/test-network-cleanup
...
test-network: code cleanup
2022-02-03 22:50:38 +00:00
Frantisek Sumsal
87bf983c55
test-network: disable irrelevant or one-time pylint checks
2022-02-03 19:31:15 +01:00
Frantisek Sumsal
54e2f32f50
test-network: use specific exceptions instead of the Exception class
2022-02-03 19:30:11 +01:00
Frantisek Sumsal
a561bceeaa
test-network: avoid name clashing/redefinition
2022-02-03 19:20:42 +01:00
Frantisek Sumsal
524cc9d1d8
test-network: disable 'no-member' warning for the Utilities class
...
The warning is correct, since we don't inherit the necessary
unittest.TestCase class, but that's on purpose, since the Utilities
class is not supposed to be instantiated on its own, but should
complement other classes' definitions which do inherit from the
unittest.TestCase class.
2022-02-03 19:13:06 +01:00
Frantisek Sumsal
283863a116
test-network: use raw strings for regexes with backslashes
...
It currently works because `\(` and `\)` are not valid escape sequences,
so they're not treated differently. Using raw strings (or double
backslashes) is a more correct solution.
2022-02-03 18:55:12 +01:00
Frantisek Sumsal
535e8107ee
test-network: explicitly set check=False for subprocess.run()
...
since we're checking the returned error code explicitly via the
`returncode` member.
2022-02-03 18:49:35 +01:00
Frantisek Sumsal
f7805a6c79
test-network: convert certain multiline strings to comments
...
Multiline comments are converted to docstrings only when they're the
first statement in a function/method. Even though they're still a no-op
otherwise, let's use "true" comments to make pylint happy.
2022-02-03 18:42:41 +01:00
Frantisek Sumsal
45dbd0b945
test-network: drop unused variables
2022-02-03 18:18:29 +01:00
Frantisek Sumsal
19aa7f99c7
test-network: drop unnecessary else statements
2022-02-03 18:18:29 +01:00
Frantisek Sumsal
6983bb0e5e
test-network: drop unnecessary semicolons
2022-02-03 18:18:27 +01:00
Frantisek Sumsal
83bceef027
test-network: drop superfluous parens
2022-02-03 18:10:06 +01:00
Yu Watanabe
7809cab717
test-network: add testcase for external tunnel
2022-02-03 11:12:34 +09:00
Yu Watanabe
6a8ab6dd1e
Merge pull request #22332 from yuwata/network-dhcp-server-dns-server-address
...
network: dhcp-server: allow to specify server address for DNS= or friends
2022-02-02 07:07:22 +09:00
Yu Watanabe
c5f7a08739
test-network: add tests for DNS=_server_address in [DHCPServer]
2022-02-02 05:01:59 +09:00
Luca Boccassi
98fd285c28
Merge pull request #22331 from yuwata/network-xfrm-interface-id
...
network: xfrm: refuse zero interface ID
2022-02-01 13:25:38 +00:00
Yu Watanabe
020483b248
test-network: set xfrm interface ID
...
This also unifies two tests for xfrm, and checks the output of
'ip link' command.
Fixes #22329 .
2022-02-01 13:26:43 +09:00
Yu Watanabe
a0e99a377a
network: remove only managed configs on reconfigure or carrier lost
...
Otherwise, if the carrir of the non-managed interface is lost, the
configs such as addresses or routes on the interface will be removed by
networkd.
2022-02-01 11:30:37 +09:00
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