libimcv: No need to load AIK pubkey if AIK certificate is available
[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 TESTRESTULSTARGET=/var/run/kvm-swan-testresults
13 MCASTBRS="test-br0 test-br1"
14
15 echo "Starting test environment"
16
17 [ `id -u` -eq 0 ] || die "You must be root to run $0"
18 running_any $STRONGSWANHOSTS && die "Please stop test environment before running $0"
19
20 check_commands kvm virsh
21
22 [ -f $KNLSRC ] || die "Kernel $KNLSRC not found"
23 log_action "Deploying kernel $KERNEL"
24 execute "ln -fs $KNLSRC $KNLTARGET"
25
26 log_action "Deploying $SHAREDDIR as hostfs"
27 execute "chown -R $KVMUSER:$KVMGROUP $SHAREDDIR" 0
28 execute "ln -Tfs $SHAREDDIR $HOSTFSTARGET"
29
30 log_action "Deploying $TESTRESULTSDIR as hostfs"
31 execute "ln -Tfs $TESTRESULTSDIR $TESTRESTULSTARGET"
32
33 for net in $NETWORKS
34 do
35         log_action "Network $net"
36         execute "virsh net-create $CONFDIR/$net.xml"
37 done
38
39 for host in $STRONGSWANHOSTS
40 do
41         ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
42         log_action "Guest $host"
43         execute "virsh create $CONFDIR/$host.xml"
44 done
45
46 # Enforce reception of multicast traffic on bridges
47 for br in $MCASTBRS
48 do
49         cd /sys/devices/virtual/net/$br/brif
50         for vnet in `find . -name "*eth?"`
51         do
52                 echo 2 > $vnet/multicast_router
53         done
54 done
55
56 echo 0x08 > /sys/devices/virtual/net/test-br0/bridge/group_fwd_mask
57