From 553256145994c4dc4542c80f21b0734871bba448 Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Wed, 25 Jun 2025 13:24:45 +0200 Subject: [PATCH] LU-19127 tests: Fix namespace setup in sanity-sec 75a Sanity-sec 75a initially sets up a trusted and tenant nodemap where the trusted client creates the namespace necessary for the test. Among other, the trusted client uses "echo" via "do_node" to redirect a string into a file which is read later for verification. However, because the "do_node" command uses "echo" with redirection (">") and it is quoted incorrectly, the command only works if the trusted client is the executing test client, i.e., equivalent to client "client_arr[0]". This is not guaranteed in Auster and if the "tenant" client is the client executing the test, its view on the namespace is different as it is mounted on a different fileset, causing the error that the directory was not found. This patch fixes this, so the correct client is always running the "do_node" command. Fixes: 719f6763fe ("LU-18756 sec: add resource id check to oss and mds") Test-Parameters: trivial testlist=sanity-sec env=ONLY=75a Signed-off-by: Marc Vef Change-Id: I4be96839b93bbc43cc93bd4fd675339633bad247 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59935 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-sec.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index e023d71..cf214db 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -8095,7 +8095,7 @@ setup_namespace_75a() { local tenant_file=$1 local tenant_dir=$2 local offset=$3 - $run_as_trusted echo "abc" > ${fileset_subdir}/$tenant_file || + $run_as_trusted "echo \"abc\" > ${fileset_subdir}/$tenant_file" || error "echo $tenant_file failed" $run_as_trusted mkdir -p ${fileset_subdir}/$tenant_dir || error "mkdir $tenant_dir failed" @@ -8111,7 +8111,7 @@ setup_namespace_75a() { # setup testfiles and testdirectories. *_trusted files/dirs are # world-accessible, but become inaccessible once the id_check is enabled - $run_as_trusted echo "abc" > ${fileset_subdir}/$tfile_trusted || + $run_as_trusted "echo \"abc\" > ${fileset_subdir}/$tfile_trusted" || error "echo $tfile_trusted failed" $run_as_trusted mkdir ${fileset_subdir}/$tdir_trusted || error "mkdir $tdir_trusted failed" @@ -8138,7 +8138,7 @@ setup_namespace_75a() { error "chown ${tfile_tenant}_dom failed" # create a file used in write tests - $run_as_trusted echo "def" > ${fileset_subdir}/$tf_write || + $run_as_trusted "echo \"def\" > ${fileset_subdir}/$tf_write" || error "echo $tf_write failed" $run_as_trusted chown \ $((offset_start+ID0)):$((offset_start+ID0)) \ -- 1.8.3.1