Commit Graph

6 Commits

Author SHA1 Message Date
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
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
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
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