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

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

46 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
2019-06-27 01:36:35 +02:00
#
# Integration test for gate hook.
#
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
2019-06-27 01:36:35 +02:00
set -e
2019-06-27 01:36:35 +02:00
DIR=$(mktemp -d)
pushd ${DIR}
function finish {
popd
rm -rf ${DIR}
}
trap finish EXIT
cat > input.dat <<EOF
2019-06-27 01:36:35 +02:00
# seconds.nanoseconds(sequence) random sine square triangle ramp
1561591854.277376100(0) 0.022245 -0.136359 1.000000 -0.912920 0.104354
1561591854.377354600(1) 0.015339 0.135690 -1.000000 0.913350 0.204333
1561591854.475834300(2) 0.027500 -0.088233 1.000000 -0.943756 0.302812
1561591854.575995900(3) 0.040320 0.093289 -1.000000 0.940524 0.402974
1561591854.675955300(4) 0.026079 -0.092019 1.000000 -0.941336 0.502933
1561591854.776188900(5) 0.049262 0.099324 -1.000000 0.936664 0.603167
1561591854.875119100(6) 0.014883 -0.065832 1.000000 -0.958060 0.702097
1561591854.974264200(7) 0.023232 0.039012 -1.000000 0.975158 0.801242
1561591855.077804200(8) 0.015231 -0.149670 1.000000 -0.904358 0.904782
1561591855.174828300(9) 0.060849 0.056713 -1.000000 0.963876 1.001806
EOF
cat > expect.dat <<EOF
2019-06-27 01:36:35 +02:00
# seconds.nanoseconds+offset(sequence) signal0 signal1 signal2 signal3 signal4
1561591854.277376100(0) 0.022245 -0.136359 1.000000 -0.912920 0.104354
1561591854.475834300(2) 0.027500 -0.088233 1.000000 -0.943756 0.302812
1561591854.675955300(4) 0.026079 -0.092019 1.000000 -0.941336 0.502933
1561591854.875119100(6) 0.014883 -0.065832 1.000000 -0.958060 0.702097
1561591855.077804200(8) 0.015231 -0.149670 1.000000 -0.904358 0.904782
EOF
villas hook gate -o signal=signal2 -o mode=above < input.dat > output.dat
2019-06-27 01:36:35 +02:00
villas compare output.dat expect.dat