* [PATCH 1/2] tools/mgmt-tester: Add RPA Add Device test case
@ 2015-07-13 9:26 Jakub Pawlowski
2015-07-13 9:26 ` [PATCH 2/2] tools/mgmt-tester: Add RPA Remove " Jakub Pawlowski
2015-07-13 11:49 ` [PATCH 1/2] tools/mgmt-tester: Add RPA Add " Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Pawlowski @ 2015-07-13 9:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jakub Pawlowski
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(+)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 46b088c..f12b55c 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -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_FAILED,
+};
+
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);
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] tools/mgmt-tester: Add RPA Remove Device test case
2015-07-13 9:26 [PATCH 1/2] tools/mgmt-tester: Add RPA Add Device test case Jakub Pawlowski
@ 2015-07-13 9:26 ` Jakub Pawlowski
2015-07-13 11:49 ` [PATCH 1/2] tools/mgmt-tester: Add RPA Add " Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Pawlowski @ 2015-07-13 9:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jakub Pawlowski
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(+)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index f12b55c..4e65394 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -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);
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] tools/mgmt-tester: Add RPA Add Device test case
2015-07-13 9:26 [PATCH 1/2] tools/mgmt-tester: Add RPA Add Device test case Jakub Pawlowski
2015-07-13 9:26 ` [PATCH 2/2] tools/mgmt-tester: Add RPA Remove " Jakub Pawlowski
@ 2015-07-13 11:49 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2015-07-13 11:49 UTC (permalink / raw)
To: Jakub Pawlowski; +Cc: linux-bluetooth
Hi Jakub,
On Mon, Jul 13, 2015, Jakub Pawlowski wrote:
> +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_FAILED,
Why is the kernel returning FAILED here? Wouldn't INVALID_PARAMS be a
more accurate error (since you're passing invalid parameters to the mgmt
command).
If I got this right it's the hci_conn_params_set() call that's failing
and mapping to FAILED? You might want to update that function to use
a ERR_PTR() return and then look at the returned value to decide what
mgmt error to send.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-13 11:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 9:26 [PATCH 1/2] tools/mgmt-tester: Add RPA Add Device test case Jakub Pawlowski
2015-07-13 9:26 ` [PATCH 2/2] tools/mgmt-tester: Add RPA Remove " Jakub Pawlowski
2015-07-13 11:49 ` [PATCH 1/2] tools/mgmt-tester: Add RPA Add " Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).