From 2596b2305f214efbd7aba832fa009217ab854770 Mon Sep 17 00:00:00 2001 From: "E. Scott Daniels" Date: Fri, 30 Aug 2019 12:58:54 -0400 Subject: [PATCH] Remove nanomsg support from app test scripts Nanomsg is no longer supported and this change drops the attempt to build and test on top of the nanomsg library. Signed-off-by: E. Scott Daniels Change-Id: I3e167e28779e27115f2ccd732081ee69771f7f62 --- test/app_test/Makefile | 8 +------- test/app_test/receiver.c | 3 ++- test/app_test/run_app_test.ksh | 38 +++++++++++++++++--------------------- test/app_test/run_call_test.ksh | 24 +++--------------------- test/app_test/run_lcall_test.ksh | 24 +++--------------------- test/app_test/run_multi_test.ksh | 26 +++++--------------------- test/app_test/run_rr_test.ksh | 24 ++++-------------------- test/app_test/run_rts_test.ksh | 23 ++++------------------- 8 files changed, 39 insertions(+), 131 deletions(-) diff --git a/test/app_test/Makefile b/test/app_test/Makefile index c15cdc4..e893aae 100644 --- a/test/app_test/Makefile +++ b/test/app_test/Makefile @@ -46,9 +46,6 @@ LIBRARY_PATH = $(LD_LIBRARY_PATH) .PHONY: all all: sender receiver caller mt_receiver -receiver_nano: receiver.c - gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm - receiver: receiver.c gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm @@ -58,9 +55,6 @@ mt_receiver: receiver.c lreceiver: lreceiver.c gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm -sender_nano: sender.c - gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm - sender: sender.c gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm @@ -80,4 +74,4 @@ clean: rm -f *.o nuke: clean - rm -f sender sender_nano receiver receiver_nano caller mt_receiver + rm -f sender receiver caller mt_receiver diff --git a/test/app_test/receiver.c b/test/app_test/receiver.c index e016f9e..3cf1498 100644 --- a/test/app_test/receiver.c +++ b/test/app_test/receiver.c @@ -132,9 +132,10 @@ int main( int argc, char** argv ) { fprintf( stderr, " listening on port: %s for a max of %d messages\n", listen_port, nmsgs ); #ifdef MTC + fprintf( stderr, " starting in multi-threaded mode\n" ); mrc = rmr_init( listen_port, RMR_MAX_RCV_BYTES, RMRFL_MTCALL ); // start RMr in mt-receive mode - #else + fprintf( stderr, " starting in direct receive mode\n" ); mrc = rmr_init( listen_port, RMR_MAX_RCV_BYTES, RMRFL_NONE ); // start your engines! #endif if( mrc == NULL ) { diff --git a/test/app_test/run_app_test.ksh b/test/app_test/run_app_test.ksh index 964a080..3da098a 100644 --- a/test/app_test/run_app_test.ksh +++ b/test/app_test/run_app_test.ksh @@ -21,14 +21,13 @@ # --------------------------------------------------------------------------------- # Mnemonic: run_app_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 nano/nng. +# processes for some library validation on top of nng. # It should be possible to clone the repo, switch to this directory # and execute 'ksh run -B' which will build RMr, make the sender and # recevier then run the basic test. # # Example command line: # ksh ./run_app_test.ksh # default 20 messages at 2 msg/sec -# ksh ./run_app_test.ksh -N # default but with nanomsg lib # ksh ./run_app_test.ksh -d 100 -n 10000 # send 10k messages with 100ms delay between # # Date: 22 April 2019 @@ -40,19 +39,15 @@ # file in order for the 'main' to pick them up easily. # function run_sender { - if (( $nano_sender )) - then - ./sender_nano $nmsg $delay - else - ./sender $nmsg $delay - fi + ./sender $nmsg $delay echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch } function run_rcvr { - if (( $nano_receiver )) + if (( mt_receiver )) then - ./receiver_nano $nmsg + echo " testing with mt-receiver" >&2 + ./mt_receiver $nmsg else ./receiver $nmsg fi @@ -104,8 +99,6 @@ endKat nmsg=20 # total number of messages to be exchanged (-n value changes) # need two sent to each receiver to ensure hairpin entries were removed (will fail if they were not) delay=500000 # microsec sleep between msg 1,000,000 == 1s -nano_sender=0 # start nano version if set (-N) -nano_receiver=0 wait=1 rebuild=0 nopull="" # -b sets so that build does not pull @@ -113,6 +106,8 @@ verbose=0 use_installed=0 my_ip=$(snarf_ip) # get an ip to insert into the route table keep=0 +mt_receiver=0 # -m sets in order to test with multi-threaded receive stuff +force_make=0 while [[ $1 == -* ]] @@ -123,17 +118,18 @@ do -d) delay=$2; shift;; -k) keep=1;; -i) use_installed=1;; - -N) nano_sender=1 - nano_receiver=1 - ;; + -M) force_make=1;; + -m) mt_receiver=1;; -n) nmsg=$2; shift;; -v) verbose=1;; *) echo "unrecognised option: $1" - echo "usage: $0 [-B] [-d micor-sec-delay] [-i] [-k] [-N] [-n num-msgs]" - echo " -B forces a rebuild which will use .build" + echo "usage: $0 [-B] [-d micor-sec-delay] [-i] [-k] [-M] [-m] [-n num-msgs]" + echo " -B forces an RMR rebuild which will use .build" echo " -i causes the installd libraries (/usr/local) to be referenced; -B is ignored if supplied" echo " -k keeps the route table" + echo " -M force make on test applications" + echo " -m test with mt-receive mode" echo "" echo "total number of messages must > 20 to correctly test hairpin loop removal" exit 1 @@ -175,8 +171,8 @@ else if [[ ! -d $build_path ]] then - echo "cannot find build in: $build_path" - echo "either create, and then build RMr, or set BUILD_PATH as an evironment var before running this" + echo "[FAIL] cannot find build in: $build_path" + echo "[FAIL] either create, and then build RMr, or set BUILD_PATH as an evironment var before running this" exit 1 fi fi @@ -192,9 +188,9 @@ fi export RMR_SEED_RT=${RMR_SEED_RT:-./app_test.rt} # allow easy testing with different rt -if [[ ! -f ./sender ]] +if (( force_make )) || [[ ! -f ./sender || ! -f ./receiver ]] then - if ! make >/dev/null 2>&1 + if ! make -B >/dev/null 2>&1 then echo "[FAIL] cannot find sender binary, and cannot make it.... humm?" exit 1 diff --git a/test/app_test/run_call_test.ksh b/test/app_test/run_call_test.ksh index 08562ed..40a58e6 100644 --- a/test/app_test/run_call_test.ksh +++ b/test/app_test/run_call_test.ksh @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------------- # Mnemonic: run_call_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 nano/nng. +# processes for some library validation on top of nng. # It should be possible to clone the repo, switch to this directory # and execute 'ksh run -B' which will build RMr, make the sender and # recevier then run the basic test. @@ -56,27 +56,13 @@ # file in order for the 'main' to pick them up easily. # function run_sender { - if (( nano_sender )) - then - # ./sender_nano $nmsg $delay - echo "nano is not supported" - exit 1 - else - ./caller $nmsg $delay $nthreads - fi + ./caller $nmsg $delay $nthreads echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch } # start receiver listening for nmsgs from each thread function run_rcvr { - if (( nano_receiver )) - then - #./receiver_nano $(( nmsg * nthreads )) - echo "nano is not supported" - exit 1 - else - ./mt_receiver $(( nmsg * nthreads )) # we'll test with the RMr multi threaded receive function - fi + ./mt_receiver $(( nmsg * nthreads )) # we'll test with the RMr multi threaded receive function echo $? >/tmp/PID$$.rrc } @@ -123,16 +109,12 @@ endKat nmsg=10 # total number of messages to be exchanged (-n value changes) delay=1000000 # microsec sleep between msg 1,000,000 == 1s -nano_sender=0 # start nano version if set (-N) -nano_receiver=0 wait=1 rebuild=0 verbose=0 nthreads=3 dev_base=1 # -D turns off to allow this to run on installed libs -nano_sender=0 # mt-call is not supported in nano -nano_receiver=0 while [[ $1 == -* ]] diff --git a/test/app_test/run_lcall_test.ksh b/test/app_test/run_lcall_test.ksh index 3d5d691..c159042 100644 --- a/test/app_test/run_lcall_test.ksh +++ b/test/app_test/run_lcall_test.ksh @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------------- # Mnemonic: run_lcall_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 nano/nng. This +# processes for some library validation on top of nng. This # particular test starts the latency caller and latency receiver # processes such that they exchange messages and track the latency # from the caller's perepective (both outbound to receiver, and then @@ -51,13 +51,7 @@ # file in order for the 'main' to pick them up easily. # function run_sender { - if (( $nano_sender )) - then - echo "nanomsg not supportded" - exit 1 - else - ./lcaller ${nmsg:-10} ${delay:-500} ${cthreads:-3} - fi + ./lcaller ${nmsg:-10} ${delay:-500} ${cthreads:-3} echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch } @@ -67,13 +61,7 @@ function run_rcvr { port=$(( 4460 + ${1:-0} )) export RMR_RTG_SVC=$(( 9990 + $1 )) - if (( $nano_receiver )) - then - echo "nanomsg not supported" - exit 1 - else - ./lreceiver $(( ((nmsg * cthreads)/nrcvrs) + 10 )) $port - fi + ./lreceiver $(( ((nmsg * cthreads)/nrcvrs) + 10 )) $port echo $? >/tmp/PID$$.$1.rrc } @@ -117,8 +105,6 @@ fi cthreads=3 # number of caller threads nmsg=100 # total number of messages to be exchanged (-n value changes) delay=500 # microsec sleep between msg 1,000,000 == 1s -nano_sender=0 # start nano version if set (-N) -nano_receiver=0 wait=1 rebuild=0 verbose=0 @@ -132,10 +118,6 @@ do -B) rebuild=1;; -d) delay=$2; shift;; -i) use_installed=1;; - -N) echo "abort: nanomsg does not support epoll and thus cannot be used for mt-caller" - echo "" - exit 1; - ;; -n) nmsg=$2; shift;; -r) nrcvrs=$2; shift;; -v) verbose=1;; diff --git a/test/app_test/run_multi_test.ksh b/test/app_test/run_multi_test.ksh index 0bc1e80..4e1a7a3 100644 --- a/test/app_test/run_multi_test.ksh +++ b/test/app_test/run_multi_test.ksh @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------------- # 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 nano/nng. 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 to all receivers in parallel # (forcing message cloning internally in RMr). @@ -31,7 +31,6 @@ # # Example command line: # ksh ./run_multi_test.ksh # default 10 messages at 1 msg/sec -# ksh ./run_multi_test.ksh -N # default but with nanomsg lib # ksh ./run_multi_test.ksh -d 100 -n 10000 # send 10k messages with 100ms delay between # # Date: 24 April 2019 @@ -43,12 +42,7 @@ # file in order for the 'main' to pick them up easily. # function run_sender { - if (( $nano_sender )) - then - ./sender_nano $nmsg $delay - else - ./sender $nmsg $delay - fi + ./sender $nmsg $delay echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch } @@ -58,12 +52,7 @@ function run_rcvr { port=$(( 4460 + ${1:-0} )) export RMR_RTG_SVC=$(( 9990 + $1 )) - if (( $nano_receiver )) - then - ./receiver_nano $nmsg $port - else - ./receiver $nmsg $port - fi + ./receiver $nmsg $port echo $? >/tmp/PID$$.$1.rrc } @@ -107,8 +96,6 @@ fi nmsg=10 # total number of messages to be exchanged (-n value changes) delay=1000000 # microsec sleep between msg 1,000,000 == 1s -nano_sender=0 # start nano version if set (-N) -nano_receiver=0 wait=1 rebuild=0 nopull="" @@ -121,16 +108,13 @@ do -B) rebuild=1;; -b) rebuild=1; nopull="nopull";; # enable build but without pull -d) delay=$2; shift;; - -N) nano_sender=1 - nano_receiver=1 - ;; -n) nmsg=$2; shift;; -r) nrcvrs=$2; shift;; -v) verbose=1;; *) echo "unrecognised option: $1" - echo "usage: $0 [-B] [-d micor-sec-delay] [-N] [-n num-msgs]" - echo " -B forces a rebuild which will use .build" + echo "usage: $0 [-B] [-d micor-sec-delay] [-n num-msgs]" + echo " -B forces an RMR rebuild which will use .build" exit 1 ;; esac diff --git a/test/app_test/run_rr_test.ksh b/test/app_test/run_rr_test.ksh index 473d117..d602945 100644 --- a/test/app_test/run_rr_test.ksh +++ b/test/app_test/run_rr_test.ksh @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------------- # 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 nano/nng. 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 @@ -31,7 +31,6 @@ # # 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 @@ -44,12 +43,7 @@ # function run_sender { export RMR_RTG_SVC=8990 - if (( $nano_sender )) - then - ./sender_nano $(( nmsg * nrcvrs )) $delay $max_mtype - else - ./sender $(( nmsg * nrcvrs )) $delay $max_mtype - fi + ./sender $(( nmsg * nrcvrs )) $delay $max_mtype 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 )) - if (( $nano_receiver )) - then - ./receiver_nano $nmsg $port - else - ./receiver $nmsg $port - fi + ./receiver $nmsg $port echo $? >/tmp/PID$$.$1.rrc } @@ -109,8 +98,6 @@ fi 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 nopull="" @@ -125,15 +112,12 @@ do -b) rebuild=1; nopull="nopull";; # build without pulling -d) delay=$2; shift;; -m) max_mtype=$2; shift;; - -N) nano_sender=1 - nano_receiver=1 - ;; -n) nmsg=$2; shift;; -r) nrcvrs=$2; shift;; -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] [-n num-msgs]" echo " -B forces a rebuild which will use .build" exit 1 ;; diff --git a/test/app_test/run_rts_test.ksh b/test/app_test/run_rts_test.ksh index b01613f..f6e16b4 100644 --- a/test/app_test/run_rts_test.ksh +++ b/test/app_test/run_rts_test.ksh @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------------- # Mnemonic: run_rts_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 nano/nng. This +# processes for some library validation on top of nng. This # particular test starts several senders and one receiver. All messages # go to the receiver and an ack is sent back to the sending process. # Each sender puts a tag into the message allowing it to verify that @@ -42,12 +42,7 @@ function run_sender { export RMR_RTG_SVC=$(( 9991 + $1 )) port=$(( 43080 + $1 )) - if (( $nano_sender )) - then - ./sender_nano $nmsg $delay 5:6 $port # 5:6 causes mtype 5 only which is what receiver acks - else - ./sender $nmsg $delay 5:6 $port - fi + ./sender $nmsg $delay 5:6 $port echo $? >/tmp/PID$$.$1.src # must communicate state back via file b/c asynch } @@ -57,12 +52,7 @@ function run_rcvr { port=4460 export RMR_RTG_SVC=9990 - if (( $nano_receiver )) - then - ./receiver_nano $(( nmsg * nsenders )) $port - else - ./receiver $(( nmsg * nsenders )) $port - fi + ./receiver $(( nmsg * nsenders )) $port echo $? >/tmp/PID$$.rrc } @@ -83,8 +73,6 @@ endKat nmsg=10 # total number of messages to be exchanged (-n value changes) delay=1000000 # microsec sleep between msg 1,000,000 == 1s -nano_sender=0 # start nano version if set (-N) -nano_receiver=0 wait=1 rebuild=0 nopull="" @@ -97,15 +85,12 @@ do -B) rebuild=1;; -b) rebuild=1; nopull="nopull";; # build without pulling -d) delay=$2; shift;; - -N) nano_sender=1 - nano_receiver=1 - ;; -n) nmsg=$2; shift;; -s) nsenders=$2; shift;; -v) verbose=1;; *) echo "unrecognised option: $1" - echo "usage: $0 [-B] [-d micor-sec-delay] [-N] [-n num-msgs] [-s nsenders]" + echo "usage: $0 [-B] [-d micor-sec-delay] [-n num-msgs] [-s nsenders]" echo " -B forces a rebuild which will use .build" exit 1 ;; -- 2.16.6