2 # Load test specific host configurations
4 # Copyright (C) 2004 Eric Marchionni, Patrik Rayo
5 # Zuercher Hochschule Winterthur
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 2 of the License, or (at your
10 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 source $DIR/function.sh
21 [ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
23 source $DIR/../testing.conf
25 ##########################################################################
26 # load-testconfig requires a testname as an argument
31 TESTSDIR=$BUILDDIR/tests
33 [ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
34 [ -d $TESTSDIR/$testname ] || die "Test '$testname' not found"
35 [ -f $TESTSDIR/$testname/test.conf ] || die "File 'test.conf' is missing"
37 source $TESTSDIR/$testname/test.conf
39 ##########################################################################
40 # copy test specific configurations to uml hosts
43 if [ -d $TESTSDIR/$testname/hosts ]
45 for host in `ls $TESTSDIR/$testname/hosts`
47 eval HOSTLOGIN="root@`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
48 scp -r $TESTSDIR/$testname/hosts/$host/etc $HOSTLOGIN:/ > /dev/null 2>&1
53 ##########################################################################
54 # clear auth.log and daemon.log where IKE messages are logged
57 for host in $IPSECHOSTS
59 eval HOSTLOGIN="root@`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
60 ssh $HOSTLOGIN 'rm -f /var/log/auth.log /var/log/daemon.log; \
61 kill -SIGHUP `cat /var/run/syslogd.pid`' > /dev/null 2>&1
65 ##########################################################################
66 # clear radius.log on FreeRadius servers
69 for host in $RADIUSHOSTS
71 eval HOSTLOGIN="root@`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
72 ssh $HOSTLOGIN 'rm -f /var/log/radius/radius.log; \
73 kill -SIGHUP `cat /var/run/syslogd.pid`' > /dev/null 2>&1