summaryrefslogtreecommitdiffstats
path: root/dvm/2722/testcase
blob: cbac15804e953bfa489d7bc2c3c7fbea73600ad6 (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
#!/bin/bash


function check_volume_top_messages ()
{
    $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;

    #'volume top successful' message should NOT be shown for all succeeded top operations.
    $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024000 count 100 | grep "volume top successful" 2>/dev/null 1>/dev/null;
    ret1=$?

    #message 'no entries in the list' should NOT be displayed.
    $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024000 count 100 | grep "no entries in the list" 2>/dev/null 1>/dev/null;
    ret2=$?

    #volume top on a non-existant brick should display the message 'volume top unsuccessful'.
    $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024000 count 100 brick $(hostname):$EXPORT_DIR/$global_bug_id/brick11 | grep "volume top unsuccessful" 2>/dev/null 1>/dev/null;
    ret3=$?

    if [ $ret1 -ne 0 ] && [ $ret2 -ne 0 ] && [ $ret3 -eq 0 ]; then
        return 0
    else
        return 1
    fi
}


source $cwd/regression_helpers; check_volume_top_messages