From: Inga Stotland <inga.stotland@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com, Inga Stotland <inga.stotland@intel.com>
Subject: [PATCH BlueZ] tools/mgmt-tester: Fix "Remove Ext Advertising" case
Date: Wed, 19 May 2021 14:19:07 -0700 [thread overview]
Message-ID: <20210519211907.157397-1-inga.stotland@intel.com> (raw)
This fixes the expected behavior of the following test case:
"Remove Ext Advertising - Success 1", when the fail status
was erroneously overwritten with success:
<log snip>
New Advertising Removed event received
Test condition complete, 2 left
HCI Command 0x2039 length 6
Invalid parameter size for HCI command
Remove Ext Advertising - Success 1 - test failed
HCI Command 0x203c length 1
HCI Command 0x2039 length 2
Test condition complete, 1 left
Remove Advertising (0x003f): Success (0x00)
Test condition complete, 0 left
Remove Ext Advertising - Success 1 - test passed
The expected HCI command to disable extended advertisement for a
non-zero number of sets should contain the specified number the
advertising sets.
In this particular test case, number of sets is set to 1 and,
as a result, the expected HCI command should be:
"00 | 01 | 01 00 00 00"
disable | number of sets | set info
Also, to avoid false positives/negatives, skip exmination of HCI
commands after the test conditions are met.
---
tools/mgmt-tester.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index de35008ad..1b9dc0445 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -6671,7 +6671,7 @@ static void command_hci_callback(uint16_t opcode, const void *param,
tester_print("HCI Command 0x%04x length %u", opcode, length);
- if (opcode != test->expect_hci_command)
+ if (opcode != test->expect_hci_command || data->unmet_conditions <= 0)
return;
if (test->expect_hci_func)
@@ -7720,6 +7720,10 @@ static const char set_ext_adv_disable_param[] = {
0x00, 0x00,
};
+static const char set_ext_adv_disable_param_1[] = {
+ 0x00, 0x01, 0x01, 0x00, 0x00, 0x00
+};
+
static const struct generic_data add_ext_advertising_timeout_expired = {
.expect_alt_ev = MGMT_EV_ADVERTISING_REMOVED,
.expect_alt_ev_param = advertising_instance1_param,
@@ -7747,8 +7751,8 @@ static const struct generic_data remove_ext_advertising_success_1 = {
.expect_alt_ev_param = advertising_instance1_param,
.expect_alt_ev_len = sizeof(advertising_instance1_param),
.expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE,
- .expect_hci_param = set_ext_adv_disable_param,
- .expect_hci_len = sizeof(set_ext_adv_disable_param),
+ .expect_hci_param = set_ext_adv_disable_param_1,
+ .expect_hci_len = sizeof(set_ext_adv_disable_param_1),
};
static const struct generic_data remove_ext_advertising_success_2 = {
--
2.26.3
next reply other threads:[~2021-05-19 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 21:19 Inga Stotland [this message]
2021-05-19 21:42 ` [BlueZ] tools/mgmt-tester: Fix "Remove Ext Advertising" case bluez.test.bot
2021-05-22 0:27 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210519211907.157397-1-inga.stotland@intel.com \
--to=inga.stotland@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).