summaryrefslogtreecommitdiff
path: root/unit
AgeCommit message (Collapse)AuthorFilesLines
2020-05-22unit: Exit test-mesh-crypto on any detected failBrian Gix1-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. Change-Id: Ice205022416bbcb91bd937a035e288bae1c2fc81 Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2020-05-22mesh: Remove redundant code from mesh/cryptoMichaƂ Lowas-Rzechonek1-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 Change-Id: If342e994774714a75bdd0ae90766d1ec7b750b79 Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2020-03-26mesh: Allow short messages to be segmentedBrian Gix1-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. Change-Id: I6dfa9543ab9a9a49438e46f38fa25659f50db82d Signed-off-by: Anupam Roy <anupam.r@samsung.com>
2020-03-26unit: Add Mesh test 8.3.22 - Virtual AddressingBrian Gix1-0/+41
Change-Id: I7a4bfaed4f961466c3eb81b0f46cc8643169c495 Signed-off-by: Anupam Roy <anupam.r@samsung.com>
2020-01-22unit/test-crypto: Add test for bt_crypto_gatt_hashLuiz Augusto von Dentz1-0/+66
This adds test case base on the example given in the spec. Change-Id: Ibc713afd03926375087c248a4fe9882784ea95a7 Signed-off-by: himanshu <h.himanshu@samsung.com>
2020-01-22unit: Fix fsanitize-address-use-after-scope with GCC 9Luiz Augusto von Dentz7-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 Change-Id: I33aa4edf5f2cac3f8d0a7995027be36d10ff8464 Signed-off-by: himanshu <h.himanshu@samsung.com>
2020-01-22unit/test-sdp: Avoid extra copies when sending a PDULuiz Augusto von Dentz1-17/+10
Make use of writev instead of creating a separate buffer to transmit the data. Change-Id: I3d86b09dce12c3e5438ada46b9d77a7b94125ee5 Signed-off-by: himanshu <h.himanshu@samsung.com>
2020-01-22unit/test-gdbus-client: Fix using invalid interface nameLuiz Augusto von Dentz1-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. Change-Id: I176162c288973b9db672bbb9c5eacd896dd94b41 Signed-off-by: himanshu <h.himanshu@samsung.com>
2020-01-14unit/test-sdp: Add robustness test for continuation stateLuiz Augusto von Dentz1-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 Change-Id: I9312545d675dab69e64d22779e02ac7da923bb42 Signed-off-by: himanshu <h.himanshu@samsung.com>
2020-01-14unit: Make use of tester_monitor to print input/output PDUsLuiz Augusto von Dentz5-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 Change-Id: I44bd1f913f02a953301dc1e0a4b87a448219e7f0 Signed-off-by: himanshu <h.himanshu@samsung.com>
2020-01-14unit: Fix out of boundsLuiz Augusto von Dentz2-2/+9
Test /gobex/test_stream_put_req requires 5 buffers to complete. Change-Id: I277cdcfc8c396598cb609bbf16e7944e94bc3ae0 Signed-off-by: himanshu <h.himanshu@samsung.com>
2019-12-17unit: Fix valgrind errors in test-mesh-cryptoBrian Gix1-4/+28
Two HEAP errors, and one error caused by missing checksum data. Change-Id: I383a43b5f7669b8e7efb3dd0c7bd1142f916c46a Signed-off-by: Anupam Roy <anupam.r@samsung.com>
2019-12-17unit: Add Mesh Crypto tests from Mesh Profile SpecBrian Gix1-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 Change-Id: I70b90d83e997b2c711433a2a131a4cc6ef3bca3f Signed-off-by: Anupam Roy <anupam.r@samsung.com>
2019-04-26Add support for requiring min key size for access GATT characteristicsSzymon Janc1-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. Change-Id: Ibec567f17447d35421f016c5e0021ef49aa713ef Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2019-04-26unit/test-gdbus-client: Use g_dbus_dict_append_entry()ERAMOTO Masaya1-35/+3
Change-Id: I63b356bd82ffee5f40ba4b53756d384874c7ee59 Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2019-04-15shared: Add missing ecc_valid_public_key functionMarcel Holtmann1-0/+33
Change-Id: I955d675fcf2d8fe6c2d50da9a54100c1e7041bd9 Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2018-05-17Import meshctl & bt-shell related apis and fixesAtul Rai1-0/+39
This patch imports the new meshctl and bt-shell apis and fixes from open source bluez (https://git.kernel.org/pub/scm/bluetooth/bluez.git). Change-Id: Iffa5b474c3246938f2b907eabd58c43a7e36c34a Signed-off-by: Atul Rai <a.rai@samsung.com>
2018-03-29Enable check-TESTS using %check section in bluezAtul Rai4-5/+599
This patch enables check-TESTS (unit test case execution) for bluez at build time using %check section in bluez.spec. This patch, - Modifies unit/test-gobex.c, unit/test-gatt.c, unit/test-hog.c and unit/test-gattrib.c to handle Tizen specific changes in BlueZ. - Disables crypto test cases (unit/test-crypto) as QEMU (v2.7.0) in Tizen does not support AF_ALG socket option for cypher algorithms. Change-Id: I5a49ac00a26fe5c1baf92b02915cf1bcfa30f68b Signed-off-by: Atul Rai <a.rai@samsung.com>
2018-03-19[BlueZ upgrade 5.43 to 5.48] Patch 2/2Anupam Roy3-49/+698
Change-Id: I26e0fde334c2eac84d3f19370cab6dfbed073d2f Signed-off-by: Anupam Roy <anupam.r@samsung.com>
2017-06-08Modify the uid and gid of obexd to network_fwsubmit/tizen/20170613.061600accepted/tizen/unified/20170613.194443DoHyun Pyun1-0/+9
The uid of tizen's bt-service will be changed to network_fw from owner. 'network_fw' is a no app user, so it can't use the session bus connection. Because of this, tizen obexd's dbus connection also change to system bus. Change-Id: I73f66e8a451a2b3b62c9f03a8468b824813d8767 Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
2017-03-28Bluez Upgrade: Add Bluez 5.43 open source code.h.sandeep27-97/+201
Change-Id: Ife8b8b7b7163ca2d6c521cdb7f99c2ae90b14ba0 Signed-off-by: h.sandeep <h.sandeep@samsung.com>
2016-04-12Upgrade bluez5_37 :Merge the code from privatesubmit/tizen/20160414.030922accepted/tizen/wearable/20160414.091945accepted/tizen/tv/20160414.092045accepted/tizen/mobile/20160414.092019accepted/tizen/ivi/20160414.092030accepted/tizen/common/20160414.142549h.sandeep18-674/+1049
branch:devel/bluetooth/master ================================================ commit 81e16d9fa48dc40f2dcb15aca9ce87ea50d9a85e Author: Injun Yang <injun.yang@samsung.com> Date: Thu Mar 31 17:05:06 2016 +0900 GATT Server : Handle property and write type ============================================== Change-Id: I0d2b69488337b1f393fba43dc1268bd92ea6b6ac Signed-off-by: h.sandeep <h.sandeep@samsung.com>
2016-01-12Merge the code from tizen_2.4submit/tizen_wearable/20160113.070045submit/tizen_tv/20160113.070042submit/tizen_mobile/20160113.070038accepted/tizen/wearable/20160114.013336accepted/tizen/tv/20160114.013220accepted/tizen/mobile/20160114.012931Taejin Woo9-199/+1377
Change-Id: I7386c5d3ccf7022649ed17c7cb65e7f4e1b2ee27 Signed-off-by: Taejin Woo <tt.woo@samsung.com>
2015-06-08Upgrade Bluez 5.28 and synchronize Tizen 2.4's bluezDoHyun Pyun14-307/+2295
Change-Id: Ifaf2154ba0ab19b180946e0d92f1817a1d9ed839 Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
2015-02-18Changes for successful build after porting of Tizen 2.4 codeAbhinav Kumar10-97/+4099
1> Copied Tizen 2.4 code in tizen branch. 2> Made changes to spec file for successful build. Also added a new file .gbs.conf. Change-Id: I6e479759454c1978e68340a0f3541fb66b437044
2014-05-27Imported Upstream version 5.19upstream/5.19upstreamSebastian Chlad16-58/+3327
2013-12-12Imported Upstream version 5.12upstream/5.12Wu Zheng2-6/+1092
2013-10-23Imported Upstream version 5.10upstream/5.10Wu zheng15-30/+10779
2012-10-30Imported Upstream version 4.101upstream/4.101Anas Nashif1-0/+89