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

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

27 lines
573 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2018-03-28 14:13:13 +02:00
#
# Integration test for limit_rate 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
2018-03-28 14:13:13 +02:00
set -e
2018-03-28 14:13:13 +02:00
DIR=$(mktemp -d)
pushd ${DIR}
2018-03-28 14:13:13 +02:00
function finish {
popd
rm -rf ${DIR}
}
trap finish EXIT
2018-03-28 14:13:13 +02:00
villas signal -r 1000 -l 1000 -n sine > input.dat
2018-03-28 14:13:13 +02:00
awk 'NR % 10 == 2' < input.dat > expect.dat
2018-03-28 14:13:13 +02:00
villas hook -o rate=100 -o mode=origin limit_rate < input.dat > output.dat
2018-03-28 14:13:13 +02:00
villas compare output.dat expect.dat