Commit Graph

21 Commits

Author SHA1 Message Date
Aleksander Morgado
09080073ff build: setup plugin selection logic 2019-11-27 10:11:43 +00:00
Aleksander Morgado
d7d2b9108e foxconn: new plugin to support the T77W968
The Dell DW5821e is really a re-branded Foxconn T77W968.
2019-11-13 12:31:58 +01:00
Aleksander Morgado
b99597b594 tests,helpers: minor alignment fix 2019-10-14 15:30:29 +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
87224e083c tests,helpers: minor indentation fix 2019-09-10 12:24:38 +02:00
Aleksander Morgado
141e69bc00 plugins,tests: setup new helper utilities for tests
For now, including a handy method from the ublox tests that allows
comparing arrays of bands that may not be sorted.
2019-09-09 12:24:43 +02:00
Aleksander Morgado
147facd2ec plugins,test: setup new simple keyfile tester 2019-04-02 12:14:03 +02:00
Aleksander Morgado
36e09ef441 fibocom: include udev rules tests 2018-08-21 17:02:39 +00:00
Ben Chan
254f2e3412 plugins: remove explicit GDestroyNotify cast on g_free / g_object_unref
g_free and g_object_unref are in form of  `void (*)(gpointer)`, which
matches the GDestroyNotify signature. An explicit GDestroyNotify cast on
g_free and g_object_unref is thus not needed.
2017-03-29 10:22:18 +02:00
Ben Chan
31655bb5a5 glib: remove invocations of g_type_init()
g_type_init() has been deprecated (and also marked with the attribute
'deprecated') since glib 2.36 as the type system is automatically
initialized. Since the minimum version of glib required by ModemManager
is 2.36, calling g_type_init() isn't necessarily in the ModemManager
code.
2017-02-03 10:05:14 +01:00
Aleksander Morgado
20074c5574 tests,dbus: check if we're asked to use an abstract socket 2016-11-23 11:02:18 +01:00
Aleksander Morgado
58c955f5f2 core: allow building and running without udev
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-29 15:43:05 +02:00
Aleksander Morgado
7136c0b321 tests,port-context: explicitly close the socket that is added to the listener
Since GLib 2.42, the sockets that are added to socket listeners may no longer
be closed automatically when the listener is finalized. In order to avoid that,
we will keep our own socket reference and close/unref it ourselves.

This issue was preventing adding new test cases with the same port names.

    $ ./test-service-generic --verbose
    GTest: random seed: R02S889153ee0f2e59c570f4edff9caa4176
    GTest: run: /MM/Service/Generic/enable-disable
    Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    (MSG: DEBUG: client connection closed)
    (MSG: MESSAGE: Found modem at '/org/freedesktop/ModemManager1/Modem/0')
    ** Message: Found modem at '/org/freedesktop/ModemManager1/Modem/0'
    (MSG: DEBUG: client connection closed)
    GTest: result: OK
    GTest: run: /MM/Service/Generic/cme-error-detected
    Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    (MSG: FATAL-ERROR: Cannot bind socket: Error binding to address: Address already in use)

    ** (/home/aleksander/Development/foss/ModemManager/plugins/.libs/lt-test-service-generic:32043): ERROR **: Cannot bind socket: Error binding to address: Address already in use
2016-01-16 17:59:49 +01:00
Aleksander Morgado
dfd111f291 tests,test-fixture: don't rely on other threads to update dbus properties
We were wrongly using a main loop in the port context thread to manage the
global main context. That was silently making the DBus property notifications
kind of work, as they were being updated via another thread, so here we could
just sleep() and recheck the property values.

Given that having that unrelated thread updating the dbus properties of our
MMManager object is not a good thing, we'll instead totally ignore that and
fully re-create the MMManager in each iteration with the sync() method, which
has its own internal thread.
2016-01-16 17:59:49 +01:00
Aleksander Morgado
87bafa33dc tests,port-context: properly setup per-thread main context
Instead of creating a new main context to be used in the thread, we were using
the global context. So, fix that, and create a totally new pair of main context
and main loop to be used within the thread.
2016-01-16 17:59:49 +01:00
Aleksander Morgado
692e6d344a tests,port-context: joining thread takes the reference already 2014-11-14 12:13:10 +01:00
Aleksander Morgado
a72b120798 tests,fixture: fix comment 2014-10-17 15:55:12 +02:00
Ben Chan
1e5ec7e1b1 tests: increase timeout for starting ModemManager on test bus
The timeout for starting ModemManager on the test bus was 3s, which is
sufficient under normal conditions. However, when running ModemManager
tests on a build infrastructure under a heavy load, we've observed that
the timeout isn't always sufficient and that becomes the source of false
test failures. This patch increases the timeout to 30s, which shouldn't
introduce any unexpected behavior under normnal conditions while
addressing the timeout issue on heavily loaded systems.
2014-10-05 15:37:47 -05:00
Ben Chan
3d378bef5d tests: consistently use spaces for indentation 2014-05-21 11:58:03 +02:00
Ben Chan
d278f381d2 tests: fix array bound checks in process_next_command
This patch fixes the out-of-bounds array accesses in test-port-context.c,
which is detected by AddressSanitizer, by checking the index against the
array length before accessing the array.
2014-02-14 09:03:13 +01:00
Aleksander Morgado
bff2a8d2f2 tests: added support for DBus service tests
We can now run 'simulated' modems against a ModemManager running in its own
session bus.
2014-02-13 13:41:58 +01:00