Whamcloud - gitweb
LU-13174 tests: sanity-quota to convert minutes into seconds 27/37327/5
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 27 Jan 2020 08:03:20 +0000 (11:03 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 14 May 2020 05:41:34 +0000 (05:41 +0000)
before arithmetic opertions

Change-Id: Iaefcd01dfe2066256010c2d195414a689c9f7573
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37327
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh

index d2c07d8..90b80b0 100755 (executable)
@@ -366,6 +366,14 @@ wait_grace_time() {
                        ;;
        esac
 
+       # from lfs.c:__sec2str()
+       # const char spec[] = "smhdw";
+       # {1, 60, 60*60, 24*60*60, 7*24*60*60};
+       [[ $time == *m* ]] && time=${time//m/} && time=$((time*60));
+       [[ $time == *h* ]] && time=${time//h/} && time=$((time*60*60));
+       [[ $time == *d* ]] && time=${time//d/} && time=$((time*24*60*60));
+       [[ $time == *w* ]] && time=${time//w/} && time=$((time*7*24*60*60));
+
        echo "Sleep through grace ..."
        [ "$time" == "-" ] &&
            error "Grace timeout was not set or quota not exceeded"