Whamcloud - gitweb
b=23766 atime is not updated properly
authorAndrew Perepechko <andrew.perepechko@oracle.com>
Thu, 18 Nov 2010 12:35:02 +0000 (15:35 +0300)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Thu, 18 Nov 2010 12:35:02 +0000 (15:35 +0300)
a test case for atime updates on an MDS

i=Johann Lombardi
i=Andreas Dilger

lustre/tests/sanity.sh

index af4bd91..e771b1d 100644 (file)
@@ -6804,6 +6804,28 @@ test_202() {
 }
 run_test 202 "O_APPEND+O_DIRECT multistripe write ========================"
 
+test_203() {
+        local ATIME=`do_facet mds lctl get_param -n mds.*.atime_diff`
+        echo "atime should be updated on the MDS when closing file" > $DIR/$tfile
+        sync
+        # reads should update atime on the client and close should update it on the MDS
+        multiop_bg_pause $DIR/$tfile o_r20c || return 1
+        MULTIPID=$!
+        sleep $((ATIME+1))
+        time1=`date +%s`
+        log "now is $time1"
+        kill -USR1 $MULTIPID || return 2
+        echo "starting reads"
+        wait
+        cancel_lru_locks osc
+        cancel_lru_locks mdc
+        time2=`stat -c "%X" $DIR/$tfile`
+        loh "new atime is $time2"
+        [ "$time2" -ge "$time1" ] || error "atime was not updated"
+}
+run_test 203 " atime should be updated on the MDS when closing file ===="
+
+
 #
 # tests that do cleanup/setup should be run at the end
 #