<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
- <filesystem type='mount' accessmode='passthrough'>
+ <filesystem type='mount' accessmode='mapped'>
<source dir='/var/run/kvm-swan-hostfs'/>
<target dir='/hostshare'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
-/hostshare /hostfs 9p trans=virtio,version=9p2000.L 0 0
+/hostshare /root/shared 9p trans=virtio,version=9p2000.L 0 0
. $DIR/testing.conf
rm -f $LOGFILE
+mkdir -p $BUILDDIR
if [ $ENABLE_BUILD_BASEIMAGE = "yes" ]
then
check_commands bunzip2 bzcat make wget
-mkdir -p $BUILDDIR
cd $BUILDDIR
if [ ! -f "$KERNELTARBALL" ]
load_qemu_nbd
mkdir -p $LOOPDIR
-mkdir -p $ROOTIMGCOMPILEDIR
+mkdir -p $SHAREDDIR/compile
mkdir -p $IMGDIR
log_action "Creating root image $ROOTIMG"
execute "mount -t proc none $LOOPDIR/proc"
do_on_exit umount $LOOPDIR/proc
-mkdir -p $LOOPDIR/root/compile
-log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile"
-execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile"
-do_on_exit rm -r $LOOPDIR/root/compile
-do_on_exit umount $LOOPDIR/root/compile
+mkdir -p $LOOPDIR/root/shared
+log_action "Mounting $SHAREDDIR as /root/shared"
+execute "mount -o bind $SHAREDDIR $LOOPDIR/root/shared"
+do_on_exit umount $LOOPDIR/root/shared
echo "Installing software from source"
RECPDIR=$DIR/recipes
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
-execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0
+execute "cp -r $RECPDIR/patches $LOOPDIR/root/shared/compile" 0
for r in $RECIPES
do
- cp $RECPDIR/$r ${LOOPDIR}/root/compile
+ cp $RECPDIR/$r ${LOOPDIR}/root/shared/compile
log_action "Installing from recipe $r"
- execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r"
+ execute_chroot "make SWANVERSION=$SWANVERSION -C /root/shared/compile -f $r"
done
log_action "Removing /etc/resolv.conf"
execute "rm -f $LOOPDIR/etc/resolv.conf"
-
-mkdir -p $LOOPDIR/hostfs
log_action "Deploying kernel $KERNEL"
execute "ln -fs $KNLSRC $KNLTARGET"
-log_action "Deploying $ROOTIMGCOMPILEDIR as hostfs"
-execute "ln -Tfs $ROOTIMGCOMPILEDIR $HOSTFSTARGET"
+log_action "Deploying $SHAREDDIR as hostfs"
+execute "chown -R $KVMUSER:$KVMGROUP $SHAREDDIR" 0
+execute "ln -Tfs $SHAREDDIR $HOSTFSTARGET"
for net in $NETWORKS
do
# Build directory where the guest kernel and images will be built
BUILDDIR=$TESTDIR/build
+# Directory shared between host and guests
+SHAREDDIR=$BUILDDIR/shared
# Logfile
LOGFILE=$BUILDDIR/testing.log
# The root image is the origin of all guest images. It is a clone of the base
# image and contains additional test-specific software and patches.
ROOTIMG=$IMGDIR/root.$IMGEXT
-ROOTIMGCOMPILEDIR=$BUILDDIR/compile
# libvirt config
NBDEV=/dev/nbd0
NBDPARTITION=${NBDEV}p1
VIRTIMGSTORE=/var/lib/libvirt/images
+KVMUSER=libvirt-qemu
+KVMGROUP=kvm
# Directory where test results will be stored
TESTRESULTSDIR=$TESTDIR/testresults