diff mbox series

[RFC,BlueZ,v4,1/3] emulator/btdev: Update the white list and resolving list size

Message ID 20210626063010.152987-1-hj.tedd.an@gmail.com (mailing list archive)
State Superseded
Headers show
Series [RFC,BlueZ,v4,1/3] emulator/btdev: Update the white list and resolving list size | expand

Commit Message

Tedd Ho-Jeong An June 26, 2021, 6:30 a.m. UTC
From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch updates the white list and resolving list size to small
number.
Also, it update the size of white list and resolving list to 1 more than
actual size when it is read via HCI read size commands. This is used to
simulate the case when the list is out of space.

Note that the read list size may not represent the current actual list
size depends on the device vendor.
---
 emulator/btdev.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Comments

bluez.test.bot@gmail.com June 26, 2021, 7:08 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=507457

---Test result---

Test Summary:
CheckPatch                    FAIL      2.14 seconds
GitLint                       FAIL      0.35 seconds
Prep - Setup ELL              PASS      46.45 seconds
Build - Prep                  PASS      0.14 seconds
Build - Configure             PASS      8.02 seconds
Build - Make                  PASS      202.40 seconds
Make Check                    PASS      9.53 seconds
Make Distcheck                PASS      239.28 seconds
Build w/ext ELL - Configure   PASS      8.24 seconds
Build w/ext ELL - Make        PASS      190.10 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
emulator/btdev: clean up the queue before closing the test
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#20: 
==50==    by 0x48B578E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6400.6)

- total: 0 errors, 1 warnings, 18 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] emulator/btdev: clean up the queue before closing the test" has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL
Desc: Run gitlint with rule in .gitlint
Output:
emulator/btdev: clean up the queue before closing the test
17: B1 Line exceeds max length (87>80): "==50==    by 0x48B578E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6400.6)"
32: B1 Line exceeds max length (87>80): "==50==    by 0x48B578E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6400.6)"


##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz July 1, 2021, 9:43 p.m. UTC | #2
Hi Tedd,

On Fri, Jun 25, 2021 at 11:31 PM Tedd Ho-Jeong An <hj.tedd.an@gmail.com> wrote:
>
> From: Tedd Ho-Jeong An <tedd.an@intel.com>
>
> This patch updates the white list and resolving list size to small
> number.
> Also, it update the size of white list and resolving list to 1 more than
> actual size when it is read via HCI read size commands. This is used to
> simulate the case when the list is out of space.
>
> Note that the read list size may not represent the current actual list
> size depends on the device vendor.
> ---
>  emulator/btdev.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/emulator/btdev.c b/emulator/btdev.c
> index 90457a5aa..202fc7996 100644
> --- a/emulator/btdev.c
> +++ b/emulator/btdev.c
> @@ -33,8 +33,8 @@
>  #include "monitor/bt.h"
>  #include "btdev.h"
>
> -#define WL_SIZE                        16
> -#define RL_SIZE                        16
> +#define WL_SIZE                        3
> +#define RL_SIZE                        3
>  #define CIS_SIZE               3
>
>  #define has_bredr(btdev)       (!((btdev)->features[4] & 0x20))
> @@ -3402,7 +3402,12 @@ static int cmd_read_wl_size(struct btdev *dev, const void *data, uint8_t len)
>         struct bt_hci_rsp_le_read_white_list_size rsp;
>
>         rsp.status = BT_HCI_ERR_SUCCESS;
> -       rsp.size = WL_SIZE;
> +       /* The size is not fixed and the actual list size can be different from
> +        * the returned size here.
> +        * In order to test such cases, return more than allocated size, and
> +        * HCI Add device cmd will return the Memory Capacity Exceeded(0x07)
> +        */
> +       rsp.size = WL_SIZE + 1;
>         cmd_complete(dev, BT_HCI_CMD_LE_READ_WHITE_LIST_SIZE, &rsp,
>                                                 sizeof(rsp));
>
> @@ -3687,7 +3692,12 @@ static int cmd_read_rl_size(struct btdev *dev, const void *data, uint8_t len)
>         struct bt_hci_rsp_le_read_resolv_list_size rsp;
>
>         rsp.status = BT_HCI_ERR_SUCCESS;
> -       rsp.size = RL_SIZE;
> +       /* The size is not fixed and the actual list size can be different from
> +        * the returned size here.
> +        * In order to test such cases, return more than allocated size, and
> +        * HCI Add device cmd will return the Memory Capacity Exceeded(0x07)
> +        */
> +       rsp.size = RL_SIZE + 1;
>
>         cmd_complete(dev, BT_HCI_CMD_LE_READ_RESOLV_LIST_SIZE,
>                                                         &rsp, sizeof(rsp));
> --
> 2.26.3


This one I think we need to rework somehow, the idea is that we have
this lists set dynamically in order to test the HCI error so Id have
some function limit the amount of instances that can be used instead
of reporting a wrong number like this.
diff mbox series

Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 90457a5aa..202fc7996 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -33,8 +33,8 @@ 
 #include "monitor/bt.h"
 #include "btdev.h"
 
-#define WL_SIZE			16
-#define RL_SIZE			16
+#define WL_SIZE			3
+#define RL_SIZE			3
 #define CIS_SIZE		3
 
 #define has_bredr(btdev)	(!((btdev)->features[4] & 0x20))
@@ -3402,7 +3402,12 @@  static int cmd_read_wl_size(struct btdev *dev, const void *data, uint8_t len)
 	struct bt_hci_rsp_le_read_white_list_size rsp;
 
 	rsp.status = BT_HCI_ERR_SUCCESS;
-	rsp.size = WL_SIZE;
+	/* The size is not fixed and the actual list size can be different from
+	 * the returned size here.
+	 * In order to test such cases, return more than allocated size, and
+	 * HCI Add device cmd will return the Memory Capacity Exceeded(0x07)
+	 */
+	rsp.size = WL_SIZE + 1;
 	cmd_complete(dev, BT_HCI_CMD_LE_READ_WHITE_LIST_SIZE, &rsp,
 						sizeof(rsp));
 
@@ -3687,7 +3692,12 @@  static int cmd_read_rl_size(struct btdev *dev, const void *data, uint8_t len)
 	struct bt_hci_rsp_le_read_resolv_list_size rsp;
 
 	rsp.status = BT_HCI_ERR_SUCCESS;
-	rsp.size = RL_SIZE;
+	/* The size is not fixed and the actual list size can be different from
+	 * the returned size here.
+	 * In order to test such cases, return more than allocated size, and
+	 * HCI Add device cmd will return the Memory Capacity Exceeded(0x07)
+	 */
+	rsp.size = RL_SIZE + 1;
 
 	cmd_complete(dev, BT_HCI_CMD_LE_READ_RESOLV_LIST_SIZE,
 							&rsp, sizeof(rsp));