source: trunk/test/test.sh@ 18

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

Initial import

File size: 3.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
16SCRIPTDIR=.
17
18TEST_SRCDIR="XXXSRCXXX";
19if test "x${TOP_SRCDIR}" = x; then
20 # not within source tree, and not called with 'make testN'
21 if test -f "${TEST_SRCDIR}/src/samhain.c"; then
22 TOP_SRCDIR="${TEST_SRCDIR}"; export TOP_SRCDIR
23 if test -f test/testcompile.sh; then
24 SCRIPTDIR=test
25 fi
26 # not within source tree, not called by 'make', and in 'test' subdir
27 elif test -f "../${TEST_SRCDIR}/src/samhain.c"; then
28 cd ..
29 SCRIPTDIR=test
30 TOP_SRCDIR="${TEST_SRCDIR}"; export TOP_SRCDIR
31 # within source tree, and not called with 'make testN'
32 else
33 if test -f ../src/samhain.c; then
34 cd ..
35 SCRIPTDIR=test
36 TOP_SRCDIR=.
37 export TOP_SRCDIR
38 elif test -f ./src/samhain.c; then
39 SCRIPTDIR=test
40 TOP_SRCDIR=.
41 export TOP_SRCDIR
42 else
43 echo "Please set the environment variable TOP_SRCDIR to the"
44 echo "top directory in the samhain source tree."
45 exit 1
46 fi
47 fi
48else
49 # called by make
50 if test -f "${TOP_SRCDIR}/src/samhain.c"; then
51 SCRIPTDIR=test
52 else
53 if test -f "../${TOP_SRCDIR}/src/samhain.c"; then
54 cd ..; SCRIPTDIR=test
55 else
56 echo "Please set the environment variable TOP_SRCDIR to the"
57 echo "top directory in the samhain source tree."
58 exit 1
59 fi
60 fi
61fi
62
63export SCRIPTDIR
64
65PW_DIR=`pwd`; export PW_DIR
66
67if test x$1 = x1; then
68 exec ${SCRIPTDIR}/testcompile.sh
69fi
70if test x$1 = x2; then
71 exec ${SCRIPTDIR}/testhash.sh
72fi
73if test x$1 = x3; then
74 exec ${SCRIPTDIR}/testrun_1.sh
75fi
76if test x$1 = x4; then
77 exec ${SCRIPTDIR}/testrun_1a.sh
78fi
79if test x$1 = x5; then
80 exec ${SCRIPTDIR}/testext.sh
81fi
82if test x$1 = x6; then
83 exec ${SCRIPTDIR}/testtimesrv.sh
84fi
85if test x$1 = x7; then
86 exec ${SCRIPTDIR}/testrun_1b.sh
87fi
88if test x$1 = x10; then
89 exec ${SCRIPTDIR}/testrun_2.sh $2
90fi
91if test x$1 = x11; then
92 exec ${SCRIPTDIR}/testrun_2a.sh $2
93fi
94if test x$1 = x12; then
95 exec ${SCRIPTDIR}/testrun_2b.sh $2
96fi
97if test x$1 = x13; then
98 exec ${SCRIPTDIR}/testrun_2c.sh $2
99fi
100if test x$1 = x14; then
101 exec ${SCRIPTDIR}/testrun_2d.sh $2
102fi
103if test x$1 = xall; then
104 ${SCRIPTDIR}/testcompile.sh
105 ${SCRIPTDIR}/testhash.sh
106 ${SCRIPTDIR}/testrun_1.sh
107 ${SCRIPTDIR}/testrun_1a.sh
108 ${SCRIPTDIR}/testext.sh
109 ${SCRIPTDIR}/testtimesrv.sh
110 ${SCRIPTDIR}/testrun_1b.sh
111 ${SCRIPTDIR}/testrun_2.sh $2
112 ${SCRIPTDIR}/testrun_2a.sh $2
113fi
114
115echo "Usage (in brackets: config files used):"
116echo
117echo " ${S}test.sh 1${E} -- Compilation with many different options"
118echo " ${S}test.sh 2${E} -- Hash function"
119echo " ${S}test.sh 3${E} -- Standalone init/check (testrc_1)"
120echo " ${S}test.sh 4${E} -- Microstealth init/check (testrc_1)"
121echo " ${S}test.sh 5${E} -- External program call (testrc_1ext.in)"
122echo " ${S}test.sh 6${E} -- Timeserver option (testrc_1)"
123echo " ${S}test.sh 7${E} -- GnuPG signed files (testrc_1)"
124#
125#
126#
127echo " ${S}test.sh 10 hostname${E} -- Test c/s init/check (testrc_2.in)"
128echo " ${S}test.sh 11 hostname${E} -- Test full c/s init/check (testrc_2.in)"
129echo " ${S}test.sh 12 hostname${E} -- Test full c/s w/gpg (testrc_2.in)"
130echo " ${S}test.sh 13 hostname${E} -- Test full c/s w/mysql (testrc_2.in)"
131echo " ${S}test.sh 14 hostname${E} -- Test c/s w/syslog logging(testrc_2.in)"
132echo " ${S}test.sh a hostname${E} -- All except 7,12+"
133
134echo
135echo "Scripts used: (1) ./testcompile.sh (2) ./testhash.sh (3) ./testrun_1.sh"
136echo " (4) ./testrun_1a.sh (5) ./testext.sh (6) ./testtimesrv.sh"
137echo " (7) ./testrun_1b.sh (10) ./testrun_2.sh (11) ./testrun_2a.sh"
138echo " (12) ./testrun_2b.sh (13) ./testrun_2c.sh (14) ./testrun_2d.sh"
139
Note: See TracBrowser for help on using the repository browser.