]> git.ipfire.org Git - people/ms/strongswan.git/blob - testing/start-testing
- import of strongswan-2.7.0
[people/ms/strongswan.git] / testing / start-testing
1 #!/bin/bash
2 # Start up the specified UML instances and wait for them to finish booting
3 #
4 # Copyright (C) 2004 Eric Marchionni, Patrik Rayo
5 # Zuercher Hochschule Winterthur
6 #
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>.
11 #
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
15 # for more details.
16 #
17 # RCSID $Id: start-testing,v 1.4 2004/12/07 18:04:57 as Exp $
18
19 DIR=`dirname $0`
20
21 source $DIR/scripts/function.sh
22
23 [ -f $DIR/testing.conf ] || die "!! Configuration file 'testing.conf' not found"
24 [ -d $DIR/hosts ] || die "Directory hosts cannot be found."
25
26 source $DIR/testing.conf
27
28 if [ "$#" -eq 0 ]
29 then
30 HOSTS=$STRONGSWANHOSTS
31 else
32 HOSTS=$*
33 fi
34
35 #####################################################
36 # start the uml switches
37 #
38 cecho "Start the uml switches (scripts/start-switches)"
39 $DIR/scripts/start-switches
40
41
42 #####################################################
43 # start the uml instances
44 #
45 case $UMLSTARTMODE in
46 konsole)
47 cecho "Start the uml instances (scripts/kstart-umls)"
48 $DIR/scripts/kstart-umls $HOSTS
49 ;;
50 xterm)
51 cecho "Start the uml instances (scripts/xstart-umls)"
52 $DIR/scripts/xstart-umls $HOSTS
53 ;;
54 screen)
55 cecho "Start the uml instances (scripts/start-umls)"
56 $DIR/scripts/start-umls $HOSTS
57 ;;
58 *)
59 die "The start mode is unknown! Please set $UMLSTARTMODE properly."
60 ;;
61 esac
62
63
64 #####################################################
65 # do the automated testing
66 #
67 if [ $ENABLE_DO_TESTS = "yes" ]
68 then
69 cecho "Run the automated tests (do-tests)"
70 $DIR/do-tests
71 fi
72
73
74 ##############################################################################
75 # stop all UML instances and switches
76 #
77
78 if [ $ENABLE_STOP_TESTING = "yes" ]
79 then
80 cecho "Stopping all UML instances and switches (stop-testing)"
81 $DIR/stop-testing $HOSTS
82 fi
83