Whamcloud - gitweb
LU-19127 tests: Fix namespace setup in sanity-sec 75a 35/59935/2
authorMarc Vef <mvef@whamcloud.com>
Wed, 25 Jun 2025 11:24:45 +0000 (13:24 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jul 2025 04:00:14 +0000 (04:00 +0000)
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 <mvef@whamcloud.com>
Change-Id: I4be96839b93bbc43cc93bd4fd675339633bad247
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59935
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-sec.sh

index e023d71..cf214db 100755 (executable)
@@ -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)) \