source: trunk/test/testrun_1.sh@ 16

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

Initial import

File size: 2.5 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"
20 TRUST="--with-trusted=0,2,$UID"
21else
22 TRUST="--with-trusted=0,2,500"
23fi
24
25echo; echo "${S}__ STARTING TEST RUN STANDALONE __${E}"; echo;
26echo Working directory: $PW_DIR
27
28MAKE=`which gmake`
29if test "x$?" = x1 ; then
30 MAKE="make -s"
31else
32 MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"`
33 if test "x$MAKE" = x; then
34 MAKE="make -s"
35 elif test "x$MAKE" = xno; then
36 MAKE="make -s"
37 else
38 if test "x$MAKE" = "xwhich:"; then
39 MAKE="make -s"
40 else
41 MAKE="gmake -s"
42 gmake -v >/dev/null 2>&1 || MAKE="make -s"
43 fi
44 fi
45fi
46echo MAKE is $MAKE
47echo
48
49# --with-database=mysql
50# --enable-debug
51# [egd|unix|dev|default]
52
53testrun1 ()
54{
55 #
56 # test standalone compilation
57 #
58 echo "${S}Building standalone agent${E}"; echo;
59 #
60 if test -r "Makefile"; then
61 $MAKE distclean
62 fi
63 #
64 # --enable-login-watch --enable-xml-log
65 # --enable-debug --enable-suidcheck --with-prelude
66
67 ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/test/testrc_1 --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug
68# --with-prelude --enable-micro-stealth=128
69# --with-prelude
70
71# --with-kcheck=/boot/System.map
72
73# --with-prelude --enable-xml-log
74
75# --with-kcheck=/boot/System.map-2.4.20-24.9
76# --with-kcheck=/boot/System.map-deb-2.4.18-686
77
78# --enable-stealth=192
79# --with-console=$PW_DIR/dlog_file
80
81 #
82 if test x$? = x0; then
83 echo "configure completed, exit status 0"; echo;
84 $MAKE > /dev/null
85 if test x$? = x0; then
86 echo "$MAKE completed, exit status $?"; echo;
87 else
88 echo "${S}ERROR:${E} make failed, exit status $?"; echo;
89 exit
90 fi
91
92 else
93 echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
94 exit
95 fi
96
97 rm -f ./.samhain_file
98 rm -f ./.samhain_log
99 rm -f ./.samhain_lock
100
101 ./samhain -t init
102
103 if test x$? = x0; then
104 echo
105 echo "${S}init completed${E}"
106 echo
107 ./samhain -t check
108 if test x$? = x0; then
109 echo "${S}check completed${E}"
110 else
111 echo "${S}ERROR:${E} -- check -- failed, exit status $?"
112 echo
113 exit
114 fi
115 else
116 echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
117 exit
118 fi
119
120}
121
122
123
124 testrun1
125
126
127echo; echo "${S}__ END TEST RUN STANDALONE __${E}"; echo;
128
129exit
130
Note: See TracBrowser for help on using the repository browser.