diff --git a/tests/node-infiniband-benchmark.sh b/tests/node-infiniband-benchmark.sh new file mode 100755 index 000000000..7857d5c2c --- /dev/null +++ b/tests/node-infiniband-benchmark.sh @@ -0,0 +1,186 @@ +#!/bin/bash +# +# Integration Infiniband test using villas-node. +# +# @author Dennis Potter +# @copyright 2018, Institute for Automation of Complex Power Systems, EONERC +# @license GNU General Public License (version 3) +# +# VILLASnode +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +################################################################################## + +# Check if user is superuser. SU is used for namespace +if [[ "$EUID" -ne 0 ]]; then + echo "Please run as root" + exit 99 +fi + +# Check if Infiniband card is present +if [[ ! $(lspci | grep Infiniband) ]]; then + echo "Did not find any Infiniband cards in system" + exit 99 +fi + + +SCRIPT=$(realpath $0) +SCRIPTPATH=$(dirname ${SCRIPT}) +source ${SCRIPTPATH}/../tools/integration-tests-helper.sh + +CONFIG_FILE=$(mktemp /tmp/ib-configuration-XXXX.conf) +CONFIG_FILE_TARGET=$(mktemp /tmp/ib-configuration-target-XXXX.conf) +CONFIG_FILE_SOURCE=$(mktemp /tmp/ib-configuration-source-XXXX.conf) +INPUT_FILE=$(mktemp) + +NUM_VALUES=5 +RATE_SAMPLES=10000 +NUM_SAMPLES=100000 + +# Set config file with a MODE flag +cat > ${CONFIG_FILE} < ${CONFIG_FILE_TARGET} < ${CONFIG_FILE_SOURCE} <