mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added integration test for villas-pipe doing a simple loopback
This commit is contained in:
parent
e420abede2
commit
45309bc45d
1 changed files with 31 additions and 0 deletions
31
tests/integration/pipe-loopback.sh
Executable file
31
tests/integration/pipe-loopback.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
CONFIG_FILE=$(mktemp)
|
||||
INPUT_FILE=$(mktemp)
|
||||
OUTPUT_FILE=$(mktemp)
|
||||
|
||||
cat > ${CONFIG_FILE} <<- EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "socket";
|
||||
layer = "udp";
|
||||
|
||||
local = "*:12000";
|
||||
remote = "127.0.0.1:12000"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Generate test data
|
||||
villas-signal random -l 10 -n > ${INPUT_FILE}
|
||||
|
||||
# We delay EOF of the INPUT_FILE by 1 second in order to wait for incoming data to be received
|
||||
villas-pipe ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < <(cat ${INPUT_FILE}; sleep 1; echo -n)
|
||||
|
||||
# Comapre data
|
||||
villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE}
|
||||
RC=$?
|
||||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE}
|
||||
|
||||
exit $RC
|
Loading…
Add table
Reference in a new issue