From 7385bbe1e10231a307ca4914a250c6ee6c90f691 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 30 Jul 2014 13:31:41 +0300 Subject: [PATCH] mgmt-tester: Add basic Remove Device invalid params tests --- tools/mgmt-tester.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index c4f9c9171..ea8440ce3 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -3054,6 +3054,36 @@ static const struct generic_data add_device_success_5 = { .expect_hci_len = sizeof(le_scan_enable), }; +static const uint8_t remove_device_nval_1[] = { + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, + 0xff, +}; +static const struct generic_data remove_device_fail_1 = { + .send_opcode = MGMT_OP_REMOVE_DEVICE, + .send_param = remove_device_nval_1, + .send_len = sizeof(remove_device_nval_1), + .expect_param = remove_device_nval_1, + .expect_len = sizeof(remove_device_nval_1), + .expect_status = MGMT_STATUS_INVALID_PARAMS, +}; + +static const uint8_t remove_device_param_1[] = { + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, + 0x00, +}; +static const uint8_t remove_device_rsp[] = { + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, + 0x00, +}; +static const struct generic_data remove_device_fail_2 = { + .send_opcode = MGMT_OP_REMOVE_DEVICE, + .send_param = remove_device_param_1, + .send_len = sizeof(remove_device_param_1), + .expect_param = remove_device_rsp, + .expect_len = sizeof(remove_device_rsp), + .expect_status = MGMT_STATUS_INVALID_PARAMS, +}; + static void client_cmd_complete(uint16_t opcode, uint8_t status, const void *param, uint8_t len, void *user_data) @@ -4467,5 +4497,12 @@ int main(int argc, char *argv[]) &add_device_success_5, NULL, test_command_generic); + test_bredrle("Remove Device - Invalid Params 1", + &remove_device_fail_1, + NULL, test_command_generic); + test_bredrle("Remove Device - Invalid Params 2", + &remove_device_fail_2, + NULL, test_command_generic); + return tester_run(); } -- 2.47.3