test-execute fails in LXD with failure in exec-networknamespacepath-privatemounts-no.service
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
High
|
Nick Rosbrook |
Bug Description
This is in v255. This log snippet is taken from a local autopkgtest build:
exec-networknam
exec-networknam
exec-networknam
exec-networknam
exec-networknam
exec-networknam
Serializing sd-executor-state to memfd.
exec-networknam
Closing set fd 19 (socket:[109908])
Closing set fd 21 (socket:[111151])
Closing set fd 20 (socket:[111150])
Received SIGCHLD from PID 4581 (sh).
Child 4581 (sh) died (code=exited, status=1/FAILURE)
exec-networknam
exec-networknam
exec-networknam
exec-networknam
exec-networknam
exec-networknam
exec-networknam
src/test/
(test-execute-
Assertion 'r >= 0' failed at src/test/
Changed in systemd (Ubuntu): | |
importance: | Undecided → High |
assignee: | nobody → Nick Rosbrook (enr0n) |
The issue with this is that during the test setup, adding the dummy-test-ns interface to the test-execute-netns network namespace fails with EPERM, but this return code is not checked at all:
...
have_net_ dummy = system("ip link add dummy-test-exec type dummy") == 0;
/* Create dummy network interface for testing PrivateNetwork=yes */
if (have_net_dummy) { ePath= */
(void) system("ip netns add test-execute- netns") ;
(void) system("ip netns exec test-execute-netns ip link add dummy-test-ns type dummy");
/* Create a network namespace and a dummy interface in it for NetworkNamespac
}
...
Running these commands manually in the LXD environment that the tests run in:
# ip link add dummy-test-exec type dummy
# ip netns add test-execute-netns
# ip netns exec test-execute-netns ip link add dummy-test-ns type dummy
mount of /sys failed: Operation not permitted
The right solution might be to make the test case dependent on the success of those setup calls, similar to what is done with `have_net_dummy`.