Commit Graph

26 Commits

Author SHA1 Message Date
Szymon Janc
7d95d027b1 android: Create comon header for IPC
This header contains IPC specific structures and code not related to
BT and audio HAL protocols. This allows to fully decouple IPC from
HAL messages.

This is first step to make HAL part of IPC unit-testable and reusable
between BT HAL and audio HAL.
2014-02-28 15:22:45 +01:00
Szymon Janc
3f7daeb0e8 android: Add support for disabling notifications in IPC 2014-02-28 15:22:45 +01:00
Szymon Janc
a3b0e736af android/unit: Update test-ipc with disconnect handler support 2014-02-28 15:22:45 +01:00
Szymon Janc
5862f2f6a5 android: Add support for registering disconnect callback in IPC
Allow to register callback which is called in case of IPC failure
(eg malformed message) or disconnection. This makes caller responsible
for performing expected action in such case.
2014-02-28 15:22:45 +01:00
Szymon Janc
dd1e44fce1 android: Refactor IPC init
This allows to pass socket path and max service ID while initializaing
IPC. This is first step to allow use it both for BT and Audio HALs.
2014-02-28 15:22:45 +01:00
Anderson Lizardo
ed1d75bee9 android/test-ipc: Use correct boolean values for glib functions 2014-02-12 20:20:03 +01:00
Anderson Lizardo
10be885113 android/test-ipc: Fix crash due to invalid ipc_register() parameter
This test checks for proper handling of invalid Service ID on a IPC
message, but it was attempting to register handlers for this invalid ID,
which on current ipc_register() implementation was causing a buffer
overrun.

The fix was to use a valid ID during registration, but still attempt to
use an invalid one when sending the message.
2014-02-12 11:26:56 +02:00
Marcel Holtmann
cde69653e0 android: Update copyright and license details 2014-02-11 10:42:56 -08:00
Szymon Janc
ef2b882fcc android/unit: Some codestyle cleanups 2014-02-04 21:35:11 +01:00
Szymon Janc
e6d44eb406 android/unit: Make tests names shorter 2014-02-04 21:35:11 +01:00
Jakub Tyszkowski
08c2d2d152 android/unit: Add cases for msg size verification
This patch adds checking for proper msg size verification in case it is
not declared in handlers that this is variable sized message. In
such case malformed data should not be accepted.
2014-02-04 21:35:11 +01:00
Jakub Tyszkowski
46ad7c46da android/unit: Add case for sending incomplete header
Header size is the bare minimum that should always be sent.
2014-02-04 21:35:11 +01:00
Jakub Tyszkowski
ce6444c8bd android/unit: Add negative case for msg size verification
Case for checking message size declared inside the header against the
amount of data sent for variable sized message.
2014-02-04 21:35:11 +01:00
Jakub Tyszkowski
de260fd378 android/unit: Add case for out of range service
Check reaction for sending message to services not listed inside
hal-msg.h
2014-02-04 21:35:11 +01:00
Jakub Tyszkowski
daeee89e77 android/unit: Add another case for variable sized data
This patch adds test for variable length data handling. Handlers struct
have static values representing minimum payload. It cannot be predicted
how large data will be sent so they should accept data larger than
declared inside ipc_handler array, which holds the minimum size of such
message.
2014-02-04 21:35:10 +01:00
Jakub Tyszkowski
c14110cb1d android/unit: Add test case for variable sized data
Check if sending variable length data with proper msg size declared inside the
header succeeds.
2014-02-04 21:35:10 +01:00
Jakub Tyszkowski
bdceceb9d4 android/unit: Add support for variable length data
This patch adds sending messages larger than just hal_hdr, and fixes
response verification which worked only for empty messages but was
failing when sending something more than just header.
2014-02-04 21:35:10 +01:00
Jakub Tyszkowski
639abb4ba9 android/unit: Add case for opcode without handler
This test case checks if IPC shuts down on unhandled opcode.
2014-02-04 21:35:10 +01:00
Jakub Tyszkowski
e7a054a8b2 android/unit: Add test cases for proper handler calls
This patch adds tests for calling proper opcode handler. Two handlers
are registered, but one always results in failure. No failure means that
proper opcode <-> handler maching is done by the ipc mechanism.
2014-02-04 21:35:10 +01:00
Jakub Tyszkowski
cca001f942 android/unit: Rename cmd handler
This handler responses for opcode == 1, thus should use proper naming to
avoid confision when more functions sending different responses will be
added.
2014-02-04 21:35:10 +01:00
Jakub Tyszkowski
aeed33339c android/unit: Fix checking for expected termination
This fix makes sure that when signalled termination is expected,
it actually happens. If IPC termination is expected no response will be
sent, so cmd_watch will never be executed. But if it is executed when
expecting termination, its a failure.
2014-02-04 21:35:10 +01:00
Szymon Janc
99052be6c2 android/unit: Rename tests names to be more descriptive 2014-02-03 14:15:00 +01:00
Marcin Kraglak
eeae8babb5 android/unit: Add /android_ipc/send_cmd_3 test case
This case will register service, next unregister it and send
command. Expected status is raise SIGTERM.
2014-02-03 14:15:00 +01:00
Marcin Kraglak
3ac803d029 android/unit: Add /android_ipc/send_cmd_2 test case
This will test sending command to previously registered service.
2014-02-03 14:15:00 +01:00
Marcin Kraglak
898ad7e90a android/unit: Add /android_ipc/send_cmd_1 test case
This test case will check if ipc lib will raise SIGTERM
after sending command to not registered service.
2014-02-03 14:15:00 +01:00
Marcin Kraglak
981459271d android/unit: Add android IPC unit tests
It will test ipc library. First test case will check
ipc_init() call.
2014-02-03 14:15:00 +01:00