blob: 9ac520b585dd458e6f1a986532d99b88db98700a (
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
|
#!/bin/bash
function create_data_on_mountpoint ()
{
for i in {1..100}
do
dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null;
dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null;
done
}
function check_volume_top_write_perf ()
{
$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/null;
$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null;
sleep 2
#latency-measurement should be on for 'top write-perf' to capture throughput of files
$GLUSTERFSDIR/gluster volume set $global_bug_id latency-measurement on 2>/dev/null 1>/dev/null;
mount_glusterfs $global_bug_id;
create_data_on_mountpoint;
$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024 count 100 2>/dev/null 1>/dev/null;
ret1=$?
$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 0 count 100 | grep "block size should be an integer greater than zero" 2>/dev/null 1>/dev/null;
ret2=$?
$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024 count 0 | grep "count should be an integer greater than zero" 2>/dev/null 1>/dev/null;
ret3=$?
if [ $ret1 -eq 0 ] && [ $ret2 -eq 0 ] && [ $ret3 -eq 0 ]; then
return 0
else
return 1
fi
}
source $cwd/regression_helpers; check_volume_top_write_perf
|