-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathobsrv-tests.sh
More file actions
executable file
·74 lines (59 loc) · 932 Bytes
/
obsrv-tests.sh
File metadata and controls
executable file
·74 lines (59 loc) · 932 Bytes
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
CWD=`pwd`
PID_FN="$CWD/obsrv.pid"
CFG_FN="./test-config-obsrv.json"
#
# Daemon startup
#
# PID file cannot be present at start of tests
if [ -f $PID_FN ]
then
echo Daemon PID file already exists.
exit 1
fi
# Start daemon in background
./obsrv -c $CFG_FN -p $PID_FN --daemon
sleep 1
# PID file must exist
if [ ! -f $PID_FN ]
then
echo Daemon not started.
exit 1
fi
# Ping process to make sure it exists
kill -0 `cat $PID_FN`
if [ $? -ne 0 ]
then
echo "Daemon cannot be pinged with kill(1)"
kill %1
rm -f $PID_FN
exit 1
fi
RETVAL=0
#./obsrv-test-client
#if [ $? -ne 0 ]
#then
# echo "Orad test client failed."
# RETVAL=1
#fi
#
# Daemon shutdown
#
if [ ! -f $PID_FN ]
then
echo Daemon PID file is missing.
exit 1
fi
kill `cat $PID_FN`
if [ $? -ne 0 ]
then
echo "Daemon cannot be reached via kill(1)"
exit 1
fi
sleep 1
if [ -f $PID_FN ]
then
echo Daemon PID file remains.
exit 1
fi
exit $RETVAL