aboutsummaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2016-10-12modem-helpers: implement less strict APN comparisonAleksander Morgado
u-blox modems will append a string showing the MCC and MNC info to the access point name listed in AT+CGDCONT? responses. We will try to detect when that happens, and we just accept the match. The logic doesn't just look for a string prefix; it also looks for the special MCC + MNC suffix, which is much more restrictive, to try to avoid false positives.
2016-10-12modem-helpers: new helper to parse +CESQ response into MMSignal objectsAleksander Morgado
2016-10-12modem-helpers: new +CESQ response parserAleksander Morgado
2016-10-123gpp: update registration state enumeration with CSFB related statesAleksander Morgado
Introduce "sms only" and "CSFB not preferred" home/roaming states to be reported for the CS context, while already registered on LTE. Based on 3GPP TS 27.007 v13.5.0.
2016-10-12modem-helpers: new +CFUN? response parserAleksander Morgado
2016-10-12modem-helpers: new uint list parser, including interval supportAleksander Morgado
2016-10-12modem-helpers: new CGACT? response parserAleksander Morgado
2016-10-12modem-helpers: new COPS? response parserAleksander Morgado
Split into two different actions the actual COPS? response parsing and the operator name normalization process. Also, allow parsing not only the operator string, but also the format, mode and the optional access technology value.
2016-10-12modem-helpers: new +CGCONTRDP=N response parserAleksander Morgado
2016-09-29core: allow building and running without udevAleksander Morgado
Instead of relying on the udev daemon and GUDev to manage the devices reported by the kernel, we can now run ModemManager relying solely on the kernel events reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan' option is implicit for the ModemManager daemon when udev is disabled in the build. Additionally, a new custom implementation of the kernel device object is provided, which uses sysfs to load the properties and attributes required in each kernel device, instead of using a GUdevDevice. The udev rule files are kept in place, and a simple custom parser is provided which preloads all rules in memory once and then applies them to the different kernel objects reported via ReportKernelEvent(), e.g. to set port type hints. A simple unit test setup is prepared to validate the udev rules during the `check' Makefile target.
2016-09-29core: use the kernel device object in the port object and the plugin interfaceAleksander Morgado
The mm_base_modem_grab_port() now receives a MMKernelDevice directly from the plugin, which is then stored in the MMPort corresponding to the port. This means that we have direct access to e.g. all properties set by udev rules everywhere, and we don't need additional GUdevClient objects (e.g. like the one used in the Huawei plugin to detect NDISDUP support during runtime). For virtual ports (e.g. generated during unit tests), we have a new 'generic' kernel device object which just provides the values from the kernel device properties given during its creation.
2016-08-15core: use MM-specific logging methods always instead of the generic GLib onesAleksander Morgado
2016-03-15build,core: update build rulesAleksander Morgado
We try to combine in common envvars the compiler and linker flags shared by the different components, and where possible, also re-using the implicit AM_CFLAGS and AM_LDFLAGS variables that automake provides, and which apply to all objects being built in the same Makefile.am. The internal libmodem-helpers.la library is also renamed to libhelpers.la
2016-03-15modem-helpers: fix handling split PDP context ID reporting in CGDCONT=? responseDan Williams
Cinterion PHS8-US devices send split PDP context ID like "(1-17,101-112)" and that caused the modem-helpers to choke.
2016-03-09broadband-modem: fix +CPMS empty parameter supportCarlo Lobrano
* Add new async virtual method init_current_storages to MMIfaceModemMessaging * Add logic of init_current_storages to MMBroadbandModem * Add step "INIT_CURRENT_STORAGES" in MMIfaceModemMessaging initialization in order to load and store current SMS storages for mem1 and mem2. * Add usage of current sms storage value for mem1 in place of an empty string parameter when the command AT+CPMS is used. https://bugs.freedesktop.org/show_bug.cgi?id=93135
2016-02-13helpers: move +CRSM parsing to mm_3gpp_parse_crsm_responseThomas Sailer
Also added test cases. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-13helpers: allow optional quotes in +CREG: <stat>,"<lac>","<ci>"Thomas Sailer
GSM 07.07 CREG=2 unsolicited pattern. Added testcase for Thuraya XT. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-11modem-helpers: allow optional whitespace in +CGDCONT responseThomas Sailer
Add testcase for Thuraya XT. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2015-12-02modem-helpers: fix parsing CPMS=? responses without groupsAleksander Morgado
The CPMS test parser was expecting 3 groups (parenthesis enclosed lists) of memory IDs, e.g.: +CPMS: ("SM","ME"),("SM","ME"),("SM","ME") But some modems like the Huawei MU609 may just report single elements, not groups, e.g.: +CPMS: "SM","SM","SM" This patch avoids using g_strsplit() to split the groups, as that is unaware of the possible replies without groups. Instead, a new helper method is implemented which does the group/item split itself, considering also the possibility of a reply with mixed groups and non-groups, like e.g.: +CPMS: ("SM","ME"),"SM","SM" Additionally, we also now support the case where the groups are empty, e.g.: +CPMS: (),(),() https://bugs.freedesktop.org/show_bug.cgi?id=92243
2015-09-22tests: plug memleak in +CMGR response parserAleksander Morgado
2015-09-22core: process SMS +CGMR response with regexNick Stevens
Variability in the response style from certain modems causes the parsing of the +CGMR response to fail. For example, the Telit HE910 inserts an empty string ("") in the second field of the response, causing the sscanf implementation to fail. This patch converts the parsing of the CGMR response to a regex that allows for more flexibility and robustness, and adds unit tests around the parsing call. Signed-off-by: Nick Stevens <Nick.Stevens@digi.com>
2015-03-23broadband-modem: default implementation of the network time interfaceJason Simmons
Add a default implementation that queries the real-time clock using the AT+CCLK? command. Also set AT+CTZU=1 in case a modem requires it.
2015-01-11build: add code coverage supportJakub Sitnicki
Build all targets, except for CLI tools (mmcli, uml290), with special flags needed for collecting code coverage information when the build has been configured with --enable-code-coverage. Three new targets are available in the top build directory: - `check-code-coverage' runs the test suite and generates a code coverage report, - `code-coverage-capture' generates a code coverage report from already collected data, which can come in handy when one wants to see code paths touched by a particular test, - `code-coverage-clean' removes the collected coverage data and the generated reports.
2014-10-15qcdm: don't retry probing if QCDM unescaping failsAleksander Morgado
But keep the retries when the frame marker isn't found. https://bugzilla.gnome.org/show_bug.cgi?id=708861
2014-06-27modem-helpers: don't return any result if an error happens when parsing CPMS=?Aleksander Morgado
We shouldn't rely on the caller to cleanup intermediate results when returning an error.
2014-06-03tests: fix more memory leaksBen Chan
2014-05-30tests: fix memory leaksBen Chan
This patch fixes memory leaks in unit tests detected by LeakSanitizer.
2014-05-20core: minor coding style fixesBen Chan
2014-02-13port-serial-qcdm: commands are never cachedAleksander Morgado
The QCDM port commands are never cached, so remove the option from the command() method. Will also simplify command caching afterwards as it will be an AT-only thing.
2014-02-13port-serial-qcdm: use GIO Async API like methodsAleksander Morgado
2014-02-13ports: rename 'libserial' to 'libport'Aleksander Morgado
2014-02-13ports: rename 'MMAtSerialPort' to 'MMPortSerialAt'Aleksander Morgado
2014-02-13ports: rename 'MMQcdmSerialPort' to 'MMPortSerialQcdm'Aleksander Morgado
2014-02-13ports: rename 'MMSerialPort' to 'MMPortSerial'Aleksander Morgado
2013-11-01modem-helpers: handle +CGDCONT=? replies with single contextAleksander Morgado
https://bugzilla.gnome.org/show_bug.cgi?id=708983
2013-11-01tests: enable logging if 'ENABLE_TEST_MESSAGE_TRACES' is definedAleksander Morgado
2013-10-25sms-part-cdma,test: new tests for Latin and Unicode encodingsAleksander Morgado
2013-10-25sms-part-cdma: support receiving SMS with Latin encodingAleksander Morgado
2013-10-25sms-part-cdma: new CDMA SMS creatorAleksander Morgado
Currently very limited: * Only WMT teleservice. * Only DMTF-encoded numbers. * Only either raw binary data or ASCII-7 text.
2013-10-25sms-part-cdma: read 7-bit ASCII text or raw dataAleksander Morgado
2013-10-25tests: new CDMA SMS part testerAleksander Morgado
2013-10-25tests: rename 3GPP SMS part testerAleksander Morgado
2013-10-25sms: split SMS part handling into common and 3GPP-specificAleksander Morgado
2013-09-26modem-helpers,sim: auto-detect if ICCID response is character swappedBen Chan
This patch modifies mm_3gpp_parse_iccid() to auto-detect if an ICCID response is character swapped or not by comparsing the major industry identifier part of the ICCID response to the known value (89) for telecommunication purposes. This addresses the issue where the same AT command (e.g. AT^ICCID used by the huawei plugin) does not report ICCID in a consistent format.
2013-09-10core: add helper for parsing and validating the ICCIDDan Williams
2013-08-06modem-helpers: fix parsing of CREG/CGREG/CEREG responsesBen Chan
The format of CREG/CGREG/CEREG responses is not very precisely defined in or strictly enforced by the 3GPP specifications. That leads to the fact that some modems put leading zeros in integer type fields (e.g. <n>, <stat>, <AcT>), and not all modems put double quotes around string type fields (e.g. <lac>, <ci>) in those C*REG responses. For example, 0001 can be a valid value for both <stat> and <lac>. The original C*REG parsing code in ModemManager could potentially interpret '+CREG: <stat>,<lac>,<ci>,<AcT>' as '+CREG: <n>,<stat>,<lac>,<ci>'. This patch addresses this issue by refining the regular expressions returned by mm_3gpp_creg_regex_get() with the following assumptions: 1. If a modem puts leading zeros in integer type fields, it puts double quotes around string type fields. 2. If a modem omits double quotes around string type fields, it does not put leading zeros in integer type fields.
2013-06-18tests: avoid printing in stdout by defaultAleksander Morgado
Tests had either their own g_print()s or they would enable a _mm_log() method to get all g_debug()s from the libraries printed. In order to cleanup the result of the tests run, avoid this stdout dumps by default, and only enable them if explicitly enabled in CFLAGS, e.g.: $> ./configure CFLAGS="-DENABLE_TEST_MESSAGE_TRACES"
2013-06-18build: remove unneeded GLIB_CHECK_VERSION checks, 2.32 already requiredAleksander Morgado
2013-06-18build: setup gtester based testsAleksander Morgado
2013-06-05broadband-modem-qmi: update current capabilities loading logicAleksander Morgado
Changes being: * Don't rely on the band preference TLVs presence. The band preference TLVs are always given, even if the modem doesn't support the specific capability right away. E.g. a GSM/UMTS/LTE modem configured with 'gsm-umts' capability (no 'lte') still shows the LTE band preference TLV in the SSP responses. * Don't automatically add LTE as current capability. We needed this when we were not able to change capabilities, so that we didn't lose the ability to set 4G mode as allowed.