]> git.ipfire.org Git - thirdparty/systemd.git/commit - test/test-network/systemd-networkd-tests.py
tests: also use lsmod to check whether modules are available (#10634)
authorEvgeny Vereshchagin <evvers@ya.ru>
Mon, 5 Nov 2018 03:47:38 +0000 (06:47 +0300)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Nov 2018 03:47:38 +0000 (12:47 +0900)
commit201bf07f7c5467928a0dd6c91ef298f144151740
treecc8c0e5341c2336d7f4f62298c073e9cf6cf0ec5
parentaaa501859f79a188a0f31e60e2912b54b26ed104
tests: also use lsmod to check whether modules are available (#10634)

It's not entirely impossible to screw something up playing with
kernel modules on a Saturday evening :-) This PR fixes a scenario
where a module has been loaded into the kernel but the module itself
has been removed from the disk.

```
$ lsmod | grep wireg
wireguard             225280  0
ip6_udp_tunnel         16384  1 wireguard
udp_tunnel             16384  1 wireguard

$ modprobe wireguard
modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.18.16-200.fc28.x86_64

$ sudo ./systemd-networkd-tests.py NetworkdNetDevTests.test_wireguard
...
modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.18.16-200.fc28.x86_64
test_wireguard (__main__.NetworkdNetDevTests) ... unexpected success

----------------------------------------------------------------------
Ran 1 test in 5.152s

FAILED (unexpected successes=1)
```

This is a follow-up to https://github.com/systemd/systemd/pull/10625.
test/test-network/systemd-networkd-tests.py