source: trunk/test/testtimesrv.sh@ 1

Last change on this file since 1 was 1, checked in by katerina, 19 years ago

Initial import

File size: 1.9 KB
Line 
1#! /bin/sh
2
3
4# The following two are the ANSI sequences for start and end embolden
5case $TERM in
6vt*|ansi*|con*|xterm*|linux*|screen*)
7 S=[1m
8 E=[m
9 ;;
10*)
11 S=
12 E=
13 ;;
14esac
15
16PW_DIR=`pwd`
17
18if test x$UID != x; then
19 TRUST="--with-trusted=0,2,$UID"
20else
21 TRUST="--with-trusted=0,2"
22fi
23
24echo; echo "${S}__ STARTING TEST TIMESERVER OPTION __${E}"; echo;
25echo Working directory: $PW_DIR
26
27MAKE=`which gmake`
28if test "x$?" = x1 ; then
29 MAKE="make -s"
30else
31 MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"`
32 if test "x$MAKE" = x; then
33 MAKE="make -s"
34 elif test "x$MAKE" = xno; then
35 MAKE="make -s"
36 else
37 if test "x$MAKE" = "xwhich:"; then
38 MAKE="make -s"
39 else
40 MAKE="gmake -s"
41 gmake -v >/dev/null 2>&1 || MAKE="make -s"
42 fi
43 fi
44fi
45
46echo MAKE is $MAKE
47echo
48
49
50testtime0 ()
51{
52 #
53 # standalone compilation
54 #
55 echo "${S}Building standalone agent w/timeserver${E}"; echo;
56 #
57 if test -r "Makefile"; then
58 $MAKE distclean
59 fi
60 #
61 ${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/test/testrc_1 --with-timeserver=www.foo.bar --with-alttimeserver=127.0.0.1 --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
62 #
63 if test x$? = x0; then
64 echo "configure completed, exit status 0"; echo;
65 $MAKE > /dev/null
66 echo "$MAKE completed, exit status $?"; echo;
67 else
68 echo "ERROR: configure failed"; echo;
69 fi
70
71
72 rm -f $PW_DIR/.samhain_file $PW_DIR/.samhain_log $PW_DIR/.samhain_lock
73
74 ./samhain -t init
75
76 if test x$? = x0; then
77 echo
78 echo "${S}init completed${E}"
79 echo
80 ./samhain -t check
81 if test x$? = x0; then
82 echo "${S}check completed${E}"
83 else
84 echo "${S}ERROR:${E} -- check -- failed, exit status $?"
85 echo
86 exit
87 fi
88 else
89 echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
90 exit
91 fi
92
93}
94
95
96
97 testtime0
98
99
100echo; echo "${S}__ END TEST TIMESERVER OPTION __${E}"; echo;
101
102exit
103
Note: See TracBrowser for help on using the repository browser.