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
28 HOSTS=$STRONGSWANHOSTS
33 ##########################################################################
36 if [ $ENABLE_BUILD_BASEIMAGE = "yes" ]
38 cecho "Building base image"
39 $DIR/scripts/build-baseimage
43 ##########################################################################
44 # build the UML kernel based on a vanilla kernel form kernel.org
45 # and a matching UML patch from user-mode-linux.sourceforge.net
47 if [ $ENABLE_BUILD_UMLKERNEL = "yes" ]
49 cecho "Building uml kernel (scripts/build-umlkernel)"
50 $DIR/scripts/build-umlkernel
53 ##########################################################################
54 # build a generic UML root file system based on a Gentoo root file system.
55 # compile and install a specified strongSwan release into the file system.
57 if [ $ENABLE_BUILD_UMLROOTFS = "yes" ]
59 cecho "Building uml base image (scripts/build-umlrootfs)"
60 $DIR/scripts/build-umlrootfs
63 ##########################################################################
64 # copy the default UML host configurations to $BUILDDIR
65 # and assign actual IP addresses to the UML hosts
67 if [ $ENABLE_BUILD_HOSTCONFIG = "yes" ]
69 cecho "Building host configurations (scripts/build-hostconfig)"
70 $DIR/scripts/build-hostconfig
73 ##########################################################################
74 # Creating the root filesystems for the specified UML instances
76 if [ $ENABLE_BUILD_UMLHOSTFS = "yes" ]
78 cecho "Building uml host images (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