Skip to contentSkip to conversation

Add mesh testing support

PATCH Superseded Brian Gix 2 participants 4 messages Aug 31, 2022

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Brian Gix

author
#0 lore raw

v3 cover Add mesh testing support

This patch set reserves MGMT events and opcodes for Mesh, and adds a new unit tester for those features: mesh-tester

v2 && v3: Fix whitespace

Brian Gix (2):
lib: Add mgmt opcodes and events for Mesh
tools: Add mesh-tester to test Kernel mesh support

 Makefile.tools      |   12 +-
 lib/mgmt.h          |   47 ++
 tools/mesh-tester.c | 1436 +++++++++++++++++++++++++++++++++++++++++++
 tools/test-runner.c |    2 +
 4 files changed, 1496 insertions(+), 1 deletion(-)
 create mode 100644 tools/mesh-tester.c
Signature · 1 line
2.37.2
author
#1 lore raw

PATCH v3 1/2 lib: Add mgmt opcodes and events for Mesh

---
 lib/mgmt.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
lib/mgmt.h +47 -0
index 430bd0ef6..79b77d31a 100644
@@ -760,6 +760,38 @@ struct mgmt_cp_add_adv_patterns_monitor_rssi {
 	struct mgmt_adv_pattern patterns[0];
 } __packed;
 
