Code Review
/
ric-plt
/
lib
/
rmr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix crash under SI95 with multiple receive threads
[ric-plt/lib/rmr.git]
/
test
/
app_test
/
run_rr_test.ksh
diff --git
a/test/app_test/run_rr_test.ksh
b/test/app_test/run_rr_test.ksh
index
3727cc2
..
e78cc4e
100644
(file)
--- a/
test/app_test/run_rr_test.ksh
+++ b/
test/app_test/run_rr_test.ksh
@@
-1,8
+1,8
@@
#!/usr/bin/env ksh
#!/usr/bin/env ksh
-#
:vi
ts=4 sw=4 noet :
+#
vim:
ts=4 sw=4 noet :
#==================================================================================
#==================================================================================
-# Copyright (c) 2019 Nokia
-# Copyright (c) 2018-20
19
AT&T Intellectual Property.
+# Copyright (c) 2019
-2020
Nokia
+# Copyright (c) 2018-20
20
AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@
-21,7
+21,7
@@
# ---------------------------------------------------------------------------------
# Mnemonic: run_multi_test.ksh
# Abstract: This is a simple script to set up and run the basic send/receive
# ---------------------------------------------------------------------------------
# Mnemonic: run_multi_test.ksh
# Abstract: This is a simple script to set up and run the basic send/receive
-# processes for some library validation on top of n
ano/n
ng. This
+# processes for some library validation on top of nng. This
# particular tests starts several receivers and creates a route table
# which causes messages to be sent round robin to all of the receivers.
# The number of messages command line parameter (-n) will be the number
# particular tests starts several receivers and creates a route table
# which causes messages to be sent round robin to all of the receivers.
# The number of messages command line parameter (-n) will be the number
@@
-31,7
+31,6
@@
#
# Example command line:
# ksh ./run_rr_test.ksh # default 10 messages at 1 msg/sec
#
# Example command line:
# ksh ./run_rr_test.ksh # default 10 messages at 1 msg/sec
-# ksh ./run_rr_test.ksh -N # default but with nanomsg lib
# ksh ./run_rr_test.ksh -d 100 -n 10000 # send 10k messages with 100ms delay between
#
# Date: 24 April 2019
# ksh ./run_rr_test.ksh -d 100 -n 10000 # send 10k messages with 100ms delay between
#
# Date: 24 April 2019
@@
-44,12
+43,7
@@
#
function run_sender {
export RMR_RTG_SVC=8990
#
function run_sender {
export RMR_RTG_SVC=8990
- if (( $nano_sender ))
- then
- ./sender_nano $(( nmsg * nrcvrs )) $delay 1
- else
- ./sender $(( nmsg * nrcvrs )) $delay 1
- fi
+ ./sender${si} $(( nmsg * nrcvrs )) $delay $max_mtype
echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch
}
echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch
}
@@
-59,12
+53,7
@@
function run_rcvr {
port=$(( 4560 + ${1:-0} ))
export RMR_RTG_SVC=$(( 9990 + $1 ))
port=$(( 4560 + ${1:-0} ))
export RMR_RTG_SVC=$(( 9990 + $1 ))
- if (( $nano_receiver ))
- then
- ./receiver_nano $nmsg $port
- else
- ./receiver $nmsg $port
- fi
+ ./receiver${si} $nmsg $port
echo $? >/tmp/PID$$.$1.rrc
}
echo $? >/tmp/PID$$.$1.rrc
}
@@
-85,15
+74,15
@@
function set_rt {
rte |0 | $endpoints |0
rte |1 | $endpoints |10
mse |2 | 20 | $endpoints # new style mtype/subid entry
rte |0 | $endpoints |0
rte |1 | $endpoints |10
mse |2 | 20 | $endpoints # new style mtype/subid entry
- rte |3 | $endpoints |
0
- rte |4 | $endpoints |
0
- rte |5 | $endpoints |
0
- rte |6 | $endpoints |
0
- rte |7 | $endpoints |
0
- rte |8 | $endpoints |
0
- rte |9 | $endpoints |
0
- rte |10 | $endpoints |
0
- rte |11 | $endpoints |
0
+ rte |3 | $endpoints |
-1
+ rte |4 | $endpoints |
-1
+ rte |5 | $endpoints |
-1
+ rte |6 | $endpoints |
-1
+ rte |7 | $endpoints |
-1
+ rte |8 | $endpoints |
-1
+ rte |9 | $endpoints |
-1
+ rte |10 | $endpoints |
-1
+ rte |11 | $endpoints |
-1
newrt |end
endKat
newrt |end
endKat
@@
-107,30
+96,36
@@
then
sed "s!%%hostname%%!$hn!" rt.mask >local.rt
fi
sed "s!%%hostname%%!$hn!" rt.mask >local.rt
fi
+export RMR_ASYNC_CONN=0 # ensure we don't lose first msg as drops waiting for conn look like errors
nmsg=10 # total number of messages to be exchanged (-n value changes)
delay=1000 # microsec sleep between msg 1,000,000 == 1s (shorter than others b/c/ we are sending to multiple)
nmsg=10 # total number of messages to be exchanged (-n value changes)
delay=1000 # microsec sleep between msg 1,000,000 == 1s (shorter than others b/c/ we are sending to multiple)
-nano_sender=0 # start nano version if set (-N)
-nano_receiver=0
wait=1
rebuild=0
wait=1
rebuild=0
+nopull=""
verbose=0
verbose=0
+max_mtype=1 # causes all msgs to go with type 1; use -M to set up, but likely harder to validate
nrcvrs=3 # this is sane, but -r allows it to be set up
nrcvrs=3 # this is sane, but -r allows it to be set up
+force_make=0
+si=""
while [[ $1 == -* ]]
do
case $1 in
-B) rebuild=1;;
while [[ $1 == -* ]]
do
case $1 in
-B) rebuild=1;;
+ -b) rebuild=1; nopull="nopull";; # build without pulling
-d) delay=$2; shift;;
-d) delay=$2; shift;;
- -N) nano_sender=1
- nano_receiver=1
- ;;
+ -m) max_mtype=$2; shift;;
-n) nmsg=$2; shift;;
-n) nmsg=$2; shift;;
+ -N) si="";; # build/run NNG binaries
-r) nrcvrs=$2; shift;;
-r) nrcvrs=$2; shift;;
+ -S) si="_si";; # build/run SI95 binaries
-v) verbose=1;;
*) echo "unrecognised option: $1"
-v) verbose=1;;
*) echo "unrecognised option: $1"
- echo "usage: $0 [-B] [-d micor-sec-delay] [-
N] [-n num-msgs
]"
+ echo "usage: $0 [-B] [-d micor-sec-delay] [-
M] [-n num-msgs] [-S
]"
echo " -B forces a rebuild which will use .build"
echo " -B forces a rebuild which will use .build"
+ echo " -M force test applications to be remade"
+ echo " -S build/test SI95 based binaries"
exit 1
;;
esac
exit 1
;;
esac
@@
-138,7
+133,6
@@
do
shift
done
shift
done
-
if (( verbose ))
then
echo "2" >.verbose
if (( verbose ))
then
echo "2" >.verbose
@@
-147,9
+141,8
@@
fi
if (( rebuild ))
then
if (( rebuild ))
then
- build_path=../../.build
set -e
set -e
- ksh ./rebuild.ksh
+ ksh ./rebuild.ksh
$nopull | read build_path
set +e
else
build_path=${BUILD_PATH:-"../../.build"} # we prefer .build at the root level, but allow user option
set +e
else
build_path=${BUILD_PATH:-"../../.build"} # we prefer .build at the root level, but allow user option
@@
-173,11
+166,11
@@
export RMR_SEED_RT=./rr.rt
set_rt $nrcvrs
set_rt $nrcvrs
-if
[[ ! -f ./sender
]]
+if
(( rebuild || force_make )) || [[ ! -f ./sender${si} || ! -f ./receiver${si}
]]
then
if ! make >/dev/null 2>&1
then
then
if ! make >/dev/null 2>&1
then
- echo "[FAIL] cannot find sender
binary, and cannot make it
.... humm?"
+ echo "[FAIL] cannot find sender
${si} and/or receiver${si} binary, and cannot make them
.... humm?"
exit 1
fi
fi
exit 1
fi
fi