-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtestapache.sh
More file actions
executable file
·85 lines (71 loc) · 1.83 KB
/
testapache.sh
File metadata and controls
executable file
·85 lines (71 loc) · 1.83 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -e
# to pick up correct executables and .so's
: ${CODETOP:=$HOME/code/defo-project-org/openssl}
export LD_LIBRARY_PATH=$CODETOP
: ${EDTOP:=$HOME/code/defo-project-org/ech-dev-utils}
# Note that the value for this has to match that for ATOP
# in apachemin.conf, so if you change this on the
# command line, you'll need to edit the conf file
: ${ATOP:=$HOME/code/defo-project-org/apache-httpd}
# where we have/want test files
: ${RUNTOP:=`/bin/pwd`}
if [[ "$PACKAGING" == "" ]]
then
ABIN=$ATOP/httpd
CMDPATH=$CODETOP/apps/openssl
else
CMDPATH=`which openssl`
ABIN=`which apache2`
EDTOP="$(dirname "$(realpath "$0")")/.."
RUNTOP=`mktemp -d`
fi
. $EDTOP/scripts/funcs.sh
export RUNTOP PACKAGING ATOP
CLILOGFILE=`mktemp`
SRVLOGFILE=`mktemp`
KEEPLOG="no"
allgood="yes"
prep_server_dirs apache
# if we want to reload config then that's "graceful restart"
if [[ "$1" == "graceful" ]]
then
echo "Telling apache to do the graceful thing"
$ABIN -d $RUNTOP -f $EDTOP/configs/apachemin.conf -k graceful
exit $?
fi
PIDFILE=$RUNTOP/apache/logs/httpd.pid
# Kill off old processes from the last test
if [ -f $PIDFILE ]
then
echo "Killing old httpd in process `cat $PIDFILE`"
kill `cat $PIDFILE`
rm -f $PIDFILE
fi
echo "Executing: $ABIN -d $RUNTOP -f $EDTOP/configs/apachemin.conf"
$ABIN -d $RUNTOP -f $EDTOP/configs/apachemin.conf
for type in grease public real hrr
do
port=9443
echo "Testing $type $port"
cli_test $port $type
done
ret=1
if [[ "$allgood" == "yes" ]]
then
echo "All good."
rm -f $CLILOGFILE $SRVLOGFILE
ret=0
else
echo "Something failed."
if [[ "$KEEPLOG" != "no" ]]
then
echo "Client logs in $CLILOGFILE"
echo "Server logs in $SRVLOGFILE"
else
rm -f $CLILOGFILE $SRVLOGFILE
fi
fi
kill `cat $PIDFILE`
rm -f $PIDFILE
exit $ret