Whamcloud - gitweb
LU-15053 tests: sanity-quota_13 fix 97/55197/7
authorSergey Cheremencev <scherementsev@ddn.com>
Fri, 24 May 2024 16:28:47 +0000 (19:28 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Jul 2024 20:53:53 +0000 (20:53 +0000)
Scope a case when there are any extra users
with quota limit and non zero usage besides
TSTUSR and TSTUSR2. This is possible when
tests are started with ENABLE_QUOTA=yes.
In a such case each user may have a lock between
OST and QMT depending. Take this into account
in sanity-quota_13. Fix with following failure:

  sanity-quota test_13: @@@@@@ FAIL: 2 cached locks

Test-Parameters: trivial testlist=sanity-quota
Test-Parameters: testlist=sanity-quota env=ONLY=13,ONLY_REPEAT=100
Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: Iaf48d0eb80eef0fc5ebc8246e8fac3f9c96563c0
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55197
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh

index 236d145..654d633 100755 (executable)
@@ -2663,25 +2663,26 @@ test_13(){
 
        # clear the locks in cache first
        do_facet ost1 $LCTL set_param -n $procf=clear
-       local nlock=$(do_facet ost1 $LCTL get_param -n $procf)
-       [ $nlock -eq 0 ] || error "$nlock cached locks"
+       local init_nlock=$(do_facet ost1 $LCTL get_param -n $procf)
 
        # write to acquire the per-ID lock
        $RUNAS $DD of=$TESTFILE count=1 oflag=sync ||
                quota_error a $TSTUSR "dd failed"
 
-       nlock=$(do_facet ost1 $LCTL get_param -n $procf)
-       [ $nlock -eq 1 ] || error "lock count($nlock) isn't 1"
+       local nlock=$(do_facet ost1 $LCTL get_param -n $procf)
+       [ $nlock -eq $((init_nlock + 1)) ] ||
+               error "lock count($nlock) != $init_lock + 1"
 
        # clear quota doesn't trigger per-ID lock cancellation
        resetquota -u $TSTUSR
        nlock=$(do_facet ost1 $LCTL get_param -n $procf)
-       [ $nlock -eq 1 ] || error "per-ID lock is lost on quota clear"
+       [ $nlock -eq $((init_nlock + 1)) ] ||
+               error "per-ID lock is lost on quota clear"
 
        # clear the per-ID lock
        do_facet ost1 $LCTL set_param -n $procf=clear
        nlock=$(do_facet ost1 $LCTL get_param -n $procf)
-       [ $nlock -eq 0 ] || error "per-ID lock isn't cleared"
+       [ $nlock -eq $init_nlock ] || error "per-ID lock isn't cleared"
 
        # spare quota should be released
        local OSTUUID=$(ostuuid_from_index 0)