libosmocore/tests/Makefile.am

831 lines
28 KiB
Makefile
Raw Permalink Normal View History

AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir)
AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS)
AM_LDFLAGS = -no-install
LDADD = $(top_builddir)/src/core/libosmocore.la $(TALLOC_LIBS) $(PTHREAD_LIBS)
if ENABLE_SERCOM_STUB
noinst_LIBRARIES = libsercomstub.a
LDADD += $(top_builddir)/tests/libsercomstub.a
endif
check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \
bits/bitrev_test a5/a5_test \
conv/conv_test auth/milenage_test auth/tuak_test \
lapd/lapd_test \
gsm0808/gsm0808_test gsm0408/gsm0408_test \
gprs/gprs_test kasumi/kasumi_test gea/gea_test \
logging/logging_test codec/codec_test \
logging/logging_gsmtap_test \
loggingrb/loggingrb_test strrb/strrb_test \
comp128/comp128_test \
bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \
bits/bitfield_test \
gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 17:28:09 +00:00
tlv/tlv_test oap/oap_test \
write_queue/wqueue_test socket/socket_test \
coding/coding_test conv/conv_gsm0503_test \
abis/abis_test endian/endian_test sercomm/sercomm_test \
prbs/prbs_test gsm23003/gsm23003_test \
gsm23236/gsm23236_test \
codec/codec_ecu_fr_test timer/clk_override_test \
oap/oap_client_test gsm29205/gsm29205_test \
logging/logging_vty_test \
vty/vty_transcript_test \
tdef/tdef_test tdef/tdef_vty_config_root_test \
tdef/tdef_vty_config_subnode_test \
tdef/tdef_vty_dynamic_test \
sockaddr_str/sockaddr_str_test \
use_count/use_count_test \
context/context_test \
gsm0502/gsm0502_test \
dtx/dtx_gsm0503_test \
i460_mux/i460_mux_test \
bitgen/bitgen_test \
gad/gad_test \
bsslap/bsslap_test \
bssmap_le/bssmap_le_test \
it_q/it_q_test \
time_cc/time_cc_test \
gsm48/rest_octets_test \
base64/base64_test \
iuup/iuup_test \
smscb/smscb_test \
smscb/gsm0341_test \
smscb/cbsp_test \
auth/xor2g_test \
v110/frame_test \
v110/ra1_test \
isdn: initial implementation of the V.110 TA ITU-T recommendation V.110 defines Terminal Adaptor (TA) functions for the connection of Terminal Equipment (TE) having standard V-series interfaces to the ISDN. This patch brings "software" implementation of the TA to libosmoisdn. The primary user for this soft-TA is the mobile-side implementation of CSD (Circuit Switched Data) in osmocom-bb. CSD is heavily based on V.110, which is not surprising given that GSM is a "wireless ISDN". Nevertheless, this code will likely also be useful in the context of retro-networking. Similarly to the existing V.110 code in libosmoisdn, the present implementation aims to be functional and correct, rather than efficient in any way. It also has several limitations, which are not critical for the CSD use case, but eventually may be a problem for other use cases in the context of retro-networking. Therefore, the V.110 TA API should be considered _unstable_, and may be subject to change in the future. +-------+ +------+ B-channel +------+ +-------+ | TE1 |------| TA |~~~~~~~~~~~~~~~| TA |------| TE2 | +-------+ +------+ +------+ +-------+ TE (also known as DTE) is basically a computer, having a V-series (usually RS-232) connection to TA (also known as DCE). The TA acts like a regular analog modem, except that it is not performing any kind of modulation or demodulation itself. The TE-TA interface is implemented by the user supplied callback functions, configured during the allocation of a TA instance: * .rx_cb() - receive call-back of the application, * .tx_cb() - transmit call-back of the application, * .status_update_cb() - status line update call-back. In addition to that, the application (TE) can interact with the V.24 status lines (circuits) using the following API: * osmo_v110_ta_{get,set}_status(), * osmo_v110_ta_{get,set}_circuit(). The Rx and Tx between TE and TA is always driven by the TA itself, as a result of an interaction with the lower layer implementing the B-channel interface. There is currently no buffering and thus no way for TE to initiate transmission or pull data on its own. The TA-TA (B-channel) interface is implemented by the following functions, which are meant to be called by the lower layer transmitting and receiving V.110 frames over certain medium: * osmo_v110_ta_frame_in() - indicate a received V.110 frame, * osmo_v110_ta_frame_out() - pull a V.110 frame for transmission, * osmo_v110_ta_[de]sync_ind() - indicate a synchronization event. The lower layer is responsible for finding the synchronization pattern (if needed), aligning to the frame boundaries, and doing the V.110 frame coding. The D-channel signalling is behind the scope of this module. Initial (Work-in-Progress) implementation by Harald Welte, completed and co-authored by Vadim Yanitskiy. Change-Id: I5716bd6fd0201ee7a7a29e72f775972cd374082f Related: OS#4396
2023-03-14 19:33:51 +00:00
v110/ta_test \
gsm44021/frame_csd_test \
osmo_io/osmo_io_test \
soft_uart/soft_uart_test \
rlp/rlp_test \
$(NULL)
if ENABLE_MSGFILE
check_PROGRAMS += msgfile/msgfile_test
endif
if ENABLE_PCSC
check_PROGRAMS += sim/sim_test
endif
if ENABLE_UTILITIES
check_PROGRAMS += utils/utils_test
endif
if ENABLE_VTY
check_PROGRAMS += vty/vty_test
endif
if ENABLE_CTRL
check_PROGRAMS += \
ctrl/ctrl_test \
fsm/fsm_test \
fsm/fsm_dealloc_test \
$(NULL)
endif
if !EMBEDDED
check_PROGRAMS += \
gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 17:28:09 +00:00
gsup/gsup_test \
stats/stats_test \
stats/stats_vty_test \
gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 17:28:09 +00:00
exec/exec_test \
$(NULL)
endif
if ENABLE_GB
check_PROGRAMS += gb/bssgp_fc_test gb/gprs_bssgp_test gb/gprs_bssgp_rim_test gb/gprs_ns_test gb/gprs_ns2_test fr/fr_test
endif
base64_base64_test_SOURCES = base64/base64_test.c
utils_utils_test_SOURCES = utils/utils_test.c
utils_utils_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
stats_stats_test_SOURCES = stats/stats_test.c
stats_stats_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
stats_stats_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/core
stats_stats_vty_test_SOURCES = stats/stats_vty_test.c
stats_stats_vty_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
a5_a5_test_SOURCES = a5/a5_test.c
a5_a5_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la $(LDADD)
kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c
kasumi_kasumi_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la $(LDADD)
comp128_comp128_test_SOURCES = comp128/comp128_test.c
comp128_comp128_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
auth_milenage_test_SOURCES = auth/milenage_test.c
auth_milenage_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
auth_tuak_test_SOURCES = auth/tuak_test.c
auth_tuak_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la $(LDADD)
auth_tuak_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src
auth_xor2g_test_SOURCES = auth/xor2g_test.c
auth_xor2g_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
abis_abis_test_SOURCES = abis/abis_test.c
abis_abis_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
ctrl_ctrl_test_SOURCES = ctrl/ctrl_test.c
ctrl_ctrl_test_LDADD = \
fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x00007f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f5df4d10000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
2018-01-17 12:07:16 +00:00
$(top_builddir)/src/ctrl/libosmoctrl.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/vty/libosmovty.la \
$(LDADD)
gea_gea_test_SOURCES = gea/gea_test.c
gea_gea_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
bits_bitrev_test_SOURCES = bits/bitrev_test.c
bitvec_bitvec_test_SOURCES = bitvec/bitvec_test.c
bits_bitcomp_test_SOURCES = bits/bitcomp_test.c
bits_bitfield_test_SOURCES = bits/bitfield_test.c
conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c
conv_conv_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la $(LDADD)
gsm0502_gsm0502_test_SOURCES = gsm0502/gsm0502_test.c
gsm0502_gsm0502_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
dtx_dtx_gsm0503_test_SOURCES = dtx/dtx_gsm0503_test.c
dtx_dtx_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/coding/libosmocoding.la \
$(LDADD)
conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c
conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la $(LDADD)
conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv
gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c
gsm0808_gsm0808_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gsm29205_gsm29205_test_SOURCES = gsm29205/gsm29205_test.c
gsm29205_gsm29205_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gsm0408_gsm0408_test_SOURCES = gsm0408/gsm0408_test.c
gsm0408_gsm0408_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gsm48_rest_octets_test_SOURCES = gsm48/rest_octets_test.c
gsm48_rest_octets_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gprs_gprs_test_SOURCES = gprs/gprs_test.c
gprs_gprs_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
lapd_lapd_test_SOURCES = lapd/lapd_test.c
lapd_lapd_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/isdn/libosmoisdn.la \
$(LDADD)
msgb_msgb_test_SOURCES = msgb/msgb_test.c
msgfile_msgfile_test_SOURCES = msgfile/msgfile_test.c
smscb_smscb_test_SOURCES = smscb/smscb_test.c
smscb_smscb_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
smscb_gsm0341_test_SOURCES = smscb/gsm0341_test.c
smscb_gsm0341_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
smscb_cbsp_test_SOURCES = smscb/cbsp_test.c
smscb_cbsp_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
sms_sms_test_SOURCES = sms/sms_test.c
sms_sms_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
timer_timer_test_SOURCES = timer/timer_test.c
timer_clk_override_test_SOURCES = timer/clk_override_test.c
ussd_ussd_test_SOURCES = ussd/ussd_test.c
ussd_ussd_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gb_bssgp_fc_test_SOURCES = gb/bssgp_fc_test.c
gb_bssgp_fc_test_LDADD = $(top_builddir)/src/gb/libosmogb.la \
fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x00007f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f5df4d10000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
2018-01-17 12:07:16 +00:00
$(top_builddir)/src/vty/libosmovty.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(LDADD)
gb_gprs_bssgp_test_SOURCES = gb/gprs_bssgp_test.c
gb_gprs_bssgp_test_LDADD = $(top_builddir)/src/vty/libosmovty.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/gb/libosmogb.la \
$(LDADD) \
$(LIBRARY_DLSYM)
gb_gprs_bssgp_rim_test_SOURCES = gb/gprs_bssgp_rim_test.c
gb_gprs_bssgp_rim_test_LDADD = $(top_builddir)/src/gb/libosmogb.la \
$(LDADD) \
$(LIBRARY_DLSYM)
gb_gprs_ns_test_SOURCES = gb/gprs_ns_test.c
gb_gprs_ns_test_LDADD = $(top_builddir)/src/gb/libosmogb.la \
fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x00007f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f5df4d10000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
2018-01-17 12:07:16 +00:00
$(top_builddir)/src/vty/libosmovty.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(LDADD) \
$(LIBRARY_DLSYM)
gb_gprs_ns2_test_SOURCES = gb/gprs_ns2_test.c
gb_gprs_ns2_test_LDADD = $(top_builddir)/src/vty/libosmovty.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/core/libosmocore.la \
$(top_builddir)/src/gb/libosmogb-test.la \
$(LDADD) \
$(LIBRARY_DLSYM)
logging_logging_test_SOURCES = logging/logging_test.c
logging_logging_vty_test_SOURCES = logging/logging_vty_test.c
logging_logging_vty_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
logging_logging_gsmtap_test_SOURCES = logging/logging_gsmtap_test.c
vty_vty_transcript_test_SOURCES = vty/vty_transcript_test.c
vty_vty_transcript_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
fr_fr_test_SOURCES = fr/fr_test.c
fr_fr_test_LDADD = $(top_builddir)/src/gb/libosmogb.la \
fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x00007f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f5df4d10000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
2018-01-17 12:07:16 +00:00
$(top_builddir)/src/vty/libosmovty.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(LDADD) \
$(LIBRARY_DLSYM)
codec_codec_test_SOURCES = codec/codec_test.c
codec_codec_test_LDADD = $(top_builddir)/src/codec/libosmocodec.la $(LDADD)
codec_codec_ecu_fr_test_SOURCES = codec/codec_ecu_fr_test.c
codec_codec_ecu_fr_test_LDADD = $(top_builddir)/src/codec/libosmocodec.la $(LDADD)
loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c
loggingrb_loggingrb_test_LDADD = $(LDADD)
strrb_strrb_test_SOURCES = strrb/strrb_test.c
vty_vty_test_SOURCES = vty/vty_test.c
vty_vty_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
sim_sim_test_SOURCES = sim/sim_test.c
sim_sim_test_LDADD = $(top_builddir)/src/sim/libosmosim.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(LDADD)
tlv_tlv_test_SOURCES = tlv/tlv_test.c
tlv_tlv_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gsup_gsup_test_SOURCES = gsup/gsup_test.c
gsup_gsup_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
oap_oap_test_SOURCES = oap/oap_test.c
oap_oap_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
oap_oap_client_test_SOURCES = oap/oap_client_test.c
oap_oap_client_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
fsm_fsm_test_SOURCES = fsm/fsm_test.c
fix tests linking: don't use system installed libs Do not link against the system-wide installed libosmo* libs when building the regression test programs. Always use the locally built ones. Linking some libosmo libraries causes libtool to pull in other libosmo libs even though they were not explicitly named. For example, ctrl_test explicitly links libosmoctrl, but this also has dependencies to libosmovty and libosmogsm: ldd src/ctrl/.libs/libosmoctrl.so | grep osmo libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f26c26d4000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f26c22bb000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f26c2171000) If we omit explicit LDADD of these dependencies in the Makefile.am, libtool will take the first canonical place to find them, which may just be the already installed older versions of the same libs, which may or may not be compatible with the current build. In any case, it is never intended to link installed libs. All library dependencies are listed by this quick script: cd libosmocore for l in $(find . -name "*.so") ; do echo; echo "$l"; ldd $l | grep libosmo; done ./.libs/libosmocore.so ./coding/.libs/libosmocoding.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f25fc3c2000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f25fbfa9000) libosmocodec.so.0 => /usr/local/lib/libosmocodec.so.0 (0x00007f25fbf9b000) ./codec/.libs/libosmocodec.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fb4c900d000) ./ctrl/.libs/libosmoctrl.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f5df5129000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f5df4d10000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f5df4bc6000) ./gb/.libs/libosmogb.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f788e536000) libosmovty.so.4 => /usr/local/lib/libosmovty.so.4 (0x00007f788e3ec000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f788dfd3000) ./vty/.libs/libosmovty.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f3b7ed21000) ./gsm/.libs/libosmogsm.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007fc69472e000) ./sim/.libs/libosmosim.so libosmocore.so.11 => /usr/local/lib/libosmocore.so.11 (0x00007f2f6412d000) libosmogsm.so.10 => /usr/local/lib/libosmogsm.so.10 (0x00007f2f63d14000) Add all explicit linking of all required library dependencies in all regression test programs, as shown by above listing. Example for reproducing a problem: In libosmocore.a, introduce a new function, and call that from libosmovty code. For example, I made loglevel_strs non-static in logging.c, and used that in logging_vty.c. Build and install this in a place where libtool can find it. Then go back to before this change and rebuild. You will see that linking ctrl_test (before this patch) then complains about libosmovty requiring the loglevel_strs symbol which it cannot find in libosmocore.so. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6
2018-01-17 12:07:16 +00:00
fsm_fsm_test_LDADD = \
$(top_builddir)/src/ctrl/libosmoctrl.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/vty/libosmovty.la \
$(LDADD)
fsm_fsm_dealloc_test_SOURCES = fsm/fsm_dealloc_test.c
fsm_fsm_dealloc_test_LDADD = $(LDADD)
write_queue_wqueue_test_SOURCES = write_queue/wqueue_test.c
socket_socket_test_SOURCES = socket/socket_test.c
coding_coding_test_SOURCES = coding/coding_test.c
coding_coding_test_LDADD = \
$(top_builddir)/src/gsm/libosmogsm.la \
$(top_builddir)/src/codec/libosmocodec.la \
$(top_builddir)/src/coding/libosmocoding.la \
$(LDADD)
endian_endian_test_SOURCES = endian/endian_test.c
sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c
prbs_prbs_test_SOURCES = prbs/prbs_test.c
gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c
gsm23003_gsm23003_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
gsm23236_gsm23236_test_SOURCES = gsm23236/gsm23236_test.c
gsm23236_gsm23236_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
tdef_tdef_test_SOURCES = tdef/tdef_test.c
tdef_tdef_test_LDADD = $(LDADD)
tdef_tdef_vty_config_root_test_SOURCES = tdef/tdef_vty_config_root_test.c
tdef_tdef_vty_config_root_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
tdef_tdef_vty_config_subnode_test_SOURCES = tdef/tdef_vty_config_subnode_test.c
tdef_tdef_vty_config_subnode_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
tdef_tdef_vty_dynamic_test_SOURCES = tdef/tdef_vty_dynamic_test.c
tdef_tdef_vty_dynamic_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(LDADD)
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
sockaddr_str_sockaddr_str_test_SOURCES = sockaddr_str/sockaddr_str_test.c
sockaddr_str_sockaddr_str_test_LDADD = $(LDADD)
use_count_use_count_test_SOURCES = use_count/use_count_test.c
use_count_use_count_test_LDADD = $(LDADD)
context_context_test_SOURCES = context/context_test.c
context_context_test_LDADD = $(LDADD)
exec_exec_test_SOURCES = exec/exec_test.c
exec_exec_test_LDADD = $(LDADD)
i460_mux_i460_mux_test_SOURCES = i460_mux/i460_mux_test.c
i460_mux_i460_mux_test_LDADD = $(top_builddir)/src/isdn/libosmoisdn.la $(LDADD)
bitgen_bitgen_test_SOURCES = bitgen/bitgen_test.c
bitgen_bitgen_test_LDADD = $(LDADD)
gad_gad_test_SOURCES = gad/gad_test.c
gad_gad_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
bsslap_bsslap_test_SOURCES = bsslap/bsslap_test.c
bsslap_bsslap_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
bssmap_le_bssmap_le_test_SOURCES = bssmap_le/bssmap_le_test.c
bssmap_le_bssmap_le_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
it_q_it_q_test_SOURCES = it_q/it_q_test.c
it_q_it_q_test_LDADD = $(LDADD)
time_cc_time_cc_test_SOURCES = time_cc/time_cc_test.c
time_cc_time_cc_test_LDADD = $(LDADD)
iuup_iuup_test_SOURCES = iuup/iuup_test.c
iuup_iuup_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
v110_frame_test_SOURCES = v110/frame_test.c
v110_frame_test_LDADD = $(top_builddir)/src/isdn/libosmoisdn.la $(LDADD)
v110_ra1_test_SOURCES = v110/ra1_test.c
v110_ra1_test_LDADD = $(top_builddir)/src/isdn/libosmoisdn.la $(LDADD)
isdn: initial implementation of the V.110 TA ITU-T recommendation V.110 defines Terminal Adaptor (TA) functions for the connection of Terminal Equipment (TE) having standard V-series interfaces to the ISDN. This patch brings "software" implementation of the TA to libosmoisdn. The primary user for this soft-TA is the mobile-side implementation of CSD (Circuit Switched Data) in osmocom-bb. CSD is heavily based on V.110, which is not surprising given that GSM is a "wireless ISDN". Nevertheless, this code will likely also be useful in the context of retro-networking. Similarly to the existing V.110 code in libosmoisdn, the present implementation aims to be functional and correct, rather than efficient in any way. It also has several limitations, which are not critical for the CSD use case, but eventually may be a problem for other use cases in the context of retro-networking. Therefore, the V.110 TA API should be considered _unstable_, and may be subject to change in the future. +-------+ +------+ B-channel +------+ +-------+ | TE1 |------| TA |~~~~~~~~~~~~~~~| TA |------| TE2 | +-------+ +------+ +------+ +-------+ TE (also known as DTE) is basically a computer, having a V-series (usually RS-232) connection to TA (also known as DCE). The TA acts like a regular analog modem, except that it is not performing any kind of modulation or demodulation itself. The TE-TA interface is implemented by the user supplied callback functions, configured during the allocation of a TA instance: * .rx_cb() - receive call-back of the application, * .tx_cb() - transmit call-back of the application, * .status_update_cb() - status line update call-back. In addition to that, the application (TE) can interact with the V.24 status lines (circuits) using the following API: * osmo_v110_ta_{get,set}_status(), * osmo_v110_ta_{get,set}_circuit(). The Rx and Tx between TE and TA is always driven by the TA itself, as a result of an interaction with the lower layer implementing the B-channel interface. There is currently no buffering and thus no way for TE to initiate transmission or pull data on its own. The TA-TA (B-channel) interface is implemented by the following functions, which are meant to be called by the lower layer transmitting and receiving V.110 frames over certain medium: * osmo_v110_ta_frame_in() - indicate a received V.110 frame, * osmo_v110_ta_frame_out() - pull a V.110 frame for transmission, * osmo_v110_ta_[de]sync_ind() - indicate a synchronization event. The lower layer is responsible for finding the synchronization pattern (if needed), aligning to the frame boundaries, and doing the V.110 frame coding. The D-channel signalling is behind the scope of this module. Initial (Work-in-Progress) implementation by Harald Welte, completed and co-authored by Vadim Yanitskiy. Change-Id: I5716bd6fd0201ee7a7a29e72f775972cd374082f Related: OS#4396
2023-03-14 19:33:51 +00:00
v110_ta_test_SOURCES = v110/ta_test.c
v110_ta_test_LDADD = $(top_builddir)/src/isdn/libosmoisdn.la $(LDADD)
gsm44021_frame_csd_test_SOURCES = gsm44021/frame_csd_test.c
gsm44021_frame_csd_test_LDADD = $(top_builddir)/src/isdn/libosmoisdn.la \
$(top_builddir)/src/gsm/libosmogsm.la \
$(LDADD)
osmo_io_osmo_io_test_SOURCES = osmo_io/osmo_io_test.c
soft_uart_soft_uart_test_SOURCES = soft_uart/soft_uart_test.c
rlp_rlp_test_SOURCES = rlp/rlp_test.c
rlp_rlp_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(LDADD)
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
:;{ \
echo '# Signature of the current package.' && \
echo 'm4_define([AT_PACKAGE_NAME],' && \
echo ' [$(PACKAGE_NAME)])' && \
echo 'm4_define([AT_PACKAGE_TARNAME],' && \
echo ' [$(PACKAGE_TARNAME)])' && \
echo 'm4_define([AT_PACKAGE_VERSION],' && \
echo ' [$(PACKAGE_VERSION)])' && \
echo 'm4_define([AT_PACKAGE_STRING],' && \
echo ' [$(PACKAGE_STRING)])' && \
echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
echo ' [$(PACKAGE_BUGREPORT)])'; \
echo 'm4_define([AT_PACKAGE_URL],' && \
echo ' [$(PACKAGE_URL)])'; \
} >'$(srcdir)/package.m4'
EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \
timer/timer_test.ok sms/sms_test.ok ussd/ussd_test.ok \
bits/bitrev_test.ok a5/a5_test.ok \
conv/conv_test.ok auth/milenage_test.ok ctrl/ctrl_test.ok \
auth/tuak_test.ok \
auth/xor2g_test.ok \
lapd/lapd_test.ok \
gsm0408/gsm0408_test.ok gsm0408/gsm0408_test.err \
gsm0808/gsm0808_test.ok gb/bssgp_fc_tests.err \
gb/bssgp_fc_tests.ok gb/bssgp_fc_tests.sh \
gb/gprs_bssgp_test.ok gea/gea_test.ok \
gb/gprs_bssgp_rim_test.ok \
gb/gprs_ns2_vty.vty gb/osmoappdesc.py gb/osmo-ns-dummy.cfg \
gb/gprs_ns_test.ok \
gb/gprs_ns_test.err \
gb/gprs_ns2_test.ok \
gb/gprs_ns2_test.err \
gprs/gprs_test.ok kasumi/kasumi_test.ok \
msgfile/msgfile_test.ok msgfile/msgconfig.cfg \
logging/logging_test.ok logging/logging_test.err \
logging/logging_vty_test.vty \
logging/logging_gsmtap_test.err \
fr/fr_test.ok loggingrb/logging_test.ok \
loggingrb/logging_test.err strrb/strrb_test.ok \
codec/codec_test.ok \
codec/codec_ecu_fr_test.ok \
vty/vty_test.ok vty/vty_test.err \
VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use consistent indenting. (see below for a definition of "consistent".) When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Format: Consistent means that two adjacent indenting lines have the exact same indenting characters for the common length: Weird mix if you ask me, but correct and consistent: ROOT <space>PARENT <space><tab><space>CHILD <space><tab><space><tab><tab>GRANDCHILD <space><tab><space><tab><tab>GRANDCHILD2 <space>SIBLING Inconsistent: ROOT <space>PARENT <tab><space>CHILD <space><space><tab>GRANDCHILD <space><tab><tab>GRANDCHILD2 <tab>SIBLING Also, when going back to a parent level, the exact same indenting must be used as before in that node: Incorrect: ROOT <tab>PARENT <tab><tab><tab>CHILD <tab><tab>SIBLING As not really intended side effect, it is also permitted to indent the entire file starting from the root level. We could guard against it but there's no harm: Correct and consistent: <tab>ROOT <tab><tab>PARENT <tab><tab><tab><tab>CHILD <tab><tab>SIBLING Implementation: Track parent nodes state: whenever a command enters a child node, push a parent node onto an llist to remember the exact indentation characters used for that level. As soon as the first line on a child node is parsed, remember this new indentation (which must have a longer strlen() than its parent level) to apply to all remaining child siblings and grandchildren. If the amount of spaces that indent a following VTY command are less than this expected indentation, call vty_go_parent() until it matches up. At any level, if the common length of indentation characters mismatch, abort parsing in error. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By popping a parent from the list of parents in vty_go_parent(), we can also detect that a command has changed the node without changing the parent, hence it must have stepped into a child node, and we can push a parent frame. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9
2017-09-07 01:08:06 +00:00
vty/fail_not_de-indented.cfg \
vty/fail_tabs_and_spaces.cfg \
vty/fail_too_much_indent.cfg \
vty/fail_cmd_ret_warning.cfg \
VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use consistent indenting. (see below for a definition of "consistent".) When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Format: Consistent means that two adjacent indenting lines have the exact same indenting characters for the common length: Weird mix if you ask me, but correct and consistent: ROOT <space>PARENT <space><tab><space>CHILD <space><tab><space><tab><tab>GRANDCHILD <space><tab><space><tab><tab>GRANDCHILD2 <space>SIBLING Inconsistent: ROOT <space>PARENT <tab><space>CHILD <space><space><tab>GRANDCHILD <space><tab><tab>GRANDCHILD2 <tab>SIBLING Also, when going back to a parent level, the exact same indenting must be used as before in that node: Incorrect: ROOT <tab>PARENT <tab><tab><tab>CHILD <tab><tab>SIBLING As not really intended side effect, it is also permitted to indent the entire file starting from the root level. We could guard against it but there's no harm: Correct and consistent: <tab>ROOT <tab><tab>PARENT <tab><tab><tab><tab>CHILD <tab><tab>SIBLING Implementation: Track parent nodes state: whenever a command enters a child node, push a parent node onto an llist to remember the exact indentation characters used for that level. As soon as the first line on a child node is parsed, remember this new indentation (which must have a longer strlen() than its parent level) to apply to all remaining child siblings and grandchildren. If the amount of spaces that indent a following VTY command are less than this expected indentation, call vty_go_parent() until it matches up. At any level, if the common length of indentation characters mismatch, abort parsing in error. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By popping a parent from the list of parents in vty_go_parent(), we can also detect that a command has changed the node without changing the parent, hence it must have stepped into a child node, and we can push a parent frame. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9
2017-09-07 01:08:06 +00:00
vty/ok.cfg \
vty/ok_empty_parent.cfg \
VTY: implicit node exit by de-indenting, not parent lookup Note: This will break users' config files if they do not use consistent indenting. (see below for a definition of "consistent".) When reading VTY commands from a file, use indenting as means to implicitly exit child nodes. Do not look for commands in the parent node implicitly. The VTY so far implies 'exit' commands if a VTY line cannot be parsed on the current node, but succeeds on the parent node. That is the mechanism by which our VTY config files do not need 'exit' at the end of each child node. We've hit problems with this in the following scenarios, which will show improved user experience after this patch: *) When both a parent and its child node have commands with identical names: cs7 instace 0 point-code 1.2.3 sccp-address osmo-msc point-code 0.0.1 If I put the parent's command below the child, it is still interpreted in the context of the child node: cs7 instace 0 sccp-address osmo-msc point-code 0.0.1 point-code 1.2.3 Though the indenting lets me assume I am setting the cs7 instance's global PC to 1.2.3, I'm actually overwriting osmo-msc's PC with 1.2.3 and discarding the 0.0.1. *) When a software change moves a VTY command from a child to a parent. Say 'timezone' moved from 'bts' to 'network' level: network timezone 1 2 Say a user still has an old config file with 'timezone' on the child level: network bts 0 timezone 1 2 trx 0 The user would expect an error message that 'timezone' is invalid on the 'bts' level. Instead, the VTY finds the parent node's 'timezone', steps out of 'bts' to the 'network' level, and instead says that the 'trx' command does not exist. Format: Consistent means that two adjacent indenting lines have the exact same indenting characters for the common length: Weird mix if you ask me, but correct and consistent: ROOT <space>PARENT <space><tab><space>CHILD <space><tab><space><tab><tab>GRANDCHILD <space><tab><space><tab><tab>GRANDCHILD2 <space>SIBLING Inconsistent: ROOT <space>PARENT <tab><space>CHILD <space><space><tab>GRANDCHILD <space><tab><tab>GRANDCHILD2 <tab>SIBLING Also, when going back to a parent level, the exact same indenting must be used as before in that node: Incorrect: ROOT <tab>PARENT <tab><tab><tab>CHILD <tab><tab>SIBLING As not really intended side effect, it is also permitted to indent the entire file starting from the root level. We could guard against it but there's no harm: Correct and consistent: <tab>ROOT <tab><tab>PARENT <tab><tab><tab><tab>CHILD <tab><tab>SIBLING Implementation: Track parent nodes state: whenever a command enters a child node, push a parent node onto an llist to remember the exact indentation characters used for that level. As soon as the first line on a child node is parsed, remember this new indentation (which must have a longer strlen() than its parent level) to apply to all remaining child siblings and grandchildren. If the amount of spaces that indent a following VTY command are less than this expected indentation, call vty_go_parent() until it matches up. At any level, if the common length of indentation characters mismatch, abort parsing in error. Transitions to child node are spread across VTY implementations and are hard to change. But transitions to the parent node are all handled by vty_go_parent(). By popping a parent from the list of parents in vty_go_parent(), we can also detect that a command has changed the node without changing the parent, hence it must have stepped into a child node, and we can push a parent frame. The behavior on the interactive telnet VTY remains unchanged. Change-Id: I24cbb3f6de111f2d31110c3c484c066f1153aac9
2017-09-07 01:08:06 +00:00
vty/ok_ignore_blank.cfg \
vty/ok_ignore_comment.cfg \
vty/ok_indented_root.cfg \
vty/ok_more_spaces.cfg \
vty/ok_tabs_and_spaces.cfg \
vty/ok_tabs.cfg \
vty/ok_deprecated_logging.cfg \
comp128/comp128_test.ok bits/bitfield_test.ok \
utils/utils_test.ok utils/utils_test.err \
stats/stats_test.ok stats/stats_test.err \
stats/stats_vty_test.vty \
bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \
sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \
gsup/gsup_test.ok gsup/gsup_test.err \
oap/oap_test.ok fsm/fsm_test.ok fsm/fsm_test.err \
fsm: support graceful osmo_fsm_inst_term() cascades Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18
2019-03-24 04:56:21 +00:00
fsm/fsm_dealloc_test.err \
write_queue/wqueue_test.ok socket/socket_test.ok \
socket/socket_test.err coding/coding_test.ok \
osmo-auc-gen/osmo-auc-gen_test.sh \
osmo-auc-gen/osmo-auc-gen_test.ok \
osmo-auc-gen/osmo-auc-gen_test.err \
conv/conv_gsm0503_test.ok endian/endian_test.ok \
sercomm/sercomm_test.ok prbs/prbs_test.ok \
gsm29205/gsm29205_test.ok gsm23003/gsm23003_test.ok \
gsm23236/gsm23236_test.ok \
timer/clk_override_test.ok \
oap/oap_client_test.ok oap/oap_client_test.err \
vty/vty_transcript_test.vty \
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
tdef/tdef_test.ok \
tdef/tdef_test.err \
tdef/tdef_test_range_64bit.ok \
tdef/tdef_vty_config_root_test.vty \
tdef/tdef_vty_config_subnode_test.vty \
tdef/tdef_vty_dynamic_test.vty \
sockaddr_str/sockaddr_str_test.ok \
use_count/use_count_test.ok use_count/use_count_test.err \
context/context_test.ok \
gsm0502/gsm0502_test.ok \
dtx/dtx_gsm0503_test.ok \
exec/exec_test.ok exec/exec_test.err \
i460_mux/i460_mux_test.ok \
bitgen/bitgen_test.ok \
gad/gad_test.ok \
bsslap/bsslap_test.ok \
bssmap_le/bssmap_le_test.ok \
it_q/it_q_test.ok \
time_cc/time_cc_test.ok \
gsm48/rest_octets_test.ok \
base64/base64_test.ok \
iuup/iuup_test.ok \
iuup/iuup_test.err \
smscb/smscb_test.ok \
smscb/gsm0341_test.ok \
smscb/cbsp_test.ok \
v110/frame_test.ok \
v110/ra1_test.ok \
isdn: initial implementation of the V.110 TA ITU-T recommendation V.110 defines Terminal Adaptor (TA) functions for the connection of Terminal Equipment (TE) having standard V-series interfaces to the ISDN. This patch brings "software" implementation of the TA to libosmoisdn. The primary user for this soft-TA is the mobile-side implementation of CSD (Circuit Switched Data) in osmocom-bb. CSD is heavily based on V.110, which is not surprising given that GSM is a "wireless ISDN". Nevertheless, this code will likely also be useful in the context of retro-networking. Similarly to the existing V.110 code in libosmoisdn, the present implementation aims to be functional and correct, rather than efficient in any way. It also has several limitations, which are not critical for the CSD use case, but eventually may be a problem for other use cases in the context of retro-networking. Therefore, the V.110 TA API should be considered _unstable_, and may be subject to change in the future. +-------+ +------+ B-channel +------+ +-------+ | TE1 |------| TA |~~~~~~~~~~~~~~~| TA |------| TE2 | +-------+ +------+ +------+ +-------+ TE (also known as DTE) is basically a computer, having a V-series (usually RS-232) connection to TA (also known as DCE). The TA acts like a regular analog modem, except that it is not performing any kind of modulation or demodulation itself. The TE-TA interface is implemented by the user supplied callback functions, configured during the allocation of a TA instance: * .rx_cb() - receive call-back of the application, * .tx_cb() - transmit call-back of the application, * .status_update_cb() - status line update call-back. In addition to that, the application (TE) can interact with the V.24 status lines (circuits) using the following API: * osmo_v110_ta_{get,set}_status(), * osmo_v110_ta_{get,set}_circuit(). The Rx and Tx between TE and TA is always driven by the TA itself, as a result of an interaction with the lower layer implementing the B-channel interface. There is currently no buffering and thus no way for TE to initiate transmission or pull data on its own. The TA-TA (B-channel) interface is implemented by the following functions, which are meant to be called by the lower layer transmitting and receiving V.110 frames over certain medium: * osmo_v110_ta_frame_in() - indicate a received V.110 frame, * osmo_v110_ta_frame_out() - pull a V.110 frame for transmission, * osmo_v110_ta_[de]sync_ind() - indicate a synchronization event. The lower layer is responsible for finding the synchronization pattern (if needed), aligning to the frame boundaries, and doing the V.110 frame coding. The D-channel signalling is behind the scope of this module. Initial (Work-in-Progress) implementation by Harald Welte, completed and co-authored by Vadim Yanitskiy. Change-Id: I5716bd6fd0201ee7a7a29e72f775972cd374082f Related: OS#4396
2023-03-14 19:33:51 +00:00
v110/ta_test.err \
gsm44021/frame_csd_test.ok \
osmo_io/osmo_io_test.ok osmo_io/osmo_io_test.err \
soft_uart/soft_uart_test.ok \
rlp/rlp_test.ok \
socket/socket_sctp_test.ok socket/socket_sctp_test.err \
$(NULL)
if ENABLE_LIBSCTP
if ENABLE_SCTP_TESTS
check_PROGRAMS += socket/socket_sctp_test
socket_socket_sctp_test_SOURCES = socket/socket_sctp_test.c
endif
endif
DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c
BUILT_SOURCES = conv/gsm0503_test_vectors.c
noinst_HEADERS = conv/conv.h
TESTSUITE = $(srcdir)/testsuite
update_exp: $(check_PROGRAMS)
a5/a5_test \
>$(srcdir)/a5/a5_test.ok
abis/abis_test \
>$(srcdir)/abis/abis_test.ok
if ENABLE_CTRL
ctrl/ctrl_test \
>$(srcdir)/ctrl/ctrl_test.ok
endif
kasumi/kasumi_test \
>$(srcdir)/kasumi/kasumi_test.ok
bits/bitrev_test \
>$(srcdir)/bits/bitrev_test.ok
bitvec/bitvec_test \
>$(srcdir)/bitvec/bitvec_test.ok
bits/bitcomp_test \
>$(srcdir)/bits/bitcomp_test.ok
bits/bitfield_test \
>$(srcdir)/bits/bitfield_test.ok
conv/conv_test \
>$(srcdir)/conv/conv_test.ok
conv/conv_gsm0503_test \
>$(srcdir)/conv/conv_gsm0503_test.ok
coding/coding_test \
>$(srcdir)/coding/coding_test.ok
msgb/msgb_test \
>$(srcdir)/msgb/msgb_test.ok
gea/gea_test \
>$(srcdir)/gea/gea_test.ok
if ENABLE_MSGFILE
msgfile/msgfile_test $(srcdir)/msgfile/msgconfig.cfg \
>$(srcdir)/msgfile/msgfile_test.ok
endif
sms/sms_test \
>$(srcdir)/sms/sms_test.ok
smscb/smscb_test \
>$(srcdir)/smscb/smscb_test.ok
smscb/gsm0341_test \
>$(srcdir)/smscb/gsm0341_test.ok
smscb/cbsp_test \
>$(srcdir)/smscb/cbsp_test.ok
ussd/ussd_test \
>$(srcdir)/ussd/ussd_test.ok
auth/milenage_test \
>$(srcdir)/auth/milenage_test.ok
auth/tuak_test \
>$(srcdir)/auth/tuak_test.ok
comp128/comp128_test \
>$(srcdir)/comp128/comp128_test.ok
lapd/lapd_test \
>$(srcdir)/lapd/lapd_test.ok
gsm0502/gsm0502_test \
>$(srcdir)/gsm0502/gsm0502_test.ok
dtx/dtx_gsm0503_test \
>$(srcdir)/dtx/dtx_gsm0503_test.ok
gsm0808/gsm0808_test \
>$(srcdir)/gsm0808/gsm0808_test.ok
gsm29205/gsm29205_test \
>$(srcdir)/gsm29205/gsm29205_test.ok
gsm0408/gsm0408_test \
2>$(srcdir)/gsm0408/gsm0408_test.err \
1>$(srcdir)/gsm0408/gsm0408_test.ok
gsm48/rest_octets_test \
>$(srcdir)/gsm48/rest_octets_test.ok
gprs/gprs_test \
>$(srcdir)/gprs/gprs_test.ok
logging/logging_test \
>$(srcdir)/logging/logging_test.ok \
2>$(srcdir)/logging/logging_test.err
logging/logging_gsmtap_test \
2>&1 |grep -v "enqueueing message failed" >$(srcdir)/logging/logging_gsmtap_test.err
codec/codec_test \
>$(srcdir)/codec/codec_test.ok
codec/codec_ecu_fr_test \
>$(srcdir)/codec/codec_ecu_fr_test.ok
if ENABLE_GB
fr/fr_test \
>$(srcdir)/fr/fr_test.ok
endif
loggingrb/loggingrb_test \
>$(srcdir)/loggingrb/logging_test.ok \
2>$(srcdir)/loggingrb/logging_test.err
strrb/strrb_test \
>$(srcdir)/strrb/strrb_test.ok
if ENABLE_VTY
vty/vty_test $(srcdir)/vty \
>$(srcdir)/vty/vty_test.ok \
2>$(srcdir)/vty/vty_test.err
endif
if ENABLE_GB
gb/gprs_bssgp_test \
>$(srcdir)/gb/gprs_bssgp_test.ok
gb/gprs_bssgp_rim_test \
>$(srcdir)/gb/gprs_bssgp_rim_test.ok
gb/gprs_ns_test \
>$(srcdir)/gb/gprs_ns_test.ok \
2>$(srcdir)/gb/gprs_ns_test.err
gb/gprs_ns2_test \
>$(srcdir)/gb/gprs_ns2_test.ok \
2>$(srcdir)/gb/gprs_ns2_test.err
endif
if ENABLE_UTILITIES
utils/utils_test \
>$(srcdir)/utils/utils_test.ok
endif
if !EMBEDDED
stats/stats_test \
>$(srcdir)/stats/stats_test.ok \
2>$(srcdir)/stats/stats_test.err
endif
write_queue/wqueue_test \
>$(srcdir)/write_queue/wqueue_test.ok
if ENABLE_GB
$(srcdir)/gb/bssgp_fc_tests.sh gb \
>$(srcdir)/gb/bssgp_fc_tests.ok \
2>$(srcdir)/gb/bssgp_fc_tests.err
endif
if ENABLE_PCSC
sim/sim_test \
>$(srcdir)/sim/sim_test.ok
endif
timer/timer_test \
>$(srcdir)/timer/timer_test.ok
timer/clk_override_test \
>$(srcdir)/timer/clk_override_test.ok
tlv/tlv_test \
>$(srcdir)/tlv/tlv_test.ok
gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 17:28:09 +00:00
if !EMBEDDED
gsup/gsup_test \
>$(srcdir)/gsup/gsup_test.ok \
2>$(srcdir)/gsup/gsup_test.err
gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 17:28:09 +00:00
endif
if ENABLE_CTRL
fsm/fsm_test \
>$(srcdir)/fsm/fsm_test.ok \
2>$(srcdir)/fsm/fsm_test.err
fsm/fsm_dealloc_test \
2>$(srcdir)/fsm/fsm_dealloc_test.err
endif
oap/oap_test \
>$(srcdir)/oap/oap_test.ok
oap/oap_client_test \
>$(srcdir)/oap/oap_client_test.ok \
2>$(srcdir)/oap/oap_client_test.err
socket/socket_test \
>$(srcdir)/socket/socket_test.ok \
2>$(srcdir)/socket/socket_test.err
socket/socket_sctp_test \
>$(srcdir)/socket/socket_sctp_test.ok \
2>$(srcdir)/socket/socket_sctp_test.err
$(srcdir)/osmo-auc-gen/osmo-auc-gen_test.sh ../utils/osmo-auc-gen \
>$(srcdir)/osmo-auc-gen/osmo-auc-gen_test.ok \
2>$(srcdir)/osmo-auc-gen/osmo-auc-gen_test.err
endian/endian_test \
>$(srcdir)/endian/endian_test.ok
sercomm/sercomm_test \
>$(srcdir)/sercomm/sercomm_test.ok
prbs/prbs_test \
>$(srcdir)/prbs/prbs_test.ok
gsm23003/gsm23003_test \
>$(srcdir)/gsm23003/gsm23003_test.ok
gsm23236/gsm23236_test \
>$(srcdir)/gsm23236/gsm23236_test.ok
tdef/tdef_test \
>$(srcdir)/tdef/tdef_test.ok \
2>$(srcdir)/tdef/tdef_test.err
sockaddr_str/sockaddr_str_test \
>$(srcdir)/sockaddr_str/sockaddr_str_test.ok
use_count/use_count_test \
>$(srcdir)/use_count/use_count_test.ok \
2>$(srcdir)/use_count/use_count_test.err
context/context_test \
>$(srcdir)/context/context_test.ok
if !EMBEDDED
exec/exec_test \
>$(srcdir)/exec/exec_test.ok \
2>$(srcdir)/exec/exec_test.err
endif
i460_mux/i460_mux_test \
>$(srcdir)/i460_mux/i460_mux_test.ok
bitgen/bitgen_test \
>$(srcdir)/bitgen/bitgen_test.ok
gad/gad_test \
>$(srcdir)/gad/gad_test.ok
bsslap/bsslap_test \
>$(srcdir)/bsslap/bsslap_test.ok
bssmap_le/bssmap_le_test \
>$(srcdir)/bssmap_le/bssmap_le_test.ok
it_q/it_q_test \
>$(srcdir)/it_q/it_q_test.ok
time_cc/time_cc_test \
>$(srcdir)/time_cc/time_cc_test.ok
iuup/iuup_test \
>$(srcdir)/iuup/iuup_test.ok \
2>$(srcdir)/iuup/iuup_test.err
v110/frame_test \
>$(srcdir)/v110/frame_test.ok
v110/ra1_test \
>$(srcdir)/v110/ra1_test.ok
isdn: initial implementation of the V.110 TA ITU-T recommendation V.110 defines Terminal Adaptor (TA) functions for the connection of Terminal Equipment (TE) having standard V-series interfaces to the ISDN. This patch brings "software" implementation of the TA to libosmoisdn. The primary user for this soft-TA is the mobile-side implementation of CSD (Circuit Switched Data) in osmocom-bb. CSD is heavily based on V.110, which is not surprising given that GSM is a "wireless ISDN". Nevertheless, this code will likely also be useful in the context of retro-networking. Similarly to the existing V.110 code in libosmoisdn, the present implementation aims to be functional and correct, rather than efficient in any way. It also has several limitations, which are not critical for the CSD use case, but eventually may be a problem for other use cases in the context of retro-networking. Therefore, the V.110 TA API should be considered _unstable_, and may be subject to change in the future. +-------+ +------+ B-channel +------+ +-------+ | TE1 |------| TA |~~~~~~~~~~~~~~~| TA |------| TE2 | +-------+ +------+ +------+ +-------+ TE (also known as DTE) is basically a computer, having a V-series (usually RS-232) connection to TA (also known as DCE). The TA acts like a regular analog modem, except that it is not performing any kind of modulation or demodulation itself. The TE-TA interface is implemented by the user supplied callback functions, configured during the allocation of a TA instance: * .rx_cb() - receive call-back of the application, * .tx_cb() - transmit call-back of the application, * .status_update_cb() - status line update call-back. In addition to that, the application (TE) can interact with the V.24 status lines (circuits) using the following API: * osmo_v110_ta_{get,set}_status(), * osmo_v110_ta_{get,set}_circuit(). The Rx and Tx between TE and TA is always driven by the TA itself, as a result of an interaction with the lower layer implementing the B-channel interface. There is currently no buffering and thus no way for TE to initiate transmission or pull data on its own. The TA-TA (B-channel) interface is implemented by the following functions, which are meant to be called by the lower layer transmitting and receiving V.110 frames over certain medium: * osmo_v110_ta_frame_in() - indicate a received V.110 frame, * osmo_v110_ta_frame_out() - pull a V.110 frame for transmission, * osmo_v110_ta_[de]sync_ind() - indicate a synchronization event. The lower layer is responsible for finding the synchronization pattern (if needed), aligning to the frame boundaries, and doing the V.110 frame coding. The D-channel signalling is behind the scope of this module. Initial (Work-in-Progress) implementation by Harald Welte, completed and co-authored by Vadim Yanitskiy. Change-Id: I5716bd6fd0201ee7a7a29e72f775972cd374082f Related: OS#4396
2023-03-14 19:33:51 +00:00
v110/ta_test \
2>$(srcdir)/v110/ta_test.err
gsm44021/frame_csd_test \
>$(srcdir)/gsm44021/frame_csd_test.ok
osmo_io/osmo_io_test \
>$(srcdir)/osmo_io/osmo_io_test.ok \
2>$(srcdir)/osmo_io/osmo_io_test.err
soft_uart/soft_uart_test \
>$(srcdir)/soft_uart/soft_uart.ok
rlp/rlp_test \
>$(srcdir)/rlp/rlp_test.ok \
$(NULL)
check-local: atconfig $(TESTSUITE)
[ -e /proc/cpuinfo ] && cat /proc/cpuinfo
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) ENABLE_URING=$(ENABLE_URING) ENABLE_URING_TESTS=$(ENABLE_URING_TESTS)
$(MAKE) $(AM_MAKEFLAGS) ext-tests
installcheck-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
$(TESTSUITEFLAGS) ENABLE_URING=$(ENABLE_URING) ENABLE_URING_TESTS=$(ENABLE_URING_TESTS)
clean-local:
test ! -f '$(TESTSUITE)' || \
$(SHELL) '$(TESTSUITE)' --clean
AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
mv $@.tmp $@
conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py
$(AM_V_GEN)python3 $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \
--target-path $(builddir)/conv
if ENABLE_EXT_TESTS
ext-tests:
# don't run vty and ctrl tests concurrently so that the ports don't conflict
$(MAKE) vty-test
$(MAKE) ctrl-test
else
ext-tests:
echo "Not running python-based external tests (determined at configure-time)"
endif
# To update the VTY script from current application behavior,
# pass -u to osmo_verify_transcript_vty.py by doing:
# make vty-test U=-u
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
if ENABLE_GB
vty-test-ns2: $(top_builddir)/utils/osmo-ns-dummy
$(MAKE) -C $(top_builddir)/utils osmo-ns-dummy
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/utils/osmo-ns-dummy -p 42042" \
$(U) $(srcdir)/gb/gprs_ns2*.vty
osmotestvty.py -p $(abs_top_srcdir)/tests/gb -w $(abs_top_builddir)/tests/gb -v
osmotestconfig.py -p $(abs_top_srcdir)/tests/gb -w $(abs_top_builddir)/tests/gb -v
else
vty-test-ns2:
echo "Not running vty-test-ns2 because osmo-ns-dummy is not built (--disable-gb)"
endif
vty-test-logging: $(top_builddir)/tests/logging/logging_vty_test
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/tests/logging/logging_vty_test" \
$(U) $(srcdir)/logging/*.vty
vty-test-vty: $(top_builddir)/tests/vty/vty_transcript_test
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/tests/vty/vty_transcript_test" \
$(U) $(srcdir)/vty/*.vty
vty-test-tdef: $(top_builddir)/tests/tdef/tdef_vty_config_root_test \
$(top_builddir)/tests/tdef/tdef_vty_config_subnode_test \
$(top_builddir)/tests/tdef/tdef_vty_dynamic_test
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/tests/tdef/tdef_vty_config_root_test" \
$(U) $(srcdir)/tdef/tdef_vty_config_root_test.vty
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/tests/tdef/tdef_vty_config_subnode_test" \
$(U) $(srcdir)/tdef/tdef_vty_config_subnode_test.vty
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/tests/tdef/tdef_vty_dynamic_test" \
$(U) $(srcdir)/tdef/tdef_vty_dynamic_test.vty
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
vty-test-stats: $(top_builddir)/tests/stats/stats_vty_test
osmo_verify_transcript_vty.py -v \
-p 42042 \
-r "$(top_builddir)/tests/stats/stats_vty_test" \
$(U) $(srcdir)/stats/*.vty
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
# don't run vty tests concurrently so that the ports don't conflict
vty-test:
$(MAKE) vty-test-logging
$(MAKE) vty-test-vty
add osmo_tdef API, originally adopted from osmo-bsc T_def Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more consistent. Upgrade to first class API: - add timer grouping - add generic vty support - add mising API doc - add C test - add VTY transcript tests, also as examples for using the API From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API. The root reason for moving to libosmocore is that I want to use the mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible place for this. osmo_tdef provides: - a list of Tnnnn (GSM) timers with description, unit and default value. - vty UI to allow users to configure non-default timeouts. - API to tie T timers to osmo_fsm states and set them on state transitions. - a few standard units (minute, second, millisecond) as well as a custom unit (which relies on the timer's human readable description to indicate the meaning of the value). - conversion for standard units: for example, some GSM timers are defined in minutes, while our FSM definitions need timeouts in seconds. Conversion is for convenience only and can be easily avoided via the custom unit. By keeping separate osmo_tdef arrays, several groups of timers can be kept separately. The VTY tests in tests/tdef/ showcase different schemes: - tests/vty/tdef_vty_test_config_root.c: Keep several timer definitions in separately named groups: showcase the osmo_tdef_vty_groups*() API. Each timer group exists exactly once. - tests/vty/tdef_vty_test_config_subnode.c: Keep a single list of timers without separate grouping. Put this list on a specific subnode below the CONFIG_NODE. There could be several separate subnodes with timers like this, i.e. continuing from this example, sets timers could be separated by placing timers in specific config subnodes instead of using the global group name. - tests/vty/tdef_vty_test_dynamic.c: Dynamically allocate timer definitions per each new created object. Thus there can be an arbitrary number of independent timer definitions, one per allocated object. T_def was introduced during the recent osmo-bsc refactoring for inter-BSC handover, and has proven useful: - without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be programmed with the right timeout value, for all code paths that invoke this state change. It is a likely source of errors to get one of them wrong. By defining a T timer exactly for an FSM state, the caller can merely invoke the state change and trust on the original state definition to apply the correct timeout. - it is helpful to have a standardized config file UI to provide user configurable timeouts, instead of inventing new VTY commands for each separate application of T timer numbers. Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
$(MAKE) vty-test-tdef
$(MAKE) vty-test-ns2
$(MAKE) vty-test-stats
ctrl-test:
echo "No CTRL tests exist currently"