+#define MGMT_OP_SET_MESH_RECEIVER		0x0057
+struct mgmt_cp_set_mesh {
+	uint8_t enable;
+	uint16_t window;
+	uint16_t period;
+	uint8_t num_ad_types;
+	uint8_t ad_types[];
+} __packed;
+
+#define MGMT_OP_MESH_READ_FEATURES	0x0058
+struct mgmt_rp_mesh_read_features {
+	uint16_t index;
+	uint8_t max_handles;
+	uint8_t used_handles;
+	uint8_t handles[];
+} __packed;
+
+#define MGMT_OP_MESH_SEND		0x0059
+struct mgmt_cp_mesh_send {
+	struct mgmt_addr_info addr;
+	uint64_t instant;
+	uint16_t delay;
+	uint8_t cnt;
+	uint8_t adv_data_len;
+	uint8_t adv_data[];
+} __packed;
+
+#define MGMT_OP_MESH_SEND_CANCEL	0x005A
+struct mgmt_cp_mesh_send_cancel {
+	uint8_t handle;
+} __packed;
+
 #define MGMT_EV_CMD_COMPLETE		0x0001
 struct mgmt_ev_cmd_complete {
 	uint16_t opcode;
@@ -1035,6 +1067,21 @@ struct mgmt_ev_adv_monitor_device_lost {
 	struct mgmt_addr_info addr;
 } __packed;
 
+#define MGMT_EV_MESH_DEVICE_FOUND	0x0031
+struct mgmt_ev_mesh_device_found {
+	struct mgmt_addr_info addr;
+	int8_t rssi;
+	uint64_t instant;
+	uint32_t flags;
+	uint16_t eir_len;
+	uint8_t	eir[];
+} __packed;
+
+#define MGMT_EV_MESH_PACKET_CMPLT		0x0032
+struct mgmt_ev_mesh_pkt_cmplt {
+	uint8_t	handle;
+} __packed;
+
 static const char *mgmt_op[] = {
 	"<0x0000>",
 	"Read Version",
Signature · 1 line
2.37.2
#2 lore raw

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=672980

---Test result---

Test Summary:

CheckPatch                    FAIL      2.87 seconds
GitLint                       PASS      0.96 seconds
Prep - Setup ELL              PASS      31.96 seconds
Build - Prep                  PASS      0.66 seconds
Build - Configure             PASS      10.04 seconds
Build - Make                  PASS      981.55 seconds
Make Check                    PASS      12.52 seconds
Make Check w/Valgrind         PASS      347.96 seconds
Make Distcheck                PASS      292.35 seconds
Build w/ext ELL - Configure   PASS      10.16 seconds
Build w/ext ELL - Make        PASS      101.38 seconds
Incremental Build w/ patches  PASS      238.65 seconds
Scan Build                    PASS      784.56 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf Output:
[BlueZ,v3,2/2] tools: Add mesh-tester to test Kernel mesh support WARNING:LONG_LINE: line length of 81 exceeds 80 columns #362: FILE: tools/mesh-tester.c:252:
+ sizeof(set_exp_feat_param_mesh), set_exp_feat_param_mesh,

WARNING:LONG_LINE: line length of 83 exceeds 80 columns #502: FILE: tools/mesh-tester.c:392:
+ sizeof(set_exp_feat_param_debug), set_exp_feat_param_debug,

WARNING:LONG_LINE: line length of 81 exceeds 80 columns #592: FILE: tools/mesh-tester.c:482:
+ test_pre_setup, test_setup, func, NULL, \

WARNING:LONG_LINE: line length of 83 exceeds 80 columns #593: FILE: tools/mesh-tester.c:483:
+ test_post_teardown, timeout, user, free); \

WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line #728: FILE: tools/mesh-tester.c:618:
+/* Read HCI commands in the expect_hci_list and add it to the queue +*/

ERROR:SWITCH_CASE_INDENT_LEVEL: switch and case should be at the same indent #1040: FILE: tools/mesh-tester.c:930:
+ switch (opcode) {
+ case BT_HCI_CMD_WRITE_SCAN_ENABLE:
+ case BT_HCI_CMD_LE_SET_ADV_ENABLE:
+ case BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE:
[...]
+ case BT_HCI_CMD_WRITE_SIMPLE_PAIRING_MODE:
[...]
+ default:

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #1249: FILE: tools/mesh-tester.c:1139:
+ * for a callback. */

WARNING:LONG_LINE: line length of 81 exceeds 80 columns #1441: FILE: tools/mesh-tester.c:1331:
+ sizeof(set_exp_feat_param_mesh), set_exp_feat_param_mesh,

/github/workspace/src/12961464.patch total: 1 errors, 7 warnings, 1474 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.

/github/workspace/src/12961464.patch 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.

---
Regards,
Linux Bluetooth

author
#3 lore raw

PATCH v3 2/2 tools: Add mesh-tester to test Kernel mesh support

In reply to Brian Gix

Ever growing set of tests for Mesh kernel support

---
 Makefile.tools      |   12 +-
 tools/mesh-tester.c | 1436 +++++++++++++++++++++++++++++++++++++++++++
 tools/test-runner.c |    2 +
 3 files changed, 1449 insertions(+), 1 deletion(-)
 create mode 100644 tools/mesh-tester.c
Makefile.tools +11 -1
index 9412aed36..f4b951474 100644
@@ -86,7 +86,8 @@ noinst_PROGRAMS += emulator/btvirt emulator/b1ee emulator/hfp \
 					tools/l2cap-tester tools/sco-tester \
 					tools/smp-tester tools/hci-tester \
 					tools/rfcomm-tester tools/bnep-tester \
-					tools/userchan-tester tools/iso-tester
+					tools/userchan-tester tools/iso-tester \
+					tools/mesh-tester
 
 emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \
 				emulator/serial.h emulator/serial.c \
@@ -127,6 +128,15 @@ tools_mgmt_tester_SOURCES = tools/mgmt-tester.c monitor/bt.h \
 tools_mgmt_tester_LDADD = lib/libbluetooth-internal.la \
 				src/libshared-glib.la $(GLIB_LIBS)
 
+tools_mesh_tester_SOURCES = tools/mesh-tester.c monitor/bt.h \
+				emulator/hciemu.h emulator/hciemu.c \
+				emulator/vhci.h emulator/vhci.c \
+				emulator/btdev.h emulator/btdev.c \
+				emulator/bthost.h emulator/bthost.c \
+				emulator/smp.c
+tools_mesh_tester_LDADD = lib/libbluetooth-internal.la \
+				src/libshared-glib.la $(GLIB_LIBS)
+
 tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \
 				emulator/hciemu.h emulator/hciemu.c \
 				emulator/vhci.h emulator/vhci.c \
tools/mesh-tester.c new file +1436 -0

1,436 lines not on this page · raw message

tools/test-runner.c +2 -0
index 71d50e015..e1794e8c1 100644
@@ -614,6 +614,7 @@ static const char *test_table[] = {
 	"rfcomm-tester",
 	"sco-tester",
 	"iso-tester",
+	"mesh-tester",
 	"bnep-tester",
 	"check-selftest",
 	"tools/mgmt-tester",
@@ -622,6 +623,7 @@ static const char *test_table[] = {
 	"tools/rfcomm-tester",
 	"tools/sco-tester",
 	"tools/iso-tester",
+	"tools/mesh-tester",
 	"tools/bnep-tester",
 	"tools/check-selftest",
 	NULL
Signature · 1 line
2.37.2