Use qemu/KVM virtualization instead of UML

Guest and network configuration is setup using the libvirt
virtualization API. The [start|stop]_testing scripts have been updated
accordingly.

qemu/KVM does not currently support a hostfs, so the shared build tree
mount has been dropped for now.
This commit is contained in:
Reto Buerki
2013-01-17 16:54:52 +01:00
committed by Tobias Brunner
parent f9df3d06b5
commit 9b3316ed27
21 changed files with 568 additions and 408 deletions
-5
View File
@@ -55,10 +55,5 @@ do
execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r"
done
log_action "Setting up shared build tree at /root/compile"
echo "" >> $LOOPDIR/etc/fstab
echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab
log_status 0
log_action "Removing /etc/resolv.conf"
execute "rm -f $LOOPDIR/etc/resolv.conf"
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
# Install strongSwan from mounted strongswan-shared tree
#
# Copyright (C) 2006 Martin Willi
# Hochschule fuer Technik Rapperswil
# 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.
#
. $PWD/scripts/function.sh
cecho "installing strongSwan from shared tree"
cecho-n " on: "
for host in $STRONGSWANHOSTS
do
eval HOSTLOGIN="root@`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
cecho-n "$host... "
ssh $HOSTLOGIN 'cd ~/strongswan-shared && make install' > /dev/null
done
cecho
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
# Install strongSwan from mounted strongswan-shared tree
#
# Copyright (C) 2006 Martin Willi
# Hochschule fuer Technik Rapperswil
# 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.
#
. $PWD/scripts/function.sh
cecho "shutting down"
cecho-n " "
for host in $STRONGSWANHOSTS
do
eval HOSTLOGIN="root@`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
cecho-n "$host... "
ssh $HOSTLOGIN 'shutdown now -h' > /dev/null
done
cecho
-64
View File
@@ -1,64 +0,0 @@
#!/bin/bash
# start the UML bridges in the kernel using the brctl command
#
# Copyright (C) 2009 Andreas Steffen
# HSR Hochschule fuer Technik Rapperswil
#
# 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
# create umlbr1 and its taps
#
if [ `brctl show | grep umlbr1 | wc -l` -eq 1 ]
then
cecho " * Great, umlbr1 is already running!"
else
cecho-n " * Starting umlbr1 with taps.."
umlbr_add 1 10.1.0.254 255.255.0.0
umlbr_add_tap 1 alice
umlbr_add_tap 1 venus
umlbr_add_tap 1 moon
cgecho "done"
fi
# create umlbr0 and its taps
#
if [ `brctl show | grep umlbr0 | wc -l` -eq 1 ]
then
cecho " * Great, umlbr0 is already running!"
else
cecho-n " * Starting umlbr0 with taps.."
umlbr_add 0 192.168.0.254 255.255.255.0
umlbr_add_tap 0 alice
umlbr_add_tap 0 moon
umlbr_add_tap 0 carol
umlbr_add_tap 0 winnetou
umlbr_add_tap 0 dave
umlbr_add_tap 0 sun
cgecho "done"
fi
# create umlbr2 and its taps
#
if [ `brctl show | grep umlbr2 | wc -l` -eq 1 ]
then
cecho " * Great, umlbr2 is already running!"
else
cecho-n " * Starting umlbr2 with taps.."
umlbr_add 2 10.2.0.254 255.255.0.0
umlbr_add_tap 2 sun
umlbr_add_tap 2 bob
cgecho "done"
fi
-101
View File
@@ -1,101 +0,0 @@
#!/bin/bash
# starts the UML instances with a hidden screen
#
# 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.
. $PWD/scripts/function.sh
if [ "$#" -eq 0 ]
then
HOSTS=$STRONGSWANHOSTS
else
HOSTS=$*
fi
BOOTING_HOSTS=""
count_max=12
count=0
for host in $HOSTS
do
up=0
if [ -d ~/.uml/${host} ]
then
pid=`cat ~/.uml/${host}/pid`
up=`ps up $pid | wc -l`
fi
if [ $up -eq 2 ]
then
cecho " * Great, ${host} is already running!"
else
rm -rf ~/.uml/${host}
BOOTING_HOSTS="$BOOTING_HOSTS ${host}"
let "count_max += 12"
UMLHOSTFS=$BUILDDIR/root-fs/${host}.img
[ -f $UMLHOSTFS ] || die "!! uml root file system '$UMLHOSTFS' not found"
cecho-n " * Starting ${host}.."
eval setsid $UMLKERNEL umid=${host} ubda=$UMLHOSTFS \$SWITCH_${host} mem=${MEM}M con=null con1=xterm >>$LOGFILE 2>&1 &
cgecho "done"
fi
done
if [ -z "$BOOTING_HOSTS" ]
then
exit 0
fi
cecho " * Waiting for the uml instances to finish booting"
for host in $BOOTING_HOSTS
do
cecho-n " * Checking on $host.."
while [ $count -lt $count_max ] && [ ! -d ~/.uml/$host ]
do
cecho-n "."
sleep 5
let "count+=1"
done
if [ $count -ge $count_max ]
then
cecho "exit"
exit 1
fi
up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
while [ $count -lt $count_max ] && [ $up -eq 0 ]
do
cecho-n "."
sleep 5
up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
let "count+=1"
done
if [ $count -ge $count_max ]
then
cecho "exit"
exit 1
else
cgecho "up"
fi
done
cecho " * All uml instances are up now"
-49
View File
@@ -1,49 +0,0 @@
#!/bin/bash
# stop the UML bridges in the kernel using the brctl command
#
# Copyright (C) 2009 Andreas Steffen
# HSR Hochschule fuer Technik Rapperswil
#
# 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
# stop umlbr1 and its taps
#
cecho-n " * Stopping umlbr1 with taps.."
umlbr_del_tap 1 alice
umlbr_del_tap 1 venus
umlbr_del_tap 1 moon
umlbr_del 1
cgecho "done"
# stop umlbr0 and its taps
#
cecho-n " * Stopping umlbr0 with taps.."
umlbr_del_tap 0 alice
umlbr_del_tap 0 moon
umlbr_del_tap 0 carol
umlbr_del_tap 0 winnetou
umlbr_del_tap 0 dave
umlbr_del_tap 0 sun
umlbr_del 0
cgecho "done"
# stop umlbr2 and its taps
#
cecho-n " * Stopping umlbr2 with taps.."
umlbr_del_tap 2 sun
umlbr_del_tap 2 bob
umlbr_del 2
cgecho "done"