[Bug 2046498] Re: test-execute fails in LXD with failure in exec-networknamespacepath-privatemounts-no.service

Nick Rosbrook 2046498 at bugs.launchpad.net
Tue Jan 9 16:32:42 UTC 2024


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:

...
        /* Create dummy network interface for testing PrivateNetwork=yes */
        have_net_dummy = system("ip link add dummy-test-exec type dummy") == 0;

        if (have_net_dummy) {
                /* Create a network namespace and a dummy interface in it for NetworkNamespacePath= */
                (void) system("ip netns add test-execute-netns");
                (void) system("ip netns exec test-execute-netns ip link add dummy-test-ns type dummy");
        }
...

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`.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2046498

Title:
  test-execute fails in LXD with failure in exec-networknamespacepath-
  privatemounts-no.service

Status in systemd package in Ubuntu:
  New

Bug description:
  This is in v255. This log snippet is taken from a local autopkgtest
  build:

  exec-networknamespacepath-privatemounts-no.service: Child 4580 belongs to exec-networknamespacepath-privatemounts-no.service.
  exec-networknamespacepath-privatemounts-no.service: Main process exited, code=exited, status=0/SUCCESS (success)
  exec-networknamespacepath-privatemounts-no.service: Running next main command for state start.
  exec-networknamespacepath-privatemounts-no.service: Will spawn child (service_run_next_main): /bin/sh
  exec-networknamespacepath-privatemounts-no.service: Passing 0 fds to service
  exec-networknamespacepath-privatemounts-no.service: About to execute: /bin/sh -x -c "ip link show dummy-test-ns"
  Serializing sd-executor-state to memfd.
  exec-networknamespacepath-privatemounts-no.service: Forked /bin/sh as 4581
  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-networknamespacepath-privatemounts-no.service: Child 4581 belongs to exec-networknamespacepath-privatemounts-no.service.
  exec-networknamespacepath-privatemounts-no.service: Main process exited, code=exited, status=1/FAILURE
  exec-networknamespacepath-privatemounts-no.service: Failed with result 'exit-code'.
  exec-networknamespacepath-privatemounts-no.service: Service will not restart (restart setting)
  exec-networknamespacepath-privatemounts-no.service: Changed start -> failed
  exec-networknamespacepath-privatemounts-no.service: Unit entered failed state.
  exec-networknamespacepath-privatemounts-no.service: Consumed 23ms CPU time.
  src/test/test-execute.c:1124:test_exec_networknamespacepath: exec-networknamespacepath-privatemounts-no.service: can_unshare=no: exit status 1, expected 0
  (test-execute-without-unshare) terminated by signal ABRT.
  Assertion 'r >= 0' failed at src/test/test-execute.c:1330, function prepare_ns(). Aborting.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2046498/+subscriptions




More information about the foundations-bugs mailing list