tools/mgmt-tester: Add tests for individual ext adv MGMT commands
authorDaniel Winkler <danielwinkler@google.com>
Tue, 24 Nov 2020 17:31:23 +0000 (09:31 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
commit56d91a907ce0ddd1852eaa3fd2c634fd37ac86b0
treec424bca461680ee6b78f0a2a45b4f7e36b8e9108
parent9fc7a8a9964f7855c64808209065e85c5f9f6bbe
tools/mgmt-tester: Add tests for individual ext adv MGMT commands

The new extended advertising MGMT commands are paired, requiring both a
Set Parameters and Set Data command to configure a new advertisement.
This patch adds the following new tests to test these APIs:

1. Verify that if the adapter is unpowered, MGMT_OP_ADD_EXT_ADV_PARAMS
will return a rejected status.

2. Verify that MGMT_OP_ADD_EXT_ADV_PARAMS will return an invalid
parameters status if the data payload is malformed.

3. Verify that MGMT_OP_ADD_EXT_ADV_PARAMS is successful on BT4 if
request is valid by checking MGMT return value.

4. Verify that MGMT_OP_ADD_EXT_ADV_PARAMS is successful on BT5 if
request is valid by checking MGMT return value and that HCI traffic
contains a correct advertising parameters request.

5. Verify that if a MGMT_OP_ADD_EXT_ADV_DATA request is received for an
advertising instance that is unknown, i.e. MGMT_OP_ADD_EXT_ADV_PARAMS
was not yet called, an invalid parameters status is returned.

Tests 6-8 first call MGMT_OP_ADD_EXT_ADV_PARAMS successfully in setup to
then validate the contents of the subsequent MGMT_OP_ADD_EXT_ADV_DATA
call.

6. Verify that if MGMT_OP_ADD_EXT_ADV_DATA is passed an invalid tlv
structure, an invalid parameters status is returned.

7. Verify that if MGMT_OP_ADD_EXT_ADV_DATA contains a valid structure,
the hci traffic contain a correctly formed Adv Data hci request.

8. Verify that if MGMT_OP_ADD_EXT_ADV_DATA contains a valid structure,
the hci traffic contain a correctly formed Adv Scan Response hci
request.

Reviewed-by: Manish Mandlik <mmandlik@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/mgmt-tester.c