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.
29 lines
603 B
Bash
Executable File
29 lines
603 B
Bash
Executable File
#!/bin/bash
|
|
|
|
. $PWD/scripts/function.sh
|
|
|
|
NETWORKS="vnet1 vnet2 vnet3"
|
|
CONFDIR=$PWD/config/kvm
|
|
KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
|
|
KNLTARGET=/var/run/kvm-swan-kernel
|
|
|
|
echo "Starting test environment"
|
|
|
|
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
|
|
|
log_action "Deploying kernel $KERNEL"
|
|
execute "ln -fs $KNLSRC $KNLTARGET"
|
|
|
|
for net in $NETWORKS
|
|
do
|
|
log_action "Network $net"
|
|
execute "virsh net-create $CONFDIR/$net.xml"
|
|
done
|
|
|
|
for host in $STRONGSWANHOSTS
|
|
do
|
|
ln -fs $ROOTFSDIR/$host.img $VIRTIMGSTORE/$host.img
|
|
log_action "Guest $host"
|
|
execute "virsh create $CONFDIR/$host.xml"
|
|
done
|