Export compile directory to guests
[strongswan.git] / testing / start-testing
1 #!/bin/bash
2
3 . $PWD/scripts/function.sh
4
5 NETWORKS="vnet1 vnet2 vnet3"
6 CONFDIR=$PWD/config/kvm
7 KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
8 KNLTARGET=/var/run/kvm-swan-kernel
9 HOSTFSTARGET=/var/run/kvm-swan-hostfs
10
11 echo "Starting test environment"
12
13 [ `id -u` -eq 0 ] || die "You must be root to run $0"
14
15 check_commands virsh
16
17 log_action "Deploying kernel $KERNEL"
18 execute "ln -fs $KNLSRC $KNLTARGET"
19
20 log_action "Deploying $ROOTIMGCOMPILEDIR as hostfs"
21 execute "ln -Tfs $ROOTIMGCOMPILEDIR $HOSTFSTARGET"
22
23 for net in $NETWORKS
24 do
25         log_action "Network $net"
26         execute "virsh net-create $CONFDIR/$net.xml"
27 done
28
29 for host in $STRONGSWANHOSTS
30 do
31         ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
32         log_action "Guest $host"
33         execute "virsh create $CONFDIR/$host.xml"
34 done