From 6a012fe89a63cea5b0f1008125c5df319c4986cb Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Fri, 29 May 2020 12:38:43 +0300 Subject: [PATCH] LU-12905 tests: wrappers for createmany and unlinkmany which set debug=0 if number of operations is high enough. this is to speedup testing. according to Maloo sanity in review-ldiskfs takes ~9min less. Signed-off-by: Alex Zhuravlev Change-Id: I0e0a0ef6cf217ecddd1b780103d01e2109fc33d9 Reviewed-on: https://review.whamcloud.com/36585 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Olaf Faaland-LLNL Reviewed-by: Oleg Drokin --- lustre/tests/test-framework.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index bec90b5..fcbd4d1 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -10436,3 +10436,40 @@ statx_supported() { $STATX --quiet --version return $? } + +# +# wrappers for createmany and unlinkmany +# to set debug=0 if number of creates is high enough +# this is to speedup testing +# +function createmany() { + local count=${!#} + + (( count > 100 )) && { + local saved_debug=$($LCTL get_param -n debug) + local list=$(comma_list $(all_nodes)) + + do_nodes $list $LCTL set_param debug=0 + } + $LUSTRE/tests/createmany $* + local rc=$? + (( count > 100 )) && + do_nodes $list "$LCTL set_param debug=\\\"$saved_debug\\\"" + return $rc +} + +function unlinkmany() { + local count=${!#} + + (( count > 100 )) && { + local saved_debug=$($LCTL get_param -n debug) + local list=$(comma_list $(all_nodes)) + + do_nodes $list $LCTL set_param debug=0 + } + $LUSTRE/tests/unlinkmany $* + local rc=$? + (( count > 100 )) && + do_nodes $list "$LCTL set_param debug=\\\"$saved_debug\\\"" + return $rc +} -- 1.8.3.1