Whamcloud - gitweb
LU-8340 tests: in sanity-sec 25 client nodemap must be admin 50/22750/3
authorKit Westneat <kit.westneat@gmail.com>
Tue, 27 Sep 2016 02:30:02 +0000 (22:30 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 5 Oct 2016 03:51:14 +0000 (03:51 +0000)
If the ENABLE_QUOTA is set, then cleanup_and_setup_lustre will use
the client node to setup quota, which requires admin privileges on
the nodemap. This patch enables admin privileges on all clients
before calling cleanup_and_setup_lustre.

Test-Parameters: envdefinitions=ENABLE_QUOTA=yes
Signed-off-by: Kit Westneat <kit.westneat@gmail.com>
Change-Id: If8d92d20aaa8cf75e3d443d1a81ff2f201d118cc
Reviewed-on: http://review.whamcloud.com/22750
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-sec.sh

index 289711a..a9a07e4 100755 (executable)
@@ -1581,6 +1581,7 @@ test_25() {
        local tmpfile=$(mktemp)
        local tmpfile2=$(mktemp)
        local subdir=c0dir
+       local client
 
        nodemap_version_check || return 0
 
@@ -1590,8 +1591,16 @@ test_25() {
 
        nodemap_test_setup
 
-       echo c* nodemaps:
-       do_facet mgs $LCTL get_param nodemap.c*.*
+       # enable trusted/admin for setquota call in cleanup_and_setup_lustre()
+       i=0
+       for client in $clients; do
+               do_facet mgs $LCTL nodemap_modify --name c${i} \
+                       --property admin --value 1
+               do_facet mgs $LCTL nodemap_modify --name c${i} \
+                       --property trusted --value 1
+               ((i++))
+       done
+       wait_nm_sync c$((i - 1)) trusted_nodemap
 
        trap nodemap_test_cleanup EXIT