1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/tests/integration/relay.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.4 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
#
# Integration test for villas relay
#
2022-03-15 09:18:01 -04:00
# Author: Steffen Vogel <post@steffenvogel.de>
2022-03-15 09:28:57 -04:00
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
2022-07-04 18:20:03 +02:00
# SPDX-License-Identifier: Apache-2.0
2022-01-11 10:18:05 -05:00
echo "Test is broken"
exit 99
set -e
DIR=$(mktemp -d)
pushd ${DIR}
function finish {
popd
rm -rf ${DIR}
2022-01-11 09:11:04 -05:00
kill ${PID_RELAY}
}
trap finish EXIT
NUM_SAMPLES=100
cat > config.json << EOF
{
"nodes": {
"relay1": {
"type": "websocket",
2022-01-11 09:11:04 -05:00
"wait_connected": true,
"destinations": [
"http://localhost:8123/node"
]
2022-01-11 09:11:04 -05:00
},
"relay2": {
"type": "websocket",
2022-01-11 09:11:04 -05:00
"wait_connected": true,
"destinations": [
"http://localhost:8123/node"
]
}
}
}
EOF
2022-01-11 09:11:04 -05:00
VILLAS_LOG_PREFIX="[signal] " \
villas signal -l ${NUM_SAMPLES} -n random > input.dat
# Test with loopback
2022-01-11 09:11:04 -05:00
VILLAS_LOG_PREFIX="[relay] " \
villas relay -l -p 8123 &
2022-01-11 09:11:04 -05:00
PID_RELAY=$!
2022-01-11 09:11:04 -05:00
VILLAS_LOG_PREFIX="[pipe1] " \
villas pipe config.json relay1 < input.dat > output.dat
2022-01-11 09:11:04 -05:00
VILLAS_LOG_PREFIX="[compare] " \
villas compare input.dat output.dat
2022-01-11 09:11:04 -05:00
# VILLAS_LOG_PREFIX="[pipe2-recv] " \
# villas pipe config.json -r relay2 > output.dat &
2022-01-11 09:11:04 -05:00
# sleep 0.1
2022-01-11 09:11:04 -05:00
# VILLAS_LOG_PREFIX="[pipe2-send] " \
# villas pipe config.json -s relay1 < input.dat
2022-01-11 09:11:04 -05:00
# VILLAS_LOG_PREFIX="[compare] " \
# villas compare input.dat output.dat