From 67357c844a3bfb78884821494bce9747da0e68b7 Mon Sep 17 00:00:00 2001 From: catborise Date: Fri, 20 Nov 2026 20:38:44 +0300 Subject: [PATCH] test: the install-lib failed-write check fails for root too The socket live suite runs as root inside a compute, where a 500 directory is still writable: the check that a failed write leaves no local settings put a directory where the part file goes instead. Found by the full live run before v5.0.0. --- webvirtcloud/tests/sh/install_lib.test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webvirtcloud/tests/sh/install_lib.test.sh b/webvirtcloud/tests/sh/install_lib.test.sh index 4f7469dd..ad760129 100755 --- a/webvirtcloud/tests/sh/install_lib.test.sh +++ b/webvirtcloud/tests/sh/install_lib.test.sh @@ -31,9 +31,10 @@ check "local settings written" "[ \"\$(cat '$tmp/data/local_settings.py')\" = FI check "local settings mode 600" "[ \"\$(stat -c %a '$tmp/data/local_settings.py')\" = 600 ]" check "local settings return 1 when present" "! echo SECOND | wvc_ensure_local_settings '$tmp/data' >/dev/null" check "existing local settings kept" "[ \"\$(cat '$tmp/data/local_settings.py')\" = FIRST ]" -mkdir "$tmp/ro" && chmod 500 "$tmp/ro" +# a directory where the part file goes: the write fails, for root too +mkdir -p "$tmp/ro/local_settings.py.part" wvc_ensure_local_settings "$tmp/ro" < /dev/null 2>/dev/null; rc=$? -check "a failed write returns 2 and leaves no file" "[ $rc = 2 ] && [ ! -e '$tmp/ro/local_settings.py' ] && [ ! -e '$tmp/ro/local_settings.py.part' ]" +check "a failed write returns 2 and leaves no file" "[ $rc = 2 ] && [ ! -e '$tmp/ro/local_settings.py' ]" # wvc_harden_modes mkdir -p "$tmp/app/data"