summaryrefslogtreecommitdiff
path: root/unit
Commit message (Collapse)AuthorAgeFilesLines
* test-bap: Add SCC tests for Vendor-Specific codecLuiz Augusto von Dentz2023-04-281-117/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | 4.8.2 Unicast Client Initiates a Config Codec Operation – Vendor-Specific (page 42): Test Purpose: Verify that a Unicast Client IUT can initiate a Config Codec operation for a vendor-specific codec. Test Case Configuration: BAP/UCL/SCC/BV-033-C [UCL SRC Config Codec, VS] BAP/UCL/SCC/BV-034-C [UCL SNK Config Codec, VS] Pass verdict: The IUT successfully writes to the ASE Control Point characteristic with the opcode set to 0x01 (Config Codec) and the specified parameters. The Codec_ID parameter is formatted with octet 0 set to 0xFF, octets 1–2 set to TSPX_VS_Company_ID, and octets 3–4 set to TSPX_VS_Codec_ID. Test Summary ------------ BAP/UCL/SCC/BV-033-C [UCL SRC Config Codec, VS] Passed BAP/UCL/SCC/BV-034-C [UCL SNK Config Codec, VS] Passed Total: 2, Passed: 2 (100.0%), Failed: 0, Not Run: 0
* test-bap: Introduce SCC tests for LC3Luiz Augusto von Dentz2023-04-281-7/+536
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.8.1 Unicast Client Initiates a Config Codec Operation – LC3 (Page 39): Test Purpose: Verify that a Unicast Client IUT can initiate a Config Codec operation for an LC3 codec. Test Case Configuration: BAP/UCL/SCC/BV-001-C [UCL SRC Config Codec, LC3 8_1] BAP/UCL/SCC/BV-002-C [UCL SRC Config Codec, LC3 8_2] BAP/UCL/SCC/BV-003-C [UCL SRC Config Codec, LC3 16_1] BAP/UCL/SCC/BV-004-C [UCL SRC Config Codec, LC3 16_2] BAP/UCL/SCC/BV-005-C [UCL SRC Config Codec, LC3 24_1] BAP/UCL/SCC/BV-006-C [UCL SRC Config Codec, LC3 24_2] BAP/UCL/SCC/BV-007-C [UCL SRC Config Codec, LC3 32_1] BAP/UCL/SCC/BV-008-C [UCL SRC Config Codec, LC3 32_2] BAP/UCL/SCC/BV-009-C [UCL SRC Config Codec, LC3 44.1_1] BAP/UCL/SCC/BV-010-C [UCL SRC Config Codec, LC3 44.1_2] BAP/UCL/SCC/BV-011-C [UCL SRC Config Codec, LC3 48_1] BAP/UCL/SCC/BV-012-C [UCL SRC Config Codec, LC3 48_2] BAP/UCL/SCC/BV-013-C [UCL SRC Config Codec, LC3 48_3] BAP/UCL/SCC/BV-014-C [UCL SRC Config Codec, LC3 48_4] BAP/UCL/SCC/BV-015-C [UCL SRC Config Codec, LC3 48_5] BAP/UCL/SCC/BV-016-C [UCL SRC Config Codec, LC3 48_6] BAP/UCL/SCC/BV-017-C [UCL SNK Config Codec, LC3 8_1] BAP/UCL/SCC/BV-018-C [UCL SNK Config Codec, LC3 8_2] BAP/UCL/SCC/BV-019-C [UCL SNK Config Codec, LC3 16_1] BAP/UCL/SCC/BV-020-C [UCL SNK Config Codec, LC3 16_2] BAP/UCL/SCC/BV-021-C [UCL SNK Config Codec, LC3 24_1] BAP/UCL/SCC/BV-022-C [UCL SNK Config Codec, LC3 24_2] BAP/UCL/SCC/BV-023-C [UCL SNK Config Codec, LC3 32_1] BAP/UCL/SCC/BV-024-C [UCL SNK Config Codec, LC3 32_2] BAP/UCL/SCC/BV-025-C [UCL SNK Config Codec, LC3 44.1_1] BAP/UCL/SCC/BV-026-C [UCL SNK Config Codec, LC3 44.1_2] BAP/UCL/SCC/BV-027-C [UCL SNK Config Codec, LC3 48_1] BAP/UCL/SCC/BV-028-C [UCL SNK Config Codec, LC3 48_2] BAP/UCL/SCC/BV-029-C [UCL SNK Config Codec, LC3 48_3] BAP/UCL/SCC/BV-030-C [UCL SNK Config Codec, LC3 48_4] BAP/UCL/SCC/BV-031-C [UCL SNK Config Codec, LC3 48_5] BAP/UCL/SCC/BV-032-C [UCL SNK Config Codec, LC3 48_6] Pass verdict: The IUT successfully writes to the ASE Control point with the opcode set to 0x01 (Config Codec) and correctly formatted parameter values from Table 4.9. The Codec_ID field is a 5-octet field with octet 0 set to the LC3 Coding_Format value defined in Bluetooth Assigned Numbers, octets 1–4 set to 0x0000. Test Summary ------------ BAP/UCL/SCC/BV-001-C [UCL SRC Config Codec, LC3 8_1] Passed BAP/UCL/SCC/BV-002-C [UCL SRC Config Codec, LC3 8_2] Passed BAP/UCL/SCC/BV-003-C [UCL SRC Config Codec, LC3 16_1] Passed BAP/UCL/SCC/BV-004-C [UCL SRC Config Codec, LC3 16_2] Passed BAP/UCL/SCC/BV-005-C [UCL SRC Config Codec, LC3 24_1] Passed BAP/UCL/SCC/BV-006-C [UCL SRC Config Codec, LC3 24_2] Passed BAP/UCL/SCC/BV-007-C [UCL SRC Config Codec, LC3 32_1] Passed BAP/UCL/SCC/BV-008-C [UCL SRC Config Codec, LC3 32_2] Passed BAP/UCL/SCC/BV-009-C [UCL SRC Config Codec, LC3 44.1_1] Passed BAP/UCL/SCC/BV-010-C [UCL SRC Config Codec, LC3 44.1_2] Passed BAP/UCL/SCC/BV-011-C [UCL SRC Config Codec, LC3 48_1] Passed BAP/UCL/SCC/BV-012-C [UCL SRC Config Codec, LC3 48_2] Passed BAP/UCL/SCC/BV-013-C [UCL SRC Config Codec, LC3 48_3] Passed BAP/UCL/SCC/BV-014-C [UCL SRC Config Codec, LC3 48_4] Passed BAP/UCL/SCC/BV-015-C [UCL SRC Config Codec, LC3 48_5] Passed BAP/UCL/SCC/BV-016-C [UCL SRC Config Codec, LC3 48_6] Passed BAP/UCL/SCC/BV-017-C [UCL SNK Config Codec, LC3 8_1] Passed BAP/UCL/SCC/BV-018-C [UCL SNK Config Codec, LC3 8_2] Passed BAP/UCL/SCC/BV-019-C [UCL SNK Config Codec, LC3 16_1] Passed BAP/UCL/SCC/BV-020-C [UCL SNK Config Codec, LC3 16_2] Passed BAP/UCL/SCC/BV-021-C [UCL SNK Config Codec, LC3 24_1] Passed BAP/UCL/SCC/BV-022-C [UCL SNK Config Codec, LC3 24_2] Passed BAP/UCL/SCC/BV-023-C [UCL SNK Config Codec, LC3 32_1] Passed BAP/UCL/SCC/BV-024-C [UCL SNK Config Codec, LC3 32_2] Passed BAP/UCL/SCC/BV-025-C [UCL SNK Config Codec, LC3 44.1_1] Passed BAP/UCL/SCC/BV-026-C [UCL SNK Config Codec, LC3 44.1_2] Passed BAP/UCL/SCC/BV-027-C [UCL SNK Config Codec, LC3 48_1] Passed BAP/UCL/SCC/BV-028-C [UCL SNK Config Codec, LC3 48_2] Passed BAP/UCL/SCC/BV-029-C [UCL SNK Config Codec, LC3 48_3] Passed BAP/UCL/SCC/BV-030-C [UCL SNK Config Codec, LC3 48_4] Passed BAP/UCL/SCC/BV-031-C [UCL SNK Config Codec, LC3 48_5] Passed BAP/UCL/SCC/BV-032-C [UCL SNK Config Codec, LC3 48_6] Passed Total: 32, Passed: 32 (100.0%), Failed: 0, Not Run: 0
* unit/mesh: Add unit testing of Mesh Private BeaconingBrian Gix2023-01-301-35/+147
| | | | | This includes the Sample Data from the Mesh Profile specification v1.1, and validates that the beacon crypto functions work as expected.
* test-crypto: Add /crypto/sef testLuiz Augusto von Dentz2022-12-221-0/+39
| | | | | | | | | | | | | | | | | | | This adds test /crypto/sef which validas the implementation of bt_crypto_sef using the sample data from CSIS[1] spec: A.2. sef SIRK Encryption Function > unit/test-crypto -s "/crypto/sef" SIRK: cd cc 72 dd 86 8c cd ce 22 fd a1 21 09 7d 7d 45 ..r....."..!.}}E K: d9 ce e5 3c 22 c6 1e 06 6f 69 48 d4 9b 1b 6e 67 ...<"...oiH...ng Expected: 46 d3 5f f2 d5 62 25 7e a0 24 35 e1 35 38 0a 17 F._..b%~.$5.58.. Result: 46 d3 5f f2 d5 62 25 7e a0 24 35 e1 35 38 0a 17 F._..b%~.$5.58.. [1]https://www.bluetooth.com/specifications/csis-1-0-1/
* test-crypto: Add /crypto/sih testLuiz Augusto von Dentz2022-12-211-0/+35
| | | | | | | | | | | | | | | | | | | This adds test /crypto/sih which validas the implementation of bt_crypto_sih using the sample data from CSIS[1] spec: A.1. sih Resolvable Set Identifier hash function > unit/test-crypto -s "/crypto/sih" K: cd cc 72 dd 86 8c cd ce 22 fd a1 21 09 7d 7d 45 ..r....."..!.}}E R: 63 f5 69 c.i Expected: da 48 19 .H. Result: da 48 19 .H. [1] https://www.bluetooth.com/specifications/csis-1-0-1/
* unit: Introduce test-bapLuiz Augusto von Dentz2022-11-151-0/+568
| | | | | | | | | | | | Test Summary ------------ BAP/UCL/DISC/BV-01-C Passed BAP/UCL/DISC/BV-02-C Passed BAP/UCL/DISC/BV-06-C Passed BAP/UCL/DISC/BV-05-C Passed BAP/UCL/DISC/BV-03-C Passed BAP/UCL/DISC/BV-04-C Passed Total: 6, Passed: 6 (100.0%), Failed: 0, Not Run: 0
* shared/tester: Remove include to io.hLuiz Augusto von Dentz2022-09-151-0/+1
| | | | | Users of tester.h shall also include io.h, including io.h by default may cause errors if has been previously included.
* test-tester: This add tests for testerLuiz Augusto von Dentz2022-08-051-0/+92
| | | | | | | | | | | | | | This adds tests for the tester itself: > unit/test-tester Test Summary ------------ /tester/basic Passed 0.000 seconds /tester/setup_io Passed 0.000 seconds /tester/io_send Passed 0.000 seconds Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.000355 seconds
* build: Replace use of g_memdup with util_memdupLuiz Augusto von Dentz2022-01-068-35/+38
| | | | | | | | | | | This replaces the uses of g_memdup with util_memdup since the former has been deprecated: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead [-Wdeprecated-declarations] g_memdup2 requires bumping glib version which would likely have its own problems thus why util_memdup was introduced.
* test-hog: Add monitor supportLuiz Augusto von Dentz2021-12-211-9/+2
| | | | | | | | | | | | | | This adds monitor support so data can properly be decoded by the likes of btmon: = test-hog: /TP/HGRF/RH/BV-01-I - init = test-hog: /TP/HGRF/RH/BV-01-I - setup = test-hog: /TP/HGRF/RH/BV-01-I - setup complete = test-hog: /TP/HGRF/RH/BV-01-I - run > test-hog: User Data RX ATT: Read By Group Type Request (0x10) len 6 Handle range: 0x0001-0xffff Attribute group type: Primary Service (0x2800)
* sdpd: Fix leaking buffers stored in cstates cacheLuiz Augusto von Dentz2021-11-121-1/+1
| | | | | | | | | | | | | | These buffer shall only be keep in cache for as long as they are needed so this would cleanup any client cstates in the following conditions: - There is no cstate on the response - No continuation can be found for cstate - Different request opcode - Respond with an error - Client disconnect Fixes: https://github.com/bluez/bluez/security/advisories/GHSA-3fqg-r8j5-f5xq
* test-hog: Update pdu sequenceLuiz Augusto von Dentz2021-10-061-7/+7
| | | | | | With recent changes to use bt_att_resend the procedures such as read long will group the reads to the same handler before proceeding to the next procedures.
* unit/mesh: Inclusive language changesArchie Pusaka2021-09-211-2/+2
| | | | | | | | According to https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf "flooding" is the preferred term. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* shared/util: use 64-bit bitmap in util_get/clear_uidPauli Virtanen2021-09-061-1/+1
| | | | | | | | | | | The util_get/clear_uid functions use int type for bitmap, and are used e.g. for SEID allocation. However, valid SEIDs are in range 1 to 0x3E (AVDTP spec v1.3, 8.20.1), and 8*sizeof(int) is often smaller than 0x3E. The function is also used in src/advertising.c, but an explicit maximum value is always provided, so growing the bitmap size is safe there. Use 64-bit bitmap instead, to be able to cover the valid range.
* unit/gobex: remove timer only when it's not removed yetArchie Pusaka2021-05-064-367/+476
| | | | | | | | | There are instances where timer is removed because timeout has occurred, yet we still remove it again by the end of the test. This causes double removal and prints ugly messages which obscures the real culprit. Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
* gatt: Either notify or indicate, do not do bothCurtis Maves2021-04-131-14/+29
| | | | | | | | AcquireNotify and StartNotify starts notifications and/or indications by whether the characteristic supports them. Before this patch, if both were supported, Bluez would try to start both simultaneously. This patch changes this behavior so if both are supported, only notifications are started. Test cases have also be updated accordingly.
* shared/att: Add debug level to bt_att_set_debugLuiz Augusto von Dentz2021-01-081-1/+1
| | | | | | This creates different levels of debugging which can be passed to bt_att_set_debug as depending on the application it may not need to print everything which can pollute the logs quite a bit.
* unit: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-2129-407/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- GPL-2.0-or-later : 25 LGPL-2.1-or-later : 1 GPL-2.0-only : 2 BSD-2-Clause : 1 License: GPL-2.0-or-later unit/test-hog.c unit/test-eir.c unit/test-gobex-header.c unit/test-crc.c unit/test-avrcp.c unit/test-ringbuf.c unit/test-gobex-apparam.c unit/test-gobex.c unit/test-hfp.c unit/test-textfile.c unit/test-avdtp.c unit/test-sdp.c unit/test-gatt.c unit/test-avctp.c unit/test-gattrib.c unit/test-queue.c unit/test-gobex-packet.c unit/test-uuid.c unit/test-crypto.c unit/test-uhid.c unit/test-gdbus-client.c unit/test-midi.c unit/test-lib.c unit/test-mgmt.c unit/test-gobex-transfer.c License: LGPL-2.1-or-later unit/test-mesh-crypto.c License: GPL-2.0-only unit/util.h unit/util.c License: BSD-2-Clause unit/test-ecc.c
* unit/test-gatt: Fix test /TP/GAR/CL/BI-16-C/autoLuiz Augusto von Dentz2020-07-021-1/+1
| | | | | Test has been using Read Blob Response (0x0d) opcode instead of the expected Read Response (0x0b) to Read Resquest (0x0a).
* unit/test-crypto: test for bt_crypto_verify_att_signArchie Pusaka2020-04-071-0/+59
| | | | Adding tests for verifying att signature
* unit: Exit test-mesh-crypto on any detected failBrian Gix2020-04-071-3/+25
| | | | | | Unit test would signal failures if run on commandline, but not if run as part of a unit test sweep. This change forces an exit(1) on any detected fail, and is caught by test suite runner.
* mesh: Remove redundant code from mesh/cryptoMichał Lowas-Rzechonek2020-04-071-102/+103
| | | | | | | | | | - Remove application_encrypt/application_decrypt - Make mesh_crypto_privacy_counter private, add mesh_crypto_pecb - Make *_nonce functions private and align their implementation to be more consistent - Refactor network_encrypt/network_decrypt to use *_nonce functions and rename them to packet_encrypt/packet_decrypt - Refactor packet_encode/packet_decode
* mesh: Allow short messages to be segmentedBrian Gix2020-03-201-2/+2
| | | | | | | | | | | For added reliability, it is legal to send short messages as "single segment" segmented messages, which require transport layer acknowledgement. This feature is intended for heavy usage in the future so I am adding it now. Further, to support this functionality, an additional queue has been added to allow multiple SAR messages to the same DST to be queued and sent serially.
* gatt: Add support for Notify MultipleLuiz Augusto von Dentz2020-03-021-1/+1
| | | | | This adds support for Notify Multiple procedure marking its bit as supported in the Client Features.
* shared/gatt-client: Add support for EATT featuresLuiz Augusto von Dentz2020-03-021-8/+15
| | | | | This enables EATT in the Client Features if the EATT characteristic is present in the database.
* unit: Add Mesh test 8.3.22 - Virtual AddressingBrian Gix2020-02-181-0/+41
|
* unit: Fix valgrind errors in test-mesh-cryptoBrian Gix2019-10-121-4/+28
| | | | Two HEAP errors, and one error caused by missing checksum data.
* unit: Add Mesh Crypto tests from Mesh Profile SpecBrian Gix2019-10-051-0/+2000
| | | | | | | | | | | | | This unit test will be grown over time to include tests formed from the sample data in the Bluetooth Mesh Profile specification (Currently at version v1.0.1). Currently it includes test cases for the following sets of sample data: Sections 8.1.1-6 Sections 8.2.1-6 Sections 8.3.1-11 Section 8.4.3 Section 8.6.2
* unit/test-crypto: Add test for bt_crypto_gatt_hashLuiz Augusto von Dentz2019-02-061-0/+66
| | | | This adds test case base on the example given in the spec.
* unit: Fix fsanitize-address-use-after-scope with GCC 9Luiz Augusto von Dentz2019-01-147-25/+52
| | | | | | | Raw data payload must be copied since the declaration goes out of scope: Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=202213
* unit/test-sdp: Avoid extra copies when sending a PDULuiz Augusto von Dentz2019-01-141-17/+10
| | | | | Make use of writev instead of creating a separate buffer to transmit the data.
* unit/test-gdbus-client: Fix using invalid interface nameLuiz Augusto von Dentz2018-12-181-2/+2
| | | | | Each element must only contain the ASCII characters "[A-Z][a-z][0-9]_" and must not begin with a digit so '-' cannot be used.
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-0610-8/+12
|
* unit/test-sdp: Add robustness test for continuation stateLuiz Augusto von Dentz2018-11-021-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a test for invalid continuation state: /TP/SERVER/SA/ROB/BI-01-C - init /TP/SERVER/SA/ROB/BI-01-C - setup /TP/SERVER/SA/ROB/BI-01-C - setup complete /TP/SERVER/SA/ROB/BI-01-C - run test-sdp: < 02 00 01 00 16 35 11 1c 00 00 01 00 00 00 10 00 .....5.......... test-sdp: 80 00 00 80 5f 9b 34 fb 00 01 00 ...._.4.... bluetoothd[26193]: process_request: Got a svc srch req bluetoothd[26193]: extract_des: Seq type : 53 bluetoothd[26193]: extract_des: Data size : 17 bluetoothd[26193]: extract_des: Data type: 0x1c bluetoothd[26193]: extract_des: No of elements : 1 bluetoothd[26193]: service_search_req: Expected count: 1 bluetoothd[26193]: service_search_req: Bytes scanned : 19 bluetoothd[26193]: sdp_cstate_get: Continuation State size : 0 bluetoothd[26193]: service_search_req: Checking svcRec : 0x0 bluetoothd[26193]: service_search_req: Checking svcRec : 0x1 bluetoothd[26193]: service_search_req: Checking svcRec : 0x10000 bluetoothd[26193]: service_search_req: Match count: 1 bluetoothd[26193]: process_request: Sending rsp. status 0 bluetoothd[26193]: process_request: Bytes Sent : 14 test-sdp: > 03 00 01 00 09 00 01 00 01 00 01 00 00 00 .............. test-sdp: < 04 00 01 00 0f 00 01 00 00 00 07 35 06 09 00 00 ...........5.... test-sdp: 09 00 01 00 .... bluetoothd[26193]: process_request: Got a svc attr req bluetoothd[26193]: extract_des: Seq type : 53 bluetoothd[26193]: extract_des: Data size : 6 bluetoothd[26193]: extract_des: Data type: 0x09 bluetoothd[26193]: extract_des: No of elements : 1 bluetoothd[26193]: extract_des: Data type: 0x09 bluetoothd[26193]: extract_des: No of elements : 2 bluetoothd[26193]: sdp_cstate_get: Continuation State size : 0 bluetoothd[26193]: service_attr_req: SvcRecHandle : 0x10000 bluetoothd[26193]: service_attr_req: max_rsp_size : 7 bluetoothd[26193]: extract_attrs: Entries in attr seq : 2 bluetoothd[26193]: extract_attrs: AttrDataType : 9 bluetoothd[26193]: extract_attrs: AttrDataType : 9 bluetoothd[26193]: service_attr_req: Creating continuation state of size : 18 bluetoothd[26193]: sdp_set_cstate_pdu: Non null sdp_cstate_t id : 0x5bdb0511 bluetoothd[26193]: process_request: Sending rsp. status 0 bluetoothd[26193]: process_request: Bytes Sent : 23 test-sdp: > 05 00 01 00 12 00 07 35 10 09 00 00 0a 00 08 11 .......5........ test-sdp: 05 db 5b 07 00 00 00 ..[.... test-sdp: < 04 00 02 00 17 00 01 00 00 00 07 35 06 09 00 00 ...........5.... test-sdp: 09 00 01 08 11 05 db 5b ff ff 00 00 .......[.... bluetoothd[26193]: process_request: Got a svc attr req bluetoothd[26193]: extract_des: Seq type : 53 bluetoothd[26193]: extract_des: Data size : 6 bluetoothd[26193]: extract_des: Data type: 0x09 bluetoothd[26193]: extract_des: No of elements : 1 bluetoothd[26193]: extract_des: Data type: 0x09 bluetoothd[26193]: extract_des: No of elements : 2 bluetoothd[26193]: sdp_cstate_get: Continuation State size : 8 bluetoothd[26193]: sdp_cstate_get: Cstate TS : 0x5bdb0511 bluetoothd[26193]: sdp_cstate_get: Bytes sent : 65535 bluetoothd[26193]: service_attr_req: SvcRecHandle : 0x10000 bluetoothd[26193]: service_attr_req: max_rsp_size : 7 bluetoothd[26193]: NULL cache buffer and non-NULL continuation state bluetoothd[26193]: process_request: Sending rsp. status 5 bluetoothd[26193]: process_request: Bytes Sent : 7 test-sdp: > 01 00 02 00 02 00 05 ....... /TP/SERVER/SA/ROB/BI-01-C - test passed /TP/SERVER/SA/ROB/BI-01-C - teardown /TP/SERVER/SA/ROB/BI-01-C - teardown complete /TP/SERVER/SA/ROB/BI-01-C - done
* unit: Make use of tester_monitor to print input/output PDUsLuiz Augusto von Dentz2018-10-085-44/+16
| | | | | | | | | | | | | | | | | | | | | | | tester_monitor will forward the data to btmon when -m/--monitor is enabled which will attempt to decode the PDUs: = test-gatt: /robustness/unkown-command - init 11:44:53.464325 = test-gatt: /robustness/unkown-command - setup = test-gatt: /robustness/unkown-command - setup complete = test-gatt: /robustness/unkown-command - run < test-gatt: User Data TX ATT: Exchange MTU Request (0x02) len 2 Client RX MTU: 23 > test-gatt: User Data RX ATT: Exchange MTU Response (0x03) len 2 Server RX MTU: 512 < test-gatt: User Data TX ATT: Unknown (0xff) len 1 00 . = test-gatt: /robustness/unkown-command - test passed = test-gatt: /robustness/unkown-command - teardown = test-gatt: /robustness/unkown-command - teardown complete = test-gatt: /robustness/unkown-command - done
* unit: Fix out of boundsLuiz Augusto von Dentz2018-08-272-2/+9
| | | | Test /gobex/test_stream_put_req requires 5 buffers to complete.
* Add support for requiring min key size for access GATT characteristicsSzymon Janc2018-03-261-1/+1
| | | | | | This allows to configure bluetoothd to require minimum encryption key size when accessing GATT server characteristics. It is a global configuration option affecting whole GATT database.
* unit/test-gdbus-client: Use g_dbus_dict_append_entry()ERAMOTO Masaya2018-03-011-35/+3
|
* unit/test-ecc: Fix uninitialised valuesLuiz Augusto von Dentz2018-02-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Conditional jump or move depends on uninitialised value(s) at 0x40208C: test_sample (test-ecc.c:106) by 0x4022AB: test_invalid_pub (test-ecc.c:272) by 0x406DA2: run_callback (tester.c:415) by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x408245: tester_run (tester.c:830) by 0x401CC3: main (test-ecc.c:291) Conditional jump or move depends on uninitialised value(s) at 0x4020D6: test_sample (test-ecc.c:113) by 0x4022AB: test_invalid_pub (test-ecc.c:272) by 0x406DA2: run_callback (tester.c:415) by 0x4E83576: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x4E86B76: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x4E86F1F: ??? (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x4E87231: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5400.3) by 0x408245: tester_run (tester.c:830) by 0x401CC3: main (test-ecc.c:291)
* shared: Add missing ecc_valid_public_key functionMarcel Holtmann2018-01-221-0/+35
|
* unit: Add missing break statementMarcel Holtmann2017-07-111-0/+1
|
* shared/gatt-client: Allow multiple ready callbacksLuiz Augusto von Dentz2017-07-041-2/+2
| | | | | | This makes the ready callbacks much more convenient to track when the client is ready since its is now possible to notify more than on client at the same time.
* unit/test-gatt: Adjust the PDUs for characteristic discoveryLuiz Augusto von Dentz2017-05-121-33/+27
| | | | | The new behavior of bt_gatt_client is to discovery the characteristics of the entire range (0x0001-0xffff) not service by service.
* unit/test-gatt: Adjust the PDUs to the new behaviorLuiz Augusto von Dentz2017-05-121-14/+6
| | | | | The new behavior of bt_gatt_client is to discovery the entire range (0x0001-0xffff) not service by service.
* unit/test-gatt: Add test for unknown requestLuiz Augusto von Dentz2017-05-021-0/+18
| | | | | | | | | | | This send an unknown command (0xff) to test that no response is sent since the spec mandates the server to not respond to commands: BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F page 2179 'If a server receives a command that it does not support, indicated by the Command Flag of the PDU set to one, then the server shall ignore the Command.'
* unit/test-gatt: Add test for unknown requestLuiz Augusto von Dentz2017-05-021-0/+6
| | | | | | | | | | | This send an unknown request (0xbf) to test if a response is sent since the spec mandates the server to always respond to all requests it receives: BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F page 2173 'A client may send attribute protocol requests to a server, and the server shall respond to all requests that it receives.'
* unit/test-midi: Make unit test compatible with GLIB v2.28Brian Gix2017-01-251-2/+6
| | | | | g_assert_memcmp would require to bump the glib version so instead just use just use g_assert_cmpint and g_assert.
* unit/test-midi: Added libmidi use-case testsFelipe F. Tonello2017-01-041-0/+628
| | | | | | | | I tried to test all basic and most common use-case scenarios here and some more weird as well. It tests cases where the parser needs to handle problematic MIDI messages as well as ALSA Sequencer events. It is really simple to add new tests, so others are welcome to do so.
* input/hog-lib: Add support to gatt-dbLuiz Augusto von Dentz2016-12-291-0/+6
| | | | | | This add support of passing a gatt-db to avoid having to discover the services again, this should also make it easier to port to bt_gatt_client once Android code support it.
* unit/test-gatt: Add /TP/GAD/CL/BV-02-C-1-alternativeŁukasz Rymanowski2016-10-181-0/+8
| | | | | | | | According to GATT.TS.4.2.1, 4.4.3 TP/GAD/CL/BV-02-C [Discover Primary Services by Service UUID – by Client] Pass verdict is also when response has end_handle = 0xffff. This patch add such test.