diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2014-01-28 12:49:39 +0000 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2014-01-28 12:49:39 +0000 |
commit | 738e76f0799fa598eac308144174c6cf9db21b7a (patch) | |
tree | 0cb787d50ff0753b81cd3b0913476c27adbe4686 /tests/bugs | |
parent | 007182f1aad9d14e8d5bc7771d500b35026f0afa (diff) | |
parent | 6dfe01d7e726675913e98dc65c6c7406e5060e15 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/bug-1023974.t | 2 | ||||
-rw-r--r-- | tests/bugs/bug-1030580.t | 8 | ||||
-rw-r--r-- | tests/bugs/bug-1035576.t | 2 | ||||
-rwxr-xr-x | tests/bugs/bug-1040423.t | 72 | ||||
-rw-r--r-- | tests/bugs/bug-1047416.t | 66 | ||||
-rw-r--r-- | tests/bugs/bug-848251.t | 1 | ||||
-rwxr-xr-x | tests/bugs/bug-990028.t | 1 |
7 files changed, 141 insertions, 11 deletions
diff --git a/tests/bugs/bug-1023974.t b/tests/bugs/bug-1023974.t index 56766b979..06d33c12f 100644 --- a/tests/bugs/bug-1023974.t +++ b/tests/bugs/bug-1023974.t @@ -21,6 +21,8 @@ TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0; TEST mkdir -p $M0/1/2; TEST $CLI volume quota $V0 limit-usage /1/2 100MB 70%; +TEST $CLI volume quota $V0 hard-timeout 0 +TEST $CLI volume quota $V0 soft-timeout 0 #The corresponding write(3) should fail with EDQUOT ("Disk quota exceeded") TEST ! dd if=/dev/urandom of=$M0/1/2/file bs=1M count=102; diff --git a/tests/bugs/bug-1030580.t b/tests/bugs/bug-1030580.t index ed1cdb864..642c6dc44 100644 --- a/tests/bugs/bug-1030580.t +++ b/tests/bugs/bug-1030580.t @@ -9,14 +9,6 @@ function write_to_file { dd of=$M0/1 if=/dev/zero bs=1M count=128 oflag=append 2>&1 >/dev/null } -function cumulative_stat_count { - echo "$1" | grep "Cumulative Stats:" | wc -l -} - -function incremental_stat_count { - echo "$1" | grep "Interval$2Stats:" | wc -l -} - TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 diff --git a/tests/bugs/bug-1035576.t b/tests/bugs/bug-1035576.t index 08c8a5ea2..52d93dd87 100644 --- a/tests/bugs/bug-1035576.t +++ b/tests/bugs/bug-1035576.t @@ -21,7 +21,7 @@ TEST $CLI volume set $V0 performance.read-ahead off TEST $CLI volume set $V0 background-self-heal-count 0 TEST $CLI volume set $V0 self-heal-daemon off TEST $CLI volume quota $V0 enable -sleep 5 # wait for brick to connect to quotad + TEST kill_brick $V0 $H0 $B0/${V0}0 TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 cd $M0 diff --git a/tests/bugs/bug-1040423.t b/tests/bugs/bug-1040423.t new file mode 100755 index 000000000..6dae9eac6 --- /dev/null +++ b/tests/bugs/bug-1040423.t @@ -0,0 +1,72 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup + +function _init() { +# Start glusterd +TEST glusterd; +TEST pidof glusterd; +TEST $CLI volume info; + +# Lets create volume +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; + +## Verify volume is created +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; + +#Start volume and verify +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 + +#Enable Quota +TEST $CLI volume quota $V0 enable + +#As quotad consumes some time to connect to brick process we invoke sleep +sleep 10; + +#set limit of 1GB of quota on root +TEST $CLI volume quota $V0 limit-usage / 1GB +} + +function get_hardlimit() +{ + VOLUME=$1 + + $CLI volume quota $VOLUME list | tail -1 | sed "s/ \{1,\}/ /g" | + cut -d' ' -f 2 +} + +function check_fattrs { + +touch $M0/file1; + +#This confirms that pgfid is also filtered +TEST ! "getfattr -d -e hex -m . $M0/file1 | grep pgfid "; + +#just check for quota xattr are visible or not +TEST ! "getfattr -d -e hex -m . $M0 | grep quota"; + +#setfattr should fail +TEST ! setfattr -n trusted.glusterfs.quota.limit-set -v 10 $M0; + +#remove xattr should fail +TEST ! setfattr -x trusted.glusterfs.quota.limit-set $M0; + +#check if list command still shows the correct value or not + +EXPECT "1.0GB" get_hardlimit $V0 + +} + +_init; +check_fattrs; +cleanup + + + + diff --git a/tests/bugs/bug-1047416.t b/tests/bugs/bug-1047416.t new file mode 100644 index 000000000..53c7f8614 --- /dev/null +++ b/tests/bugs/bug-1047416.t @@ -0,0 +1,66 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +function write_to_file { + dd of=$M0/1 if=/dev/zero bs=1M count=128 oflag=append 2>&1 >/dev/null +} + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 +TEST $CLI volume start $V0 +TEST $CLI volume profile $V0 start +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 + +# Verify 'volume profile info' prints both cumulative and incremental stats +write_to_file & +wait +output=$($CLI volume profile $V0 info) +EXPECT 2 cumulative_stat_count "$output" +EXPECT 2 incremental_stat_count "$output" ' 0 ' + +# Verify 'volume profile info peek' prints both cumulative and incremental stats +# without clearing incremental stats +write_to_file & +wait +output=$($CLI volume profile $V0 info peek) +EXPECT 2 cumulative_stat_count "$output" +EXPECT 2 incremental_stat_count "$output" ' 1 ' + +write_to_file & +wait +output=$($CLI volume profile $V0 info peek) +EXPECT 2 cumulative_stat_count "$output" +EXPECT 2 incremental_stat_count "$output" ' 1 ' + +# Verify 'volume profile info incremental peek' prints incremental stats only +# without clearing incremental stats +write_to_file & +wait +output=$($CLI volume profile $V0 info incremental peek) +EXPECT 0 cumulative_stat_count "$output" +EXPECT 2 incremental_stat_count "$output" ' 1 ' + +write_to_file & +wait +output=$($CLI volume profile $V0 info incremental peek) +EXPECT 0 cumulative_stat_count "$output" +EXPECT 2 incremental_stat_count "$output" ' 1 ' + +# Verify 'volume profile info clear' clears both incremental and cumulative stats +write_to_file & +wait +output=$($CLI volume profile $V0 info clear) +EXPECT 2 cleared_stat_count "$output" + +output=$($CLI volume profile $V0 info) +EXPECT 2 cumulative_stat_count "$output" +EXPECT 2 incremental_stat_count "$output" ' 0 ' +EXPECT 4 data_read_count "$output" ' 0 ' +EXPECT 4 data_written_count "$output" ' 0 ' + +cleanup; diff --git a/tests/bugs/bug-848251.t b/tests/bugs/bug-848251.t index 844162283..a5c80b1b4 100644 --- a/tests/bugs/bug-848251.t +++ b/tests/bugs/bug-848251.t @@ -19,7 +19,6 @@ TEST $CLI volume quota $V0 enable; TEST MOUNTDIR="/tmp/$RANDOM" TEST mkdir $MOUNTDIR TEST glusterfs -s $H0 --volfile-id=$V0 $MOUNTDIR -sleep 10 function set_quota(){ mkdir "$MOUNTDIR/$name" diff --git a/tests/bugs/bug-990028.t b/tests/bugs/bug-990028.t index ece7235cd..fbf4175be 100755 --- a/tests/bugs/bug-990028.t +++ b/tests/bugs/bug-990028.t @@ -22,7 +22,6 @@ function __init() TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 TEST $CLI volume quota $V0 enable - sleep 15 } #CASE-1 |