2 # Create the strongSwan UML testing environment
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
21 source $DIR/scripts/function.sh
23 [ -f $DIR/testing.conf ] || die "!! Configuration file 'testing.conf' not found."
25 source $DIR/testing.conf
29 HOSTS=$STRONGSWANHOSTS
34 ##########################################################################
35 # build the UML kernel based on a vanilla kernel form kernel.org
36 # and a matching UML patch from user-mode-linux.sourceforge.net
38 if [ $ENABLE_BUILD_UMLKERNEL = "yes" ]
40 cecho "Building uml kernel (scripts/build-umlkernel)"
41 $DIR/scripts/build-umlkernel
44 ##########################################################################
45 # Adding the ssh RSA public keys to ~/.ssh/known_hosts
47 if [ $ENABLE_BUILD_SSHKEYS = "yes" ]
49 cecho "Adding ssh public keys of the uml instances (scripts/build-sshkeys)"
50 $DIR/scripts/build-sshkeys
53 ##########################################################################
54 # copy the default UML host configurations to $BUILDDIR
55 # and assign actual IP addresses to the UML hosts
57 if [ $ENABLE_BUILD_HOSTCONFIG = "yes" ]
59 cecho "Building host configurations (scripts/build-hostconfig)"
60 $DIR/scripts/build-hostconfig
63 ##########################################################################
64 # build a generic UML root file system based on a Gentoo root file system.
65 # compile and install a specified strongSwan release into the file system.
67 if [ $ENABLE_BUILD_UMLROOTFS = "yes" ]
69 cecho "Building uml root file system with strongSwan (scripts/build-umlrootfs)"
70 $DIR/scripts/build-umlrootfs
73 ##########################################################################
74 # Creating the root filesystems for the specified UML instances
76 if [ $ENABLE_BUILD_UMLHOSTFS = "yes" ]
78 cecho "Building uml host root file systems (scripts/build-umlhostfs)"
79 $DIR/scripts/build-umlhostfs $HOSTS
82 ##########################################################################
83 # Start up the UML switches and designated UML instances
85 if [ $ENABLE_START_TESTING = "yes" ]
87 cecho "Starting the uml switches and instances (start-testing)"
88 $DIR/start-testing $HOSTS