mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
migrate integration tests to new config format
This commit is contained in:
parent
85351febb8
commit
7eaa93cd36
17 changed files with 145 additions and 120 deletions
|
@ -28,17 +28,19 @@ CONFIG_FILE=$(mktemp)
|
|||
FETCHED_NODES=$(mktemp)
|
||||
|
||||
cat > ${CONFIG_FILE} <<EOF
|
||||
nodes = {
|
||||
testnode1 = {
|
||||
type = "websocket";
|
||||
dummy = "value1";
|
||||
},
|
||||
testnode2 = {
|
||||
type = "socket";
|
||||
dummy = "value2";
|
||||
{
|
||||
"nodes" : {
|
||||
"testnode1" : {
|
||||
"type" : "websocket",
|
||||
"dummy" : "value1"
|
||||
},
|
||||
"testnode2" : {
|
||||
"type" : "socket",
|
||||
"dummy" : "value2",
|
||||
|
||||
local = "*:12001";
|
||||
remote = "localhost:12000";
|
||||
"local" : "*:12001",
|
||||
"remote" : "localhost:12000"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
@ -61,4 +63,4 @@ RC=$?
|
|||
|
||||
rm -f ${CONFIG_FILE} ${FETCHED_NODES}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -52,13 +52,13 @@ cat <<EOF > ${EXPECT_FILE}
|
|||
1490500400.676379108(9) -0.587785 -58 -58 -0.587785
|
||||
EOF
|
||||
|
||||
villas-hook convert 'mode="fixed" scale=100 mask=0x6' < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
villas-hook convert -o mode=fixed -o scale=100 -o mask=0x6 < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
|
||||
# Compare only the data values
|
||||
diff -u <(cut -f2- ${OUTPUT_FILE}) <(cut -f2- ${EXPECT_FILE})
|
||||
villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
RC=$?
|
||||
|
||||
rm -f ${INPUT_FILE} ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -46,13 +46,13 @@ cat <<EOF > ${EXPECT_FILE}
|
|||
1490500400.676379108(9) -0.587785 -0.587785 -0.587785 -0.587785
|
||||
EOF
|
||||
|
||||
villas-hook decimate 'ratio=3' < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
villas-hook decimate -o ratio=3 < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
|
||||
# Compare only the data values
|
||||
diff -u <(cut -f2- ${OUTPUT_FILE}) <(cut -f2- ${EXPECT_FILE})
|
||||
villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
RC=$?
|
||||
|
||||
rm -f ${INPUT_FILE} ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -55,10 +55,10 @@ EOF
|
|||
villas-hook drop < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
|
||||
# Compare only the data values
|
||||
diff -u <(cut -f2- ${OUTPUT_FILE}) <(cut -f2- ${EXPECT_FILE})
|
||||
villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
RC=$?
|
||||
|
||||
rm -f ${INPUT_FILE} ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -52,13 +52,13 @@ cat <<EOF > ${EXPECT_FILE}
|
|||
1490500400.676379108(9) -0.587785 9 1490500400 676379108 -0.587785 -0.587785
|
||||
EOF
|
||||
|
||||
villas-hook map 'mapping = [ "data[3]", "hdr.sequence", "ts.origin", "data[1-2]" ]' < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
villas-hook map -o map=data[3] -o map=hdr.sequence -o map=ts.origin -o map=data[1-2] < ${INPUT_FILE} > ${OUTPUT_FILE}
|
||||
|
||||
# Compare only the data values
|
||||
diff -u <(cut -f2- ${OUTPUT_FILE}) <(cut -f2- ${EXPECT_FILE})
|
||||
villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
RC=$?
|
||||
|
||||
rm -f ${INPUT_FILE} ${OUTPUT_FILE} ${EXPECT_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -23,18 +23,21 @@
|
|||
##################################################################################
|
||||
|
||||
OUTPUT_FILE=$(mktemp)
|
||||
INPUT_FILE=$(mktemp)
|
||||
|
||||
OFFSET=100
|
||||
|
||||
villas-signal random -l ${NUM_SAMPLES} -n | villas-hook shift_seq offset=${OFFSET} > ${OUTPUT_FILE}
|
||||
villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE}
|
||||
|
||||
villas-hook shift_seq -o offset=${OFFSET} > ${OUTPUT_FILE} < ${INPUT_FILE}
|
||||
|
||||
# Compare shifted sequence no
|
||||
diff -u \
|
||||
<(sed -re 's/^[0-9]+\.[0-9]+([\+\-][0-9]+\.[0-9]+(e[\+\-][0-9]+)?)?\(([0-9]+)\).*/\3/g' ${OUTPUT_FILE}) \
|
||||
<(sed -re '/^#/d;s/^[0-9]+\.[0-9]+([\+\-][0-9]+\.[0-9]+(e[\+\-][0-9]+)?)?\(([0-9]+)\).*/\3/g' ${OUTPUT_FILE}) \
|
||||
<(seq ${OFFSET} $((${NUM_SAMPLES}+${OFFSET}-1)))
|
||||
|
||||
RC=$?
|
||||
|
||||
rm -f ${OUTPUT_FILE}
|
||||
rm -f ${OUTPUT_FILE} ${INPUT_FILE}
|
||||
|
||||
exit $RC
|
||||
|
|
|
@ -29,7 +29,9 @@ NUM_SAMPLES=${NUM_SAMPLES:-10}
|
|||
OFFSET=-10
|
||||
EPSILON=0.05
|
||||
|
||||
villas-signal random -l ${NUM_SAMPLES} -r 10 | villas-hook shift_ts offset=${OFFSET} | villas-hook stats format=\"json\" output=\"${STATS_FILE}\" > /dev/null
|
||||
villas-signal random -l ${NUM_SAMPLES} -r 50 | \
|
||||
villas-hook shift_ts offset=${OFFSET} | \
|
||||
villas-hook stats -o format=json -o output="${STATS_FILE}" > /dev/null
|
||||
|
||||
jq .owd ${STATS_FILE}
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ SKIP=10
|
|||
|
||||
echo ${OUTPUT_FILE}
|
||||
|
||||
villas-signal random -r 1 -l ${NUM_SAMPLES} -n | villas-hook skip_first seconds=${SKIP} > ${OUTPUT_FILE}
|
||||
villas-signal random -r 1 -l ${NUM_SAMPLES} -n | villas-hook skip_first -o seconds=${SKIP} > ${OUTPUT_FILE}
|
||||
|
||||
LINES=$(wc -l < ${OUTPUT_FILE})
|
||||
LINES=$(sed -re '/^#/d' ${OUTPUT_FILE} | wc -l)
|
||||
|
||||
rm ${OUTPUT_FILE}
|
||||
|
||||
# Test condition
|
||||
(( ${LINES} == ${NUM_SAMPLES} - ${SKIP} ))
|
||||
(( ${LINES} == ${NUM_SAMPLES} - ${SKIP} ))
|
||||
|
|
|
@ -26,11 +26,11 @@ OUTPUT_FILE=$(mktemp)
|
|||
|
||||
SKIP=50
|
||||
|
||||
villas-signal random -r 1 -l ${NUM_SAMPLES} -n | villas-hook skip_first samples=${SKIP} > ${OUTPUT_FILE}
|
||||
villas-signal random -r 1 -l ${NUM_SAMPLES} -n | villas-hook skip_first -o samples=${SKIP} > ${OUTPUT_FILE}
|
||||
|
||||
LINES=$(wc -l < ${OUTPUT_FILE})
|
||||
LINES=$(sed -re '/^#/d' ${OUTPUT_FILE} | wc -l)
|
||||
|
||||
rm ${OUTPUT_FILE}
|
||||
|
||||
# Test condition
|
||||
(( ${LINES} == ${NUM_SAMPLES} - ${SKIP} ))
|
||||
(( ${LINES} == ${NUM_SAMPLES} - ${SKIP} ))
|
||||
|
|
|
@ -30,24 +30,28 @@ NUM_SAMPLES=${NUM_SAMPLES:-10}
|
|||
|
||||
URI=https://1Nrd46fZX8HbggT:badpass@rwth-aachen.sciebo.de/public.php/webdav/node/tests/pipe
|
||||
|
||||
# WebDav / OwnCloud / Sciebo do not support partial upload
|
||||
# So we disable flusing the output
|
||||
cat > ${CONFIG_FILE} <<EOF
|
||||
nodes = {
|
||||
remote_file_out = {
|
||||
type = "file",
|
||||
{
|
||||
"nodes" : {
|
||||
"remote_file_out" : {
|
||||
"type" : "file",
|
||||
|
||||
out = {
|
||||
uri = "${URI}"
|
||||
mode = "w+"
|
||||
flush = false /* WebDav / OwnCloud / Sciebo do not support partial upload */
|
||||
"out" : {
|
||||
"uri" : "${URI}",
|
||||
"mode" : "w+",
|
||||
"flush" : false
|
||||
}
|
||||
},
|
||||
},
|
||||
remote_file_in = {
|
||||
type = "file",
|
||||
in = {
|
||||
uri = "${URI}"
|
||||
mode = "r"
|
||||
epoch_mode = "original"
|
||||
eof = "exit",
|
||||
"remote_file_in" : {
|
||||
"type" : "file",
|
||||
"in" : {
|
||||
"uri" : "${URI}",
|
||||
"mode" : "r",
|
||||
"epoch_mode" : "original",
|
||||
"eof" : "exit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,21 +30,23 @@ NODE_FILE=$(mktemp)
|
|||
NUM_SAMPLES=${NUM_SAMPLES:-10}
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "file";
|
||||
|
||||
in = {
|
||||
uri = "${NODE_FILE}",
|
||||
mode = "w+",
|
||||
{
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "file",
|
||||
|
||||
epoch_mode = "original",
|
||||
eof = "wait"
|
||||
},
|
||||
out = {
|
||||
uri = "${NODE_FILE}"
|
||||
mode = "w+"
|
||||
flush = true /* we need to flush / upload the new samples continously for a loopback */
|
||||
"in" : {
|
||||
"uri" : "${NODE_FILE}",
|
||||
"mode" : "w+",
|
||||
|
||||
"epoch_mode" : "original",
|
||||
"eof" : "wait"
|
||||
},
|
||||
"out" : {
|
||||
"uri" : "${NODE_FILE}",
|
||||
"mode" : "w+",
|
||||
"flush" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,4 +64,4 @@ RC=$?
|
|||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE} ${NODE_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -29,9 +29,11 @@ OUTPUT_FILE=$(mktemp)
|
|||
NUM_SAMPLES=${NUM_SAMPLES:-10}
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "loopback"
|
||||
{
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "loopback"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
@ -48,7 +50,7 @@ cat ${OUTPUT_FILE}
|
|||
|
||||
# Comapre data
|
||||
villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE}
|
||||
RC=$?
|
||||
RC:$?
|
||||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE}
|
||||
|
||||
|
|
|
@ -29,19 +29,21 @@ OUTPUT_FILE=$(mktemp)
|
|||
NUM_SAMPLES=${NUM_SAMPLES:-10}
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "socket";
|
||||
layer = "udp";
|
||||
{
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "socket";
|
||||
"layer" : "udp";
|
||||
|
||||
local = "*:12000";
|
||||
remote = "224.1.2.3:12000";
|
||||
|
||||
multicast = { # IGMP multicast is only support for layer = (ip|udp)
|
||||
enabled = true,
|
||||
|
||||
group = "224.1.2.3", # The multicast group. Must be within 224.0.0.0/4
|
||||
loop = true # Whether or not to loopback outgoing multicast packets to the local host.
|
||||
"local" : "*:12000";
|
||||
"remote" : "224.1.2.3:12000";
|
||||
|
||||
"multicast" : {
|
||||
"enabled" : true,
|
||||
|
||||
"group" : "224.1.2.3",
|
||||
"loop" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,8 +57,8 @@ villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FI
|
|||
|
||||
# Comapre data
|
||||
villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE}
|
||||
RC=$?
|
||||
RC:$?
|
||||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -29,12 +29,14 @@ OUTPUT_FILE=$(mktemp)
|
|||
NUM_SAMPLES=${NUM_SAMPLES:-10}
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "nanomsg";
|
||||
{
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "nanomsg",
|
||||
|
||||
subscribe = "tcp://127.0.0.1:12000";
|
||||
publish = "tcp://127.0.0.1:12000"
|
||||
"subscribe" : "tcp://127.0.0.1:12000",
|
||||
"publish" : "tcp://127.0.0.1:12000"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
@ -55,4 +57,4 @@ RC=$?
|
|||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -33,18 +33,20 @@ for POLLING in true false; do
|
|||
for VECTORIZE in 1 5 25; do
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
logging = {
|
||||
level = 2
|
||||
}
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "shmem";
|
||||
out_name = "/villas-test";
|
||||
in_name = "/villas-test";
|
||||
samplelen = ${SAMPLELEN};
|
||||
queuelen = 1024,
|
||||
polling = ${POLLING};
|
||||
vectorize = ${VECTORIZE};
|
||||
{
|
||||
"logging" : {
|
||||
"level" : 2
|
||||
},
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "shmem",
|
||||
"out_name" : "/villas-test",
|
||||
"in_name" : "/villas-test",
|
||||
"samplelen" : ${SAMPLELEN},
|
||||
"queuelen" : 1024,
|
||||
"polling" : ${POLLING},
|
||||
"vectorize" : ${VECTORIZE}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
|
|
@ -42,13 +42,13 @@ case ${LAYER} in
|
|||
LOCAL="*:12000"
|
||||
REMOTE="127.0.0.1:12000"
|
||||
;;
|
||||
|
||||
|
||||
ip)
|
||||
# We use IP protocol number 253 which is reserved for experimentation and testing according to RFC 3692
|
||||
LOCAL="127.0.0.1:254"
|
||||
REMOTE="127.0.0.1:254"
|
||||
;;
|
||||
|
||||
|
||||
eth)
|
||||
# We use IP protocol number 253 which is reserved for experimentation and testing according to RFC 7042
|
||||
LOCAL="00:00:00:00:00:00%lo:34997"
|
||||
|
@ -58,17 +58,19 @@ case ${LAYER} in
|
|||
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "socket";
|
||||
{
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "socket",
|
||||
|
||||
layer = "${LAYER}";
|
||||
header = "${HEADER}";
|
||||
endian = "${ENDIAN}";
|
||||
verify_source = ${VERIFY_SOURCE};
|
||||
"layer" : "${LAYER}",
|
||||
"header" : "${HEADER}",
|
||||
"endian" : "${ENDIAN}",
|
||||
"verify_source" : ${VERIFY_SOURCE},
|
||||
|
||||
local = "${LOCAL}";
|
||||
remote = "${REMOTE}";
|
||||
"local" : "${LOCAL}",
|
||||
"remote" : "${REMOTE}"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
@ -78,10 +80,10 @@ villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FI
|
|||
|
||||
# Compare data
|
||||
villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE}
|
||||
RC=$?
|
||||
RC:$?
|
||||
|
||||
if (( ${RC} != 0 )); then
|
||||
echo "=========== Sub-test failed for: layer=${LAYER}, header=${HEADER}, endian=${ENDIAN} verify_source=${VERIFY_SOURCE}"
|
||||
echo "=========== Sub-test failed for: layer=${LAYER}, header=${HEADER}, endian=${ENDIAN}, verify_source=${VERIFY_SOURCE}"
|
||||
cat ${CONFIG_FILE}
|
||||
echo
|
||||
cat ${INPUT_FILE}
|
||||
|
@ -89,11 +91,11 @@ if (( ${RC} != 0 )); then
|
|||
cat ${OUTPUT_FILE}
|
||||
exit ${RC}
|
||||
else
|
||||
echo "=========== Sub-test succeeded for: layer=${LAYER}, header=${HEADER}, endian=${ENDIAN} verify_source=${VERIFY_SOURCE}"
|
||||
echo "=========== Sub-test succeeded for: layer=${LAYER}, header=${HEADER}, endian=${ENDIAN}, verify_source=${VERIFY_SOURCE}"
|
||||
fi
|
||||
|
||||
done; done; done; done
|
||||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE} ${THEORIES}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
|
@ -29,13 +29,15 @@ OUTPUT_FILE=$(mktemp)
|
|||
NUM_SAMPLES=${NUM_SAMPLES:-10}
|
||||
|
||||
cat > ${CONFIG_FILE} << EOF
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "zeromq";
|
||||
{
|
||||
"nodes" : {
|
||||
"node1" : {
|
||||
"type" : "zeromq",
|
||||
|
||||
pattern = "pubsub";
|
||||
subscribe = "tcp://127.0.0.1:12000";
|
||||
publish = "tcp://127.0.0.1:12000"
|
||||
"pattern" : "pubsub",
|
||||
"subscribe" : "tcp://127.0.0.1:12000",
|
||||
"publish" : "tcp://127.0.0.1:12000"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
@ -52,4 +54,4 @@ RC=$?
|
|||
|
||||
rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE}
|
||||
|
||||
exit $RC
|
||||
exit $RC
|
||||
|
|
Loading…
Add table
Reference in a new issue