Annotation of embedaddon/strongswan/testing/start-testing, revision 1.1.1.1

1.1       misho       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: [ -d $TESTRESULTSDIR ] || mkdir $TESTRESULTSDIR
                     31: log_action "Deploying $TESTRESULTSDIR as hostfs"
                     32: execute "ln -Tfs $TESTRESULTSDIR $TESTRESTULSTARGET"
                     33: 
                     34: for net in $NETWORKS
                     35: do
                     36:        log_action "Network $net"
                     37:        execute "virsh net-create $CONFDIR/$net.xml"
                     38: done
                     39: 
                     40: for host in $STRONGSWANHOSTS
                     41: do
                     42:        ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
                     43:        log_action "Guest $host"
                     44:        execute "virsh create $CONFDIR/$host.xml"
                     45: done
                     46: 
                     47: # Enforce reception of multicast traffic on bridges
                     48: for br in $MCASTBRS
                     49: do
                     50:        cd /sys/devices/virtual/net/$br/brif
                     51:        for vnet in `find . -name "*eth?"`
                     52:        do
                     53:                echo 2 > $vnet/multicast_router
                     54:        done
                     55: done
                     56: 
                     57: echo 0x08 > /sys/devices/virtual/net/test-br0/bridge/group_fwd_mask
                     58: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>