diff --git a/tools/jenkins/configurations/kvm.sh b/tools/jenkins/configurations/kvm.sh index 0e239d2..7239e4d 100755 --- a/tools/jenkins/configurations/kvm.sh +++ b/tools/jenkins/configurations/kvm.sh @@ -2,16 +2,17 @@ EXECUTOR_NUMBER=$1 CONFIGURATION=$2 +ADAPTER=$3 function usage() { echo "Usage: $0 - Build a test configuration" echo "" - echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION]" + echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER]" exit 1 } # Validate inputs -if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" ]]; then +if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" || "$ADAPTER" = ""]]; then usage fi @@ -23,14 +24,16 @@ cd ../../.. TOP_DIR=(pwd) # Name test instance based on executor -NAME=executor-$EXECUTOR_NUMBER -virsh destroy `virsh list | grep $NAME | cut -d " " -f1` || true +BASE_NAME=executor-`printf "%02d" $EXECUTOR_NUMBER` +GUEST_NAME=$BASE_NAME.$ADAPTER +virsh destroy `virsh list | grep $BASE_NAME | cut -d " " -f1` || true +rm -f /var/lib/libvirt/dnsmasq/$BASE_NAME*.leases # Configure localrc cat <localrc RECLONE=yes GUEST_NETWORK=$EXECUTOR_NUMBER -GUEST_NAME=$NAME +GUEST_NAME=$GUEST_NAME FLOATING_RANGE=192.168.$EXECUTOR_NUMBER.128/27 GUEST_CORES=4 GUEST_RAM=1000000 diff --git a/tools/jenkins/jenkins_home/jobs/kvm/config.xml b/tools/jenkins/jenkins_home/jobs/kvm/config.xml index 02efbc9..32ce768 100644 --- a/tools/jenkins/jenkins_home/jobs/kvm/config.xml +++ b/tools/jenkins/jenkins_home/jobs/kvm/config.xml @@ -58,7 +58,7 @@ set -o errexit cd tools/jenkins -sudo ./build_configuration.sh $EXECUTOR_NUMBER kvm +sudo ./build_configuration.sh $EXECUTOR_NUMBER kvm $ADAPTER set -o errexit