Whamcloud - gitweb
DDN-2073 tests: fix sanity-sec test_15
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 30 Sep 2021 14:02:36 +0000 (16:02 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 1 Oct 2021 23:19:59 +0000 (23:19 +0000)
sanity-sec test_15 should not inherit trusted and admin properties for
newly created nodemaps from the default nodemap. Instead, it must
explicitly set both to 0, as the whole point is to exercise id
mappings.

Test-Parameters: trivial testlist=sanity-sec
Test-Parameters: clientdistro=ubuntu2004 testlist=sanity-sec
Change-Id: Ie80a10528268024d59cd079949620ebd1a836395
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-on: https://review.whamcloud.com/45100
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity-sec.sh
lustre/utils/obd.c

index a45b16e..6f3c54d 100755 (executable)
@@ -990,6 +990,20 @@ test_15() {
        rc=$?
        [[ $rc != 0 ]] && error "nodemap_add failed with $rc" && return 1
 
+       for (( i = 0; i < NODEMAP_COUNT; i++ )); do
+               local csum=${HOSTNAME_CHECKSUM}_${i}
+
+               if ! do_facet mgs $LCTL nodemap_modify --name $csum \
+                               --property admin --value 0; then
+                       rc=$((rc + 1))
+               fi
+               if ! do_facet mgs $LCTL nodemap_modify --name $csum \
+                               --property trusted --value 0; then
+                       rc=$((rc + 1))
+               fi
+       done
+       [[ $rc != 0 ]] && error "nodemap_modify failed with $rc" && return 1
+
        rc=0
        for ((i = 0; i < NODEMAP_COUNT; i++)); do
                if ! add_range ${HOSTNAME_CHECKSUM}_${i} $i; then
index 8f11d9a..87309ac 100644 (file)
@@ -4185,7 +4185,7 @@ int jt_nodemap_test_id(int argc, char **argv)
        }
 
        rc = nodemap_cmd(LCFG_NODEMAP_TEST_ID, &rawbuf, sizeof(rawbuf),
-                        argv[0], nidstr, typestr, idstr);
+                        argv[0], nidstr, typestr, idstr, NULL);
        if (rc == 0)
                printf("%s\n", (char *)rawbuf);