summaryrefslogtreecommitdiffstats
path: root/tests/basic/gfapi/libgfapi-fini-hang.sh
blob: 56633288020bdb07ecf4885782c7f58eb6bbe5ef (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
#!/bin/bash

. $(dirname $0)/../../include.rc

function check_process () {
    pgrep libgfapi-fini-hang
    if [ $? -eq 1 ] ; then
        echo "Y"
    else
        echo "N"
    fi
}

cleanup;

TEST glusterd

TEST $CLI volume create $V0 $H0:$B0/brick1;
EXPECT 'Created' volinfo_field $V0 'Status';

TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';

build_tester -lgfapi $(dirname $0)/libgfapi-fini-hang.c -o $M0/libgfapi-fini-hang
TEST cd $M0
 ./libgfapi-fini-hang $V0 &
lpid=$!

# check if the process "libgfapi-fini-hang" exits with in $PROCESS_UP_TIMEOUT
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Y' check_process

# Kill the process if present
TEST ! kill -9 $lpid

TEST rm -f $M0/libgfapi-fini-hang

TEST $CLI volume stop $V0
TEST $CLI volume delete $V0

cleanup;