source: trunk/test/testrun_1a.sh@ 7

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

Initial import

File size: 2.1 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 RUN STEALTH STANDALONE __${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
50testrun1 ()
51{
52 #
53 # test standalone compilation
54 #
55 echo "${S}Building standalone agent${E}"; echo;
56 #
57 if test -r "Makefile"; then
58 $MAKE distclean
59 fi
60 #
61 ${TOP_SRCDIR}/configure --quiet $TRUST --enable-debug --enable-xml-log --enable-micro-stealth=137 --enable-nocl=foo --enable-login-watch --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
62 #
63 if test x$? = x0; then
64 echo "configure completed, exit status 0"; echo;
65 $MAKE > /dev/null
66 if test x$? = x0; then
67 echo "$MAKE completed, exit status $?"; echo;
68 else
69 echo "${S}ERROR:${E} make failed, exit status $?"; echo;
70 exit
71 fi
72
73 else
74 echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
75 exit
76 fi
77
78 rm -f ./.samhain_file
79 rm -f ./.samhain_log
80 rm -f ./.samhain_lock
81
82 echo '-t init' | ./samhain foo
83
84 if test x$? = x0; then
85 echo
86 echo "${S}init completed${E}"
87 echo
88 echo '-t check' | ./samhain foo
89 if test x$? = x0; then
90 echo "${S}check completed${E}"
91 else
92 echo "${S}ERROR:${E} -- check -- failed, exit status $?"
93 echo
94 exit
95 fi
96 else
97 echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
98 exit
99 fi
100
101}
102
103
104
105 testrun1
106
107
108echo; echo "${S}__ END TEST RUN STANDALONE __${E}"; echo;
109
110exit
111
Note: See TracBrowser for help on using the repository browser.