tools/mgmt-tester: Fix expected HCI command accounting
authorInga Stotland <inga.stotland@intel.com>
Fri, 4 Jun 2021 17:59:13 +0000 (10:59 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:35 +0000 (19:08 +0530)
commit2d26d223b3df0635df5793bf4a3f9881207cff38
tree64c26b4825ced5feae2ecf7b1f2984cf59c0704c
parentae3698dd91ecc6c593fa956db38fafd7a95fc05d
tools/mgmt-tester: Fix expected HCI command accounting

This fixes test condition count in the expected HCI command
callback.

When the expected HCI opcode is detected, mark the condition
as done. Any subsequent HCI commands are ignored.

Without this fix, in couple of test cases where the expected HCI
command is detected more than once, the test may be erroneously
reported as a failure or prematurely declared as a success before
waiting on an expected MGMT event condition.

The test cases where this behavior is fixed:
Remove Ext Advertising - Success 1
Remove Ext Advertising - Success 2
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/mgmt-tester.c