From 9fac2a983f91acd3bc72a701de6aa11b499f11d2 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 21 Oct 2018 21:08:38 +0100 Subject: [PATCH] tests: be compatible with BSD getopt() which does not permute the order of positional arguments --- tests/integration/hook-cast.sh | 2 +- tests/integration/hook-convert.sh | 2 +- tests/integration/hook-decimate.sh | 2 +- tests/integration/hook-limit_rate.sh | 4 ++-- tests/integration/hook-print.sh | 4 ++-- tests/integration/hook-scale.sh | 2 +- tests/integration/hook-shift_seq.sh | 4 ++-- tests/integration/hook-shift_ts.sh | 6 +++--- tests/integration/hook-skip_first.sh | 4 ++-- tests/integration/hook-skip_first2.sh | 4 ++-- tests/integration/node-infiniband.sh | 2 +- tests/integration/node-loopback-socket.sh | 2 +- tests/integration/pipe-file-advio.sh | 2 +- tests/integration/pipe-loopback-amqp.sh | 2 +- tests/integration/pipe-loopback-file.sh | 2 +- tests/integration/pipe-loopback-iec61850-9-2.sh | 2 +- tests/integration/pipe-loopback-loopback.sh | 2 +- tests/integration/pipe-loopback-mqtt.sh | 2 +- tests/integration/pipe-loopback-nanomsg.sh | 2 +- tests/integration/pipe-loopback-shmem.sh | 2 +- tests/integration/pipe-loopback-socket-multicast.sh | 2 +- tests/integration/pipe-loopback-socket-netem.sh | 4 ++-- tests/integration/pipe-loopback-socket.sh | 2 +- tests/integration/pipe-loopback-websocket.sh | 2 +- tests/integration/pipe-loopback-zeromq.sh | 2 +- tests/integration/pipe-python-protobuf.sh | 2 +- 26 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/integration/hook-cast.sh b/tests/integration/hook-cast.sh index 5e1d902e6..6bb0bd2a0 100755 --- a/tests/integration/hook-cast.sh +++ b/tests/integration/hook-cast.sh @@ -55,7 +55,7 @@ cat < ${EXPECT_FILE} EOF cat ${INPUT_FILE} | \ -villas-hook scale -o scale=100 | \ +villas-hook -o scale=100 scale | \ villas-hook cast | \ tee ${OUTPUT_FILE} diff --git a/tests/integration/hook-convert.sh b/tests/integration/hook-convert.sh index 81e3cef90..09323de52 100755 --- a/tests/integration/hook-convert.sh +++ b/tests/integration/hook-convert.sh @@ -52,7 +52,7 @@ cat < ${EXPECT_FILE} 1490500400.676379108(9) -0.587785 -58 -58 -0.587785 EOF -villas-hook convert -o mode=fixed -o scale=100 -o mask=0x6 < ${INPUT_FILE} > ${OUTPUT_FILE} +villas-hook -o mode=fixed -o scale=100 -o mask=0x6 convert < ${INPUT_FILE} > ${OUTPUT_FILE} # Compare only the data values villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE} diff --git a/tests/integration/hook-decimate.sh b/tests/integration/hook-decimate.sh index 8677ecd8c..18a5bdf92 100755 --- a/tests/integration/hook-decimate.sh +++ b/tests/integration/hook-decimate.sh @@ -46,7 +46,7 @@ cat < ${EXPECT_FILE} 1490500400.676379108(9) -0.587785 -0.587785 -0.587785 -0.587785 EOF -villas-hook decimate -o ratio=3 < ${INPUT_FILE} > ${OUTPUT_FILE} +villas-hook -o ratio=3 decimate < ${INPUT_FILE} > ${OUTPUT_FILE} # Compare only the data values villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE} diff --git a/tests/integration/hook-limit_rate.sh b/tests/integration/hook-limit_rate.sh index 11e42e3a7..3ee36e5a9 100755 --- a/tests/integration/hook-limit_rate.sh +++ b/tests/integration/hook-limit_rate.sh @@ -26,10 +26,10 @@ INPUT_FILE=$(mktemp) OUTPUT_FILE=$(mktemp) EXPECT_FILE=$(mktemp) -villas-signal sine -r 1000 -l 1000 -n > ${INPUT_FILE} +villas-signal -r 1000 -l 1000 -n sine > ${INPUT_FILE} awk 'NR % 10 == 2' < ${INPUT_FILE} > ${EXPECT_FILE} -villas-hook limit_rate -o rate=100 -o mode=origin < ${INPUT_FILE} > ${OUTPUT_FILE} +villas-hook -o rate=100 -o mode=origin limit_rate < ${INPUT_FILE} > ${OUTPUT_FILE} # Compare only the data values villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE} diff --git a/tests/integration/hook-print.sh b/tests/integration/hook-print.sh index bf9f7f648..087a6c505 100755 --- a/tests/integration/hook-print.sh +++ b/tests/integration/hook-print.sh @@ -29,9 +29,9 @@ INPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-100} # Prepare some test data -villas-signal random -v 1 -r 10 -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -v 1 -r 10 -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} -villas-hook print -o format=villas.human -o output=${OUTPUT_FILE1} > ${OUTPUT_FILE2} < ${INPUT_FILE} +villas-hook -o format=villas.human -o output=${OUTPUT_FILE1} print > ${OUTPUT_FILE2} < ${INPUT_FILE} # Compare only the data values villas-test-cmp ${OUTPUT_FILE1} ${OUTPUT_FILE2} ${INPUT_FILE} diff --git a/tests/integration/hook-scale.sh b/tests/integration/hook-scale.sh index 749786f7f..f0741c0e7 100755 --- a/tests/integration/hook-scale.sh +++ b/tests/integration/hook-scale.sh @@ -52,7 +52,7 @@ cat < ${EXPECT_FILE} 1490500400.676379108-1.490500e+09(9) -15.877850 -15.877850 -15.877850 -15.877850 EOF -villas-hook scale -o scale=10 -o offset=-10 < ${INPUT_FILE} > ${OUTPUT_FILE} +villas-hook -o scale=10 -o offset=-10 scale < ${INPUT_FILE} > ${OUTPUT_FILE} # Compare only the data values villas-test-cmp ${OUTPUT_FILE} ${EXPECT_FILE} diff --git a/tests/integration/hook-shift_seq.sh b/tests/integration/hook-shift_seq.sh index 3faf23380..477f7a8a2 100755 --- a/tests/integration/hook-shift_seq.sh +++ b/tests/integration/hook-shift_seq.sh @@ -26,8 +26,8 @@ OUTPUT_FILE=$(mktemp) OFFSET=100 -villas-signal random -l ${NUM_SAMPLES} -n | \ -villas-hook shift_seq -o offset=${OFFSET} > ${OUTPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random | \ +villas-hook -o offset=${OFFSET} shift_seq > ${OUTPUT_FILE} # Compare shifted sequence no diff -u \ diff --git a/tests/integration/hook-shift_ts.sh b/tests/integration/hook-shift_ts.sh index 0f114da3c..274f05f99 100755 --- a/tests/integration/hook-shift_ts.sh +++ b/tests/integration/hook-shift_ts.sh @@ -29,9 +29,9 @@ NUM_SAMPLES=${NUM_SAMPLES:-10} OFFSET=-10.0 EPSILON=0.05 -villas-signal random -l ${NUM_SAMPLES} -r 50 | \ -villas-hook shift_ts -o offset=${OFFSET} | \ -villas-hook stats -o format=json -o output="${STATS_FILE}" > /dev/null +villas-signal -l ${NUM_SAMPLES} -r 50 random | \ +villas-hook -o offset=${OFFSET} shift_ts | \ +villas-hook -o format=json -o output="${STATS_FILE}" stats > /dev/null jq .owd ${STATS_FILE} jq -e ".owd.mean + ${OFFSET} | length < ${EPSILON}" ${STATS_FILE} > /dev/null diff --git a/tests/integration/hook-skip_first.sh b/tests/integration/hook-skip_first.sh index 6f79f3419..7dd059857 100755 --- a/tests/integration/hook-skip_first.sh +++ b/tests/integration/hook-skip_first.sh @@ -28,8 +28,8 @@ SKIP=10 echo ${OUTPUT_FILE} -villas-signal random -r 1 -l ${NUM_SAMPLES} -n | \ -villas-hook skip_first -o seconds=${SKIP} > ${OUTPUT_FILE} +villas-signal -r 1 -l ${NUM_SAMPLES} -n random | \ +villas-hook -o seconds=${SKIP} skip_first > ${OUTPUT_FILE} LINES=$(sed -re '/^#/d' ${OUTPUT_FILE} | wc -l) diff --git a/tests/integration/hook-skip_first2.sh b/tests/integration/hook-skip_first2.sh index 6fa126ddc..4501e14ed 100755 --- a/tests/integration/hook-skip_first2.sh +++ b/tests/integration/hook-skip_first2.sh @@ -26,8 +26,8 @@ OUTPUT_FILE=$(mktemp) SKIP=50 -villas-signal random -r 1 -l ${NUM_SAMPLES} -n | \ -villas-hook skip_first -o samples=${SKIP} > ${OUTPUT_FILE} +villas-signal -r 1 -l ${NUM_SAMPLES} -n random | \ +villas-hook -o samples=${SKIP} skip_first > ${OUTPUT_FILE} LINES=$(sed -re '/^#/d' ${OUTPUT_FILE} | wc -l) diff --git a/tests/integration/node-infiniband.sh b/tests/integration/node-infiniband.sh index 5e3d00a65..ed855ce60 100755 --- a/tests/integration/node-infiniband.sh +++ b/tests/integration/node-infiniband.sh @@ -55,7 +55,7 @@ RC=0 # Generate test data for RC, UC, and UD test VILLAS_LOG_PREFIX=$(colorize "[Signal]") \ -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} # Set config file with a MODE flag cat > ${CONFIG_FILE} < ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} # Start node VILLAS_LOG_PREFIX=$(colorize "[Node] ") \ diff --git a/tests/integration/pipe-file-advio.sh b/tests/integration/pipe-file-advio.sh index 3bb4c8033..e4d408a69 100755 --- a/tests/integration/pipe-file-advio.sh +++ b/tests/integration/pipe-file-advio.sh @@ -61,7 +61,7 @@ curl -sX DELETE ${URI} > /dev/null # Generate test data VILLAS_LOG_PREFIX=$(colorize "[Signal] ") \ -villas-signal random -n -l ${NUM_SAMPLES} > ${INPUT_FILE} +villas-signal -n -l ${NUM_SAMPLES} random > ${INPUT_FILE} # Upload data to cloud VILLAS_LOG_PREFIX=$(colorize "[Send] ") \ diff --git a/tests/integration/pipe-loopback-amqp.sh b/tests/integration/pipe-loopback-amqp.sh index 359cae453..e7e3ab955 100755 --- a/tests/integration/pipe-loopback-amqp.sh +++ b/tests/integration/pipe-loopback-amqp.sh @@ -33,7 +33,7 @@ OUTPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-100} # Generate test data -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} FORMAT="protobuf" VECTORIZE="10" diff --git a/tests/integration/pipe-loopback-file.sh b/tests/integration/pipe-loopback-file.sh index 3233a8ff8..04e37390b 100755 --- a/tests/integration/pipe-loopback-file.sh +++ b/tests/integration/pipe-loopback-file.sh @@ -50,7 +50,7 @@ cat > ${CONFIG_FILE} << EOF EOF # Generate test data -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FILE} diff --git a/tests/integration/pipe-loopback-iec61850-9-2.sh b/tests/integration/pipe-loopback-iec61850-9-2.sh index 8eaea8098..b86a3ed02 100755 --- a/tests/integration/pipe-loopback-iec61850-9-2.sh +++ b/tests/integration/pipe-loopback-iec61850-9-2.sh @@ -33,7 +33,7 @@ OUTPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-100} # Generate test data -villas-signal random -l ${NUM_SAMPLES} -v 4 -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -v 4 -n random > ${INPUT_FILE} cat > ${CONFIG_FILE} << EOF { diff --git a/tests/integration/pipe-loopback-loopback.sh b/tests/integration/pipe-loopback-loopback.sh index e964989b9..9d05efbac 100755 --- a/tests/integration/pipe-loopback-loopback.sh +++ b/tests/integration/pipe-loopback-loopback.sh @@ -39,7 +39,7 @@ cat > ${CONFIG_FILE} << EOF EOF # Generate test data -villas-signal mixed -v 5 -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -v 5 -l ${NUM_SAMPLES} -n mixed > ${INPUT_FILE} villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FILE} diff --git a/tests/integration/pipe-loopback-mqtt.sh b/tests/integration/pipe-loopback-mqtt.sh index 63964cdb6..ac3dd5658 100755 --- a/tests/integration/pipe-loopback-mqtt.sh +++ b/tests/integration/pipe-loopback-mqtt.sh @@ -33,7 +33,7 @@ OUTPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-100} # Generate test data -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} FORMAT="protobuf" VECTORIZE="10" diff --git a/tests/integration/pipe-loopback-nanomsg.sh b/tests/integration/pipe-loopback-nanomsg.sh index 41553e736..8f3966986 100755 --- a/tests/integration/pipe-loopback-nanomsg.sh +++ b/tests/integration/pipe-loopback-nanomsg.sh @@ -33,7 +33,7 @@ OUTPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-100} # Generate test data -villas-signal mixed -v 5 -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -v 5 -l ${NUM_SAMPLES} -n mixed > ${INPUT_FILE} FORMAT="protobuf" VECTORIZE="10" diff --git a/tests/integration/pipe-loopback-shmem.sh b/tests/integration/pipe-loopback-shmem.sh index 2e4dd8b62..808150406 100755 --- a/tests/integration/pipe-loopback-shmem.sh +++ b/tests/integration/pipe-loopback-shmem.sh @@ -56,7 +56,7 @@ cat > ${CONFIG_FILE} << EOF EOF # Generate test data -villas-signal random -l ${NUM_SAMPLES} -v ${SAMPLELEN} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -v ${SAMPLELEN} -n random > ${INPUT_FILE} villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FILE} diff --git a/tests/integration/pipe-loopback-socket-multicast.sh b/tests/integration/pipe-loopback-socket-multicast.sh index 09a513b73..a03cb4c29 100755 --- a/tests/integration/pipe-loopback-socket-multicast.sh +++ b/tests/integration/pipe-loopback-socket-multicast.sh @@ -54,7 +54,7 @@ cat > ${CONFIG_FILE} << EOF EOF # Generate test data -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FILE} diff --git a/tests/integration/pipe-loopback-socket-netem.sh b/tests/integration/pipe-loopback-socket-netem.sh index 2e13441bc..685523b3e 100755 --- a/tests/integration/pipe-loopback-socket-netem.sh +++ b/tests/integration/pipe-loopback-socket-netem.sh @@ -58,11 +58,11 @@ cat > ${CONFIG_FILE} << EOF EOF # Generate test data -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} villas-pipe -l ${NUM_SAMPLES} ${CONFIG_FILE} node1 > ${OUTPUT_FILE} < ${INPUT_FILE} # Check network emulation characteristics -villas-hook stats -o verbose < ${OUTPUT_FILE} > /dev/null +villas-hook -o verbose stats < ${OUTPUT_FILE} > /dev/null rm ${OUTPUT_FILE} ${INPUT_FILE} ${CONFIG_FILE} diff --git a/tests/integration/pipe-loopback-socket.sh b/tests/integration/pipe-loopback-socket.sh index c5886529b..67a306a27 100755 --- a/tests/integration/pipe-loopback-socket.sh +++ b/tests/integration/pipe-loopback-socket.sh @@ -35,7 +35,7 @@ NUM_SAMPLES=${NUM_SAMPLES:-100} NUM_VALUES=${NUM_VALUES:-4} # Generate test data -villas-signal random -v ${NUM_VALUES} -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -v ${NUM_VALUES} -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} for FORMAT in villas.human villas.binary villas.web csv json gtnet.fake raw.32.le raw.64.be protobuf; do for LAYER in udp ip eth unix; do diff --git a/tests/integration/pipe-loopback-websocket.sh b/tests/integration/pipe-loopback-websocket.sh index 40b41292e..565f3d46d 100755 --- a/tests/integration/pipe-loopback-websocket.sh +++ b/tests/integration/pipe-loopback-websocket.sh @@ -64,7 +64,7 @@ EOF # Generate test data VILLAS_LOG_PREFIX=$(colorize "[Signal]") \ -villas-signal random -l ${NUM_SAMPLES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n random > ${INPUT_FILE} VILLAS_LOG_PREFIX=$(colorize "[Recv] ") \ villas-pipe -r -d 15 -l ${NUM_SAMPLES} ${CONFIG_FILE2} node2 | tee ${OUTPUT_FILE} & diff --git a/tests/integration/pipe-loopback-zeromq.sh b/tests/integration/pipe-loopback-zeromq.sh index 2a3cef237..29713673a 100755 --- a/tests/integration/pipe-loopback-zeromq.sh +++ b/tests/integration/pipe-loopback-zeromq.sh @@ -33,7 +33,7 @@ OUTPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-10} # Generate test data -villas-signal random -l ${NUM_SAMPLES} -n -v 5 > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -n -v 5 random > ${INPUT_FILE} VECTORIZE="10" FORMAT="protobuf" diff --git a/tests/integration/pipe-python-protobuf.sh b/tests/integration/pipe-python-protobuf.sh index 4fb1a3d3b..936f97d3f 100755 --- a/tests/integration/pipe-python-protobuf.sh +++ b/tests/integration/pipe-python-protobuf.sh @@ -38,7 +38,7 @@ NUM_SAMPLES=${NUM_SAMPLES:-20} NUM_VALUES=${NUM_VALUES:-5} # Generate test data -villas-signal random -l ${NUM_SAMPLES} -v ${NUM_VALUES} -n > ${INPUT_FILE} +villas-signal -l ${NUM_SAMPLES} -v ${NUM_VALUES} -n random > ${INPUT_FILE} case ${LAYER} in unix)