strongswan/testing/start-testing
Reto Buerki 2c4954ad24 Switch to 'mapped' access mode for hostfs
Passthrough mode only works as expected when running as root. On
Debian/Ubuntu systems qemu runs as user 'libvirt-qemu' and group 'kvm'
so all shared files must be chowned to grant access from guests.

Symlinks created on the host are still problematic because the Plan 9
filesystem has no direct notion of symbolic links, see [1].

[1] - http://ericvh.github.com/9p-rfc/rfc9p2000.u.html
2013-01-17 16:55:04 +01:00

38 lines
859 B
Bash
Executable File

#!/bin/bash
DIR=$(dirname `readlink -f $0`)
. $DIR/testing.conf
. $DIR/scripts/function.sh
NETWORKS="vnet1 vnet2 vnet3"
CONFDIR=$DIR/config/kvm
KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
KNLTARGET=/var/run/kvm-swan-kernel
HOSTFSTARGET=/var/run/kvm-swan-hostfs
echo "Starting test environment"
[ `id -u` -eq 0 ] || die "You must be root to run $0"
check_commands virsh
log_action "Deploying kernel $KERNEL"
execute "ln -fs $KNLSRC $KNLTARGET"
log_action "Deploying $SHAREDDIR as hostfs"
execute "chown -R $KVMUSER:$KVMGROUP $SHAREDDIR" 0
execute "ln -Tfs $SHAREDDIR $HOSTFSTARGET"
for net in $NETWORKS
do
log_action "Network $net"
execute "virsh net-create $CONFDIR/$net.xml"
done
for host in $STRONGSWANHOSTS
do
ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
log_action "Guest $host"
execute "virsh create $CONFDIR/$host.xml"
done