summaryrefslogtreecommitdiffstats
path: root/tests/basic/ctime/ctime-noatime.t
blob: d71528c566c798feb0cfa9945b00cc00a378263b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../afr.rc
cleanup;

function atime_compare {
    local atime=$1
    local file_name=$2
    local atime1=$(stat -c "%X" $file_name)

    if [ $atime == $atime1 ]
    then
        echo "0"
    else
        echo "1"
    fi
}

TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 performance.stat-prefetch off
TEST $CLI volume set $V0 performance.read-ahead off
TEST $CLI volume set $V0 performance.quick-read off
TEST $CLI volume set $V0 performance.read-after-open off
TEST $CLI volume set $V0 performance.open-behind off
TEST $CLI volume set $V0 performance.write-behind off
TEST $CLI volume set $V0 performance.io-cache off

TEST $CLI volume set $V0 utime on
TEST $CLI volume set $V0 ctime on
TEST $CLI volume start $V0

TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;

cd $M0
TEST "echo hello_world > FILE"
atime1=$(stat -c "%X" FILE)

TEST "cat FILE > /dev/null"
EXPECT "0" atime_compare $atime1 FILE

sleep 1

TEST $CLI volume set $V0 noatime off
TEST "cat FILE > /dev/null"
EXPECT "1" atime_compare $atime1 FILE

cd -
cleanup