aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2024-05-16mgmt-tester: Fix non-nul-terminated stringBastien Nocera1-2/+6
Error: STRING_NULL (CWE-170): [#def59] [important] tools/mgmt-tester.c:12670:2: string_null_source: Function "vhci_read_devcd" does not terminate string "buf". tools/mgmt-tester.c:12677:2: string_null: Passing unterminated string "buf" to "strtok_r", which expects a null-terminated string. 12675| 12676| /* Verify if all devcoredump header fields are present */ 12677|-> line = strtok_r(buf, delim, &saveptr); 12678| while (strlen(test->expect_dump_data[i])) { 12679| if (!line || strcmp(line, test->expect_dump_data[i])) {
2024-05-16isotest: Fix string size expectationsBastien Nocera1-2/+13
Verify that the peer is a valid bdaddr (and so has the correct length) before using it. Error: STRING_SIZE (CWE-120): [#def54] [important] tools/isotest.c:1198:26: string_size_argv: "argv" contains strings with unknown size. tools/isotest.c:1459:4: string_size: Passing string "argv[optind + i]" of unknown size to "send_mode", which expects a string of a particular size. Error: STRING_SIZE (CWE-120): [#def55] [important] tools/isotest.c:1198:26: string_size_argv: "argv" contains strings with unknown size. tools/isotest.c:1476:4: var_assign_var: Assigning: "peer" = "argv[optind + i]". Both are now tainted. tools/isotest.c:1484:5: string_size: Passing string "peer" of unknown size to "bcast_do_connect_mbis", which expects a string of a particular size. Error: STRING_SIZE (CWE-120): [#def56] [important] tools/isotest.c:1198:26: string_size_argv: "argv" contains strings with unknown size. tools/isotest.c:1476:4: var_assign_var: Assigning: "peer" = "argv[optind + i]". Both are now tainted. tools/isotest.c:1514:5: string_size: Passing string "argv[optind + i]" of unknown size to "do_connect", which expects a string of a particular size.
2024-05-16test-runner: Fix fd leak on failureBastien Nocera1-0/+2
Error: RESOURCE_LEAK (CWE-772): [#def65] [important] tools/test-runner.c:877:3: open_fn: Returning handle opened by "attach_proto". tools/test-runner.c:877:3: var_assign: Assigning: "serial_fd" = handle returned from "attach_proto(node, 0U, basic_flags, extra_flags)". tools/test-runner.c:955:3: leaked_handle: Handle variable "serial_fd" going out of scope leaks the handle. 953| if (pid < 0) { 954| perror("Failed to fork new process"); 955|-> return; 956| } 957|
2024-05-16isotest: Fix bad freeBastien Nocera1-2/+5
Error: BAD_FREE (CWE-763): [#def58] [important] tools/isotest.c:1461:5: address: Taking offset from "strchr(filename, 44)". tools/isotest.c:1461:5: assign: Assigning: "filename" = "strchr(filename, 44) + 1". tools/isotest.c:1536:2: incorrect_free: "free" frees incorrect pointer "filename". 1534| 1535| done: 1536|-> free(filename); 1537| 1538| syslog(LOG_INFO, "Exit");
2024-05-16test-runner: Fix uninitialised variable usageBastien Nocera1-2/+2
Error: UNINIT (CWE-457): [#def64] [important] tools/test-runner.c:701:2: var_decl: Declaring variable "envp" without initializer. tools/test-runner.c:739:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve". 737| 738| if (pid == 0) { 739|-> execve(argv[0], argv, envp); 740| exit(EXIT_SUCCESS); 741| }
2024-05-16test-runner: Fix uninitialised variable usageBastien Nocera1-0/+5
Error: UNINIT (CWE-457): [#def72] [important] tools/test-runner.c:856:2: var_decl: Declaring variable "argv" without initializer. tools/test-runner.c:945:2: uninit_use: Using uninitialized value "argv[0]". 943| envp[pos] = NULL; 944| 945|-> printf("Running command %s\n", cmdname ? cmdname : argv[0]); 946| 947| pid = fork();
2024-05-16test-runner: Remove unused envpBastien Nocera1-2/+2
Error: UNINIT (CWE-457): [#def70] [important] tools/test-runner.c:644:2: var_decl: Declaring variable "envp" without initializer. tools/test-runner.c:682:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve". 680| 681| if (pid == 0) { 682|-> execve(argv[0], argv, envp); 683| exit(EXIT_SUCCESS); 684| } Error: UNINIT (CWE-457): [#def71] [important] tools/test-runner.c:701:2: var_decl: Declaring variable "envp" without initializer. tools/test-runner.c:739:3: uninit_use_in_call: Using uninitialized value "*envp" when calling "execve". 737| 738| if (pid == 0) { 739|-> execve(argv[0], argv, envp); 740| exit(EXIT_SUCCESS); 741| }
2024-05-16tools/mesh-cfgclient: Fix uninitialised variable usageBastien Nocera1-2/+1
Error: UNINIT (CWE-457): [#def64] [important] tools/mesh-cfgclient.c:1992:2: var_decl: Declaring variable "result" without initializer. tools/mesh-cfgclient.c:2041:3: uninit_use: Using uninitialized value "result". Field "result.last_seen" is uninitialized. 2039| l_queue_length(devices) + 1); 2040| dev = l_malloc(sizeof(struct unprov_device)); 2041|-> *dev = result; 2042| 2043| } else if (dev->rssi < result.rssi) Error: UNINIT (CWE-457): [#def65] [important] tools/mesh-cfgclient.c:1992:2: var_decl: Declaring variable "result" without initializer. tools/mesh-cfgclient.c:2044:3: uninit_use: Using uninitialized value "result". Field "result.last_seen" is uninitialized. 2042| 2043| } else if (dev->rssi < result.rssi) 2044|-> *dev = result; 2045| 2046| dev->last_seen = time(NULL);
2024-05-15Revert "mgmt-tester: update for Poll Errqueue experimental fature"Pauli Virtanen1-5/+1
This reverts commit c777c55ab662db4e9853bb08a6e1e6c77b319e09. The kernel feature needs further work.
2024-05-15tools: disable running TX timestamping tests for nowPauli Virtanen3-0/+17
Disable the TX timestamping related tests for now, as the feature will need some further work.
2024-05-13tools: fix using too small buffers in test-runnerPauli Virtanen1-2/+2
Fix compiler warning: tools/test-runner.c:309:57: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
2024-05-10iso-tester: Fix fd leakBastien Nocera1-0/+1
Error: RESOURCE_LEAK (CWE-772): [#def63] [important] tools/iso-tester.c:1796:2: open_fn: Returning handle opened by "socket". tools/iso-tester.c:1796:2: var_assign: Assigning: "sk" = handle returned from "socket(31, 2053, 8)". tools/iso-tester.c:1807:3: leaked_handle: Handle variable "sk" going out of scope leaks the handle. 1805| if (!master_bdaddr) { 1806| tester_warn("No master bdaddr"); 1807|-> return -ENODEV; 1808| } 1809|
2024-05-10isotest: Fix fd leakBastien Nocera1-0/+2
Error: RESOURCE_LEAK (CWE-772): [#def65] [important] tools/isotest.c:923:4: open_fn: Returning handle opened by "open_file". tools/isotest.c:923:4: var_assign: Assigning: "fd" = handle returned from "open_file(altername)". tools/isotest.c:953:3: leaked_handle: Handle variable "fd" going out of scope leaks the handle. 951| 952| free(sk_arr); 953|-> return; 954| } 955|
2024-05-10isotest: Fix error check after opening fileBastien Nocera1-1/+1
Consider "0" to be a valid fd.
2024-05-10isotest: Consider "0" fd to be validBastien Nocera1-1/+1
Error: RESOURCE_LEAK (CWE-772): [#def79] [important] tools/isotest.c:923:4: open_fn: Returning handle opened by "open_file". tools/isotest.c:923:4: var_assign: Assigning: "fd" = handle returned from "open_file(altername)". tools/isotest.c:925:3: off_by_one: Testing whether handle "fd" is strictly greater than zero is suspicious. "fd" leaks when it is zero. tools/isotest.c:925:3: remediation: Did you intend to include equality with zero? tools/isotest.c:926:4: overwrite_var: Overwriting handle "fd" in "fd = open_file(filename)" leaks the handle. 924| 925| if (fd <= 0) 926|-> fd = open_file(filename); 927| } 928|
2024-04-10iso-tester: add test for BT_POLL_ERRQUEUEPauli Virtanen2-2/+125
Also test BT_POLL_ERRQUEUE is experimental feature. Add test: ISO Send - TX No Poll Timestamping
2024-04-10mgmt-tester: update for Poll Errqueue experimental faturePauli Virtanen1-1/+5
Update Read Exp Feature - Success (Index None) for new experimental feature Poll Errqueue.
2024-04-04l2cap-tester: add tests for LE Client read/write/tx-timestampingPauli Virtanen1-1/+40
Add tests: L2CAP LE Client - Read Success L2CAP LE Client - Write Success L2CAP LE Client - TX Timestamping
2024-04-04sco-tester: add TX timestamping testPauli Virtanen1-4/+94
Add test: SCO CVSD Send - TX Timestamping
2024-04-04l2cap-tester: Add test for TX timestampingPauli Virtanen1-5/+102
Add test L2CAP BR/EDR Client - TX Timestamping
2024-04-04iso-tester: Add tests for TX timestampingPauli Virtanen2-10/+335
Add TX timestamping test utilities in new tools/tester.h, so that they can be shared between testers. Add tests: ISO Send - TX Timestamping ISO Send - TX Sched Timestamping ISO Send - TX Msg Timestamping
2024-04-02iso-tester: Fix Codec Configuration lengthLuiz Augusto von Dentz1-3/+3
The length is actually 16 (0x10) bytes not 17 (0x17).
2024-04-02iso-tester: Add test for Broadcast Receiver Get BASEIulia Tanasescu1-3/+55
This adds a new Broadcast Receiver test, to validate that a Broadcast Sink is able to sync to the PA transmitted by a Source (when no BIG is active) and is able to successfully detect the BASE: ISO Broadcaster Receiver Defer Get BASE - Success
2024-04-01mgmt-tester: Adjust Coded PHY scan interval and windowLuiz Augusto von Dentz1-6/+6
Coded PHY interval and window recommneded by the core specification are 3x of the 1M.
2024-03-28iso-tester: Separate iso_defer_accept into dedicated functionsIulia Tanasescu1-10/+35
This separates the iso_defer_accept function into dedicated ones for unicast/broadcast, since the flow is different for each scenario: For unicast, POLLOUT is checked on socket before calling read and adding a G_IO_OUT watch. Checking for POLLOUT is not necessary for broadcast, since currently this event is never generated on the child socket. Instead, G_IO_IN is generated after BIG sync is established and a BIS socket is ready to be accepted.
2024-03-08mgmt-tester: Fix eir name length related testsFrédéric Danis1-34/+32
According to Section 1.2 of Core Specification Supplement Part A the complete or short name strings are defined as utf8s, which should not include the trailing NULL for variable length array as defined in Core Specification Vol1 Part E Section 2.9.3. This patch remove the trailing NULL in expected packets, and update the lengths accordingly, to be in sync with Kernel patch "Bluetooth: Fix eir name length"
2024-03-08bluetooth: Add BT_ISO_SYNC_TIMEOUTLuiz Augusto von Dentz1-2/+2
This defines BT_ISO_SYNC_TIMEOUT(20 sec) which shall be considered the default sync_timeout and make all instance previously hardcoding a value to use it.
2024-02-20build: handle relative libexecdir instancesEmil Velikov1-1/+1
With earlier commit, we've used exec_dir to reference the path of obexd and bluetoothd within the service files. At the same time, in my testing I was providing the complete path on the configure command line. As result, things just worked. In the default case, the variable contains relative references to ${} variables, which as result end up literal in the services. Ultimately the service files were broken. Document are reuse the existing pattern of manually expanding the variables. Fixes: https://github.com/bluez/bluez/issues/736
2024-02-16tools/rfcomm: _exit() on execvp() failureMatthias Schiffer1-1/+1
When the exec fails, the child process must be terminated instead of continuing as a second main process.
2024-02-16tools/rfcomm: reset ignored signals after forkMatthias Schiffer1-0/+6
rfcomm sets SIGCHLD and SIGPIPE to SIG_IGN, which is inherited by child processes and preserved across execvp(). Many applications do not expect these signals to be ignored, causing all kinds of breakage (including the standard C system() function misbehaving on glibc and probably other libcs because waitpid() does not work when SIGCHLD is ignored).
2024-02-15rfcomm-tester: Fix crash on test-basicLuiz Augusto von Dentz1-3/+2
This fixes to following trace caused by not initializing data->io: AddressSanitizer:DEADLYSIGNAL ================================================================= ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f199c3a01c9 bp 0x7ffc26624a10 sp 0x7ffc26624a00 T0) The signal is caused by a READ memory access. Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn . #0 0x7f199c3a01c9 in g_io_channel_unref (/lib64/libglib-2.0.so.0+0x4d1c9) #1 0x5565f82fcece in test_post_teardown tools/rfcomm-tester.c:205 #2 0x5565f83939b3 in teardown_callback src/shared/tester.c:434
2024-02-12hcidump: Fix help message for --timestamp optionArkadiusz Bokowy1-1/+1
2024-02-08mgmt-tester: Remove High Speed test casesLuiz Augusto von Dentz1-63/+0
High Speed is has been removed so these tests are not run anymore so they can be safely removed.
2024-02-06mgmt-tester: Fix Read Ext Controller Info testsLuiz Augusto von Dentz1-5/+5
This fixes Read Ext Controller Info now that BT_HS has been removed.
2024-02-06mgmt-tester: Adjust a test for recent kernel changesJonas Dreßler1-1/+1
With the changes in the kernel to move to hci_sync for connecting ACL devices (see kernel commit "Bluetooth: hci_conn: Only do ACL connections sequentially"), the "ETIMEDOUT" error path for the "HCI Create Connection" command was changed, sending a "HCI Create Connection Cancel" command after the timeout. This leads to the returned error in the "Pair Device - Power off 1" test to change from NOT_POWERED to DISCONNECTED, so adjust for that.
2024-02-06mgmt-tester: Add a 0-entry to expect_hci_list listsJonas Dreßler1-0/+7
In add_expect_hci_list() we iterate through the entries of the expect_hci_list as long as there is an opcode, which means currently this relies on overflowing the buffer to detect the end of the list. This is not great and when running with address sanitizer, the out-of-bounds read gets detected and mgmt-tester aborts. Fix it by adding a trailing zero-entry to all those lists.
2024-01-25btgatt-client: Add function to search all primary servicesFrédéric Danis1-7/+23
This is requested to pass PTS GATT/CL/GAD/BV-01-C test.
2024-01-25btgatt-client: Add function to search characteristicsFrédéric Danis1-0/+82
This is requested to pass PTS GATT/CL/GAD/BV-05-C test. This search characteristics based on UUID, start and end handles.
2024-01-25btgatt-client: Add function to search service based on UUIDFrédéric Danis1-0/+69
This is requested to pass PTS GATT/CL/GAD/BV-02-C test.
2024-01-25btgatt-client: Add command to prevent security level changeFrédéric Danis1-12/+72
Some PTS GATT tests like GATT/CL/GAR/BI-04-C request to be able to get the security error and do not try to change the security level. This commit adds the ability to prevent to change the security level.
2024-01-25build: manage .service.in files via configure.acEmil Velikov1-1/+1
Considering we do basic substitution, we don't need to manually sed, track dependencies, dist nor clean. Just add the files to AC_CONFIG_FILES() call it a day - it does everything for us.
2024-01-23isotest: Fix not handling 0 length packetsLuiz Augusto von Dentz1-2/+2
It is in fact possible to receive 0 length packets since that probably means their status is not sucess.
2023-12-11tools: avtest: Add reject-code optionFrédéric Danis1-7/+16
Some PTS tests like A2DP/SNK/AVP/BI-03-C, A2DP/SNK/AVP/BI-08-C , … request some specific rejection code to pass. This commit adds an option to specify the rejection code during AVDTP_SET_CONFIGURATION rejection. E.g. "avtest --reject setconf --reject-code 195" to reject setconf with INVALID_SAMPLING_FREQUENCY code. Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
2023-11-28isotest: Fix high-reliability QoS presetsLuiz Augusto von Dentz1-16/+16
This changes the high-reliability QoS presets to be conformant to BAP[1] specification: Table 5.2: QoS configuration support setting requirements for the Unicast Client and Unicast Server [1] https://www.bluetooth.com/specifications/bap-1-0-1/ Fixes: https://github.com/bluez/bluez/issues/665
2023-11-28iso-tester: Add tests for GMAP broadcast QoS presetsLuiz Augusto von Dentz1-15/+118
This adds the following tests: ISO QoS 48_1_g - Success ISO QoS 48_2_g - Success ISO QoS 48_3_g - Success ISO QoS 48_4_g - Success
2023-11-22isotest: Add presets from GMAPLuiz Augusto von Dentz1-0/+13
This adds the following presets from GMAP: 16_1_gs 16_2_gs 32_1_gs 32_2_gs 48_1_gs 48_2_gs 32_1_gr 32_2_gr 48_1_gr 48_2_gr 48_3_gr 48_4_gr
2023-11-22iso-tester: Add presets from GMAPLuiz Augusto von Dentz1-0/+109
This adds the following presets from GMAP: ISO QoS 48_1_gc - Success Passed ISO QoS 48_2_gc - Success Passed ISO QoS 48_1_gr - Success Passed ISO QoS 48_2_gr - Success Passed ISO QoS 48_3_gr - Success Passed ISO QoS 48_4_gr - Success Passed
2023-11-20iso-tester: Add test for bcast AC 13 reconnectIulia Tanasescu1-6/+54
This adds a test for Broadcast AC 13 reconnect: ISO Broadcaster AC 13 Reconnect - Success
2023-10-24iso-tester: Add test for bcast receiver PA bindIulia Tanasescu1-19/+51
This adds a test for binding a Broadcast Receiver to a number of BISes after PA sync has been established.
2023-10-03iso-tester: Test bcast receiver with PA sync, no BISIulia Tanasescu1-6/+35
This tests that a broadcast receiver is able to successfully sync to the PA transmitted by a source, without performing BIS sync also: ISO Broadcaster Receiver Defer No BIS - Success
2023-10-03iso-tester: Add test for bcast AC 13 BIS unsetIulia Tanasescu1-5/+20
This adds a new test for the ISO Broadcast AC 13, when the BIG handle is set but the advertising handle is unset: ISO Broadcaster AC 13 BIG 0x01 - Success
2023-09-28transport: Implement QoS propertyLuiz Augusto von Dentz2-4/+4
This implements Transport.QoS as a dict instead of listing each field as a individual property.
2023-09-14l2cap-tester: Add tests for connection timeoutLuiz Augusto von Dentz1-2/+80
This adds the following tests which attempts to use SO_SNDTIMEO so the socket times out before the connection completes: L2CAP BR/EDR Client - Timeout L2CAP LE Client - Timeout L2CAP Ext-Flowctl Client - Timeout
2023-09-14l2cap-tester: Add tests for closing socket before connection completesLuiz Augusto von Dentz1-0/+74
This adds the following tests which attempts to close/shutdown the socket before the connection completes: L2CAP BR/EDR Client - Close L2CAP LE Client - Close L2CAP Ext-Flowctl Client - Close
2023-08-23isotest: Add defer setup support for Broadcast ReceiverIulia Tanasescu1-42/+80
This adds defer setup support for the Broadcast Receiver scenario. In order to create a Broadcast Receiver with the defer setup option, the -W command line parameter should be used, as described in isotest.rst.
2023-08-21iso-tester: add test for ACL disconnect before ISO createdPauli Virtanen1-0/+38
Simulate ACL being disconnected when connecting ISO, before LE Create CIS got sent. The kernel shall indicate connection failure for the ISO socket immediately when the ACL is gone, since connecting the ISO can no longer proceed. ISO Connect ACL Disconnect - Failure
2023-08-21sco-tester: add test for ACL disconnect before SCO establishedPauli Virtanen1-0/+34
Simulate ACL being disconnected before SCO is established. Kernel shall not crash. eSCO ACL Disconnect - Failure Link: https://lore.kernel.org/linux-bluetooth/00000000000013b93805fbbadc50@google.com/
2023-08-17iso-tester: Add test for bcast receiver defer setupIulia Tanasescu1-1/+31
This adds the following test to validate defer setup support for the Broadcast Receiver scenario: ISO Broadcaster Receiver Defer - Success
2023-08-15iso-tester: Add suspend testsLuiz Augusto von Dentz1-1/+84
This adds the following test which attempt to trigger suspend code path while ISO sockets are connecting or have been connected: ISO Connect Suspend - Success ISO Connected Suspend - Success ISO Connect2 Suspend - Success ISO Connected2 Suspend - Success
2023-08-15doc/test-runner: Update documentation using rst formatLuiz Augusto von Dentz1-200/+0
This updates test-runner documentation with a few examples using rst format.
2023-08-07iso-tester: test busy CIG error does not drop existing connectionsPauli Virtanen1-0/+85
A second connection made with same CIG while the CIG is busy, shall not disconnect the first already existing connection. Add test for this: ISO Connect2 Busy CIG 0x01 - Success/Invalid This was the original intent of "ISO Connect2 CIG 0x01 - Success/Invalid", but the busy check should not be made synchronously in connect() (to maintain ordering with Remove CIG etc), but must be done in hci_sync. So the test needs to check the error async and explictly that the first conn is not dropped.
2023-08-04iso-tester: Fix test ISO Connect2 CIG 0x01 - Success/InvalidLuiz Augusto von Dentz1-26/+3
This test shall succeed rather than fail as this appears to be a bug in the kernel code preventing Set CIG Parameters to work properly when there are concurrent tasks only one CIS is being programmed.
2023-08-02iso-tester: add tests checking Remove CIG is emittedPauli Virtanen1-0/+96
Kernel should send LE Remove CIG after all CIS are shut down. Add tests checking this, closing either immediately or after waiting connection to complete. ISO Defer Close - Success ISO Connect Close - Success ISO Defer Wait Close - Success ISO Connect Wait Close - Success
2023-08-02iso-tester: test with large CIS_ID and invalid CIG_ID/CIS_IDPauli Virtanen1-0/+72
Add test with a large CIS_ID and multiple CIS so it hits an error condition in current kernels (which is why the AC configuration is used). Add tests for invalid configurations with bad or duplicate IDs, and for trying to connect two CIS in same CIG without BT_DEFER_SETUP. ISO QoS CIG 0xF0 - Invalid ISO QoS CIS 0xF0 - Invalid ISO Connect2 CIG 0x01 - Success/Invalid ISO AC 6(ii) CIS 0xEF/auto - Success ISO AC 6(ii) CIS 0xEF/0xEF - Invalid
2023-08-02sco-tester: test local and remote disconnecting simultaneouslyPauli Virtanen1-0/+59
Demonstrate a kernel race condition when remote side disconnects at the same time as local side tries to cancel the connection. I.e. [controller] > HCI Synchronous Connect Complete [controller] > HCI Disconnection Complete (from remote) [user] shutdown(sco_socket) [kernel] hci_conn_abort(SCO handle) [kernel] > HCI Create Connection Cancel [kernel] < HCI Synchronous Connect Complete [kernel] < HCI Disconnect Complete [controller] < HCI Create Connection Cancel [controller] > HCI Command Status (Create Connection Cancel) [kernel] < HCI Command Status (Create Connection Cancel) and then we get BUG: KASAN: slab-use-after-free in hci_conn_failed when hci_conn_abort tries to delete the same connection a second time. This type of crash is probably not limited to the sequence here, but for this one it was possible to get the timing right in the emulator. Add a test that hits this in the emulator environment (pretty narrow window to hit on real hardware): eSCO Simultaneous Disconnect - Failure
2023-07-20btmgmt: Add man pageLuiz Augusto von Dentz1-0/+79
This adds btmgmt.rst which is then converted to btmgmt.1 using rst2man.
2023-07-14client: Add support for mgmt submenuLuiz Augusto von Dentz1-6035/+5
This moves the functionality of btmgmt into client/mgmt.c so its commands become available on bluetoothctl via mgmt submenu.
2023-07-14iso-tester: Add test for BT_PKT_STATUS sockoptLuiz Augusto von Dentz1-2/+89
This adds a test for setting BT_PKT_STATUS sockopt and checks if BT_SCM_PKT_STATUS is properly received.
2023-07-14bthost: Add support to set ISO Packet StatusLuiz Augusto von Dentz1-1/+1
This adds support to set ISO Packet Status to bthost_send_iso.
2023-07-13test-runner: fix behavior when no audio serverPauli Virtanen1-2/+3
If no audio server, don't pass NULL to printf and parse TESTAUDIO correctly.
2023-07-13test-runner: set non-quiet printk before running testsPauli Virtanen1-0/+20
It is useful to see WARN_ON etc. messages when running the tests. The 'quiet' in cmdline suppresses levels >= WARN, so re-enable them explicitly after boot, so that it is on by default and doesn't need to be handled in local test scripts.
2023-07-10mgmt-tester: Fix tests that consider 31 bytes the max adv lenghtLuiz Augusto von Dentz1-4/+67
This fixes a couple of tests that consider 31 bytes the max advertising length since in case of extended advertising that number is actually 251.
2023-07-10test-runner: Add documentationLuiz Augusto von Dentz1-0/+200
This adds test-runner.rst documentation with a few examples of how it can be used to run kernel testers like mgmt-tester and also bluetoothd, audio and Bluetooth controller plugged in the host system which is quite useful when trying experimental features such LE Audio, etc.
2023-07-05mgmt-tester: Add a regression test hitting hci_sync bugPauli Virtanen1-0/+49
Add a test "Add + Remove Device Nowait - Success" that hits a race condition in kernel hci_sync.c. On current kernels this causes BUG: KASAN: slab-use-after-free in hci_update_passive_scan_sync+0x857/0x1230 due to unsafe iteration of hdev->pend_le_conns (in Linux <= 6.4-rc4). This seems to hit the race condition also without the added emulator delay (since the emulator runs in the same thread), but it's better to add the delay since otherwise it'll depend on timings on kernel side.
2023-06-26isotest: Add check after accepting connectionIulia Tanasescu1-0/+26
This checks for the POLLERR event on a newly accepted connection, to determine if the connection was successful or not.
2023-06-23iso-tester: Fix checks of latency and intervalLuiz Augusto von Dentz1-4/+4
Due to rounding of latency, BAP uses msec while HCI uses slots of 1.25 ms, values may not return an exact match which is fine since the BAP QoS suggests they are the maximum latency/interval so values bellow that shall be considered a match.
2023-05-30iso-tester: Add BAP Broadcast AC testsIulia Tanasescu1-38/+159
This adds the following tests based on BAP Broadcast Audio Configurations: ISO Broadcaster AC 12 - Success ISO Broadcaster AC 13 - Success ISO Broadcaster AC 14 - Success
2023-05-30isotest: Add support for creating/synchronizing to multiple BISesIulia Tanasescu2-76/+218
This adds an additional command line option for the Broadcast exercise, so that the user can indicate the number of BISes to create as part of a BIG (Broadcast Source), or the number of BISes to synchronize to (Broadcast Sink). For the Broadcast Source exercise, issue the following command, in order to create a BIG with handle 0x01, associated with the advertising handle 0x01, with 2 BISes: tools/isotest -i hci0 -s 00:00:00:00:00:00 -N 2 -G 1 -T 1 The isotest and btmon logs will look something like this: isotest[7178]: mgmt socket: fd 3 isotest[7178]: mgmt_set_le: err 0 isotest[7178]: mgmt_set_experimental: err 0 isotest[7179]: Exit isotest[7178]: Connecting 00:00:00:00:00:00 ... isotest[7178]: Connected [00:00:00:00:00:00] isotest[7178]: QoS [BIG 0x01 BIS 0x01 Packing 0x00 Framing 0x00 Encryption 0x00] isotest[7178]: Input QoS [Interval 10000 us Latency 10 ms SDU 0 PHY 0x00 RTN 2] isotest[7178]: Output QoS [Interval 10000 us Latency 10 ms SDU 40 PHY 0x02 RTN 2] isotest[7178]: Connecting 00:00:00:00:00:00 ... isotest[7178]: Connected [00:00:00:00:00:00] isotest[7178]: QoS [BIG 0x01 BIS 0x01 Packing 0x00 Framing 0x00 Encryption 0x00] isotest[7178]: Input QoS [Interval 10000 us Latency 10 ms SDU 0 PHY 0x00 RTN 2] isotest[7178]: Output QoS [Interval 10000 us Latency 10 ms SDU 40 PHY 0x02 RTN 2] isotest[7183]: Sending ... isotest[7183]: Number of packets: 1 isotest[7183]: Socket jitter buffer: 80 buffer isotest[7183]: [seq 0] 40 bytes buffered 92 (3712 bytes) isotest[7184]: Sending ... isotest[7184]: Number of packets: 1 isotest[7184]: Socket jitter buffer: 80 buffer isotest[7184]: [seq 0] 40 bytes buffered 92 (3712 bytes) isotest[7178]: Exit < HCI Command: LE Create Broadcast Isochronous Group (0x08|0x0068) plen 31 Handle: 0x01 Advertising Handle: 0x01 Number of BIS: 2 SDU Interval: 10000 us (0x002710) Maximum SDU size: 40 Maximum Latency: 10 ms (0x000a) RTN: 0x02 PHY: LE 2M (0x02) Packing: Sequential (0x00) Framing: Unframed (0x00) Encryption: 0x00 Broadcast Code: 00000000000000000000000000000000 > HCI Event: Command Status (0x0f) plen 4 LE Create Broadcast Isochronous Group (0x08|0x0068) ncmd 1 Status: Success (0x00) > HCI Event: LE Meta Event (0x3e) plen 23 LE Broadcast Isochronous Group Complete (0x1b) Status: Success (0x00) Handle: 0x01 BIG Synchronization Delay: 1974 us (0x0007b6) Transport Latency: 1974 us (0x0007b6) PHY: LE 2M (0x02) NSE: 3 BN: 1 PTO: 1 IRC: 3 Maximum PDU: 40 ISO Interval: 10.00 msec (0x0008) Connection Handle #0: 10 Connection Handle #1: 11 < HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13 Handle: 10 Data Path Direction: Input (Host to Controller) (0x00) Data Path: HCI (0x00) Coding Format: Transparent (0x03) Company Codec ID: Ericsson Technology Licensing (0) Vendor Codec ID: 0 Controller Delay: 0 us (0x000000) Codec Configuration Length: 0 Codec Configuration: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 10 < HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13 Handle: 11 Data Path Direction: Input (Host to Controller) (0x00) Data Path: HCI (0x00) Coding Format: Transparent (0x03) Company Codec ID: Ericsson Technology Licensing (0) Vendor Codec ID: 0 Controller Delay: 0 us (0x000000) Codec Configuration Length: 0 Codec Configuration: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 11 < ISO Data TX: Handle 10 flags 0x02 dlen 44 < ISO Data TX: Handle 11 flags 0x02 dlen 44 > HCI Event: Number of Completed Packets (0x13) plen 5 Num handles: 1 Handle: 10 Count: 1 > HCI Event: Number of Completed Packets (0x13) plen 5 Num handles: 1 Handle: 11 Count: 1 For the Broadcast Sink exercise, issue the following command, in order to synchronize to the BISes created by the source: tools/isotest -i hci1 -r 36:13:00:E1:1B:F0 -V le_random -N 2 -G 1 The flow is shown by the isotest log and the filtered btmon snippet below: isotest[4033]: mgmt socket: fd 3 isotest[4034]: Exit isotest[4033]: mgmt_set_le: err 0 isotest[4033]: mgmt_set_experimental: err 0 isotest[4033]: Waiting for connection 36:13:00:E1:1B:F0... isotest[4036]: Connected [36:13:00:E1:1B:F0] isotest[4036]: QoS [BIG 0x01 BIS 0x00 Packing 0x00 Framing 0x00 Encryption 0x00] isotest[4036]: Input QoS [Interval 1974 us Latency 10 ms SDU 40 PHY 0x00 RTN 0] isotest[4036]: Output QoS [Interval 0 us Latency 0 ms SDU 0 PHY 0x00 RTN 0] isotest[4036]: Receiving ... isotest[4037]: Connected [36:13:00:E1:1B:F0] isotest[4037]: QoS [BIG 0x01 BIS 0x00 Packing 0x00 Framing 0x00 Encryption 0x00] isotest[4037]: Input QoS [Interval 1974 us Latency 10 ms SDU 40 PHY 0x00 RTN 0] isotest[4037]: Output QoS [Interval 0 us Latency 0 ms SDU 0 PHY 0x00 RTN 0] isotest[4037]: Receiving ... isotest[4037]: [seq 0] 280 bytes in 6.48 sec speed 0.34 kb/s isotest[4036]: [seq 0] 280 bytes in 6.54 sec speed 0.33 kb/s isotest[4037]: [seq 1] 280 bytes in 7.01 sec speed 0.31 kb/s isotest[4036]: [seq 1] 280 bytes in 7.02 sec speed 0.31 kb/s isotest[4037]: [seq 2] 280 bytes in 7.06 sec speed 0.31 kb/s isotest[4036]: [seq 2] 280 bytes in 7.04 sec speed 0.31 kb/s < HCI Command: LE Periodic Advertising Create Sync (0x08|0x0044) plen 14 Options: 0x0000 Use advertising SID, Advertiser Address Type and address Reporting initially enabled SID: 0x00 Adv address type: Random (0x01) Adv address: 36:13:00:E1:1B:F0 (Non-Resolvable) Skip: 0x0000 Sync timeout: 163840 msec (0x4000) Sync CTE type: 0x0000 > HCI Event: Command Status (0x0f) plen 4 LE Periodic Advertising Create Sync (0x08|0x0044) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 13 Own address type: Public (0x00) Filter policy: Ignore not in accept list (0x01) PHYs: 0x05 Entry 0: LE 1M Type: Passive (0x00) Interval: 60.000 msec (0x0060) Window: 30.000 msec (0x0030) Entry 1: LE Coded Type: Passive (0x00) Interval: 60.000 msec (0x0060) Window: 30.000 msec (0x0030) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6 Extended scan: Enabled (0x01) Filter duplicates: Enabled (0x01) Duration: 0 msec (0x0000) Period: 0.00 sec (0x0000) > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Enable (0x08|0x0042) ncmd 1 Status: Success (0x00) > HCI Event: LE Meta Event (0x3e) plen 16 LE Periodic Advertising Sync Established (0x0e) Status: Success (0x00) Sync handle: 0 Advertising SID: 0x00 Advertiser address type: Random (0x01) Advertiser address: 36:13:00:E1:1B:F0 (Non-Resolvable) Advertiser PHY: LE 2M (0x02) Periodic advertising interval: 10.00 msec (0x0008) Advertiser clock accuracy: 0x00 > HCI Event: LE Meta Event (0x3e) plen 8 LE Periodic Advertising Report (0x0f) Sync handle: 0 TX power: 127 dbm (0x7f) RSSI: -47 dBm (0xd1) CTE Type: No Constant Tone Extension (0xff) Data status: Complete Data length: 0x00 > HCI Event: LE Meta Event (0x3e) plen 20 LE Broadcast Isochronous Group Info Advertising Report (0x22) Sync Handle: 0x0000 Number BIS: 2 NSE: 3 ISO Interval: 10.00 msec (0x0008) BN: 1 PTO: 1 IRC: 3 Maximum PDU: 40 SDU Interval: 10000 us (0x002710) Maximum SDU: 40 PHY: LE 2M (0x02) Framing: Unframed (0x00) Encryption: 0x00 < HCI Command: LE Broadcast Isochronous Group Create Sync (0x08|0x006b) plen 26 BIG Handle: 0x01 BIG Sync Handle: 0x0000 Encryption: Unencrypted (0x00) Broadcast Code: 00000000000000000000000000000000 Maximum Number Subevents: 0x00 Timeout: 163840 ms (0x4000) Number of BIS: 2 BIS ID: 0x01 BIS ID: 0x02 > HCI Event: LE Meta Event (0x3e) plen 19 LE Broadcast Isochronous Group Sync Estabilished (0x1d) Status: Success (0x00) BIG Handle: 0x01 Transport Latency: 1974 us (0x0007b6) NSE: 3 BN: 1 PTO: 1 IRC: 3 Maximum PDU: 40 ISO Interval: 10.00 msec (0x0008) Connection Handle #0: 10 Connection Handle #1: 11 < HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13 Handle: 10 Data Path Direction: Output (Controller to Host) (0x01) Data Path: HCI (0x00) Coding Format: Transparent (0x03) Company Codec ID: Ericsson Technology Licensing (0) Vendor Codec ID: 0 Controller Delay: 0 us (0x000000) Codec Configuration Length: 0 Codec Configuration: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 10 < HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13 Handle: 11 Data Path Direction: Output (Controller to Host) (0x01) Data Path: HCI (0x00) Coding Format: Transparent (0x03) Company Codec ID: Ericsson Technology Licensing (0) Vendor Codec ID: 0 Controller Delay: 0 us (0x000000) Codec Configuration Length: 0 Codec Configuration: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 11 > ISO Data RX: Handle 10 flags 0x06 dlen 48 > ISO Data RX: Handle 11 flags 0x06 dlen 48
2023-05-30test-runner: enable no_hash_pointers=1Pauli Virtanen1-1/+1
Set no_hash_pointers=1 to avoid printk printing "___ptrval___" for %p. This happens with test-runner since the kernel is not running long enough to gather entropy and so refuses to print addresses, and makes debugging harder. As test-runner is only used for testing and debugging, pointer hashing is not needed.
2023-05-30iso-tester: Add tests for AC configuration reconnectPauli Virtanen1-9/+30
Add test for reconnecting a CIG with two CIS, either both with same peer or with different peers. ISO Reconnect AC 6(i) - Success ISO Reconnect AC 6(ii) - Success
2023-05-23iso-tester: Make QoS parameters reflect the tests namesLuiz Augusto von Dentz1-14/+21
AC 1 + 2 tests shall use their respective QoS parameters.
2023-05-22iso-tester: Add tests for AC 1 + 2Pauli Virtanen1-0/+47
Add tests connecting two CIS using different CIG_ID, with fixed and auto-allocated IDs. ISO AC 1 + 2 - Success ISO AC 1 + 2 CIG 0x01/0x02 - Success The CIS are connected sequentially so that the first is closed after the second is connected. In the auto/auto case the kernel shall pick a new CIG_ID since the first CIG_ID is no longer in a configurable state.
2023-05-22iso-tester: always use DEFER_SETUP for multiple CIS in same CIGPauli Virtanen1-46/+104
There is a race between multiple connect() for CIS in the same CIG. connect() will both reconfigure the CIG and connect the CIS, but CIG cannot be reconfigured once one CIS has already connected. That these tests pass currently relies on some timing/event ordering in the emulator. Connecting multiple CIS in same CIG is meant to be done using DEFER_SETUP, so change the tests to use it, so we test the intended usage.
2023-05-17tools/test-runner: add option to start Pipewire inside the VMPauli Virtanen1-4/+145
Add option for launching Pipewire inside the VM to serve Bluetooth endpoints, which can be used in tests. Make the option to optionally take path to the audio daemon, so e.g. Pulseaudio support can be added later.
2023-05-17test-runner: revert udevd and audio supportPauli Virtanen1-105/+3
Tests running inside the VM don't need access to sound cards running on the host. This reverts commit 91a48af52efb0751fab396b2b9026c9186b10b88 This reverts commit e20e7e0b05c7edb74255c9b092916ac5bb99c97f
2023-04-19tools/iso-tester: Add Broadcast tests for encrypted BIGIulia Tanasescu1-7/+57
This adds the following tests for encrypted broadcast: ISO Broadcaster Encrypted - Success ISO Broadcaster Receiver Encrypted - Success
2023-04-19tools/isotest: Add BIG encryption optionsIulia Tanasescu2-29/+91
Add command line options for BIG encryption and broadcast code.
2023-04-13iso-tester: Add BAP Audio Configuration testsLuiz Augusto von Dentz1-8/+262
This adds the following tests based on BAP Audio Configurations: ISO AC 1 & 4 - Success ISO AC 2 & 10 - Success ISO AC 3 & 5 - Success ISO AC 6(i) - Success ISO AC 6(ii) - Success ISO AC 7(i) - Success ISO AC 7(ii) - Success ISO AC 8(i) - Success ISO AC 8(ii) - Success ISO AC 9(i) - Success ISO AC 9(ii) - Success ISO AC 11(i) - Success ISO AC 11(ii) - Success
2023-04-07mgmt-tester: Fix Get/Set PHY testsLuiz Augusto von Dentz1-30/+19
This fixes the following tests now that all supported PHYs are enabled by default: Start Discovery LE - (Ext Scan Param) Failed Get PHY Success Failed Set PHY 1m 2m coded Succcess Timed out
2023-03-31Split bt_iso_qos into dedicated structuresIulia Tanasescu3-82/+291
Split bt_iso_qos into dedicated unicast and broadcast structures and add additional broadcast parameters.
2023-03-30mgmt-tester: Add devcoredump testsManish Mandlik1-0/+173
Add mgmt-tester tests for hci devcoredump. These testa trigger the devcoredump with a test data and verifies the generated devcoredump file for the test data and correct devcoredump header fields.
2023-03-28l2test: Fix setting mode for BR/EDR l2cap socketSimon Mikuda1-1/+21
BT_MODE_* enums are used only for socket SOL_BLUETOOTH, option BT_MODE Otherwise we should use L2CAP_MODE_* enums.
2023-03-28l2test: Enable hex input for PSMSimon Mikuda1-1/+1
2023-03-17tools/mesh-cfgclient: Auto request own composition dataInga Stotland4-2/+26
When attaching a local provisioner node, always request own composition data to accommodate functional consolidation of regular and remote provisioning mechanisms. The knowledge of the own node composition is necessary for provisioning initiation and self configuration.
2023-03-17tools/mesh-cfgclient: Prevent storing duplicate modelsInga Stotland2-5/+21
This fixes the situation when subsequent requests to get a node composition result in appending element's model list with duplicate models. This adds a check for a presence of a model on an element when attempting to add a new model ID to a model list on this element.
2023-03-14btmon: Fix decoding truncated dataŁukasz Rymanowski1-3/+3
Some platforms use different filtering and for this purpose, some of the ACL/SCO/ISO/SDP data is truncated. In such a case, included length is smaller than the original size. Without this fix, btmon stops working after first truncated packet.
2023-03-10tools: Add support to generate RSI using SIRKSathish Narasimman1-2/+78
The patch helps to generate Resolvable set identifier adv data. which can be used as ADV data during advertisement. It will be used to identify the device as part of setmember for Coordinated set identification profile. Example: $<path to advtest/>advtest -i "761FAE703ED681F0C50B34155B6434FB" SIRK: 761FAE703ED681F0C50B34155B6434FB RSI: 0x71 0xcb 0xbc 0x7e 0x01 0x84 Random: bccb71 Hash: 84017e
2023-03-10iso-tester: Update High Reliability presetsLuiz Augusto von Dentz1-16/+16
This updates High Reliability presets as published in BAP 1.0.1: https://www.bluetooth.com/specifications/bap-1-0-1/
2023-03-09l2cap-tester: Add server tests for Ext-FlowctlLuiz Augusto von Dentz1-24/+228
This adds the following tests: L2CAP Ext-Flowctl Server - Success L2CAP Ext-Flowctl Server - Nval SCID L2CAP LE EATT Client - Success L2CAP LE EATT Server - Success L2CAP LE EATT Server - Reject
2023-02-27iso-tester: Add test for central receiving timestamped ISO packetPauli Virtanen1-1/+15
This attempts to receive a timestamped HCI ISO data packet on central. With kernel 6.2 HCI ISO packet parsing this test fails with Bluetooth: Frame malformed (len 40, expected len 0) Link: https://lore.kernel.org/linux-bluetooth/1fd2d4523c139deda93aab2c31f1508d79c32472.1676921889.git.pav@iki.fi/
2023-02-27bthost: Allow sending ISO packets with sequence number and timestampPauli Virtanen1-1/+2
Change bthost_send_iso to take packet sequence number and timestamp, and allow it to send timestamped HCI ISO data packets. Currently, btdev passes through ISO packets, so this can also be used to test RX timestamping.
2023-02-13tools/btmgmt: add MGMT setting bit names for CIS feature supportPauli Virtanen1-0/+2
Add names for CIS Central/Peripheral MGMT setting bits: [mgmt]# info Index list with 1 item hci0: Primary controller addr XX:XX:XX:XX:XX:XX version 12 manufacturer 2 class 0x7c0104 supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr le advertising secure-conn debug-keys privacy configuration static-addr phy-configuration wide-band-speech cis-central cis-peripheral current settings: powered bondable ssp br/edr le secure-conn cis-central cis-peripheral name xxx short name hci0: Configuration options supported options: public-address missing options:
2023-01-30tools/mesh-cfgtest: Support extended device compositionInga Stotland1-20/+168
This adds support for extended device composition to account for new fundamental models supported by bluetooth-meshd daemon. Also, update to include explicit element locations and handle different ordering of model IDs in the composition data.
2023-01-30tools/mesh: Add support for Mesh Private BeaconsBrian Gix3-12/+62
This allows generation of Mesh Private Beacon server commands, and recognition of the resulting Status messages.
2023-01-30tools/mesh: Optimize for multiple RPR servers and NPPIBrian Gix6-87/+598
These changes allow the mesh-cfgclient tool to request remote node compositions from page 128. Depending on the differences between there and what is stored in the local configuration database, it may recomend reprovisioning with NPPI-1 (Address Refresh) or NPPI-2 (Composition Refresh). Additionally, NPPI-0 may be performed to refresh the Device Key only.
2022-12-09isotest: Fix not calculating time to waitLuiz Augusto von Dentz1-0/+4
The difference of time start and current time may have advanced just enough to add a second leaving start nanoseconds to be bigger.
2022-12-07iso-tester: Add test when peer rejects CISLuiz Augusto von Dentz1-6/+31
This adds the following test for testing when remote stack rejects the CIS: ISO Connect - Reject Passed
2022-12-06bthost: Add callback to accept ISO connectionsLuiz Augusto von Dentz1-1/+1
This enables setting an accept callback which can return reject reason if the connection shall not be accepted.
2022-11-17tools: Use portable 64 bit data formatsBrian Gix1-2/+3
The isotest executable was using the non-portable %zd string formatter for loging 64 bit integers. This replaces them with PRId64.
2022-11-01tools: Switch hciattach_qualcomm to FAILIF macro completelyMarek Vasut1-16/+8
Use the FAILIF() macro consistently to avoid unused variable n warnings.
2022-11-01tools: Make hciattach_* firmware path build-time configurableMarek Vasut4-6/+8
Make hciattach_qualcomm.c and hciattach_tialt.c behave the same way as hciattach_bcm43xx.c does, where FIRMWARE_DIR can be overridden at build time by using -DFIRMWARE_DIR= CFLAGS.
2022-10-28tools/test-runner: Remove bluetooth.enable_ecredLuiz Augusto von Dentz1-1/+0
L2CAP ECRED is now enabled by default by the following kernel change: 98f18bb78b7d ("Bluetooth: Add CONFIG_BT_LE_L2CAP_ECRED")
2022-10-10mgmt-tester: Fix Set Static Address testsLuiz Augusto von Dentz1-12/+51
Set Static Address tests needs to power after setting the address since the programming of the address using the HCI command only happens during power on procedure.
2022-10-06tools: mgmt-tester - Test for HCI cmd after static addr setBrian Gix1-0/+6
This change checks for the expected HCI command after Static Address change requested.
2022-09-27tools: Fix mesh-tester to expect end of ADVBrian Gix1-0/+12
Tester was failing by not clearing the HCI queue of expected events
2022-09-27rctest: Fix scan-build warningLuiz Augusto von Dentz1-1/+1
This fixes the following warning: tools/rctest.c:131:2: warning: 1st function call argument is an uninitialized value [core.CallAndMessage] sdp_list_free(protos, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-09-26tools/mpris-proxy: unregister object path if player registration failsHaochen Tong1-0/+1
The `owner' string, passed as user data, is freed if the player fails registration, but the object path still exists. Upon program exiting, the lingering path will be enumerated and the attached user data will be freed again.
2022-09-26tools: fix printf format stringsChristian Eggers2-4/+6
time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
2022-09-21tools/ioctl-tester - Add ioctl-testerTedd Ho-Jeong An2-0/+962
This patch adds ioctl-tester which tests the IOCTL commands. HCI Down Device List Device List - Invalid Param 1 Device Info Reset Stat Set Link Mode - ACCEPT Set Link Mode - MASTER Set Pkt Type - DM Set Pkt Type - DH Set Pkt Type - HV Set Pkt Type - 2-DH Set Pkt Type - 2-DH Set Pkt Type - ALL Set ACL MTU - 1 Set ACL MTU - 2 Set SCO MTU - 1 Set SCO MTU - 2 Block BDADDR - Success Block BDADDR - Fail Unblock BDADDR - Success Unblock BDADDR - Fail Connection List - No Conn Connection List Connection Info Connection Info - No Connection Connection Info - Wrong Type Authentication Info - No Connection Authentication Info
2022-09-13rfcomm-tester: Add test to close socket while connectingLuiz Augusto von Dentz1-4/+37
This adds Basic RFCOMM Socket Client - Close test which attempt to close socket while connecting.
2022-09-02rfcomm-tester: Use latest Bluetooth versionLuiz Augusto von Dentz1-1/+1
This makes rfcomm-tester use the latest Bluetooth supported by the emulator which is useful the detect regression related to ACL data transfer.
2022-09-01mgmt-tester: Adds turning on Mesh Experimental featureBrian Gix1-2/+38
Turns on experimental Mesh feature, and expects it in report when querying which experimental features are supported and have been enabled.
2022-09-01tools: Add mesh-tester to test Kernel mesh supportBrian Gix2-0/+1443
Ever growing set of tests for Mesh kernel support
2022-08-29tools/btmgmt: add missing return statementChristian Eggers1-1/+1
Leave function on error instead of printing (possibly) invalid flags.
2022-08-29client/player: Use QoS interval on transport.sendLuiz Augusto von Dentz1-1/+0
This makes use of QoS interval when sending a file.
2022-08-29client/player: Add support for PACS endpointsLuiz Augusto von Dentz1-1/+1
This adds support for PAC_SINK and PAC_SOURCE endpoints as well as LC3 presets.
2022-08-22iso-tester: Make use of bthost_add_iso_hook destroy callbackLuiz Augusto von Dentz1-21/+31
This makes use of bthost_add_iso_hook to track when an ISO connection has been disconnected and then set its handle to 0x0000 which is then checked when the socket HUP to confirm the remote has properly disconnected (e.g. received Disconnected Complete).
2022-08-22bthost: Add destroy callback to bthost_add_iso_hookLuiz Augusto von Dentz1-1/+1
This adds a destroy callback to bthost_add_iso_hook so its user can detect when the hook is freed when the connection is disconnected.
2022-08-19iso-tester: Fix using shutdown(SHUT_RDWR)Luiz Augusto von Dentz1-6/+6
shutdown(SHUT_RDWR) results in socket being HUP immeditaly instead of waiting for Disconnect Complete event so instead just use SHUT_WR to start the disconnect procedure without causing the socket to HUP.
2022-08-15iso-tester: Introduce tests for Disconnect/ReconnectLuiz Augusto von Dentz1-0/+80
This introduces a test that do use shutdown to disconnect an ISO socket and then another one that attempts to reconnect it again to emulate upper profile transitions.
2022-08-05iso-tester: Add ISO 48_2_1 Defer Receive - SuccessLuiz Augusto von Dentz1-1/+19
This adds a test to check if different QoS are properly handled when acting as peripheral.
2022-08-05bthost: Add qos support to bthost_set_cig_paramsLuiz Augusto von Dentz1-1/+1
This enables setting QoS other then the mandatory 16_2_1.
2022-08-04build: Fix make check failingLuiz Augusto von Dentz1-0/+7
This fixes make check failing because lack of suppression for bind on bt_log_open.
2022-08-04iso-tester: Test BT_DEFER_SETUP works with getsockoptLuiz Augusto von Dentz1-0/+13
This attempts to test BT_DEFER_SETUP is properly set when the test has defer flag set.
2022-07-28iso-test: Add ISO 48_2_1 Defer SendLuiz Augusto von Dentz1-0/+11
This adds ISO 48_2_1 Defer Send test which enables just output instead of both.
2022-07-22isotest: Add documentationLuiz Augusto von Dentz1-0/+202
This adds isotest.rst which documents the modes and options of isotest(1) and is then converted isotest.1 manpage.
2022-07-22tools: Add isotest toolLuiz Augusto von Dentz1-0/+1217
This adds isotest tool which can be used to test ISO sockets.
2022-07-22tools: Add iso-testerLuiz Augusto von Dentz2-2/+1705
This adds iso-tester which tests BTPROTO_ISO socket: Basic Framework - Success Basic ISO Socket - Success Basic ISO Get Socket Option - Success Basic ISO Set Socket Option - Success ISO QoS 8_1_1 - Success ISO QoS 8_2_1 - Success ISO QoS 16_1_1 - Success ISO QoS 16_2_1 - Success ISO QoS 16_2_1 CIG 0x01 - Success ISO QoS 16_2_1 CIG 0x01 CIS 0x01 - Success ISO QoS 24_1_1 - Success ISO QoS 24_2_1 - Success ISO QoS 32_1_1 - Success ISO QoS 32_2_1 - Success ISO QoS 44_1_1 - Success ISO QoS 44_2_1 - Success ISO QoS 48_1_1 - Success ISO QoS 48_2_1 - Success ISO QoS 48_3_1 - Success ISO QoS 48_4_1 - Success ISO QoS 48_5_1 - Success ISO QoS 48_6_1 - Success ISO QoS 8_1_2 - Success ISO QoS 8_2_2 - Success ISO QoS 16_1_2 - Success ISO QoS 16_2_2 - Success ISO QoS 24_1_2 - Success ISO QoS 24_2_2 - Success ISO QoS 32_1_2 - Success ISO QoS 32_2_2 - Success ISO QoS 44_1_2 - Success ISO QoS 44_2_2 - Success ISO QoS 48_1_2 - Success ISO QoS 48_2_2 - Success ISO QoS 48_3_2 - Success ISO QoS 48_4_2 - Success ISO QoS 48_5_2 - Success ISO QoS 48_6_2 - Success ISO QoS - Invalid ISO Connect2 CIG 0x01 - Success ISO Send - Success ISO Receive - Success ISO Defer - Success ISO Defer Send - Success ISO Defer Receive - Success ISO Defer Reject - Success ISO Send and Receive - Success ISO Broadcaster - Success ISO Broadcaster BIG 0x01 - Success ISO Broadcaster BIG 0x01 BIS 0x01 - Success ISO Broadcaster Receiver - Success
2022-07-22btio: Add support for ISO socketsLuiz Augusto von Dentz1-0/+110
This adds support to create objects that map to ISO sockets.
2022-07-22mgmt-tester: Fix Read Exp Feature testsLuiz Augusto von Dentz1-3/+11
This adds ISO Socket UUID as response to Read Exp Feature.
2022-07-01tools/test-runner: Fix errors reported by scan-buildTedd Ho-Jeong An1-3/+11
This patch fixes the errors reported by the scan-build. tools/test-runner.c:315:2: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] execve(argv[0], argv, qemu_envp); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tools/test-runner.c:554:6: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] if (chdir(home + 5) < 0) { ^~~~~~~~~~~~~~~ tools/test-runner.c:638:6: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] if (chdir(home + 5) < 0) { ^~~~~~~~~~~~~~~ tools/test-runner.c:695:6: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker] if (chdir(home + 5) < 0) { ^~~~~~~~~~~~~~~ tools/test-runner.c:984:3: warning: Value stored to 'serial_fd' is never read [deadcode.DeadStores] serial_fd = -1; ^ ~~
2022-07-01tools/btmgmt: Fix errors reported by scan-buildTedd Ho-Jeong An1-14/+11
This patch fixes the errors reported by the scan-build. tools/btmgmt.c:2699:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores] argc -= optind; ^ ~~~~~~ tools/btmgmt.c:2859:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores] argc -= optind; ^ ~~~~~~ tools/btmgmt.c:2860:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores] argv += optind; ^ ~~~~~~ tools/btmgmt.c:2934:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores] argc -= optind; ^ ~~~~~~ tools/btmgmt.c:2935:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores] argv += optind; ^ ~~~~~~ tools/btmgmt.c:3000:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores] argc -= optind; ^ ~~~~~~ tools/btmgmt.c:3001:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores] argv += optind; ^ ~~~~~~ tools/btmgmt.c:3261:11: warning: Value stored to 'index' during its initialization is never read [deadcode.DeadStores] uint16_t index = mgmt_index; ^~~~~ ~~~~~~~~~~ tools/btmgmt.c:3450:2: warning: Value stored to 'argc' is never read [deadcode.DeadStores] argc -= optind; ^ ~~~~~~ tools/btmgmt.c:3451:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores] argv += optind; ^ ~~~~~~ tools/btmgmt.c:4822:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker] memcpy(cp->data + uuid_bytes, adv_data, adv_len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tools/btmgmt.c:4823:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker] memcpy(cp->data + uuid_bytes + adv_len, scan_rsp, scan_rsp_len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tools/btmgmt.c:5244:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker] memcpy(cp->data + uuid_bytes, adv_data, adv_len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tools/btmgmt.c:5245:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker] memcpy(cp->data + uuid_bytes + adv_len, scan_rsp, scan_rsp_len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-06-23mgmt-tester: Fix null dereference issue reported by scan-buildTedd Ho-Jeong An1-0/+2
This patch fixes the null dereference reported by the scan-build. tools/mgmt-tester.c:12025:28: warning: Access to field 'cap_len' results in a dereference of a null pointer (loaded from variable 'rp') [core.NullDereference] if (sizeof(rp->cap_len) + rp->cap_len != length) { ^~~~~~~~~~~
2022-06-21tools/mgmt-tester: Add test case for scan response data is not updatingTedd Ho-Jeong An1-1/+84
This patch adds a test case to test if the scan response data is updated when the following scenarios are performed. 1. Add Extended Advertising Parameters Command 2. Add Extended Advertising Data Command w/ Scan Resp Data 3. Remove Advertising Command 4. Add Extended Advertising Parameters Command 5. Add Extended Advertising Data Command w/ Scan Resp Data 6. Host should set Scan Resp Data
2022-06-17test-runner: Fix issues found by coverityFrédéric Danis1-3/+13
2022-06-17tools/btmgmt: Add support Add Ext Adv commandTedd Ho-Jeong An1-0/+377
This patch adds new command to support the following MGMT API: Add Extended Advertising Parameters Command Add Extended Advertising Data Command
2022-06-13mgmt-tester: Fix regression with tests failing to setupLuiz Augusto von Dentz1-5/+0
This fixes the regression introduced by ab31e2f7e828df3d971cba6f12859edc69f149d5 which causes tests using add_advertising_mgmt_cmd_arr: Add Advertising - Success (Name+data+appear) Timed out Add Ext Advertising - Success (Name+data+appear) Timed out
2022-06-13test-runner: Add udevd and trigger eventsFrédéric Danis1-3/+80
Kernel events should have been managed so the audio card is accessible from PipeWire
2022-06-13test-runner: Add audio card supportFrédéric Danis1-1/+22
With this commit audio daemons can detect an audio card with output and input, allowing to test interaction between BlueZ and the audio daemon.
2022-06-13test-runner: Add DBus session supportFrédéric Danis1-12/+85
Audio daemons requests access to DBus session to start
2022-06-13btproxy: Allow to select multiple BT controllersFrédéric Danis1-16/+25
When running on a computer with a real Bluetooth controller (e.g. hci0) and multiple emulators (e.g. hci1 and hci2) it isn't possible to use the emulators with 2 test-runner vms. If btproxy is started without index parameter the first test-runner will use hci0, and btprox can't be started with multiple index parameters (e.g. -i1 -i2). This patch keeps the old beahvior when used without -i option, in this case it will try to use the first controller available. It also allows to select multiple controllers to be used by btproxy.
2022-06-02mgmt-tester: Fix build errorLuiz Augusto von Dentz1-21/+9
This fixes the following build error: CC tools/mgmt-tester.o tools/mgmt-tester.c: In function ‘setup_command_generic’: tools/mgmt-tester.c:7503:16: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘(const struct setup_mgmt_cmd *)test->setup_mgmt_cmd_arr + (sizetype)(i * 24)’ must not be NULL [-Werror=address] 7503 | for (; test->setup_mgmt_cmd_arr + i; ++i) { | ^~~~
2022-06-02test-runner: Fix not waiting for system_bus_socketLuiz Augusto von Dentz1-3/+3
This makes test-runner wait for system_bus_socket to be available before continuing otherwise the likes of bluetoothd would likely fail to start.
2022-05-31mesh-gatt: Fix use_after_freeGopal Tiwari1-1/+2
Following scenario happens when prov is false and we have double free as mentioned in the below bluez-5.64/tools/mesh-gatt/prov-db.c:847: freed_arg: "g_free" frees "in_str". bluez-5.64/tools/mesh-gatt/prov-db.c:867: double_free: Calling "g_free" frees pointer "in_str" which has already been freed.
2022-05-31meshctl: Fix possible use_after_freeGopal Tiwari1-1/+0
Reported by coverity tool as follows : bluez-5.64/tools/meshctl.c:1968: freed_arg: "g_free" frees "mesh_dir". bluez-5.64/tools/meshctl.c:2018: double_free: Calling "g_free" frees pointer "mesh_dir" which has already been freed.
2022-05-31obex-client: Fix leaked_handleGopal Tiwari1-0/+1
While performing static tool analysis using coverity found following reports for resouse leak bluez-5.64/tools/obex-client-tool.c:315: leaked_handle: Handle variable "sk" going out of scope leaks the handle.
2022-05-31mesh/mesh-db: Fix resource leaksGopal Tiwari1-0/+2
While performing static tool analysis using coverity found following reports for resouse leak bluez-5.64/tools/mesh/mesh-db.c:2388: leaked_handle: Handle variable "fd" going out of scope leaks the handle. bluez-5.64/tools/mesh/mesh-db.c:2388: leaked_storage: Variable "str" going out of scope leaks the storage it points to.
2022-05-31l2cap-tester: Fix leaked_handleGopal Tiwari1-0/+1
While performing static tool analysis using coverity found following reports for resouse leak bluez-5.64/tools/l2cap-tester.c:1712: leaked_handle: Handle variable "new_sk" going out of scope leaks the handle.
2022-05-31create-image: Fix leaked_handleGopal Tiwari1-4/+3
While performing static tool analysis using coverity found following reports for resouse leak bluez-5.64/tools/create-image.c:124: leaked_storage: Variable "map" going out of scope leaks the storage it points to.
2022-05-31cltest: Fix leaked_handleGopal Tiwari1-0/+1
While performing static tool analysis using coverity found following reports for resouse leak bluez-5.64/tools/cltest.c:75: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
2022-05-09tools: Fix handle leak in rfcommIldar Kamaletdinov1-0/+4
Some branches of execution can make handle (socket) leakage. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
2022-05-09tools: Fix memory leaks in btgatt-server/clientIldar Kamaletdinov2-2/+9
According to man buffer allocated by getline() should be freed by the user program even if getline() failed. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
2022-05-09tools: Fix memory leak in hciconfigIldar Kamaletdinov1-1/+5
printf() was using function that return dynamic allocated memory as a parameter. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
2022-04-18test-runner: Add dedicated option to start D-BusLuiz Augusto von Dentz1-11/+27
This adds a dedicated option to start D-Bus alone which can be useful when testing the bluetoothd with the likes of valgrind.
2022-04-04tools: Limit width of fields in sscanfIldar Kamaletdinov2-2/+2
In tools/btmgmt.c and tools/hex2hcd.c few sscanf does not limit width of fields. This could lead to static overflow and stack corruption. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
2022-04-04tools: Fix signed integer overflow in btsnoop.cIldar Kamaletdinov1-1/+1
If malformed packet is proceed with zero 'size' field we will face with wrong behaviour of write() call. Value 'toread - 1' gives wrong sign for value 'written' (-1) in write() call. To prevent this we should check that 'toread' is not equal to zero. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
2022-04-04tools: Fix buffer overflow in hciattach_tialt.cIldar Kamaletdinov1-1/+2
Array 'c_brf_chip' of size 8 could be accessed by index > 7. We should limit array access like in previous check at line 221. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
2022-04-04tools: Fix g_dbus_setup_private connection check in mpris-proxyFrédéric Danis1-1/+1
2022-03-30client: Add support for player submenuLuiz Augusto von Dentz1-1066/+15
This moves adds the functionality of bluetooth-player into bluetoothctl.
2022-03-08test-runner: Update help informationLuiz Augusto von Dentz1-0/+1
This updates usage so it list -l/--emulator properly: test-runner - Automated test execution utility Usage: test-runner [options] [--] <command> [args] Options: -a, --auto Find tests and run them -d, --dbus Start D-Bus daemon -m, --monitor Start btmon -l, --emulator Start btvirt -u, --unix [path] Provide serial device -q, --qemu <path> QEMU binary -k, --kernel <image> Kernel image (bzImage) -h, --help Show help options
2022-03-08test-runner: Fix -l/--emulatorLuiz Augusto von Dentz1-2/+7
This fixes -l/--emulator not able to start depending on what parameters are given as it was not setting the directory properly.
2022-03-01test-runner: Fix parsing of command lineLuiz Augusto von Dentz1-21/+7
Instead of parsing the command line, which can contain a shell script, run using /bin/sh so it allows more complex command line to be tested: sudo tools/test-runner -l -d -k <pathto/bzImage> -- 'client/bluetoothctl power on && sleep 2 && client/bluetoothctl power off'
2022-02-28test-runner: Add option to start emulatorLuiz Augusto von Dentz1-4/+82
This adds an option (-l/--emulator) to start btvirt before processing the command which is convenient to runs tools like bluetoothctl: sudo tools/test-runner -l -d -k <pathto/bzImage> -- client/bluetoothctl power on
2022-02-25btproxy: Attempt to bind the next indexLuiz Augusto von Dentz1-4/+17
If no specific index is given attempt to bind the next index if the current one is already in use.
2022-02-16tools/mesh-cfgtest: include limits.hMichael Nosthoff1-0/+1
mesh-cfgtest.c uses MAX_PATH so it should include limits.h. fixes compilation error with musl-based toolchains.
2022-02-15build: Fix errors with glibc < 2.25Fabrice Fontaine1-2/+1
getrandom and sys/random.h are only available since glibc 2.25: https://www.gnu.org/software/gnulib/manual/html_node/sys_002frandom_002eh.html resulting in the following build failures since version 5.63 and https://git.kernel.org/pub/scm/bluetooth/bluez.git/log/?qt=grep&q=getrandom: plugins/autopair.c:20:24: fatal error: sys/random.h: No such file or directory #include <sys/random.h> ^ To fix this build failure, add util_getrandom and a fallback (borrowed from pipewire and licensed under MIT): https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/pipewire/utils.c Fixes: - http://autobuild.buildroot.org/results/6b8870d12e0804d6154230a7322c49416c1dc0e2
2022-02-14rfcomm-tester: Increase amount of data from 8k to 32kLuiz Augusto von Dentz1-24/+66
This forces the behavior where not all data can be written at once so it is able to reproduce the from [1]. [1]https://bugzilla.kernel.org/show_bug.cgi?id=215594
2022-02-14obexctl: Add optional argument channel to connect commandLuiz Augusto von Dentz1-6/+21
This adds a third argument to connect command so a channel can be passed to CreateSession which is useful since it possible to force a specific RFCOMM channel.
2022-02-09rfcomm-tester: Add test to write big chunks of dataLuiz Augusto von Dentz1-7/+40
This attempts to test traffic similar to OBEX using big chunk of data.
2022-01-12tools/mesh-cfgclient: Fix config menu help messageInga Stotland1-3/+3
An info message suggesting to request a remote node composition should reference the correct menu command: "composition-get".
2022-01-12tools/mesh-cfgclient: Fix typos in config storageInga Stotland1-2/+2
Fix keyword typos and comments.
2022-01-06build: Replace use of g_memdup with util_memdupLuiz Augusto von Dentz2-9/+11
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.
2021-12-23build: Fix build when sanitizer are enabledLuiz Augusto von Dentz2-4/+9
This fixes various issues found when sanitizers are enabled.
2021-12-08tools/btgatt-server: Replace random number generation functionTedd Ho-Jeong An1-1/+6
This patch replaces the rand() function to the getrandom() syscall. It was reported by the Coverity scan rand() should not be used for security-related applications, because linear congruential algorithms are too easy to break
2021-11-10tools/mesh: Add <Vendor ID> option to sub-add cmdJefferson Zhai1-5/+11
If the Subscription being added is a Vendor Model, there needs to be a 4th parameter. Fixes oversight of not supporting vendor model in Meshctl.
2021-11-09mgmt-tester: Add test for Device Privacy Mode flagLuiz Augusto von Dentz1-0/+88
This tests the use of Set Device Flags to set Device Privacy Mode which results in the following sequence: @ MGMT Event: Command Compl.. (0x0001) plen 10 {0x0001} Set Device Flags (0x0050) plen 7 Status: Success (0x00) LE Address: BC:9A:78:56:34:12 (OUI BC-9A-78) < HCI Command: LE Set Exten.. (0x08|0x0042) plen 6 Extended scan: Disabled (0x00) Filter duplicates: Disabled (0x00) Duration: 0 msec (0x0000) Period: 0.00 sec (0x0000) = mgmt-tester: Set Device Flags (0x0050): Success (0x00) = mgmt-tester: Test condition complete, 4 left = mgmt-tester: New Device Flags Changed event received = mgmt-tester: Test condition complete, 3 left > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Scan Enable (0x08|0x0042) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Addre.. (0x08|0x002d) plen 1 Address resolution: Disabled (0x00) = mgmt-tester: HCI Command 0x2042 length 6 > HCI Event: Command Complete (0x0e) plen 4 LE Set Address Resolution Enable (0x08|0x002d) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Priva.. (0x08|0x004e) plen 8 Peer Identity address type: Public (0x00) Peer Identity address: BC:9A:78:56:34:12 (OUI BC-9A-78) Privacy Mode: Use Device Privacy (0x01) = mgmt-tester: HCI Command 0x202d length 1 = mgmt-tester: Test condition complete, 2 left > HCI Event: Command Complete (0x0e) plen 4 LE Set Privacy Mode (0x08|0x004e) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Addre.. (0x08|0x002d) plen 1 Address resolution: Enabled (0x01) = mgmt-tester: HCI Command 0x204e length 8 = mgmt-tester: Test condition complete, 1 left > HCI Event: Command Complete (0x0e) plen 4 LE Set Address Resolution Enable (0x08|0x002d) ncmd 1 Status: Success (0x00) < HCI Command: LE Set Exten.. (0x08|0x0041) plen 8 Own address type: Random (0x03) Filter policy: Ignore not in accept list (0x01) PHYs: 0x01 Entry 0: LE 1M Type: Passive (0x00) Interval: 60.000 msec (0x0060) Window: 30.000 msec (0x0030) = mgmt-tester: HCI Command 0x202d length 1 = mgmt-tester: Test condition complete, 0 left
2021-11-01mgmt-tester: Add test for Limited/Device PrivacyLuiz Augusto von Dentz1-8/+25
This adds a test for Limited/Device Privacy (0x02): @ MGMT Command: Set Privacy (0x002f) plen 17 Privacy: Limited (0x02) Key: 01020304050607080102030405060708 @ MGMT Event: Command Complete (0x0001) plen 7 Set Privacy (0x002f) plen 4 Status: Success (0x00) Current settings: 0x00002080 BR/EDR Privacy @ MGMT Event: New Settings (0x0006) plen 4 Current settings: 0x00002080 BR/EDR Privacy
2021-10-29tools/mgmt-tester: Add LL Privacy test casesTedd Ho-Jeong An1-261/+1975
This patch adds LL Privacy related test cases. Multi Ext Advertising - Success 3 (Add 2 Advs) Multi Ext Advertising - Success 4 (Remove Adv) Multi Ext Advertising - Success 5 (Remove all) Multi Ext Advertising - Success 6 (Add w/o power on) Multi Ext Advertising - Fail (Add MAX) LL Privacy - Add Device 1 (Add to AL) LL Privacy - Add Device 2 (Add to RL) LL Privacy - Add Device 3 (Enable RL) LL Privacy - Add Device 4 (2 Devices to AL) LL Privacy - Add Device 5 (2 Devices to RL) LL Privacy - Add Device 6 (RL is full) LL Privacy - Add Device 7 (WL is full) LL Privacy - Add Device 8 (Disable Adv) LL Privacy - Add Device 9 (Multi Adv) LL Privacy - Add Device 10 (Multi Dev and Multi Adv) LL Privacy - Remove Device 1 (Remove from AL) LL Privacy - Remove Device 2 (Remove from RL) LL Privacy - Remove Device 3 (Disable RL) LL Privacy - Remove Device 4 (Disable Adv) LL Privacy - Remove Device 5 (Multi Adv) LL Privacy - Start Discovery 1 (Disable RL) LL Privacy - Start Discovery 2 (Disable RL) LL Privacy - Advertising 1 (Scan Results) LL Privacy - Acceptor 1 LL Privacy - Acceptor 2 LL Privacy - Pair 1 LL Privacy - Pair 2 (Add to AL) LL Privacy - Unpair 1 LL Privacy - Unpair 2 (Remove from AL)
2021-10-29tools/mgmt-tester: Update the expected manufacturer of emulatorTedd Ho-Jeong An1-5/+5
This patch updates the expected manufacturer of the emulator for the following test cases: > Read Ext Controller Info 1 Failed > Read Ext Controller Info 2 Failed > Read Ext Controller Info 3 Failed > Read Ext Controller Info 4 Failed > Read Ext Controller Info 5 Failed
2021-10-25tools/mgmt-tester: Add support for experimental feature in setupTedd Ho-Jeong An1-0/+18
This patch adds support for experimental feature in setup_settings options.
2021-10-21mgmt-tester: Fix expected manufacturerLuiz Augusto von Dentz1-1/+1
The emulator is now using Linux Foundation manufacturer ID.
2021-10-21tools/hcitool: Fix the descriptions of leal* commandsArchie Pusaka1-4/+4
The descriptions of leal* commands are copied from lewl* commands. However they should use "accept list" instead.
2021-10-18mgmt-tester: Make use of vhci_set_force_suspend/vhci_set_force_wakeupLuiz Augusto von Dentz1-81/+24
This replaces the direct setting debugfs to use vhci instance which properly stores the controller index so it can be used even if there are real controllers in the system.
2021-10-08tools/mesh-cfg-client: Fix NULL pointer dereferencingInga Stotland3-3/+8
This patch fixes a number of potential NULL pointer dereferencing cases.
2021-10-08tools/mgmt-tester: Add more suspend/resume test casesTedd Ho-Jeong An1-7/+164
This patch adds more suspend/resuem test cases like - Discover -> Suspend - Discover -> Suspend -> Resume - Suspend -> Resume -> Suspend -> Resume
2021-10-08tools/mgmt-tester: Updates Experimental Feature test casesTedd Ho-Jeong An1-3/+89
This patch updates/adds test cases for Read and Set Experimental Feature commands.
2021-10-06tools/mgmt-tester: Update the correct suspend reason for disconnectTedd Ho-Jeong An1-8/+4
This patch fixes the suspend reason for the pairing test cases to the disconnect.
2021-10-05tools/mgmt-tester: Fix the suspend reason codeTedd Ho-Jeong An1-6/+80
This patch fixes the suspend reason code to align with the corrent kernel implementation.
2021-10-04tools/mgmt-tester: Add test cases for load_long_term_keys commandTedd Ho-Jeong An1-0/+299
This patch adds extra test cases for load_long_term_keys command.
2021-09-29tools/mgmt-tester: Add suspend/resume test casesTedd Ho-Jeong An1-0/+295
This patch adds the suspend/resume test cases: Suspend/Resume - Success 1 (Suspend) Suspend/Resume - Success 2 (Resume) Suspend/Resume - Success 3 (Device in WL) Suspend/Resume - Success 4 (Advertising) Suspend/Resume - Success 5 (Pairing - Legacy) Suspend/Resume - Success 6 (Pairing - SSP)