]> git.ipfire.org Git - people/ms/strongswan.git/blob - testing/start-testing
imv_policy_manager: Added capability to execute an allow or block shell command string
[people/ms/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 [ -f $KNLSRC ] || die "Kernel $KNLSRC not found"
21 log_action "Deploying kernel $KERNEL"
22 execute "ln -fs $KNLSRC $KNLTARGET"
23
24 log_action "Deploying $SHAREDDIR as hostfs"
25 execute "chown -R $KVMUSER:$KVMGROUP $SHAREDDIR" 0
26 execute "ln -Tfs $SHAREDDIR $HOSTFSTARGET"
27
28 for net in $NETWORKS
29 do
30 log_action "Network $net"
31 execute "virsh net-create $CONFDIR/$net.xml"
32 done
33
34 for host in $STRONGSWANHOSTS
35 do
36 ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
37 log_action "Guest $host"
38 execute "virsh create $CONFDIR/$host.xml"
39 done
40
41 # Enforce reception of multicast traffic on bridges
42 for br in $MCASTBRS
43 do
44 cd /sys/devices/virtual/net/$br/brif
45 for vnet in `find . -name "*eth?"`
46 do
47 echo 2 > $vnet/multicast_router
48 done
49 done
50
51 echo 0x08 > /sys/devices/virtual/net/test-br0/bridge/group_fwd_mask
52