Osmocom Mobile Switching Centre
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
osmo-msc/tests/testsuite.at

124 lines
4.9 KiB

AT_INIT
AT_BANNER([Regression tests.])
AT_SETUP([smpp])
AT_KEYWORDS([smpp])
AT_CHECK([test "$enable_smpp_test" != no || exit 77])
cat $abs_srcdir/smpp/smpp_test.ok > expout
cat $abs_srcdir/smpp/smpp_test.err > experr
AT_CHECK([$abs_top_builddir/tests/smpp/smpp_test], [], [expout], [experr])
AT_CLEANUP
Use libvlr in libmsc (large refactoring) Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050
7 years ago
AT_SETUP([sms_queue_test])
AT_KEYWORDS([sms_queue_test])
cat $abs_srcdir/sms_queue/sms_queue_test.ok > expout
cat $abs_srcdir/sms_queue/sms_queue_test.err > experr
AT_CHECK([$abs_top_builddir/tests/sms_queue/sms_queue_test], [], [expout], [experr])
AT_CLEANUP
Introduce initial unit test for db_sms_* API Since OsmoMSC has built-in SMSC, it needs to store the messages somewhere. Currently we use libdbi and SQLite3 back-end for that. For a long time, the db_sms_* API remained uncovered by unit tests. This change aims to fix that, and does cover the following calls: - db_sms_store(), - db_sms_get(), - db_sms_get_next_unsent(), - db_sms_mark_delivered(), - db_sms_delete_sent_message_by_id(), - db_sms_delete_by_msisdn(), - db_sms_delete_oldest_expired_message(). Due to performance reasons, the test database is initialized in RAM using the magic filename ':memory:'. This is a feature of SQLite3 (and not libdbi), see: https://www.sqlite.org/inmemorydb.html Of course, this unit test helped to discover some problems: 1) Storing an SMS with empty TP-User-Data (TP-UDL=0) causes buffer overruns in both db_sms_store() and db_sms_get(). 2) TP-User-Data-Length is always being interpreted in octets, regardless of DCS (Data Coding Scheme). This results in storing garbage in the database if the default 7-bit encoding is used. Fortunately, the 'user_data' buffer in structure 'gsm_sms' is large emough, so we don't experience buffer overruns. 3) db_sms_delete_oldest_expired_message() doesn't work as expected. Instead of removing the *oldest* expired message, it tries to remove the *newest* one. The current test expectations do reflect these problems. All of them will be fixed in the follow-up patches. Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3
4 years ago
AT_SETUP([db_sms_test])
AT_KEYWORDS([db_sms_test])
cat $abs_srcdir/db_sms/db_sms_test.ok > expout
cat $abs_srcdir/db_sms/db_sms_test.err > experr
# swap the output from stderr and stdout so we can drop libdbi prints to stderr when trying to load wrong drivers
AT_CHECK([$abs_top_builddir/tests/db_sms/db_sms_test 3>&1 1>&2 2>&3 | grep -v "Failed to load driver" | grep -v "cannot open shared object file"], [], [expout], [experr])
Introduce initial unit test for db_sms_* API Since OsmoMSC has built-in SMSC, it needs to store the messages somewhere. Currently we use libdbi and SQLite3 back-end for that. For a long time, the db_sms_* API remained uncovered by unit tests. This change aims to fix that, and does cover the following calls: - db_sms_store(), - db_sms_get(), - db_sms_get_next_unsent(), - db_sms_mark_delivered(), - db_sms_delete_sent_message_by_id(), - db_sms_delete_by_msisdn(), - db_sms_delete_oldest_expired_message(). Due to performance reasons, the test database is initialized in RAM using the magic filename ':memory:'. This is a feature of SQLite3 (and not libdbi), see: https://www.sqlite.org/inmemorydb.html Of course, this unit test helped to discover some problems: 1) Storing an SMS with empty TP-User-Data (TP-UDL=0) causes buffer overruns in both db_sms_store() and db_sms_get(). 2) TP-User-Data-Length is always being interpreted in octets, regardless of DCS (Data Coding Scheme). This results in storing garbage in the database if the default 7-bit encoding is used. Fortunately, the 'user_data' buffer in structure 'gsm_sms' is large emough, so we don't experience buffer overruns. 3) db_sms_delete_oldest_expired_message() doesn't work as expected. Instead of removing the *oldest* expired message, it tries to remove the *newest* one. The current test expectations do reflect these problems. All of them will be fixed in the follow-up patches. Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3
4 years ago
AT_CLEANUP
AT_SETUP([msc_vlr_test_no_authen])
AT_KEYWORDS([msc_vlr_test_no_authen])
cat $abs_srcdir/msc_vlr/msc_vlr_test_no_authen.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_no_authen.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_no_authen], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_gsm_authen])
AT_KEYWORDS([msc_vlr_test_gsm_authen])
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_authen.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_authen.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_gsm_authen], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_gsm_ciph])
AT_KEYWORDS([msc_vlr_test_gsm_ciph])
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_ciph.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_gsm_ciph.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_gsm_ciph], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_umts_authen])
AT_KEYWORDS([msc_vlr_test_umts_authen])
cat $abs_srcdir/msc_vlr/msc_vlr_test_umts_authen.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_umts_authen.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_umts_authen], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_authen_reuse])
AT_KEYWORDS([msc_vlr_test_authen_reuse])
cat $abs_srcdir/msc_vlr/msc_vlr_test_authen_reuse.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_authen_reuse.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_authen_reuse], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_hlr_reject])
AT_KEYWORDS([msc_vlr_test_hlr_reject])
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_reject.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_reject.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_hlr_reject], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_hlr_timeout])
AT_KEYWORDS([msc_vlr_test_hlr_timeout])
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_timeout.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_hlr_timeout.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_hlr_timeout], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_ms_timeout])
AT_KEYWORDS([msc_vlr_test_ms_timeout])
cat $abs_srcdir/msc_vlr/msc_vlr_test_ms_timeout.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_ms_timeout.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_ms_timeout], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_reject_concurrency])
AT_KEYWORDS([msc_vlr_test_reject_concurrency])
cat $abs_srcdir/msc_vlr/msc_vlr_test_reject_concurrency.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_reject_concurrency.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_reject_concurrency], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_call])
AT_KEYWORDS([msc_vlr_test_call])
cat $abs_srcdir/msc_vlr/msc_vlr_test_call.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_call.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_call], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_rest])
AT_KEYWORDS([msc_vlr_test_rest])
cat $abs_srcdir/msc_vlr/msc_vlr_test_rest.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_rest.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_rest], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([msc_vlr_test_ss])
AT_KEYWORDS([msc_vlr_test_ss])
cat $abs_srcdir/msc_vlr/msc_vlr_test_ss.ok > expout
cat $abs_srcdir/msc_vlr/msc_vlr_test_ss.err > experr
AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_ss], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([sdp_msg_test])
AT_KEYWORDS([sdp_msg_test])
cat $abs_srcdir/sdp_msg/sdp_msg_test.ok > expout
cat $abs_srcdir/sdp_msg/sdp_msg_test.err > experr
AT_CHECK([$abs_top_builddir/tests/sdp_msg/sdp_msg_test], [], [expout], [experr])
AT_CLEANUP
AT_SETUP([mncc_test])
AT_KEYWORDS([mncc_test])
cat $abs_srcdir/mncc/mncc_test.ok > expout
cat $abs_srcdir/mncc/mncc_test.err > experr
AT_CHECK([$abs_top_builddir/tests/mncc/mncc_test], [], [expout], [experr])
AT_CLEANUP