aboutsummaryrefslogtreecommitdiff
path: root/plugins/tests
AgeCommit message (Collapse)Author
2017-03-29plugins: remove explicit GDestroyNotify cast on g_free / g_object_unrefBen Chan
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-02-03glib: remove invocations of g_type_init()Ben Chan
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.
2016-11-23tests,dbus: check if we're asked to use an abstract socketAleksander 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-01-16tests,port-context: explicitly close the socket that is added to the listenerAleksander Morgado
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-16tests,test-fixture: don't rely on other threads to update dbus propertiesAleksander Morgado
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-16tests,port-context: properly setup per-thread main contextAleksander Morgado
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.
2014-11-14tests,port-context: joining thread takes the reference alreadyAleksander Morgado
2014-10-17tests,fixture: fix commentAleksander Morgado
2014-10-05tests: increase timeout for starting ModemManager on test busBen Chan
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-05-21tests: consistently use spaces for indentationBen Chan
2014-02-14tests: fix array bound checks in process_next_commandBen Chan
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-13tests: added support for DBus service testsAleksander Morgado
We can now run 'simulated' modems against a ModemManager running in its own session bus.