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/node-hook.sh

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

78 lines
1.8 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
#
2021-09-22 10:42:03 +02:00
# Test hooks in villas node
#
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
set -e
DIR=$(mktemp -d)
pushd ${DIR}
function finish {
popd
rm -rf ${DIR}
}
trap finish EXIT
cat > expect.dat <<EOF
1553690684.041211800-4.313770e-02(5) 6.303265 0.492616 0.309017 -1.000000 0.800000 0.050000
1553690684.051211800-5.287260e-02(6) 5.673902 0.148827 0.368125 -1.000000 0.760000 0.060000
1553690684.061211800-6.266780e-02(7) 5.896198 0.232320 0.425779 -1.000000 0.720000 0.070000
1553690684.071211800-7.256350e-02(8) 5.788125 0.152309 0.481754 -1.000000 0.680000 0.080000
1553690684.081211800-8.251890e-02(9) 6.748635 0.608491 0.535827 -1.000000 0.640000 0.090000
EOF
cat > config.json <<EOF
{
"idle_stop": true,
"nodes": {
"sig": {
"type": "signal",
"signal": "mixed",
"realtime": false,
"limit": 10,
"rate": 100,
"values": 5
},
"file": {
"type": "file",
"uri": "output.dat"
}
},
"paths": [
{
"in": "sig",
"out": "file",
"hooks": [
{
"type": "average",
"signals": [ "random", "sine", "square", "triangle", "ramp" ],
"offset": 0
},
{
"type": "skip_first",
"samples": 5
},
{
"type": "scale",
"scale": 10,
"offset": 5,
"signal": "average"
}
]
}
]
}
EOF
villas node config.json
villas compare output.dat expect.dat