X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fapp_test%2Frun_lcall_test.ksh;h=241deb5ef428c62eec345bb9cc11791bbe619d0c;hb=31210e1b6555e92dc62d16e119615b951c1f63eb;hp=3d5d691a16a5f86d87f7405e14f28449ce081469;hpb=3925774e739509bb51df2c81addb3ab742c1801f;p=ric-plt%2Flib%2Frmr.git diff --git a/test/app_test/run_lcall_test.ksh b/test/app_test/run_lcall_test.ksh index 3d5d691..241deb5 100644 --- a/test/app_test/run_lcall_test.ksh +++ b/test/app_test/run_lcall_test.ksh @@ -1,8 +1,8 @@ #!/usr/bin/env ksh -# :vi ts=4 sw=4 noet : +# vim: ts=4 sw=4 noet : #================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 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. @@ -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${si} ${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${si} $(( ((nmsg * cthreads)/nrcvrs) + 10 )) $port echo $? >/tmp/PID$$.$1.rrc } @@ -114,16 +102,17 @@ then 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 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 nrcvrs=3 # this is sane, but -r allows it to be set up use_installed=0 +force_make=0 +si="" while [[ $1 == -* ]] do @@ -132,18 +121,19 @@ 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;; + -M) force_make=1;; + -N) si="";; # build NNG binaries (turn off si) -r) nrcvrs=$2; shift;; + -S) si="_si";; # build SI95 binaries -v) verbose=1;; *) echo "unrecognised option: $1" - echo "usage: $0 [-B] [-c caller-threads] [-d micor-sec-delay] [-i] [-n num-msgs] [-r num-receivers]" - echo " -B forces a rebuild which will use .build" + echo "usage: $0 [-B] [-c caller-threads] [-d micor-sec-delay] [-i] [-M] [-n num-msgs] [-r num-receivers] [-S]" + echo " -B forces an RMR rebuild which will use .build" echo " -i will use installed libraries (/usr/local) and cause -B to be ignored if supplied)" + echo " -M force test applictions to be remade" + echo " -S build/test SI95 based binaries" exit 1 ;; esac @@ -159,14 +149,13 @@ fi if (( use_installed )) # point at installed library then - export LD_LIBRARY_PATH=/usr/local/lib - export LIBRARY_PATH=$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH-:/usr/local/lib} # use caller's or set sane default else if (( rebuild )) then build_path=../../.build # if we rebuild we can insist that it is in .build :) set -e - ksh ./rebuild.ksh + $SHELL ./rebuild.ksh set +e else build_path=${BUILD_PATH:-"../../.build"} # we prefer .build at the root level, but allow user option @@ -181,9 +170,9 @@ else if [[ -d $build_path/lib64 ]] then - export LD_LIBRARY_PATH=$build_path:$build_path/lib64 + export LD_LIBRARY_PATH=$build_path:$build_path/lib64:$LD_LIBRARY_PATH else - export LD_LIBRARY_PATH=$build_path:$build_path/lib + export LD_LIBRARY_PATH=$build_path:$build_path/lib:$LD_LIBRARY_PATH fi fi @@ -192,11 +181,11 @@ export RMR_SEED_RT=./lcall.rt set_rt $nrcvrs # set up the rt for n receivers -if (( rebuild )) || [[ ! -f ./lcaller ]] +if (( force_make || rebuild )) || [[ ! -f ./lcaller{$si} || ! -f ./lreceiver${si} ]] then - if ! make -B lcaller lreceiver >/dev/null 2>&1 + if ! make -B lcaller${si} lreceiver${si} >/dev/null 2>&1 then - echo "[FAIL] cannot find lcaller binary, and cannot make it.... humm?" + echo "[FAIL] cannot find lcaller${si} and/or lreceiver${si} binary, and cannot make them.... humm?" exit 1 fi fi