fixed configure options
[strongswan.git] / testing / start-testing
1 #!/bin/bash
2
3 DIR=$(dirname `readlink -f $0`)
4 . $DIR/testing.conf
5 . $DIR/scripts/function.sh
6
7 NETWORKS="vnet1 vnet2 vnet3"
8 CONFDIR=$DIR/config/kvm
9 KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
10 KNLTARGET=/var/run/kvm-swan-kernel
11 HOSTFSTARGET=/var/run/kvm-swan-hostfs
12 MCASTBRS="test-br0 test-br1"
13
14 echo "Starting test environment"
15
16 [ `id -u` -eq 0 ] || die "You must be root to run $0"
17
18 check_commands kvm virsh
19
20 log_action "Deploying kernel $KERNEL"
21 execute "ln -fs $KNLSRC $KNLTARGET"
22
23 log_action "Deploying $SHAREDDIR as hostfs"
24 execute "chown -R $KVMUSER:$KVMGROUP $SHAREDDIR" 0
25 execute "ln -Tfs $SHAREDDIR $HOSTFSTARGET"
26
27 for net in $NETWORKS
28 do
29         log_action "Network $net"
30         execute "virsh net-create $CONFDIR/$net.xml"
31 done
32
33 for host in $STRONGSWANHOSTS
34 do
35         ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
36         log_action "Guest $host"
37         execute "virsh create $CONFDIR/$host.xml"
38 done
39
40 # Enforce reception of multicast traffic on bridges
41 for br in $MCASTBRS
42 do
43         cd /sys/devices/virtual/net/$br/brif
44         for vnet in `find . -name "*eth?"`
45         do
46                 echo 2 > $vnet/multicast_router
47         done
48 done
49
50 echo 0x08 > /sys/devices/virtual/net/test-br0/bridge/group_fwd_mask
51