dce089ad2af8d6405ef78a5c7f2ce29291fb4955
[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
10 echo "Starting test environment"
11
12 [ `id -u` -eq 0 ] || die "You must be root to run $0"
13
14 check_commands virsh
15
16 log_action "Deploying kernel $KERNEL"
17 execute "ln -fs $KNLSRC $KNLTARGET"
18
19 for net in $NETWORKS
20 do
21         log_action "Network $net"
22         execute "virsh net-create $CONFDIR/$net.xml"
23 done
24
25 for host in $STRONGSWANHOSTS
26 do
27         ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
28         log_action "Guest $host"
29         execute "virsh create $CONFDIR/$host.xml"
30 done