Commit Graph
221 Commits
Author SHA1 Message Date
Aleksander Morgado c7dee320c0 test-qcdm-serial-port: fix warnings with -Wsign-compare
test-qcdm-serial-port.c: In function 'wait_for_child':
  test-qcdm-serial-port.c:57:52: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
           if (d->child && (now.tv_sec - start.tv_sec > timeout)) {
                                                      ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado 426f69d64b tests,modem-helpers: regex number is index of an array, so starts at 0 2020-04-09 12:38:50 +00:00
Aleksander Morgado 8aec9e3889 test,modem-helpers: use MMModem3gppRegistrationState values in tests 2020-04-09 12:38:50 +00:00
Aleksander Morgado c78da3de7e broadband-modem: run +C5GREG state checks
The generic CREG parser is improved to also allow parsing +C5GREG
responses and URCs.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 040eb3880c helpers: use generic number parsing methods in CREG parser
This fixes the s8500 wave unit test, which was incorrectly parsing the
Act field reported as 'B' as "GSM" (strtol(B)=0)

Also, given that the generic parsing methods are able to parse numbers
from quoted strings, this change allows us to remove the Thuraya
specific CREG matching that just took into consideration quoted
strings. The Thuraya unit tests are also fixed up to provide proper
testing of the logic.
2020-04-09 12:38:50 +00:00
Aleksander Morgado 40b36a25ca test,modem-helpers: remove obsolete comments in u-blox CREG tests
We already support "SMS only" registration state.
2020-04-09 12:38:50 +00:00
Aleksander Morgado e956bac47b log: common logging method definition for all testers and helpers 2020-04-08 17:53:42 +02:00
Aleksander Morgado a2b57474dc error-helpers: port to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado bca5c5e423 modem-helpers-qmi: port qmi capabilities parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 7004f97093 modem-helpers: make cpms test parser return error on failure 2020-04-08 16:35:09 +02:00
Aleksander Morgado 105cb31e8c modem-helpers: port ccwa service query parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado ecd766796a modem-helpers: port cesq response parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado ef1a570afe modem-helpers: port creg response parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 39dd4c166d modem-helpers: port clcc list parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 78cad902ef modem-helpers: remove unused supported capabilities filter 2020-04-08 16:35:09 +02:00
Aleksander Morgado 5b1b33a894 modem-helpers: port cmer test parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 740827bde1 modem-helpers: parse cgdcont test parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado f76489cd81 modem-helpers: port cid selection helper to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 2b23ef3fa6 modem-helpers: port cops test parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado fb61243b7d modem-helpers: port ifc test parser to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 0f708daf0b modem-helpers: port supported modes filtering to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado fd1464cff0 modem-helpers: port device identifier to use object logging and autoptr 2020-04-08 16:35:09 +02:00
Aleksander Morgado b682d7ec67 tests,test-sms-part-cdma: remove explicit logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 72efb1b28d sms-part-cdma: port to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 3186a498c1 sms-part-3gpp: port to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 9bcadea172 log: new object logging support
So that we can provide the specific object id in every log associated
to a given object.
2020-04-08 16:35:08 +02:00
Aleksander Morgado 7075e852ca test-error-helpers: fix warnings with -Wsign-compare
test-error-helpers.c: In function ‘test_error_helpers_connection_error’:
  test-error-helpers.c:36:39: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
     36 |       for (i = enum_class->minimum; i <= enum_class->maximum; i++) {        \
        |                                       ^~
2020-01-31 14:52:49 +01:00
Aleksander Morgado 7125a86e04 test-qcdm-serial-port: fix warnings with -Wsign-compare
test-qcdm-serial-port.c: In function ‘print_buf’:
  test-qcdm-serial-port.c:79:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
     79 |     for (i = 0; i < len; i++) {
        |                   ^
  test-qcdm-serial-port.c: In function ‘server_wait_request’:
  test-qcdm-serial-port.c:163:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
    163 |     } while (total < sizeof (readbuf));
        |                    ^
2020-01-31 14:52:49 +01:00
Aleksander Morgado 9ad6e1f633 test-modem-helpers: fix warnings with -Wswitch-enum
test-modem-helpers.c: In function ‘test_cgev_indication’:
  test-modem-helpers.c:2165:9: error: enumeration value ‘MM_3GPP_CGEV_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   2165 |         switch (type) {
        |         ^~~~~~
  cc1: all warnings being treated as errors
2020-01-31 14:52:49 +01:00
Aleksander Morgado a27c957dc5 test-modem-helpers: fix warnings with -Wsign-compare
test-modem-helpers.c: In function ‘test_creg_match’:
  test-modem-helpers.c:1127:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
   1127 |     for (i = 0; i < array->len; i++) {
        |                   ^
2020-01-31 14:52:49 +01:00
Aleksander Morgado 6dcbda1c80 test-modem-helpers: fix warnings with -Wdiscarded-qualifiers
test-modem-helpers.c: In function ‘test_cmgl_response_generic’:
  test-modem-helpers.c:294:20: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    294 |             .pdu = "07914306073011F00405812261F700003130916191314095C27"
        |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ...
2020-01-31 14:52:49 +01:00
Aleksander Morgado a16ac01604 tests,at-serial-port: fix warnings with -Wdiscarded-qualifiers
test-at-serial-port.c:29:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     29 |     { "\r\n", "\r\n" },
        |       ^~~~~~
  test-at-serial-port.c:29:15: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     29 |     { "\r\n", "\r\n" },
        |               ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado 1c078531a0 build: use AX_IS_RELEASE() and AX_COMPILER_FLAGS()
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|GIR|LDFLAGS} test
for compiler and linker support of various flags, and add the flags to
the generated output.

If the command-line option '--enable-compile-warnings' is specified to
'configure', a number of additional warning options is also added to the
output. This is the default.

This update requires the presence of the GNU autoconf-archive in the
system.
2020-01-30 11:59:14 +01:00
Aleksander Morgado 6c80577bec tests,charsets: full gsm7/pack/unpack/utf8 sequence in tests 2020-01-24 09:56:53 +01:00
Aleksander Morgado 1722915f5e broadband-modem: +COPS=? response may give strings in UCS2
If the charset selected via CSCS is UCS2, the modem may decide to
return all the strings in the +COPS=? response in UCS2:

    <debug> (ttyACM0): --> 'AT+COPS=?<CR>'
    <debug> (ttyACM0): <-- '<CR><LF>+COPS: (2,"004D006F007600690073007400610072","004D006F007600690073007400610072","00320031003400300037",7)
    <debug> Found network '00320031003400300037' ('004D006F007600690073007400610072','004D006F007600690073007400610072'); availability: current, access tech: lte
2020-01-06 20:17:08 +00:00
Aleksander Morgado d83c018f98 core,tests: new test to make sure all error codes are supported
Defining the new error codes in the headers is not enough, we also
need to add support in the error helpers in order to create proper
GErrors with the expected error codes.
2019-12-17 10:52:13 +01:00
Aleksander Morgado d6f9d5e9ec sim: load emergency numbers from EF_ECC 2019-10-17 10:51:50 +02:00
Aleksander Morgado d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00
Aleksander Morgado 03223fe786 tests,sms: print PDUs only on verbose test mode
Therefore, avoid needing TEST_SMS_PART_ENABLE_TRACE build symbol.
2019-10-14 15:30:03 +02:00
Aleksander Morgado 3b18d21ba5 tests: avoid g_print() and use g_debug() instead
The debug-level logs won't be printed e.g. during 'make check', but
will be included when running the tester manually.
2019-10-14 15:30:03 +02:00
amol.lad 16145c29de sms-part-3gpp: SMS timestamp in ISO8601 format 2019-09-22 09:15:51 +02:00
Aleksander Morgado 137ece0f2f broadband-bearer: setup cid selection as a testable method
Rework how the broadband bearer runs CGDCONT? and CGDCONT=? and setup
a helper method to perform the CID selection logic.

Also, implement unit tests for the CID selection logic.
2019-09-13 18:13:26 +00:00
Aleksander Morgado f39dbe72e5 broadband-modem,voice: implement call waiting status setup/query with +CCWA 2019-07-19 17:47:51 +02:00
Aleksander Morgado 1cc31df425 helpers: new '+CLCC' test response parser 2019-07-11 23:00:50 +02:00
Aleksander Morgado dca00271ce broadband-modem: implement +CCWA URC handling 2019-07-11 23:00:50 +02:00
Aleksander Morgado 312e5dd623 modem-helpers: ignore format of unneeded fields in +CLIP URC
The regex was expecting empty values in several of the fields, which
is wrong. Instead of matching empty fields, just ignore all fields
that we don't require in our logic.
2019-06-28 09:48:28 +02:00
Aleksander Morgado a15193b7ca broadband-modem: enable and handle +CGEV indications
The +CGEV indications allow us to get notified of packet domain
events like network-initiated or ME-initiated disconnections on
specific connected contexts, as well as full PS detach events (all
contexts disconnected). If the modem supports these indications, we
will enable them with +CGEREP and will then process them when they are
emitted by the modem.

If a full PS detach event happens, we will explicitly disconnect all
connected bearers.

If a deactivation inidication is received for a single context, we
will look for the associated bearer by CID and explicitly disconnect
it.
2018-11-26 16:28:39 +00:00
Ben Chan 942bdeaec2 modem-helpers: new helper to convert binary-coded decimals
This patch adds a mm_bcd_to_string() helper function to convert a byte
array representing a binary-coded decimal (BCD) number to a string
representing the equivalent decimal number.
2018-10-26 09:50:01 -07:00
Aleksander Morgado 32aa8333c6 helpers,tests: update ICCID related unit tests
Fix the test for invalid characters, because now I allow hex chars in
the account number.

And add new tests with real China Mobile ICCIDs that contain hex chars
in the account number.
2018-09-12 17:17:36 +00:00
Aleksander Morgado 0282123287 helpers: allow 19-digit reported ICCIDs
The mm_3gpp_parse_iccid() method does validation of the ICCID string
and was originally implemented to handle +CRSM reported values. The
implementation was looking for 20-digit strings, even for 19-digit
ICCIDs (those finished with a trailing 'F').

We now extend the logic to also validate ICCID strings reported as
19-digit values directly, and when that happens we won't allow
swapping of the digits (a +CRSM specific requirement) or trailing 'F'
characters (as that is only required when reporting 19-digit ICCIDs
with 20-digit strings).

This change allows us to e.g. use the u-blox specific AT+CCID command
and validate the returned ICCID with the same helper method, which
currently fails:

  (ttyACM2): --> 'AT+CCID<CR>'
  (ttyACM2): <-- '<CR><LF>+CCID: 8934077700015848638<CR><LF><CR><LF>OK<CR><LF>'
  couldn't load SIM identifier: 'Invalid ICCID response size (was 19, expected 20)'
2018-09-12 17:17:36 +00:00