diff options
author | Reto Buerki <reet@codelabs.ch> | 2012-12-10 10:05:02 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-01-17 16:54:55 +0100 |
commit | 258cbd40cff463f4adb57f40d3338e460c7e90f2 (patch) | |
tree | 583071ab62498bf3213861a09e676e3f22d94b48 /testing | |
parent | aba43136c262151b3f213a2253eddc62a07c7e88 (diff) | |
download | strongswan-258cbd40cff463f4adb57f40d3338e460c7e90f2.tar.bz2 strongswan-258cbd40cff463f4adb57f40d3338e460c7e90f2.tar.xz |
Unify naming of base,root image settings
Diffstat (limited to 'testing')
-rwxr-xr-x | testing/scripts/build-baseimage | 14 | ||||
-rwxr-xr-x | testing/scripts/build-umlhostfs | 8 | ||||
-rwxr-xr-x | testing/scripts/build-umlrootfs | 19 | ||||
-rwxr-xr-x | testing/start-testing | 2 | ||||
-rwxr-xr-x | testing/stop-testing | 2 | ||||
-rw-r--r-- | testing/testing.conf | 27 |
6 files changed, 39 insertions, 33 deletions
diff --git a/testing/scripts/build-baseimage b/testing/scripts/build-baseimage index 915d1102a..5bf727fbf 100755 --- a/testing/scripts/build-baseimage +++ b/testing/scripts/build-baseimage @@ -23,17 +23,17 @@ APTCACHE=$LOOPDIR/var/cache/apt/archives mkdir -p $LOOPDIR mkdir -p $BUILDDIR mkdir -p $CACHEDIR -rm -f $ROOTFS +rm -f $BASEIMG -echo "`date`, building $ROOTFS" >>$LOGFILE +echo "`date`, building $BASEIMG" >>$LOGFILE load_qemu_nbd -log_action "Creating image $ROOTFS" -execute "qemu-img create -f qcow2 $ROOTFS ${ROOTFSSIZE}M" +log_action "Creating base image $BASEIMG" +execute "qemu-img create -f $IMGEXT $BASEIMG ${BASEIMGSIZE}M" log_action "Connecting image to NBD device $NBDEV" -execute "qemu-nbd -c $NBDEV $ROOTFS" +execute "qemu-nbd -c $NBDEV $BASEIMG" do_on_exit qemu-nbd -d $NBDEV log_action "Partitioning disk" @@ -61,8 +61,8 @@ mkdir -p $APTCACHE execute "mount -o bind $CACHEDIR $APTCACHE" do_on_exit graceful_umount $APTCACHE -log_action "Running debootstrap ($ROOTFSSUITE, $ROOTFSARCH)" -execute "debootstrap --arch=$ROOTFSARCH --include=$INC --exclude $EXC $ROOTFSSUITE $LOOPDIR $ROOTFSMIRROR" +log_action "Running debootstrap ($BASEIMGSUITE, $BASEIMGARCH)" +execute "debootstrap --arch=$BASEIMGARCH --include=$INC --exclude $EXC $BASEIMGSUITE $LOOPDIR $BASEIMGMIRROR" for service in $SERVICES do diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index ed026b6e8..fc2660c08 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -20,10 +20,9 @@ echo "Creating guest images" [ `id -u` -eq 0 ] || die "You must be root to run $0" -BASE=$BUILDDIR/base.qcow2 HOSTSDIR=$PWD/hosts -[ -f $BASE ] || die "Base image $BASE not found" +[ -f $ROOTIMG ] || die "Root image $ROOTIMG not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" check_commands partprobe qemu-img qemu-nbd @@ -32,6 +31,7 @@ load_qemu_nbd mkdir -p $BUILDDIR mkdir -p $LOOPDIR +mkdir -p $GUESTIMGDIR if [ "$#" -eq 0 ]; then HOSTS=$STRONGSWANHOSTS @@ -46,8 +46,8 @@ do_on_exit umount $LOOPDIR for host in $HOSTS do log_action "Creating guest image for $host" - execute "qemu-img create -b $BASE -f qcow2 $ROOTFSDIR/$host.qcow2" 0 - execute "qemu-nbd -c $NBDEV $ROOTFSDIR/$host.qcow2" 0 + execute "qemu-img create -b $ROOTIMG -f $IMGEXT $GUESTIMGDIR/$host.$IMGEXT" 0 + execute "qemu-nbd -c $NBDEV $GUESTIMGDIR/$host.$IMGEXT" 0 partprobe $NBDEV execute "mount $NBDPARTITION $LOOPDIR" 0 execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0 diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index f6bcaa78e..1c452f476 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -20,23 +20,20 @@ echo "Building root image" [ `id -u` -eq 0 ] || die "You must be root to run $0" -[ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" +[ -f "$BASEIMG" ] || die "Base image $BASEIMG not found" check_commands partprobe qemu-nbd load_qemu_nbd -mkdir -p $ROOTFSDIR mkdir -p $LOOPDIR -mkdir -p $ROOTFSCOMPILEDIR -cd $ROOTFSDIR +mkdir -p $ROOTIMGCOMPILEDIR -BASE=$BUILDDIR/base.qcow2 -log_action "Creating $BASE" -execute "cp $ROOTFS $BASE" +log_action "Creating root image $ROOTIMG" +execute "cp $BASEIMG $ROOTIMG" -log_action "Connecting base image to NBD device $NBDEV" -execute "qemu-nbd -c $NBDEV $BASE" +log_action "Connecting root image to NBD device $NBDEV" +execute "qemu-nbd -c $NBDEV $ROOTIMG" do_on_exit qemu-nbd -d $NBDEV partprobe $NBDEV @@ -49,8 +46,8 @@ execute "mount -t proc none $LOOPDIR/proc" do_on_exit umount $LOOPDIR/proc mkdir -p $LOOPDIR/root/compile -log_action "Mounting $ROOTFSCOMPILEDIR as /root/compile" -execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile" +log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile" +execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile" do_on_exit umount $LOOPDIR/root/compile echo "Installing software from source" diff --git a/testing/start-testing b/testing/start-testing index e4083bb4d..e8cca028b 100755 --- a/testing/start-testing +++ b/testing/start-testing @@ -22,7 +22,7 @@ done for host in $STRONGSWANHOSTS do - ln -fs $ROOTFSDIR/$host.qcow2 $VIRTIMGSTORE/$host.qcow2 + ln -fs $GUESTIMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT log_action "Guest $host" execute "virsh create $CONFDIR/$host.xml" done diff --git a/testing/stop-testing b/testing/stop-testing index 0f38bc4c4..12f18fa2f 100755 --- a/testing/stop-testing +++ b/testing/stop-testing @@ -19,7 +19,7 @@ for host in $STRONGSWANHOSTS do log_action "Guest $host" execute "virsh destroy $host" - rm -f $VIRTIMGSTORE/$host.qcow2 + rm -f $VIRTIMGSTORE/$host.$IMGEXT done log_action "Removing kernel $KERNEL" diff --git a/testing/testing.conf b/testing/testing.conf index edb7102b4..d4f520de1 100644 --- a/testing/testing.conf +++ b/testing/testing.conf @@ -36,16 +36,25 @@ LOGFILE=$BUILDDIR/testing.log # Directory used for loop-mounts LOOPDIR=$BUILDDIR/loop +# Image extension +IMGEXT=qcow2 + # Base image settings -ROOTFSSIZE=1024 -ROOTFSSUITE=wheezy -ROOTFSARCH=amd64 -ROOTFS=$BUILDDIR/debian-$ROOTFSSUITE-$ROOTFSARCH.qcow2 -ROOTFSMIRROR=http://cdn.debian.net/debian -ROOTFSCOMPILEDIR=$BUILDDIR/compile - -# Path to guest images -ROOTFSDIR=$BUILDDIR/root-fs +# The base image is a pristine OS installation created using debootstrap. +BASEIMGSIZE=1024 +BASEIMGSUITE=wheezy +BASEIMGARCH=amd64 +BASEIMG=$BUILDDIR/debian-$BASEIMGSUITE-$BASEIMGARCH.$IMGEXT +BASEIMGMIRROR=http://cdn.debian.net/debian + +# Root image settings +# The root image is the origin of all guest images. It contains additional +# test-specific software and patches. +ROOTIMG=$BUILDDIR/root.$IMGEXT +ROOTIMGCOMPILEDIR=$BUILDDIR/compile + +# Guest images settings +GUESTIMGDIR=$BUILDDIR/guest-images # libvirt config NBDEV=/dev/nbd0 |