summaryrefslogtreecommitdiffstats
path: root/248/regr/testcase
blob: 37d7780389db8559b95ec4529cb5ed557dbe2aa7 (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
#!/bin/bash

description="# Updating stats in posix is incorrect"
comments="# In POSIX, updating nr_files is not being done right. It is being incremented
even before checking return values from open() and close()."

source ../../init

start_glusterfs --no-servers --no-clients

sleep 2

$($GLUSTERFS --run-id regr.c.$BUGID -f $SPECDIR/server1.vol -l $LOGDIR/$(hostname)-server1.log --pid-file=$PWD/server1.pid)
sleep 1
$($GLUSTERFS --run-id regr.c.$BUGID -f $SPECDIR/client1.vol $MOUNTDIR/client1 -l $LOGDIR/$(hostname)-client1.log --pid-file=$PWD/client1.pid)


dbench -s -S 10 -t 10 -D $MOUNTDIR/client1 >/dev/null
cat server1.pid | xargs kill -USR1 >/dev/null
NR_FILES=$(grep 'nr_files' /tmp/glusterdump.`cat server1.pid` 2> /dev/null | cut -d"=" -f2 | grep 0 | wc -l) 

if [ $NR_FILES -ne 0 ] ; then
        ok $description
        comment $comments
else
    not_ok $description
    comment $comments
fi

rm /tmp/glusterdump.`cat server1.pid` 2> /dev/null
cleanup_glusterfs
cat server1.pid | xargs kill -9 >/dev/null
rm *.pid >/dev/null