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
19 source $DIR/scripts/function.sh
21 [ -f $DIR/testing.conf ] || die "!! Configuration file 'testing.conf' not found."
23 source $DIR/testing.conf
27 HOSTS=$STRONGSWANHOSTS
32 ##########################################################################
33 # build the UML kernel based on a vanilla kernel form kernel.org
34 # and a matching UML patch from user-mode-linux.sourceforge.net
36 if [ $ENABLE_BUILD_UMLKERNEL = "yes" ]
38 cecho "Building uml kernel (scripts/build-umlkernel)"
39 $DIR/scripts/build-umlkernel
42 ##########################################################################
43 # Adding the ssh RSA public keys to ~/.ssh/known_hosts
45 if [ $ENABLE_BUILD_SSHKEYS = "yes" ]
47 cecho "Adding ssh public keys of the uml instances (scripts/build-sshkeys)"
48 $DIR/scripts/build-sshkeys
51 ##########################################################################
52 # copy the default UML host configurations to $BUILDDIR
53 # and assign actual IP addresses to the UML hosts
55 if [ $ENABLE_BUILD_HOSTCONFIG = "yes" ]
57 cecho "Building host configurations (scripts/build-hostconfig)"
58 $DIR/scripts/build-hostconfig
61 ##########################################################################
62 # build a generic UML root file system based on a Gentoo root file system.
63 # compile and install a specified strongSwan release into the file system.
65 if [ $ENABLE_BUILD_UMLROOTFS = "yes" ]
67 cecho "Building uml root file system with strongSwan (scripts/build-umlrootfs)"
68 $DIR/scripts/build-umlrootfs
71 ##########################################################################
72 # Creating the root filesystems for the specified UML instances
74 if [ $ENABLE_BUILD_UMLHOSTFS = "yes" ]
76 cecho "Building uml host root file systems (scripts/build-umlhostfs)"
77 $DIR/scripts/build-umlhostfs $HOSTS
80 ##########################################################################
81 # Start up the UML switches and designated UML instances
83 if [ $ENABLE_START_TESTING = "yes" ]
85 cecho "Starting the uml switches and instances (start-testing)"
86 $DIR/start-testing $HOSTS