From 75b782be4fb8ad9ada34ea3c4a1de6aab4baca71 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 31 Mar 2020 12:13:25 +0200 Subject: [PATCH] test/lvol: Add function for calculating ceiling integers This is meant to reassemble python's math.ceil() that was used throughout the test_cases.py in couple of places. Change-Id: I0d7d13ffd1121b12d58f00fb6ca59d76a237802e Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/933 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Darek Stojaczyk --- test/lvol/common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/lvol/common.sh b/test/lvol/common.sh index f3cbbc945..695af9e5d 100644 --- a/test/lvol/common.sh +++ b/test/lvol/common.sh @@ -47,3 +47,7 @@ function run_fio_test() { fio_template="fio --name=fio_test --filename=$file --offset=$offset --size=$size --rw=$rw --direct=1 $extra_params $pattern_template" $fio_template } + +function calc() { + bc -l <<< "define ceil(x) { scale=0; return(x + (x % 1 > 0))/1 } $1" +}