From acf00ba7b5e38119983f100a89a48655a3eee0b0 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 4 Mar 2026 12:32:15 +0100 Subject: [PATCH] test: don't register short-living containers with machined, again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we might try to register the same scope again before the previous instance gets a chance to be cleaned up: [ 54.378392] systemd-nspawn[2554]: ░ Spawning container TEST-13-NSPAWN.defaultinaccessiblepaths.nxs on /var/lib/machines/TEST-13-NSPAWN.default_inaccessible_paths.nxs. [ 54.382202] systemd-nspawn[2554]: Failed to allocate scope: Unit TEST-13-NSPAWN.defaultinaccessiblepaths.nxs.scope was already loaded or has a fragment file. [ 54.411211] systemd[1]: TEST-13-NSPAWN.service: Main process exited, code=exited, status=1/FAILURE [ 54.411413] systemd[1]: TEST-13-NSPAWN.service: Failed with result 'exit-code'. [ 54.411885] systemd[1]: Failed to start TEST-13-NSPAWN.service - TEST-13-NSPAWN. This is basically the same change as in 6a05abb9b49900774bc0323316103dceab0c1a7d but for the newly added tests. Follow-up for 83b8daa032cd0adb538cfd9467e6acf2c44aa661. Resolves: #40945 --- test/units/TEST-13-NSPAWN.nspawn.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/units/TEST-13-NSPAWN.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh index c753734c33..d5cc05b89f 100755 --- a/test/units/TEST-13-NSPAWN.nspawn.sh +++ b/test/units/TEST-13-NSPAWN.nspawn.sh @@ -414,7 +414,7 @@ testcase_check_default_inaccessible_paths() { # Each inaccessible path should have zeroed permissions, which stat's %a reports as a single 0 for path in "${inaccessible_paths[@]}"; do - systemd-nspawn --directory="$root" \ + systemd-nspawn --register=no --directory="$root" \ bash -xec "ls -l $path; [[ \$(stat --format=%a $path) -eq 0 ]]" done @@ -422,14 +422,14 @@ testcase_check_default_inaccessible_paths() { # as writable, and it also skips the path masking (by dropping the MOUNT_APPLY_APIVFS_RO flag) for path in "${inaccessible_paths[@]}"; do exp="$(stat --format=%a "$path")" - SYSTEMD_NSPAWN_API_VFS_WRITABLE=yes systemd-nspawn --directory="$root" \ + SYSTEMD_NSPAWN_API_VFS_WRITABLE=yes systemd-nspawn --register=no --directory="$root" \ bash -xec "ls -l $path; [[ \$(stat --format=%a $path) -eq $exp ]]" done # SYSTEMD_NSPAWN_API_VFS_WRITABLE=network mounts only /proc/sys/net/ as writable but doesn't # drop the MOUNT_APPLY_APIVFS_RO flag, so the masking should still apply for path in "${inaccessible_paths[@]}"; do - SYSTEMD_NSPAWN_API_VFS_WRITABLE=network systemd-nspawn --directory="$root" \ + SYSTEMD_NSPAWN_API_VFS_WRITABLE=network systemd-nspawn --register=no --directory="$root" \ bash -xec "ls -l $path; [[ \$(stat --format=%a $path) -eq 0 ]]" done