A small nit-pick change that ensures that cases where the number of arguments being >1 does not result in the argument checking being skipped (NOTE: arguments after the first are never processed and are ignored). Change-Id: If7e9c16c2c3581ea95ed888586736618d1ae5f5f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71499 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Tested-by: kokoro <noreply+kokoro@google.com>
40 lines
1.3 KiB
Bash
Executable File
40 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
NUM_RUNNERS=20
|
|
NUM_BUILDERS=3
|
|
RUNNER_PREFIX="$(hostname)-runner-"
|
|
BUILDER_PREFIX="$(hostname)-builder-"
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
export VAGRANT_HOME=${SCRIPT_DIR}
|
|
|
|
param="up"
|
|
if [[ $# -ge 1 ]]; then
|
|
param=$1
|
|
if [[ "${param}" != "destroy" ]]; then
|
|
echo "Only valid parameter is 'destroy', to destroy all VMs"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
for (( i=1; i<=NUM_RUNNERS; i++ )); do
|
|
sed -i "s/ config.vm.define.*/ config.vm.define \"${RUNNER_PREFIX}${i}\"/g" Vagrantfile-runner
|
|
sed -i "s/ config.vm.hostname.*/ config.vm.hostname = \"${RUNNER_PREFIX}${i}\"/g" Vagrantfile-runner
|
|
if [[ "${param}" == "destroy" ]]; then
|
|
VAGRANT_VAGRANTFILE=Vagrantfile-runner vagrant destroy -f
|
|
else
|
|
VAGRANT_VAGRANTFILE=Vagrantfile-runner vagrant up --provider=libvirt
|
|
fi
|
|
done
|
|
|
|
for (( i=1; i<=NUM_BUILDERS; i++ )); do
|
|
sed -i "s/ config.vm.define.*/ config.vm.define \"${BUILDER_PREFIX}${i}\"/g" Vagrantfile-builder
|
|
sed -i "s/ config.vm.hostname.*/ config.vm.hostname = \"${BUILDER_PREFIX}${i}\"/g" Vagrantfile-builder
|
|
if [[ "${param}" == "destroy" ]]; then
|
|
VAGRANT_VAGRANTFILE=Vagrantfile-builder vagrant destroy -f
|
|
else
|
|
VAGRANT_VAGRANTFILE=Vagrantfile-builder vagrant up --provider=libvirt
|
|
fi
|
|
done
|