1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00
VILLASnode/tests/integration/node-multiple-destinations.sh
Steffen Vogel bc24676138 Use spaces for indention of shell scripts
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00

56 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# Integration loopback test using villas node.
#
# This test checks if a single node can be used as an input
# in multiple paths.
#
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
set -e
set -x
DIR=$(mktemp -d)
pushd ${DIR}
function finish {
popd
rm -rf ${DIR}
}
trap finish EXIT
cat > config.json <<EOF
{
"nodes": {
"sig_1": {
"type": "signal",
"values": 1,
"signal": "counter",
"offset": 100,
"limit": 10
},
"file_1": {
"type": "file",
"uri": "output1.dat"
}
},
"paths": [
{
"in": "sig_1",
"out": "file_1"
},
{
"in": "sig_1",
"out": "file_1"
}
]
}
EOF
# This configuration is invalid and must fail
! villas node config.json 2> error.log
# Error log must include description
grep -q "Every node must only be used by a single path as destination" error.log