diff options
author | Poornima G <pgurusid@redhat.com> | 2017-06-30 12:52:21 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-12-13 08:11:37 +0000 |
commit | c26cadd31dfa128c4ec6883f69d654813f351018 (patch) | |
tree | fd428b49ec15397920a5ff50974053683f949f4a /tests/basic | |
parent | 429f2436b33793136836042ccc43ce4cfd7f89f3 (diff) |
quick-read: Integrate quick read with upcall and increase cache time
Fixes : #261
Co-author: Subha sree Mohankumar <smohanku@redhat.com>
Change-Id: Ie9dd94e86459123663b9b200d92940625ef68eab
Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r-- | tests/basic/quick-read-with-upcall.t | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/basic/quick-read-with-upcall.t b/tests/basic/quick-read-with-upcall.t new file mode 100644 index 00000000000..318e93a1bf0 --- /dev/null +++ b/tests/basic/quick-read-with-upcall.t @@ -0,0 +1,69 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + #. $(dirname $0)/../volume.rc + +cleanup; + +#Basic checks +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info + +#Create a distributed volume +TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2}; +TEST $CLI volume start $V0 + +# Mount FUSE without selinux: +TEST glusterfs -s $H0 --volfile-id $V0 $M0; +TEST glusterfs -s $H0 --volfile-id $V0 $M1; + +D0="test-message0"; +D1="test-message1"; + +function write_to() +{ + local file="$1"; + local data="$2"; + echo "$data" > "$file"; +} + + +TEST write_to "$M0/test.txt" "$D0" +EXPECT "$D0" cat $M0/test.txt +EXPECT "$D0" cat $M1/test.txt + +TEST write_to "$M0/test.txt" "$D1" +EXPECT "$D1" cat $M0/test.txt +EXPECT "$D0" cat $M1/test.txt + +sleep 1 +EXPECT "$D1" cat $M1/test.txt + +TEST $CLI volume set $V0 features.cache-invalidation on +TEST $CLI volume set $V0 performance.qr-cache-timeout 60 +TEST $CLI volume set $V0 performance.md-cache-timeout 60 + +TEST write_to "$M0/test1.txt" "$D0" +EXPECT "$D0" cat $M0/test1.txt +EXPECT "$D0" cat $M1/test1.txt + +TEST write_to "$M0/test1.txt" "$D1" +EXPECT "$D1" cat $M0/test1.txt +EXPECT "$D0" cat $M1/test1.txt + +sleep 1 +EXPECT "$D0" cat $M1/test1.txt + +sleep 60 +EXPECT "$D1" cat $M1/test1.txt + +TEST $CLI volume set $V0 performance.cache-invalidation on + +TEST write_to "$M0/test2.txt" "$D0" +EXPECT "$D0" cat $M0/test2.txt +EXPECT "$D0" cat $M1/test2.txt + +TEST write_to "$M0/test2.txt" "$D1" +EXPECT "$D1" cat $M0/test2.txt +EXPECT "$D1" cat $M1/test2.txt |