2015-05-17 17:55:53 +00:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
|
2015-12-05 22:38:18 +00:00
|
|
|
AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
|
2017-10-30 12:19:58 +00:00
|
|
|
AM_LDFLAGS =
|
|
|
|
LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS)
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2018-01-18 15:50:51 +00:00
|
|
|
if ENABLE_SERCOM_STUB
|
|
|
|
noinst_LIBRARIES = libsercomstub.a
|
|
|
|
LDADD += $(top_builddir)/tests/libsercomstub.a
|
|
|
|
endif
|
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \
|
|
|
|
smscb/smscb_test bits/bitrev_test a5/a5_test \
|
|
|
|
conv/conv_test auth/milenage_test lapd/lapd_test \
|
2012-09-07 08:23:44 +00:00
|
|
|
gsm0808/gsm0808_test gsm0408/gsm0408_test \
|
2016-06-30 08:39:00 +00:00
|
|
|
gprs/gprs_test kasumi/kasumi_test gea/gea_test \
|
2017-12-01 18:39:23 +00:00
|
|
|
logging/logging_test codec/codec_test \
|
2013-08-06 12:29:14 +00:00
|
|
|
loggingrb/loggingrb_test strrb/strrb_test \
|
2017-05-18 20:59:02 +00:00
|
|
|
comp128/comp128_test smscb/gsm0341_test \
|
2016-03-14 20:04:50 +00:00
|
|
|
bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \
|
2017-10-18 11:14:49 +00:00
|
|
|
bits/bitfield_test \
|
2017-12-01 18:39:23 +00:00
|
|
|
tlv/tlv_test gsup/gsup_test oap/oap_test \
|
2016-09-22 18:48:59 +00:00
|
|
|
write_queue/wqueue_test socket/socket_test \
|
2017-01-19 10:01:15 +00:00
|
|
|
coding/coding_test conv/conv_gsm0503_test \
|
2017-05-18 20:59:02 +00:00
|
|
|
abis/abis_test endian/endian_test sercomm/sercomm_test \
|
2018-01-18 15:05:27 +00:00
|
|
|
prbs/prbs_test gsm23003/gsm23003_test \
|
2018-07-30 16:14:45 +00:00
|
|
|
codec/codec_ecu_fr_test timer/clk_override_test \
|
2018-12-10 09:57:59 +00:00
|
|
|
oap/oap_client_test gsm29205/gsm29205_test \
|
2018-09-10 15:18:28 +00:00
|
|
|
logging/logging_vty_test \
|
|
|
|
$(NULL)
|
2013-02-21 05:16:29 +00:00
|
|
|
|
2010-10-06 16:00:15 +00:00
|
|
|
if ENABLE_MSGFILE
|
2012-06-29 20:01:18 +00:00
|
|
|
check_PROGRAMS += msgfile/msgfile_test
|
2010-10-06 16:00:15 +00:00
|
|
|
endif
|
2011-11-13 00:02:54 +00:00
|
|
|
|
2016-11-15 16:31:14 +00:00
|
|
|
if ENABLE_PCSC
|
|
|
|
check_PROGRAMS += sim/sim_test
|
|
|
|
endif
|
|
|
|
|
2017-05-18 20:59:02 +00:00
|
|
|
if ENABLE_UTILITIES
|
|
|
|
check_PROGRAMS += utils/utils_test
|
|
|
|
endif
|
|
|
|
|
|
|
|
if ENABLE_VTY
|
|
|
|
check_PROGRAMS += vty/vty_test
|
|
|
|
endif
|
|
|
|
|
|
|
|
if ENABLE_CTRL
|
2017-12-01 18:39:23 +00:00
|
|
|
check_PROGRAMS += ctrl/ctrl_test fsm/fsm_test
|
2017-05-18 20:59:02 +00:00
|
|
|
endif
|
|
|
|
|
2018-01-18 15:05:27 +00:00
|
|
|
if ENABLE_STATS_TEST
|
|
|
|
check_PROGRAMS += stats/stats_test
|
|
|
|
endif
|
|
|
|
|
2017-05-18 20:59:02 +00:00
|
|
|
if ENABLE_GB
|
2017-12-01 18:39:23 +00:00
|
|
|
check_PROGRAMS += gb/bssgp_fc_test gb/gprs_bssgp_test gb/gprs_ns_test fr/fr_test
|
2017-05-18 20:59:02 +00:00
|
|
|
endif
|
|
|
|
|
2014-01-02 12:55:00 +00:00
|
|
|
utils_utils_test_SOURCES = utils/utils_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
utils_utils_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2014-01-02 12:55:00 +00:00
|
|
|
|
2015-10-01 18:43:53 +00:00
|
|
|
stats_stats_test_SOURCES = stats/stats_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
stats_stats_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2015-10-01 18:43:53 +00:00
|
|
|
|
2015-08-19 09:14:23 +00:00
|
|
|
a5_a5_test_SOURCES = a5/a5_test.c
|
2018-01-18 15:50:51 +00:00
|
|
|
a5_a5_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2015-08-19 09:14:23 +00:00
|
|
|
kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c
|
2018-01-18 15:50:51 +00:00
|
|
|
kasumi_kasumi_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
|
2014-06-16 12:59:30 +00:00
|
|
|
|
2013-12-02 10:30:32 +00:00
|
|
|
comp128_comp128_test_SOURCES = comp128/comp128_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
comp128_comp128_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2013-12-02 10:30:32 +00:00
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
auth_milenage_test_SOURCES = auth/milenage_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
auth_milenage_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2017-03-24 19:16:33 +00:00
|
|
|
abis_abis_test_SOURCES = abis/abis_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
abis_abis_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2017-03-24 19:16:33 +00:00
|
|
|
|
2017-02-24 12:59:14 +00:00
|
|
|
ctrl_ctrl_test_SOURCES = ctrl/ctrl_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
|
|
|
ctrl_ctrl_test_LDADD = $(LDADD) \
|
|
|
|
$(top_builddir)/src/ctrl/libosmoctrl.la \
|
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la \
|
|
|
|
$(top_builddir)/src/vty/libosmovty.la
|
2017-02-24 12:59:14 +00:00
|
|
|
|
2016-06-30 08:39:00 +00:00
|
|
|
gea_gea_test_SOURCES = gea/gea_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gea_gea_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2016-06-30 08:39:00 +00:00
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
bits_bitrev_test_SOURCES = bits/bitrev_test.c
|
|
|
|
|
2015-12-21 15:04:03 +00:00
|
|
|
bitvec_bitvec_test_SOURCES = bitvec/bitvec_test.c
|
|
|
|
|
2016-02-05 12:55:38 +00:00
|
|
|
bits_bitcomp_test_SOURCES = bits/bitcomp_test.c
|
|
|
|
|
2017-10-18 11:14:49 +00:00
|
|
|
bits_bitfield_test_SOURCES = bits/bitfield_test.c
|
|
|
|
|
2017-01-18 20:33:24 +00:00
|
|
|
conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c
|
2018-01-18 15:50:51 +00:00
|
|
|
conv_conv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2017-01-19 10:01:15 +00:00
|
|
|
conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c
|
2018-01-18 15:50:51 +00:00
|
|
|
conv_conv_gsm0503_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
|
2017-01-19 10:01:15 +00:00
|
|
|
conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv
|
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gsm0808_gsm0808_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2018-12-10 09:57:59 +00:00
|
|
|
gsm29205_gsm29205_test_SOURCES = gsm29205/gsm29205_test.c
|
|
|
|
gsm29205_gsm29205_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
|
|
|
|
2012-08-24 19:27:26 +00:00
|
|
|
gsm0408_gsm0408_test_SOURCES = gsm0408/gsm0408_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gsm0408_gsm0408_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2012-08-24 19:27:26 +00:00
|
|
|
|
2015-11-17 07:42:05 +00:00
|
|
|
gprs_gprs_test_SOURCES = gprs/gprs_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gprs_gprs_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2015-11-17 07:42:05 +00:00
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
lapd_lapd_test_SOURCES = lapd/lapd_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
lapd_lapd_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2015-11-27 12:26:16 +00:00
|
|
|
msgb_msgb_test_SOURCES = msgb/msgb_test.c
|
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
msgfile_msgfile_test_SOURCES = msgfile/msgfile_test.c
|
|
|
|
|
|
|
|
smscb_smscb_test_SOURCES = smscb/smscb_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
smscb_smscb_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2014-12-29 16:09:11 +00:00
|
|
|
smscb_gsm0341_test_SOURCES = smscb/gsm0341_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
smscb_gsm0341_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2014-12-29 16:09:11 +00:00
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
sms_sms_test_SOURCES = sms/sms_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
sms_sms_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2012-06-29 20:01:18 +00:00
|
|
|
|
|
|
|
timer_timer_test_SOURCES = timer/timer_test.c
|
|
|
|
|
2018-02-26 18:42:22 +00:00
|
|
|
timer_clk_override_test_SOURCES = timer/clk_override_test.c
|
|
|
|
|
2012-06-29 20:01:18 +00:00
|
|
|
ussd_ussd_test_SOURCES = ussd/ussd_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
ussd_ussd_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2011-11-13 00:02:54 +00:00
|
|
|
|
2012-09-07 08:23:44 +00:00
|
|
|
gb_bssgp_fc_test_SOURCES = gb/bssgp_fc_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gb_bssgp_fc_test_LDADD = $(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 \
|
2016-09-09 14:42:49 +00:00
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la
|
2012-09-07 08:23:44 +00:00
|
|
|
|
2014-10-14 12:49:37 +00:00
|
|
|
gb_gprs_bssgp_test_SOURCES = gb/gprs_bssgp_test.c
|
2018-05-04 17:21:58 +00:00
|
|
|
gb_gprs_bssgp_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DLSYM) \
|
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 \
|
2016-09-09 14:42:49 +00:00
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la
|
2014-10-14 12:49:37 +00:00
|
|
|
|
2013-10-08 10:04:43 +00:00
|
|
|
gb_gprs_ns_test_SOURCES = gb/gprs_ns_test.c
|
2018-05-04 17:21:58 +00:00
|
|
|
gb_gprs_ns_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DLSYM) \
|
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 \
|
2016-09-09 14:42:49 +00:00
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la
|
2013-10-08 10:04:43 +00:00
|
|
|
|
2012-09-27 12:18:37 +00:00
|
|
|
logging_logging_test_SOURCES = logging/logging_test.c
|
|
|
|
|
2018-09-10 15:18:28 +00:00
|
|
|
logging_logging_vty_test_SOURCES = logging/logging_vty_test.c
|
|
|
|
logging_logging_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la
|
|
|
|
|
2012-11-11 13:21:26 +00:00
|
|
|
fr_fr_test_SOURCES = fr/fr_test.c
|
2018-05-04 17:21:58 +00:00
|
|
|
fr_fr_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DLSYM) \
|
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 \
|
2016-09-09 14:42:49 +00:00
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la
|
2012-11-11 13:21:26 +00:00
|
|
|
|
2016-05-25 16:13:51 +00:00
|
|
|
codec_codec_test_SOURCES = codec/codec_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
codec_codec_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la
|
2016-05-25 16:13:51 +00:00
|
|
|
|
2017-12-15 20:42:15 +00:00
|
|
|
codec_codec_ecu_fr_test_SOURCES = codec/codec_ecu_fr_test.c
|
|
|
|
codec_codec_ecu_fr_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la
|
|
|
|
|
2015-03-30 12:22:14 +00:00
|
|
|
loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c
|
2017-12-01 18:39:23 +00:00
|
|
|
loggingrb_loggingrb_test_LDADD = $(LDADD)
|
2013-02-21 05:16:29 +00:00
|
|
|
|
|
|
|
strrb_strrb_test_SOURCES = strrb/strrb_test.c
|
|
|
|
|
2013-08-06 12:29:14 +00:00
|
|
|
vty_vty_test_SOURCES = vty/vty_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
vty_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la
|
2013-08-06 12:29:14 +00:00
|
|
|
|
2016-03-14 20:04:50 +00:00
|
|
|
sim_sim_test_SOURCES = sim/sim_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
sim_sim_test_LDADD = $(LDADD) $(top_builddir)/src/sim/libosmosim.la \
|
2016-09-09 14:42:49 +00:00
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la
|
2012-11-11 13:21:26 +00:00
|
|
|
|
2016-04-25 13:19:35 +00:00
|
|
|
tlv_tlv_test_SOURCES = tlv/tlv_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
tlv_tlv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2016-04-25 13:19:35 +00:00
|
|
|
|
2016-04-25 16:46:22 +00:00
|
|
|
gsup_gsup_test_SOURCES = gsup/gsup_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gsup_gsup_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2016-04-25 16:46:22 +00:00
|
|
|
|
2016-12-08 16:50:03 +00:00
|
|
|
oap_oap_test_SOURCES = oap/oap_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
oap_oap_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2016-12-08 16:50:03 +00:00
|
|
|
|
2018-07-30 16:14:45 +00:00
|
|
|
oap_oap_client_test_SOURCES = oap/oap_client_test.c
|
|
|
|
oap_oap_client_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
|
|
|
|
2016-05-29 01:53:17 +00:00
|
|
|
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 = \
|
|
|
|
$(LDADD) \
|
|
|
|
$(top_builddir)/src/ctrl/libosmoctrl.la \
|
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la \
|
|
|
|
$(top_builddir)/src/vty/libosmovty.la
|
2016-05-29 01:53:17 +00:00
|
|
|
|
2016-11-12 20:25:21 +00:00
|
|
|
write_queue_wqueue_test_SOURCES = write_queue/wqueue_test.c
|
|
|
|
|
2017-01-27 09:29:49 +00:00
|
|
|
socket_socket_test_SOURCES = socket/socket_test.c
|
|
|
|
|
2016-09-22 18:48:59 +00:00
|
|
|
coding_coding_test_SOURCES = coding/coding_test.c
|
2017-11-28 13:54:32 +00:00
|
|
|
coding_coding_test_LDADD = $(LDADD) \
|
2016-09-22 18:48:59 +00:00
|
|
|
$(top_builddir)/src/gsm/libosmogsm.la \
|
|
|
|
$(top_builddir)/src/codec/libosmocodec.la \
|
|
|
|
$(top_builddir)/src/coding/libosmocoding.la
|
|
|
|
|
2017-05-15 10:07:51 +00:00
|
|
|
endian_endian_test_SOURCES = endian/endian_test.c
|
|
|
|
|
2017-05-15 14:39:56 +00:00
|
|
|
sercomm_sercomm_test_SOURCES = sercomm/sercomm_test.c
|
|
|
|
|
2017-06-18 15:16:02 +00:00
|
|
|
prbs_prbs_test_SOURCES = prbs/prbs_test.c
|
|
|
|
|
2017-10-04 01:15:47 +00:00
|
|
|
gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c
|
2017-10-30 12:19:58 +00:00
|
|
|
gsm23003_gsm23003_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
|
2017-10-04 01:15:47 +00:00
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
# 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'
|
2012-06-29 20:01:18 +00:00
|
|
|
|
|
|
|
EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \
|
|
|
|
timer/timer_test.ok sms/sms_test.ok ussd/ussd_test.ok \
|
|
|
|
smscb/smscb_test.ok bits/bitrev_test.ok a5/a5_test.ok \
|
2017-02-24 12:59:14 +00:00
|
|
|
conv/conv_test.ok auth/milenage_test.ok ctrl/ctrl_test.ok \
|
2012-08-25 20:03:42 +00:00
|
|
|
lapd/lapd_test.ok gsm0408/gsm0408_test.ok \
|
2012-09-11 09:49:35 +00:00
|
|
|
gsm0808/gsm0808_test.ok gb/bssgp_fc_tests.err \
|
|
|
|
gb/bssgp_fc_tests.ok gb/bssgp_fc_tests.sh \
|
2016-06-30 08:39:00 +00:00
|
|
|
gb/gprs_bssgp_test.ok gb/gprs_ns_test.ok gea/gea_test.ok \
|
2017-12-15 20:42:15 +00:00
|
|
|
gprs/gprs_test.ok kasumi/kasumi_test.ok \
|
2012-09-27 12:18:37 +00:00
|
|
|
msgfile/msgfile_test.ok msgfile/msgconfig.cfg \
|
2012-11-11 13:21:26 +00:00
|
|
|
logging/logging_test.ok logging/logging_test.err \
|
2013-02-21 05:16:29 +00:00
|
|
|
fr/fr_test.ok loggingrb/logging_test.ok \
|
2013-08-06 12:29:14 +00:00
|
|
|
loggingrb/logging_test.err strrb/strrb_test.ok \
|
2017-12-15 20:42:15 +00:00
|
|
|
codec/codec_test.ok \
|
|
|
|
codec/codec_ecu_fr_test.ok \
|
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/vty_test.ok \
|
|
|
|
vty/fail_not_de-indented.cfg \
|
|
|
|
vty/fail_tabs_and_spaces.cfg \
|
|
|
|
vty/fail_too_much_indent.cfg \
|
|
|
|
vty/ok.cfg \
|
2017-09-19 21:54:01 +00:00
|
|
|
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 \
|
2017-10-18 11:14:49 +00:00
|
|
|
comp128/comp128_test.ok bits/bitfield_test.ok \
|
2018-07-19 20:11:52 +00:00
|
|
|
utils/utils_test.ok utils/utils_test.err stats/stats_test.ok \
|
2016-03-14 20:04:50 +00:00
|
|
|
bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \
|
2017-03-24 19:16:33 +00:00
|
|
|
sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \
|
2017-02-21 19:17:35 +00:00
|
|
|
gsup/gsup_test.ok gsup/gsup_test.err \
|
2016-12-08 16:50:03 +00:00
|
|
|
oap/oap_test.ok fsm/fsm_test.ok fsm/fsm_test.err \
|
2017-01-27 09:29:49 +00:00
|
|
|
write_queue/wqueue_test.ok socket/socket_test.ok \
|
2017-03-15 00:52:58 +00:00
|
|
|
socket/socket_test.err coding/coding_test.ok \
|
|
|
|
osmo-auc-gen/osmo-auc-gen_test.sh \
|
|
|
|
osmo-auc-gen/osmo-auc-gen_test.ok \
|
2017-01-19 10:01:15 +00:00
|
|
|
osmo-auc-gen/osmo-auc-gen_test.err \
|
2017-05-15 14:39:56 +00:00
|
|
|
conv/conv_gsm0503_test.ok endian/endian_test.ok \
|
2017-10-04 01:15:47 +00:00
|
|
|
sercomm/sercomm_test.ok prbs/prbs_test.ok \
|
2018-12-10 09:57:59 +00:00
|
|
|
gsm29205/gsm29205_test.ok gsm23003/gsm23003_test.ok \
|
2018-07-30 16:14:45 +00:00
|
|
|
timer/clk_override_test.ok \
|
|
|
|
oap/oap_client_test.ok oap/oap_client_test.err
|
2012-09-27 12:18:37 +00:00
|
|
|
|
2017-01-19 10:01:15 +00:00
|
|
|
DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c
|
|
|
|
BUILT_SOURCES = conv/gsm0503_test_vectors.c
|
2017-01-18 20:33:24 +00:00
|
|
|
noinst_HEADERS = conv/conv.h
|
2012-12-25 23:12:21 +00:00
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
TESTSUITE = $(srcdir)/testsuite
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
check-local: atconfig $(TESTSUITE)
|
2017-11-16 16:49:38 +00:00
|
|
|
cat /proc/cpuinfo
|
2011-11-13 00:02:54 +00:00
|
|
|
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
|
2018-09-10 15:18:28 +00:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) ext-tests
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
installcheck-local: atconfig $(TESTSUITE)
|
|
|
|
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
|
|
|
|
$(TESTSUITEFLAGS)
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2011-11-13 00:02:54 +00:00
|
|
|
clean-local:
|
|
|
|
test ! -f '$(TESTSUITE)' || \
|
|
|
|
$(SHELL) '$(TESTSUITE)' --clean
|
2012-06-29 20:01:18 +00:00
|
|
|
|
2011-11-29 21:20:34 +00:00
|
|
|
AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
|
2011-11-13 00:02:54 +00:00
|
|
|
AUTOTEST = $(AUTOM4TE) --language=autotest
|
|
|
|
$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
|
|
|
|
$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
|
|
|
|
mv $@.tmp $@
|
2017-01-19 10:01:15 +00:00
|
|
|
|
|
|
|
conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py
|
2018-07-02 13:28:55 +00:00
|
|
|
$(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \
|
2017-01-19 10:01:15 +00:00
|
|
|
--target-path $(builddir)/conv
|
2018-09-10 15:18:28 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
vty-test:
|
|
|
|
osmo_verify_transcript_vty.py -v \
|
|
|
|
-p 42042 \
|
|
|
|
-r "$(top_builddir)/tests/logging/logging_vty_test" \
|
|
|
|
$(U) $(srcdir)/logging/*.vty
|
|
|
|
|
|
|
|
ctrl-test:
|
|
|
|
echo "No CTRL tests exist currently"
|