# API and build change and fix summaries. Doc corrections
# and/or changes are not mentioned here; see the commit messages.
+2021 March 10; version 4.6.1
+ Corrected unit test "framework" to make manual testing easier, and to
+ add the ability to set the code optimisation level via the CMake
+ command line parameter OPT_LEVEL=n.
+
2021 February 22; Version 4.6.0
Enhanced to use millisecond based timestamps when writing log messages.
(RIC-627)
#
#==================================================================================
-# Copyright (c) 2019 Nokia
-# Copyright (c) 2018-2019 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
# -DGPROF=1 Enable profiling compile time flags
# -DSKIP_EXTERNALS=1 Do not use NNG submodule when building; uee installed packages
# -DMAN_PREFIX=<path> Supply a path where man pages are installed (default: /usr/share/man)
+# -DOPT_LEVEL=n Set a custom optimisation level.
# See ci/build_all for an example of how to build and test
set( major_version "4" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this
set( minor_version "6" )
-set( patch_level "0" )
+set( patch_level "1" )
set( install_root "${CMAKE_INSTALL_PREFIX}" )
set( install_inc "include/rmr" )
message( "+++ debugging is being set to ${DEBUG}" )
else()
set( debugging 0 )
- message( "+++ debugging is set to off" )
+ message( "+++ debugging is set to off (use -DDEBUG=1 to enable)" )
endif()
unset( DEBUG CACHE ) # we don't want this to persist
message( "+++ profiling is on" )
set( CMAKE_C_FLAGS "-pg " )
else()
- message( "+++ profiling is off" )
+ message( "+++ profiling is off (use -DGPROF=1 to enable" )
set( CMAKE_C_FLAGS "-g " )
endif()
unset( GPROF CACHE ) # we don't want this to persist
+if( DEFINED OPT_LEVEL )
+ message( "+++ optimisation is forced to ${OPT_LEVEL}" )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O${OPT_LEVEL} " )
+else()
+ message( "+++ optimisation will default (use -DOPT_LEVEL=n to force specific level, or disable)" )
+endif()
+unset( OPT_LEVEL CACHE ) # no optimisation flage does NOT percist
+
+message( "+++ compiler flags: ${CMAKE_C_FLAGS}" )
+
+
# Include modules
add_subdirectory( src/rmr/common )
if( BUILD_NNG )
version 4.0.0, the RMR versions should no longer skip.
+2021 March 10; version 4.6.1
+----------------------------
+
+Corrected unit test "framework" to make manual testing
+easier, and to add the ability to set the code optimisation
+level via the CMake command line parameter OPT_LEVEL=n.
+
+
+
2021 February 22; Version 4.6.0
-------------------------------
// : vi ts=4 sw=4 noet :
/*
==================================================================================
- Copyright (c) 2019-2020 Nokia
- Copyright (c) 2018-2020 AT&T Intellectual Property.
+ Copyright (c) 2019-2021 Nokia
+ Copyright (c) 2018-2021 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.
rt_req_freq = atoi( eptr );
if( rt_req_freq < 1 || rt_req_freq > 300 ) {
rt_req_freq = DEF_RTREQ_FREQ;
- rmr_vlog( RMR_VL_WARN, "rmr_rtc: RT request frequency (%d) out of range (1-300), using default", DEF_RTREQ_FREQ );
+ rmr_vlog( RMR_VL_WARN, "rmr_rtc: RT request frequency (%d) out of range (1-300), using default (%d)\n", rt_req_freq, DEF_RTREQ_FREQ );
}
}
rmr_vlog( RMR_VL_INFO, "rmr_rtc: RT request frequency set to: %d seconds", rt_req_freq );
// :vi sw=4 ts=4 noet:
/*
==================================================================================
- Copyright (c) 2019-2020 Nokia
- Copyright (c) 2018-2020 AT&T Intellectual Property.
+ Copyright (c) 2019-2021 Nokia
+ Copyright (c) 2018-2021 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.
getifaddrs( &ifs );
for( ele = ifs; ele; ele = ele->ifa_next ) {
memset( octs, 0, sizeof( octs ) );
+ if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "checking interface: %s\n", ele->ifa_name );
if( ele && strcmp( ele->ifa_name, "lo" ) && // do NOT capture the loopback interface address
(target_if == NULL || strcmp( ele->ifa_name, target_if ) == 0 ) ) { // no target, or matches ENV_BIND_IF target
if( ele->ifa_addr->sa_family == AF_INET6 ) {
getnameinfo( ele->ifa_addr, sizeof( struct sockaddr_in6 ), octs, NI_MAXHOST, NULL, 0, NI_NUMERICHOST );
fmt = "[%s]:%s";
+ } else {
+ if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "unrecognised IF family (not v4 or v6)\n" );
+ continue;
}
}
l->addrs[l->naddrs] = strdup( wbuf );
l->naddrs++;
}
+ } else {
+ if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "unrecognised or no octets octs=%x fmt=%p\n", *octs, fmt );
}
+ } else {
+ if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "no ip address for interface: %s\n", ele->ifa_name );
}
}
}
// vim: ts=4 sw=4 noet :
/*
==================================================================================
- Copyright (c) 2019-2020 Nokia
- Copyright (c) 2018-2020 AT&T Intellectual Property.
+ Copyright (c) 2019-2021 Nokia
+ Copyright (c) 2018-2021 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.
nm->header = ((char *) nm->tp_buf) + TP_HDR_LEN; // point at the new header and copy from old
SET_HDR_LEN( nm->header );
- if( copy ) { // if we need to copy the old payload too
+ if( copy != 0 ) { // if we need to copy the old payload too
memcpy( nm->header, omhdr, sizeof( char ) * (old_psize + RMR_HDR_LEN( omhdr )) );
if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "rmr_realloc_payload: copy payload into new message: %d bytes\n", old_psize );
} else { // just need to copy header
#
#=================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
.PHONY: all all_si
-all: sender receiver caller mt_receiver v_sender ex_rts_receiver sender_si receiver_si
+all: sender receiver caller mt_receiver v_sender ex_rts_receiver
all_si: sender_si receiver_si
-# ------ nng based builds ------------------------------------------------------------
+# ------ all builds are si95 now ---------------------------------------------------
%:%.c
- gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
-
-# special build as it reuses an existing source module
-mt_receiver: receiver.c
- gcc -I $${C_INCLUDE_PATH:-.} -DMTC $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
-
-
-# ----- si test builds -------------------------------------------------------------
-
-%_si : %.c
gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_si -lpthread -lm
-# explicit rule because there is no mt_recever.c
-mt_receiver_si: receiver.c
+# special build rule as it reuses an existing source module with a sepcial define
+mt_receiver: receiver.c
gcc -I $${C_INCLUDE_PATH:-.} -DMTC $< -g -o $@ -lrmr_si -lpthread -lm
The receiver acks message type 5, so the reciver should receive acks at
about the volume of 1/10th the number of messages sent.
+
+The contents of this directory are generally intended to support automated
+testing via the run_all.sh script. Howerver, there may be times where
+building and running the tools manually is needed. To support this two
+scripts, maker.sh and runner.sh, are provided. The maker.sh script will
+build RMR in ../../.build and install it in a /tmp directory so that the
+needed include files can be found when building the test programmes. The
+runner.sh script sets the environment and then starts the comand given.
+For example, to run the sencder:
+ RMR_SEED_RT=xx.rt runner.sh ./sender 1000 0 0
+
+The runner script accepts both -v and -d to set verbose and debug options
+for RMR when the programme is run.
+
+
+The maker script will always build the test programmes whether they've been
+changed or not. By default the current .deb packages in ../../.build are
+used, but the -b option can be given to force a rebuild of the RMR libraries
+in addition to building the tools. If the ../../.build directory does not
+exist, it should automatically be created and RMR built.
+
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
if (( purge ))
then
- rm -f sender sender_si receiver receiver_si
+ rm -f sender receiver
fi
echo "----- app --------------------"
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
build=""
errors=0
-si_flag="-S" # default to -S to prefer to run SI tests over NNG tests
src_root="../.."
if [[ -z $BUILD_PATH ]] # if not explicitly set, assume one of our standard spots
-B) build="-b";; # build RMR without pulling
-e) capture_file=$2; >$capture_file; shift;;
-i) installed="-i";;
- -N) si_flag="";; # turn on NNG tests (off si)
+ -N) ;; # ignored for backwards compatability; nng no longer supported
-P) build="-B";; # build RMR with a pull first
-p) purge=0;; # don't purge binaries to ensure rebuild happens
- -S) si_flag="-S";; # turn on si based tests
+ -S) ;; # ignored; nng tests are not supported so all binaries are now si95
-s) shell=$2; shift;;
-v) verbose=1;;
- -\?) echo "usage: $0 [-B|-P] [-e err_file] [-i] [-N|-S] [-p] [-s shell] [-v]";;
+ -\?) echo "usage: $0 [-B|-P] [-e err_file] [-i] [-p] [-s shell] [-v]";;
*) echo "'$1' is not a recognised option and is ignored";;
esac
if (( purge ))
then
- rm -f sender sender_si receiver receiver_si
+ rm -f sender receiver
fi
echo "----- app --------------------"
if which ip >/dev/null 2>&1 # ip command rquired for the app test; skip if not found
then
- run_test run_app_test.sh $si_flag -v $installed $build
+ run_test run_app_test.sh -v $installed $build
build=""
fi
echo "----- multi ------------------"
-run_test run_multi_test.sh $si_flag $build
+run_test run_multi_test.sh $build
echo "----- round robin -----------"
-run_test run_rr_test.sh $si_flag
+run_test run_rr_test.sh
echo "----- rts -------------------"
-run_test run_rts_test.sh $si_flag -s 5 -d 100
+run_test run_rts_test.sh -s 5 -d 100
echo "----- extended payload nocopy no clone------"
-run_test run_exrts_test.sh $si_flag -d 10 -n 1000
+run_test run_exrts_test.sh -d 10 -n 1000
echo "----- extended payload copy clone------"
-run_test run_exrts_test.sh $si_flag -d 10 -n 1000 -c 11
+run_test run_exrts_test.sh -d 10 -n 1000 -c 11
if (( errors == 0 ))
then
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
cat <<endKat >app_test.rt
newrt | start
- mse | 0 | 0 | localhost:$port,$my_ip:43086
- mse | 1 | 10 | localhost:$port,${my_host//.*/}:43086
- mse | 2 | 20 | localhost:$port
- rte | 3 | localhost:$port
- mse | 3 | 100 | localhost:$port # special test to ensure that this does not affect previous entry
- rte | 4 | localhost:$port
- rte | 5 | localhost:$port
- rte | 6 | localhost:$port
- rte | 7 | localhost:$port
- rte | 8 | localhost:$port
- rte | 9 | localhost:$port
- rte | 10 | localhost:$port
- rte | 11 | localhost:$port
- rte | 12 | localhost:$port
- rte | 13 | localhost:$port
+ mse | 0 | 0 | 127.0.0.1:$port,$my_ip:43086
+ mse | 1 | 10 | 127.0.0.1:$port,${my_host//.*/}:43086
+ mse | 2 | 20 | 127.0.0.1:$port
+ rte | 3 | 127.0.0.1:$port
+ mse | 3 | 100 | 127.0.0.1:$port # special test to ensure that this does not affect previous entry
+ rte | 4 | 127.0.0.1:$port
+ rte | 5 | 127.0.0.1:$port
+ rte | 6 | 127.0.0.1:$port
+ rte | 7 | 127.0.0.1:$port
+ rte | 8 | 127.0.0.1:$port
+ rte | 9 | 127.0.0.1:$port
+ rte | 10 | 127.0.0.1:$port
+ rte | 11 | 127.0.0.1:$port
+ rte | 12 | 127.0.0.1:$port
+ rte | 13 | 127.0.0.1:$port
newrt | end
head -3 app_test.rt
keep=0
mt_receiver=0 # -m sets in order to test with multi-threaded receive stuff
force_make=0
-si="" # -S sets to build and test SI versions
while [[ $1 == -* ]]
-M) force_make=1;;
-m) mt_receiver=1;;
-n) nmsg=$2; shift;;
- -N) si="";; # build and test NNG versions (off si)
- -S) si="_si";; # build and test SI95 versions
+ -N) ;; # ignored for back compat; NNG not supported; all binaries are si95
+ -S) ;; # ignored for back compat; all binaries are si95 and no _si suffix is used
-v) verbose=1;;
*) echo "unrecognised option: $1"
fi
fi
+exit
run_rcvr &
sleep 2 # if sender starts faster than rcvr we can drop msgs, so pause a bit
run_sender &
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
dev_base=1 # -D turns off to allow this to run on installed libs
force_make=0
si=""
-localhost="localhost"
+localhost="127.0.0.1"
-D) dev_base=0;;
-n) nmsg=$2; shift;;
-M) force_make=1;;
+ -N) si="";; # ignored for back compat; NNG not supported; all binaries are si95
+ -S) si="";; # ignored for back compat; all binaries are si95 and no _si suffix is used
-N) si="";; # enable NNG testing (off si)
- -S) si="_si" # enable SI95 testing
- localhost="127.0.0.1"
- ;;
-t) nthreads=$2; shift;;
-v) verbose=1;;
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
function run_sender {
if (( la_sender ))
then
- leak_anal ./v_sender${si} ${nmsg:-10} ${delay:-100000} ${mtype_start_stop:-0:1} >/tmp/la.log 2>&1
+ leak_anal ./v_sender ${nmsg:-10} ${delay:-100000} ${mtype_start_stop:-0:1} >/tmp/la.log 2>&1
else
- ./v_sender${si} ${nmsg:-10} ${delay:-100000} ${mtype_start_stop:-0:1}
+ ./v_sender ${nmsg:-10} ${delay:-100000} ${mtype_start_stop:-0:1}
fi
echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch
}
export RMR_RTG_SVC=$(( 9990 + $1 ))
if (( la_receiver ))
then
- leak_anal ./ex_rts_receiver${si} $copyclone -p $port >/tmp/la.log 2>&1
+ leak_anal ./ex_rts_receiver $copyclone -p $port >/tmp/la.log 2>&1
else
- ./ex_rts_receiver${si} $copyclone -p $port
+ ./ex_rts_receiver $copyclone -p $port
fi
echo $? >/tmp/PID$$.$1.rrc
}
#
function set_rt {
typeset port=4460
- typeset groups="localhost:4460"
+ typeset groups="127.0.0.1:4460"
for (( i=1; i < ${1:-3}; i++ ))
do
- groups="$groups,localhost:$((port+i))"
+ groups="$groups,127.0.0.1:$((port+i))"
done
cat <<endKat >ex_rts.rt
nrcvrs=1 # this is sane, but -r allows it to be set up
use_installed=0
mtype_start_stop=""
-si="" # -S will enable si library testing
while [[ $1 == -* ]]
do
-L) leak_anal=$2; shift;;
-m) mtype_start_stop="$2"; shift;;
-M) mt_call_flag="EX_CFLAGS=-DMTC=1";; # turn on mt-call receiver option
- -N) si="";; # enable nng based testing
+ -N) ;; # ignored for back compat; nng not supported
-n) nmsg=$2; shift;;
-r) nrcvrs=$2; shift;;
- -S) si="_si";; # run SI95 based binaries
+ -S) ;; # ignored for back compat; si95 is the only supported transport
-v) verbose=1;;
*) echo "unrecognised option: $1"
set_rt $nrcvrs # set up the rt for n receivers
-if ! build_path=$build_path make -B $mt_call_flag v_sender${si} ex_rts_receiver${si} >/tmp/PID$$.log 2>&1 # for sanity, always rebuild test binaries
+if ! build_path=$build_path make -B $mt_call_flag v_sender ex_rts_receiver >/tmp/PID$$.log 2>&1 # for sanity, always rebuild test binaries
then
echo "[FAIL] cannot make binaries"
echo "====="
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
# file in order for the 'main' to pick them up easily.
#
function run_sender {
- ./lcaller${si} ${nmsg:-10} ${delay:-500} ${cthreads:-3}
+ ./lcaller ${nmsg:-10} ${delay:-500} ${cthreads:-3}
echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch
}
port=$(( 4460 + ${1:-0} ))
export RMR_RTG_SVC=$(( 9990 + $1 ))
- ./lreceiver${si} $(( ((nmsg * cthreads)/nrcvrs) + 10 )) $port
+ ./lreceiver $(( ((nmsg * cthreads)/nrcvrs) + 10 )) $port
echo $? >/tmp/PID$$.$1.rrc
}
#
function set_rt {
typeset port=4460
- typeset groups="localhost:4460"
+ typeset groups="127.0.0.1:4460"
for (( i=1; i < ${1:-3}; i++ ))
do
- groups="$groups,localhost:$((port+i))"
+ groups="$groups,127.0.0.1:$((port+i))"
done
cat <<endKat >lcall.rt
set_rt $nrcvrs # set up the rt for n receivers
-if (( force_make || rebuild )) || [[ ! -f ./lcaller{$si} || ! -f ./lreceiver${si} ]]
+if (( force_make || rebuild )) || [[ ! -f ./lcaller || ! -f ./lreceiver ]]
then
- if ! make -B lcaller${si} lreceiver${si} >/dev/null 2>&1
+ if ! make -B lcaller lreceiver >/dev/null 2>&1
then
- echo "[FAIL] cannot find lcaller${si} and/or lreceiver${si} binary, and cannot make them.... humm?"
+ echo "[FAIL] cannot find lcaller and/or lreceiver binary, and cannot make them.... humm?"
exit 1
fi
fi
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
# It doesn't happen all of the time, but frequently enough to be annoying.
#
function run_sender {
- RMR_ASYNC_CONN=0 ./sender${si} $nmsg $delay
+ RMR_ASYNC_CONN=0 ./sender $nmsg $delay
echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch
}
port=$(( 4460 + ${1:-0} ))
export RMR_RTG_SVC=$(( 9990 + $1 ))
- ./receiver${si} $nmsg $port
+ ./receiver $nmsg $port
echo $? >/tmp/PID$$.$1.rrc
}
#
function set_rt {
typeset port=4460
- typeset groups="localhost:4460"
+ typeset groups="127.0.0.1:4460"
for (( i=1; i < ${1:-3}; i++ ))
do
- groups="$groups;localhost:$((port+i))"
+ groups="$groups;127.0.0.1:$((port+i))"
done
cat <<endKat >multi.rt
-b) rebuild=1; nopull="nopull";; # enable build but without pull
-d) delay=$2; shift;;
-n) nmsg=$2; shift;;
- -N) si="";; # buld/run NNG binaries (turn off si)
+ -N) ;; # buld/run NNG binaries (turn off si)
-M) force_make=1;;
-r) nrcvrs=$2; shift;;
- -S) si="_si";; # buld/run SI95 binaries
+ -S) ;; # buld/run SI95 binaries
-v) verbose=1;;
*) echo "unrecognised option: $1"
set_rt $nrcvrs # set up the rt for n receivers
-if (( rebuild || force_make )) || [[ ! -f ./sender${si} || ! -f ./receiver${si} ]]
+if (( rebuild || force_make )) || [[ ! -f ./sender || ! -f ./receiver ]]
then
if ! make >/dev/null 2>&1
then
- echo "[FAIL] cannot find sender${si} and/or receiver${si} binary, and cannot make them.... humm?"
+ echo "[FAIL] cannot find sender and/or receiver binary, and cannot make them.... humm?"
exit 1
fi
fi
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
#
function run_sender {
export RMR_RTG_SVC=8990
- ./sender${si} $(( nmsg * nrcvrs )) $delay $max_mtype
+ ./sender $(( nmsg * nrcvrs )) $delay $max_mtype
echo $? >/tmp/PID$$.src # must communicate state back via file b/c asynch
}
port=$(( 4560 + ${1:-0} ))
export RMR_RTG_SVC=$(( 9990 + $1 ))
- ./receiver${si} $nmsg $port
+ ./receiver $nmsg $port
echo $? >/tmp/PID$$.$1.rrc
}
#
function set_rt {
typeset port=4560
- typeset endpoints="localhost:4560"
+ typeset endpoints="127.0.0.1:4560"
for (( i=1; i < ${1:-3}; i++ ))
do
- endpoints="$endpoints,localhost:$((port+i))"
+ endpoints="$endpoints,127.0.0.1:$((port+i))"
done
cat <<endKat >rr.rt
-m) max_mtype=$2; shift;;
-M) force_make=1;;
-n) nmsg=$2; shift;;
- -N) si="";; # build/run NNG binaries
+ -N) ;; # ignored for back compat; nng nolonger supported
-r) nrcvrs=$2; shift;;
- -S) si="_si";; # build/run SI95 binaries
+ -S) ;; # ignored for back compat; only si95 is supported
-v) verbose=1;;
*) echo "unrecognised option: $1"
set_rt $nrcvrs
-if (( rebuild || force_make )) || [[ ! -f ./sender${si} || ! -f ./receiver${si} ]]
+if (( rebuild || force_make )) || [[ ! -f ./sender || ! -f ./receiver ]]
then
if ! make >/dev/null 2>&1
then
- echo "[FAIL] cannot find sender${si} and/or receiver${si} binary, and cannot make them.... humm?"
+ echo "[FAIL] cannot find sender and/or receiver binary, and cannot make them.... humm?"
exit 1
fi
fi
#!/usr/bin/env ksh
# vim: ts=4 sw=4 noet :
#==================================================================================
-# Copyright (c) 2019-2020 Nokia
-# Copyright (c) 2018-2020 AT&T Intellectual Property.
+# Copyright (c) 2019-2021 Nokia
+# Copyright (c) 2018-2021 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.
function run_sender {
export RMR_RTG_SVC=$(( 9991 + $1 ))
port=$(( 43080 + $1 ))
- ./sender${si} $nmsg $delay 5:6 $port
+ ./sender $nmsg $delay 5:6 $port
echo $? >/tmp/PID$$.$1.src # must communicate state back via file b/c asynch
}
port=4460
export RMR_RTG_SVC=9990
- ./receiver${si} $(( nmsg * nsenders )) $port
+ ./receiver $(( nmsg * nsenders )) $port
echo $? >/tmp/PID$$.rrc
}
function set_rt {
cat <<endKat >rts.rt
newrt | start
- mse |5 | -1 | localhost:4460
+ mse |5 | -1 | 127.0.0.1:4460
newrt | end
endKat
-b) rebuild=1; nopull="nopull";; # build without pulling
-d) delay=$2; shift;;
-n) nmsg=$2; shift;;
- -N) si="";; # enable NNG tests (disable si)
+ -N) ;; # ignored for back compat -- nng no longer supported
-s) nsenders=$2; shift;;
- -S) si="_si";; # enable SI95 tests
+ -S) ;; # ignored for back compat -- si is only supported transport
-v) verbose=1;;
*) echo "unrecognised option: $1"
set_rt # create the route table
-if [[ ! -f ./sender${si} || ! -f ./receiver${si} ]]
+if [[ ! -f ./sender || ! -f ./receiver ]]
then
- if ! make ./sender${si} ./receiver${si} >/dev/null 2>&1
+ if ! make ./sender ./receiver >/dev/null 2>&1
then
- echo "[FAIL] cannot find sender${si} and/or receiver${si} binary, and cannot make them.... humm?"
+ echo "[FAIL] cannot find sender and/or receiver binary, and cannot make them.... humm?"
exit 1
fi
fi
struct ifaddrs *ifs; // pointer to head
struct ifaddrs *ele; // pointer into the list
char* rstr = NULL; // return string
+ char octs[NI_MAXHOST+1];
if( (l = (if_addrs_t *) malloc( sizeof( if_addrs_t ) )) == NULL ) {
getifaddrs( &ifs );
for( ele = ifs; ele; ele = ele->ifa_next ) {
if( ele && strcmp( ele->ifa_name, "lo" ) ) {
- rstr = strdup( ele->ifa_name );
- break;
+ memset( octs, 0, sizeof( octs ) );
+ getnameinfo( ele->ifa_addr, sizeof( struct sockaddr_in6 ), octs, NI_MAXHOST, NULL, 0, NI_NUMERICHOST );
+ if( *octs ) {
+ rstr = strdup( ele->ifa_name );
+ fprintf( stderr, "<INFO> found interface with address: %s\n", rstr );
+ break;
+ }
}
}
free( l );
+ if( rstr == NULL ) {
+ fprintf( stderr, "<ERROR> no interface with an address was found!\n" );
+ }
return rstr;
}
}
free( ip );
+ } else {
+ fprintf( stderr, "<SKIP> test skipped because no interface with address could be found on system" );
}
errors += ztbf_test(); // test the zero term buffer fill function