From: Lei Feng Date: Thu, 1 Aug 2024 07:34:25 +0000 (+0800) Subject: LU-17679 tests: make stdout unbuffered in sanity/851 X-Git-Tag: 2.15.65~5 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ace60bbdfdb00b35e1a94acf9482c262aa99c588;p=fs%2Flustre-release.git LU-17679 tests: make stdout unbuffered in sanity/851 Make stdout unbuffered in sanity/test_851. So that the output can be detected ASAP. Fixes: 7101742b459 ("LU-17490 tests: verify fanotify works for lustre") Signed-off-by: Lei Feng Test-Parameters: trivial Test-Parameters: testlist=sanity env=ONLY=851,ONLY_REPEAT=1000 Change-Id: I852a73b6bbdcbae7dfe1704183d4cb3c8200be43 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55904 Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Li Xi Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/tests/monitor_lustrefs.c b/lustre/tests/monitor_lustrefs.c index b9fdf364..2ab0db8 100644 --- a/lustre/tests/monitor_lustrefs.c +++ b/lustre/tests/monitor_lustrefs.c @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) len = read(fd, (void *)&buf[0], sizeof(buf)); if (len < 0 && errno != EAGAIN) { fprintf(stderr, - "failed to read from fanotiify file descriptor." + "failed to read from fanotify file descriptor." " %d:%s", errno, strerror(errno)); exit(EXIT_FAILURE); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 8a2662b..913fb6e 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -33134,7 +33134,7 @@ test_851() { test_mkdir $dir || error "failed to create dir $dir" - $fanotify_prog $DIR > $report & + stdbuf -o0 $fanotify_prog $DIR > $report & pid=$! sleep 1 @@ -33146,8 +33146,8 @@ test_851() { stack_trap "rm -f $report" echo "1234567890" > $file - wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 || - error "fanotify did not report anything after 30 seconds" + wait_update_cond localhost "stat -c %s $report" "-gt" "0" 60 || + error "fanotify did not report anything after 60 seconds" grep -a -E "open.*:$file:" $report || error "no open event for writing $file" grep -a -E "write.*:$file:" $report || @@ -33157,8 +33157,8 @@ test_851() { > $report cat $file - wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 || - error "fanotify did not report anything after 30 seconds" + wait_update_cond localhost "stat -c %s $report" "-gt" "0" 60 || + error "fanotify did not report anything after 60 seconds" grep -a -E "open.*:$file:" $report || error "no open event for reading $file" grep -a -E "read.*:$file:" $report ||