X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=fd78e64dd6e153bca2a0f2fe401db75f4d68cbf6;hb=7101742b4590542e9e6d1590d0ac5e692109f9da;hp=fed78965a61d0183dae95256bfb47b83ba77fa1f;hpb=5b07dce19b1830769d7a1f7bba8b559d3ead9dfb;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index fed7896..fd78e64 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -31971,6 +31971,49 @@ test_850() { } run_test 850 "lljobstat can parse living and aggregated job_stats" +test_851() { + local dir=$DIR/$tdir + local file=$dir/f_test_851_$$ + local report=/tmp/report_test_851_$$ + local fanotify_prog=monitor_lustrefs + local pid + + test_mkdir $dir || error "failed to create dir $dir" + + $fanotify_prog $DIR > $report & + pid=$! + + sleep 1 + if ! kill -0 $pid; then + error "failed to start $fanoify_prog" + fi + + stack_trap "kill $pid" + 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" + grep -a -E "open.*:$file:" $report || + error "no open event for writing $file" + grep -a -E "write.*:$file:" $report || + error "no write event for writing $file" + grep -a -E "close.*:$file:" $report || + error "no close event for writing $file" + + > $report + cat $file + wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 || + error "fanotify did not report anything after 30 seconds" + grep -a -E "open.*:$file:" $report || + error "no open event for reading $file" + grep -a -E "read.*:$file:" $report || + error "no write event for reading $file" + grep -a -E "close.*:$file:" $report || + error "no close event for reading $file" +} +run_test 851 "fanotify can monitor open/read/write/close events for lustre fs" + # # tests that do cleanup/setup should be run at the end #