aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReto Buerki <reet@codelabs.ch>2012-12-06 18:26:39 +0100
committerTobias Brunner <tobias@strongswan.org>2013-01-17 15:22:10 +0100
commit261cf0e395ec43634e49e3f431cd189d69f03edc (patch)
treed3b94d24c6b8e178a8b8423e838e0f40eaf257e1
parent2d1577d661c02753ad7c9b34f993a7c340706679 (diff)
downloadstrongswan-261cf0e395ec43634e49e3f431cd189d69f03edc.tar.bz2
strongswan-261cf0e395ec43634e49e3f431cd189d69f03edc.tar.xz
Drop build-hostconfig script
Use processed host configurations directly instead.
-rw-r--r--testing/hosts/alice/etc/network/interfaces8
-rw-r--r--testing/hosts/bob/etc/network/interfaces4
-rw-r--r--testing/hosts/carol/etc/network/interfaces4
-rw-r--r--testing/hosts/dave/etc/network/interfaces4
-rw-r--r--testing/hosts/moon/etc/network/interfaces8
-rw-r--r--testing/hosts/sun/etc/network/interfaces8
-rw-r--r--testing/hosts/venus/etc/network/interfaces4
-rw-r--r--testing/hosts/winnetou/etc/network/interfaces4
-rwxr-xr-xtesting/make-testing11
-rwxr-xr-xtesting/scripts/build-hostconfig132
-rwxr-xr-xtesting/scripts/build-umlhostfs11
-rwxr-xr-xtesting/scripts/restore-defaults7
-rwxr-xr-xtesting/testing.conf1
13 files changed, 32 insertions, 174 deletions
diff --git a/testing/hosts/alice/etc/network/interfaces b/testing/hosts/alice/etc/network/interfaces
index f9ee562bc..6fcbaa597 100644
--- a/testing/hosts/alice/etc/network/interfaces
+++ b/testing/hosts/alice/etc/network/interfaces
@@ -3,18 +3,18 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_ALICE
+ address 10.1.0.10
netmask 255.255.0.0
broadcast 10.1.255.255
gateway 10.1.0.1
iface eth0 inet6 static
- address PH_IP6_ALICE
+ address fec1::10
netmask 16
iface eth1 inet static
- address PH_IP_ALICE1
+ address 192.168.0.50
netmask 255.255.255.0
broadcast 192.168.0.255
iface eth1 inet6 static
- address PH_IP6_ALICE1
+ address fec0::5
netmask 16
diff --git a/testing/hosts/bob/etc/network/interfaces b/testing/hosts/bob/etc/network/interfaces
index 3e50c056a..eca4f8fe7 100644
--- a/testing/hosts/bob/etc/network/interfaces
+++ b/testing/hosts/bob/etc/network/interfaces
@@ -3,10 +3,10 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_BOB
+ address 10.2.0.10
netmask 255.255.0.0
broadcast 10.2.255.255
gateway 10.2.0.1
iface eth0 inet6 static
- address PH_IP6_BOB
+ address fec2::10
netmask 16
diff --git a/testing/hosts/carol/etc/network/interfaces b/testing/hosts/carol/etc/network/interfaces
index 3579153e5..67bc73359 100644
--- a/testing/hosts/carol/etc/network/interfaces
+++ b/testing/hosts/carol/etc/network/interfaces
@@ -3,10 +3,10 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_CAROL
+ address 192.168.0.100
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
iface eth0 inet6 static
- address PH_IP6_CAROL
+ address fec0::10
netmask 16
diff --git a/testing/hosts/dave/etc/network/interfaces b/testing/hosts/dave/etc/network/interfaces
index f3a12454d..59e526751 100644
--- a/testing/hosts/dave/etc/network/interfaces
+++ b/testing/hosts/dave/etc/network/interfaces
@@ -3,10 +3,10 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_DAVE
+ address 192.168.0.200
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
iface eth0 inet6 static
- address PH_IP6_DAVE
+ address fec0::20
netmask 16
diff --git a/testing/hosts/moon/etc/network/interfaces b/testing/hosts/moon/etc/network/interfaces
index df85cc139..fde2f102f 100644
--- a/testing/hosts/moon/etc/network/interfaces
+++ b/testing/hosts/moon/etc/network/interfaces
@@ -3,19 +3,19 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_MOON
+ address 192.168.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
iface eth0 inet6 static
- address PH_IP6_MOON
+ address fec0::1
netmask 16
auto eth1
iface eth1 inet static
- address PH_IP_MOON1
+ address 10.1.0.1
netmask 255.255.0.0
broadcast 10.1.255.255
iface eth1 inet6 static
- address PH_IP6_MOON1
+ address fec1::1
netmask 16
diff --git a/testing/hosts/sun/etc/network/interfaces b/testing/hosts/sun/etc/network/interfaces
index cd8186e0c..841735af1 100644
--- a/testing/hosts/sun/etc/network/interfaces
+++ b/testing/hosts/sun/etc/network/interfaces
@@ -3,19 +3,19 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_SUN
+ address 192.168.0.2
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
iface eth0 inet6 static
- address PH_IP6_SUN
+ address fec0::2
netmask 16
auto eth1
iface eth1 inet static
- address PH_IP_SUN1
+ address 10.2.0.1
netmask 255.255.0.0
broadcast 10.2.255.255
iface eth1 inet6 static
- address PH_IP6_SUN1
+ address fec2::1
netmask 16
diff --git a/testing/hosts/venus/etc/network/interfaces b/testing/hosts/venus/etc/network/interfaces
index 13a1f7305..9cbae6041 100644
--- a/testing/hosts/venus/etc/network/interfaces
+++ b/testing/hosts/venus/etc/network/interfaces
@@ -3,10 +3,10 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_VENUS
+ address 10.1.0.20
netmask 255.255.0.0
broadcast 10.1.255.255
gateway 10.1.0.1
iface eth0 inet6 static
- address PH_IP6_VENUS
+ address fec1::20
netmask 16
diff --git a/testing/hosts/winnetou/etc/network/interfaces b/testing/hosts/winnetou/etc/network/interfaces
index 6fd14d0c6..7bfb6a9f2 100644
--- a/testing/hosts/winnetou/etc/network/interfaces
+++ b/testing/hosts/winnetou/etc/network/interfaces
@@ -3,10 +3,10 @@ iface lo inet loopback
auto eth0
iface eth0 inet static
- address PH_IP_WINNETOU
+ address 192.168.0.150
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254
iface eth0 inet6 static
- address PH_IP6_WINNETOU
+ address fec0::15
netmask 16
diff --git a/testing/make-testing b/testing/make-testing
index cd749b29c..9f5f17c6a 100755
--- a/testing/make-testing
+++ b/testing/make-testing
@@ -38,7 +38,6 @@ then
$DIR/scripts/build-baseimage
fi
-
##########################################################################
# build the UML kernel based on a vanilla kernel form kernel.org
# and a matching UML patch from user-mode-linux.sourceforge.net
@@ -58,16 +57,6 @@ then
fi
##########################################################################
-# copy the default UML host configurations to $BUILDDIR
-# and assign actual IP addresses to the UML hosts
-#
-if [ $ENABLE_BUILD_HOSTCONFIG = "yes" ]
-then
- cecho "Building host configurations (scripts/build-hostconfig)"
- $DIR/scripts/build-hostconfig
-fi
-
-##########################################################################
# Creating the root filesystems for the specified UML instances
#
if [ $ENABLE_BUILD_UMLHOSTFS = "yes" ]
diff --git a/testing/scripts/build-hostconfig b/testing/scripts/build-hostconfig
deleted file mode 100755
index cbe43dbb8..000000000
--- a/testing/scripts/build-hostconfig
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/bash
-# build the hosts configuration directory with the actual IP addresses
-#
-# Copyright (C) 2004 Eric Marchionni, Patrik Rayo
-# Zuercher Hochschule Winterthur
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-
-DIR=`dirname $0`
-
-source $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "!! Configuration file 'testing.conf' not found"
-[ -d $DIR/../hosts ] || die "!! Directory 'hosts' not found"
-
-source $DIR/../testing.conf
-
-if [ ! -d $BUILDDIR ]
-then
- cecho " * Creating directory '$BUILDDIR'"
- mkdir $BUILDDIR
-fi
-
-########################################
-# copy default host configs to $BUILDDIR
-#
-
-HOSTCONFIGDIR=${BUILDDIR}/hosts
-
-if [ -d $HOSTCONFIGDIR ]
-then
- rm -r $HOSTCONFIGDIR
-fi
-
-mkdir $HOSTCONFIGDIR
-
-cecho-n " * Copying default host config for.."
-
-for host in $STRONGSWANHOSTS
-do
- cecho-n "$host.."
- HOSTDIR=${HOSTCONFIGDIR}/$host
- mkdir $HOSTDIR
- cp -rfp $UMLTESTDIR/testing/hosts/default/* $HOSTDIR
- cp -rfp $UMLTESTDIR/testing/hosts/$host/* $HOSTDIR
-done
-
-cgecho "done"
-
-########################################
-# assign IP for each host to hostname
-#
-
-cecho-n " * Generate default config for.."
-
-HOSTIP=`ifconfig eth0 |grep inet |sed -e "s/.*inet addr://" -e "s/ Bcast.*//"`
-
-for host in $STRONGSWANHOSTS
-do
- cecho-n "${host}.."
- eval ipv4_${host}="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
- eval ipv6_${host}="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
-
- [ "`eval echo \\\$ipv4_${host}`" != "$HOSTIP" ] || die "$host has the same IP as eth0 (Host)! Please change that."
-
- case $host in
- moon)
- eval ipv4_moon1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- [ "`eval echo \\\$ipv4_moon1`" != "$HOSTIP" ] || die "eth1 of $host has the same IP as eth0 (Host)! Please change that."
- searchandreplace PH_IP_MOON1 $ipv4_moon1 $HOSTCONFIGDIR
- searchandreplace PH_IP_MOON $ipv4_moon $HOSTCONFIGDIR
- eval ipv6_moon1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP6_MOON1 $ipv6_moon1 $HOSTCONFIGDIR
- searchandreplace PH_IP6_MOON $ipv6_moon $HOSTCONFIGDIR
- ;;
- sun)
- eval ipv4_sun1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- [ "`eval echo \\\$ipv4_sun1`" != "$HOSTIP" ] || die "eth1 of $host has the same IP as eth0 (Host)! Please change that."
- searchandreplace PH_IP_SUN1 $ipv4_sun1 $HOSTCONFIGDIR
- searchandreplace PH_IP_SUN $ipv4_sun $HOSTCONFIGDIR
- eval ipv6_sun1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP6_SUN1 $ipv6_sun1 $HOSTCONFIGDIR
- searchandreplace PH_IP6_SUN $ipv6_sun $HOSTCONFIGDIR
- ;;
- alice)
- eval ipv4_alice1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP_ALICE1 $ipv4_alice1 $HOSTCONFIGDIR
- searchandreplace PH_IP_ALICE $ipv4_alice $HOSTCONFIGDIR
- eval ipv6_alice1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP6_ALICE1 $ipv6_alice1 $HOSTCONFIGDIR
- searchandreplace PH_IP6_ALICE $ipv6_alice $HOSTCONFIGDIR
- ;;
- venus)
- searchandreplace PH_IP_VENUS $ipv4_venus $HOSTCONFIGDIR
- searchandreplace PH_IP6_VENUS $ipv6_venus $HOSTCONFIGDIR
- ;;
- bob)
- searchandreplace PH_IP_BOB $ipv4_bob $HOSTCONFIGDIR
- searchandreplace PH_IP6_BOB $ipv6_bob $HOSTCONFIGDIR
- ;;
- carol)
- eval ipv4_carol1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP_CAROL1 $ipv4_carol1 $HOSTCONFIGDIR
- searchandreplace PH_IP_CAROL $ipv4_carol $HOSTCONFIGDIR
- eval ipv6_carol1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP6_CAROL1 $ipv6_carol1 $HOSTCONFIGDIR
- searchandreplace PH_IP6_CAROL $ipv6_carol $HOSTCONFIGDIR
- ;;
- dave)
- eval ipv4_dave1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP_DAVE1 $ipv4_dave1 $HOSTCONFIGDIR
- searchandreplace PH_IP_DAVE $ipv4_dave $HOSTCONFIGDIR
- eval ipv6_dave1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
- searchandreplace PH_IP6_DAVE1 $ipv6_dave1 $HOSTCONFIGDIR
- searchandreplace PH_IP6_DAVE $ipv6_dave $HOSTCONFIGDIR
- ;;
- winnetou)
- searchandreplace PH_IP_WINNETOU $ipv4_winnetou $HOSTCONFIGDIR
- searchandreplace PH_IP6_WINNETOU $ipv6_winnetou $HOSTCONFIGDIR
- ;;
- esac
-done
-
-cgecho "done"
diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs
index d5b347973..ada9696c7 100755
--- a/testing/scripts/build-umlhostfs
+++ b/testing/scripts/build-umlhostfs
@@ -25,10 +25,12 @@ DIR=`dirname $0`
[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
. $DIR/../testing.conf
-cd $BUILDDIR/root-fs
BASE=$BUILDDIR/base.img
+ROOTFSDIR=$BUILDDIR/root-fs
+HOSTSDIR=$DIR/../hosts
[ -f $BASE ] || die "Base image $BASE not found"
+[ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found"
mkdir -p $BUILDDIR
mkdir -p $LOOPDIR
@@ -42,9 +44,10 @@ fi
for host in $HOSTS
do
log_action "Creating guest image for $host"
- execute "cp $BASE $host.img" 0
- execute "mount -o loop $host.img $LOOPDIR" 0
- execute "cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR" 0
+ execute "cp $BASE $ROOTFSDIR/$host.img" 0
+ execute "mount -o loop $ROOTFSDIR/$host.img $LOOPDIR" 0
+ execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0
+ execute "cp -rf $HOSTSDIR/default/etc $LOOPDIR" 0
if [ "$host" = "winnetou" ]
then
execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0
diff --git a/testing/scripts/restore-defaults b/testing/scripts/restore-defaults
index 64cc0262e..6bad3c5f0 100755
--- a/testing/scripts/restore-defaults
+++ b/testing/scripts/restore-defaults
@@ -16,11 +16,10 @@
DIR=`dirname $0`
-source $DIR/function.sh
+. $DIR/function.sh
[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-
-source $DIR/../testing.conf
+. $DIR/../testing.conf
##########################################################################
# load-testconfig requires a testname as an argument
@@ -28,7 +27,7 @@ source $DIR/../testing.conf
testname=$1
-HOSTCONFIGDIR=$BUILDDIR/hosts
+HOSTCONFIGDIR=$DIR/../hosts
TESTSDIR=$BUILDDIR/tests
[ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
diff --git a/testing/testing.conf b/testing/testing.conf
index 6bb97dd7f..59ed9b358 100755
--- a/testing/testing.conf
+++ b/testing/testing.conf
@@ -74,7 +74,6 @@ TZUML="Europe/Zurich"
ENABLE_BUILD_BASEIMAGE="yes"
ENABLE_BUILD_UMLKERNEL="yes"
ENABLE_BUILD_UMLROOTFS="yes"
-ENABLE_BUILD_HOSTCONFIG="yes"
ENABLE_BUILD_UMLHOSTFS="yes"
##############################################################