From: E. Scott Daniels Date: Fri, 3 Apr 2020 14:14:44 +0000 (-0400) Subject: Rename health_ck support binary to rmr_probe X-Git-Tag: 3.7.0^0 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=b021c0dbde7e13ad02c2ac0669e0530a40a9eb85;p=ric-plt%2Flib%2Frmr.git Rename health_ck support binary to rmr_probe The health_ck name was determed to be too generic and has been replaced with rmr_probe. The application performs the same health check function, and may at some point in the futre be extended to provide other RMR delivered probes. This change also adds a useage message which was missing Issue-ID: RIC-308 Signed-off-by: E. Scott Daniels Change-Id: I98f9dd7f9598b6a5682e4fb0d62c4146e8577e97 --- diff --git a/CHANGES_CORE.txt b/CHANGES_CORE.txt index c3244be..1e00418 100644 --- a/CHANGES_CORE.txt +++ b/CHANGES_CORE.txt @@ -5,6 +5,9 @@ # API and build change and fix summaries. Doc correctsions # and/or changes are not mentioned here; see the commit messages. +2020 April 7; version 3.7.0 + The health check support programme was renamed to rmr_probe (RIC-308). + 2020 April 6; version 3.6.6 Correct bug in SI95 address conversion module (RIC-327) Correct bug in SI initialisation module diff --git a/CMakeLists.txt b/CMakeLists.txt index b54c676..c73b5dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,8 +39,8 @@ project( rmr LANGUAGES C ) cmake_minimum_required( VERSION 3.5 ) set( major_version "3" ) # 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 "6" ) +set( minor_version "7" ) +set( patch_level "0" ) set( install_root "${CMAKE_INSTALL_PREFIX}" ) set( install_inc "include/rmr" ) diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt index f3124f5..36a1edc 100644 --- a/src/support/CMakeLists.txt +++ b/src/support/CMakeLists.txt @@ -18,17 +18,24 @@ # # build support tools and setup for their install -add_executable( health_ck health_ck.c ) + +# The health_ck binary is deprecated. We will stop building it soon. It is +# replaced with the rmr_probe binary. +add_executable( health_ck rmr_probe.c ) add_dependencies( health_ck rmr_si_static ) target_link_libraries( health_ck rmr_si_static;pthread;m ) +add_executable( rmr_probe rmr_probe.c ) +add_dependencies( rmr_probe rmr_si_static ) +target_link_libraries( rmr_probe rmr_si_static;pthread;m ) + include_directories( ${CMAKE_SOURCE_DIR}/src/rmr/common/include ) # install only into the runtime package if( NOT DEV_PKG ) install( - TARGETS health_ck + TARGETS health_ck rmr_probe DESTINATION bin ) endif() diff --git a/src/support/README b/src/support/README index 7e274d1..5965010 100644 --- a/src/support/README +++ b/src/support/README @@ -23,12 +23,17 @@ might provide means to query information about an RMR based application using the RMR_CTL_PORT. Support tools: - health_ck -- A generic health check application which + rmr_probe -- A generic health check application which sends n messages to the application running at the indicated host:port and expects to receive n responses. Exit code is a simple binary: 0 == received responses, 1 == failure. - Support tools are automatically built and included in the runtime package (deb or rpm). + + +The original name of rmr_probe was health_ck. This was deemed too +generic and thus is replaced by rmr_probe. We continue to build +and package health_ck for a few versions allowing any containers +which use that to avoid breakage. diff --git a/src/support/health_ck.c b/src/support/rmr_probe.c similarity index 89% rename from src/support/health_ck.c rename to src/support/rmr_probe.c index 290c500..b6df5eb 100644 --- a/src/support/health_ck.c +++ b/src/support/rmr_probe.c @@ -19,8 +19,15 @@ */ /* - Mnemonic: health_ck.c - Abstract: This is a generic, and very simplistic, health check application + Mnemonic: rmr_probe.c + Abstract: This sends probe messages to the indicated applications. The only + use currently is to send health check messages and wait for a + response. It might be extended later and would cause a bit of + a redesign, but from the outside the switch to the name rmr_probe + makes sense. + + Original abstract which stands until the probe does more: + This is a generic, and very simplistic, health check application which will send n RMR messages to an application (localhost:4560 by default) and expect to receive n responses. Messages are sent with the message type RIC_HEALTH_CHECK_REQ and responses are @@ -106,6 +113,16 @@ static int elapsed( struct timespec* start_ts, struct timespec* end_ts ) { return bin; } +static void usage( char* arg0 ) { + + fprintf( stderr, "version 1.0.0\n" + "usage: %s [-h host:port] [-n msg-count] [-r] [-t seconds] [-v]\n" + "\thost:port may be ip-address:port or name:port of the application\n" + "\tmsg-count is the number of health check requests sent; default is 1\n" + "\t-r causes a random listen port NOT to be used; 43086 is used instead\n" + "\t-v enables some amount of extra verbose output to stderr\n", arg0 ); +} + int main( int argc, char** argv ) { int ai = 1; // arg index int i; @@ -163,8 +180,12 @@ int main( int argc, char** argv ) { verbose = 1; break; + case '?': usage( argv[0] ); + exit( 0 ); + default: fprintf( stderr, "[FAIL] unrecognised option: %s\n", argv[ai] ); + usage( argv[0] ); exit( 1 ); }