Skip to contentSkip to conversation

tools/mgmt-tester: Add RPA Add Device test case

PATCH Superseded Jakub Pawlowski 1 participant 2 messages Jul 13, 2015 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tools/mgmt-tester: Add RPA Add Device test case

This test verify if kernel correctly responds with error to Add Device command with Resolvable Private Address.

---
 tools/mgmt-tester.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
tools/mgmt-tester.c +21 -0
index 46b088c..9b71156 100644
@@ -3665,6 +3665,24 @@ static const struct generic_data add_device_fail_3 = {
 	.expect_status = MGMT_STATUS_INVALID_PARAMS,
 };
 
+static const uint8_t add_device_nval_4[] = {
+					0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc,
+					0x02,
+					0x02,
+};
+static const uint8_t add_device_rsp_4[] =  {
+					0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc,
+					0x02,
+};
+static const struct generic_data add_device_fail_4 = {
+	.send_opcode = MGMT_OP_ADD_DEVICE,
+	.send_param = add_device_nval_4,
+	.send_len = sizeof(add_device_nval_4),
+	.expect_param = add_device_rsp_4,
+	.expect_len = sizeof(add_device_rsp_4),
+	.expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
 static const uint8_t add_device_success_param_1[] = {
 					0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc,
 					0x00,
@@ -6696,6 +6714,9 @@ int main(int argc, char *argv[])
 	test_bredrle("Add Device - Invalid Params 3",
 				&add_device_fail_3,
 				NULL, test_command_generic);
+	test_bredrle("Add Device - Invalid Params 4",
+				&add_device_fail_4,
+				NULL, test_command_generic);
 	test_bredrle("Add Device - Success 1",
 				&add_device_success_1,
 				NULL, test_command_generic);
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 tools/mgmt-tester: Add RPA Remove Device test case

This test verify if kernel correctly responds with error to Remove Device command with Resolvable Private Address.

---
 tools/mgmt-tester.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
tools/mgmt-tester.c +16 -0
index 9b71156..9ace20a 100644
@@ -3797,6 +3797,19 @@ static const struct generic_data remove_device_fail_2 = {
 	.expect_status = MGMT_STATUS_INVALID_PARAMS,
 };
 
+static const uint8_t remove_device_param_3[] = {
+					0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc,
+					0x02,
+};
+static const struct generic_data remove_device_fail_3 = {
+	.send_opcode = MGMT_OP_REMOVE_DEVICE,
+	.send_param = remove_device_param_3,
+	.send_len = sizeof(remove_device_param_3),
+	.expect_param = remove_device_param_3,
+	.expect_len = sizeof(remove_device_param_3),
+	.expect_status = MGMT_STATUS_INVALID_PARAMS,
+};
+
 static const struct generic_data remove_device_success_1 = {
 	.send_opcode = MGMT_OP_REMOVE_DEVICE,
 	.send_param = remove_device_param_1,
@@ -6739,6 +6752,9 @@ int main(int argc, char *argv[])
 	test_bredrle("Remove Device - Invalid Params 2",
 				&remove_device_fail_2,
 				NULL, test_command_generic);
+	test_bredrle("Remove Device - Invalid Params 3",
+				&remove_device_fail_3,
+				NULL, test_command_generic);
 	test_bredrle("Remove Device - Success 1",
 				&remove_device_success_1,
 				setup_add_device, test_command_generic);
Signature · 1 line
2.1.4