osmo-gsm-tester/src/osmo_gsm_tester
Neels Hofmeyr 5b04ef213e OsmoCtrl cleanup: get_var(), set_var(), get_trap()
CTRL interface interaction was mostly inherited from the first legacy
implementation of osmo-gsm-tester, and it was a pain to look at from the
start. Now, while I'm close to the topic, I want this to improve:

Properly match a GET_REPLY/SET_REPLY to a sent GET/SET by the message
ID.

Completely drop the do_get() and do_set(), which were not useful for
correct handling of the CTRL request and response messaging. The API to
use by callers is set_var(), get_var()/get_int_var() and get_trap().
These call the internal _sendrecv() (or for TRAP only _recv())
functions. Make it so that tese work both on an already connected
OsmoCtrl, as well as one that needs to establish a (short) connection,
so that both are trivially possible:

    # one CTRL connection stays open
    with OsmoCtrl(...) as ctrl:
  	ctrl.get_var('var1')
  	ctrl.get_var('var2')
  	ctrl.get_var('var3')

and

  # get_var() opens a connection, does the GET and closes again
  OsmoCtrl(...).get_var('var1')

Do away with doubling the instances OsmoCtrl and e.g. OsmoBscCtrl.
Rather make OsmoBscCtrl a child class of OsmoCtrl, which means that we
no longer have bsc.ctrl().ctrl(), just bsc.ctrl().

Have VERB_* constants instead of dup'd strings.

Apply to / simplify all callers of OsmoCtrl.

Some of these changes are similar to recently added OsmoVty.

Change-Id: Id561e5a55d8057a997a8ec9e7fa6f94840194df1
2020-12-11 00:30:38 +01:00
..
core report fragment: strip ansi colors from junit XML 2020-12-11 00:19:13 +01:00
external gnuradio_zmq_broker_remote: fix eNB port mapping for carrier aggregation 2020-11-30 14:27:10 +01:00
obj OsmoCtrl cleanup: get_var(), set_var(), get_trap() 2020-12-11 00:30:38 +01:00
templates cfg templates: log level and source basename last, log no category-hex 2020-12-10 23:03:27 +00:00
__init__.py Re-License under GPLv3-or-later instead of AGPLv3-or-later 2017-06-03 14:23:51 +00:00
testenv.py do not redirect_stdout in test scripts 2020-12-11 00:19:13 +01:00