Whamcloud - gitweb
LU-16492 tests: sanity/398b variable used without assignment 87/49687/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Thu, 19 Jan 2023 02:41:43 +0000 (08:11 +0530)
committerOleg Drokin <green@whamcloud.com>
Tue, 31 Jan 2023 02:35:08 +0000 (02:35 +0000)
This patch initilizes 'before' variable with UNIX
timestamp. Variable 'before' was used without assigning
any value.

Test-Parameters: trivial testlist=sanity env=ONLY=398b
Fixes: b4880f37582a ("LU-15483 tests: Improve test 398b")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Iba9e361735272d9c640a115f520ee7c60ac41239
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49687
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 439d2db..9f7134e 100755 (executable)
@@ -25076,26 +25076,29 @@ test_398a() { # LU-4198
 run_test 398a "direct IO should cancel lock otherwise lockless"
 
 test_398b() { # LU-4198
+       local before=$(date +%s)
+       local njobs=4
+       local size=48
+
        which fio || skip_env "no fio installed"
        $LFS setstripe -c -1 -S 1M $DIR/$tfile
-
-       local size=48
        dd if=/dev/zero of=$DIR/$tfile bs=1M count=$size
 
-       local njobs=4
        # Single page, multiple pages, stripe size, 4*stripe size
        for bsize in $(( $PAGE_SIZE )) $(( 4*$PAGE_SIZE )) 1048576 4194304; do
                echo "mix direct rw ${bsize} by fio with $njobs jobs..."
                fio --name=rand-rw --rw=randrw --bs=$bsize --direct=1 \
                        --numjobs=$njobs --fallocate=none \
-                       --iodepth=16 --allow_file_create=0 --size=$((size/njobs))M \
+                       --iodepth=16 --allow_file_create=0 \
+                       --size=$((size/njobs))M \
                        --filename=$DIR/$tfile &
                bg_pid=$!
 
                echo "mix buffer rw ${bsize} by fio with $njobs jobs..."
                fio --name=rand-rw --rw=randrw --bs=$bsize \
                        --numjobs=$njobs --fallocate=none \
-                       --iodepth=16 --allow_file_create=0 --size=$((size/njobs))M \
+                       --iodepth=16 --allow_file_create=0 \
+                       --size=$((size/njobs))M \
                        --filename=$DIR/$tfile || true
                wait $bg_pid
        done