]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd-test: lazy umount tmp directories
authorLuca Boccassi <bluca@debian.org>
Fri, 8 Apr 2022 22:52:38 +0000 (23:52 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 9 Apr 2022 01:27:10 +0000 (10:27 +0900)
In Semaphore CI, for some reason, /run/systemd/resolve is busy so the umount
fails at the end of the test run:

Verify link states with Unmanaged= settings, cold-plug. ... umount: /run/systemd/resolve: target is busy.14:57
ok14:57
ERROR14:57
======================================================================14:57
ERROR: tearDownModule (__main__)14:57
----------------------------------------------------------------------14:57
Traceback (most recent call last):14:57
  File /tmp/autopkgtest-lxc.6islza9t/downtmp/build.A9b/src/test/networkd-test.py, line 94, in tearDownModule14:57
    subprocess.check_call([umount, d])14:57
  File /usr/lib/python3.9/subprocess.py, line 373, in check_call14:57
    raise CalledProcessError(retcode, cmd)14:57
subprocess.CalledProcessError: Command '['umount', '/run/systemd/resolve']' returned non-zero exit status 32.14:57
----------------------------------------------------------------------14:58
Ran 35 tests in 138.868s14:58
FAILED (errors=1, skipped=2)

Use lazy umount to avoid erroring out.

test/networkd-test.py

index 7faa12ef793f803d54bed2206fcd19a5e5c1b2bf..1001cd7cc8eb8a0be0bb7e55859a4dd15013f502 100755 (executable)
@@ -91,7 +91,7 @@ def setUpModule():
 def tearDownModule():
     global tmpmounts
     for d in tmpmounts:
-        subprocess.check_call(["umount", d])
+        subprocess.check_call(["umount", "--lazy", d])
     for u in stopped_units:
         subprocess.call(["systemctl", "stop", u])
     for u in running_units: