From: Sebastien Buisson Date: Thu, 30 Sep 2021 14:02:36 +0000 (+0200) Subject: DDN-2073 tests: fix sanity-sec test_15 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=84ff195bd33c4251b927cf4e1285475d37d97949;p=fs%2Flustre-release.git DDN-2073 tests: fix sanity-sec test_15 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 Reviewed-on: https://review.whamcloud.com/45100 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index a45b16e..6f3c54d 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -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 diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 8f11d9a..87309ac 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -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);