All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] tools/mgmt-tester: Fix expected HCI command accounting
@ 2021-05-25  5:39 Inga Stotland
  2021-05-26  5:45 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Inga Stotland @ 2021-05-25  5:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, Inga Stotland

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

When the expected opcode has been detected, the test condition
is either marked as completed in case of passing the checks or the
test failure is reported. Any subsequent HCI commandis logged only as
informational and does not contribute towards test accounting.

Without the fix, in number of test cases where the expected HCI command
is detected more than once, the test condition countdown goes into
negative numbers or the test is erroneously reported as failed.
---
 tools/mgmt-tester.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index c9de770c1..22b6a3387 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -6882,6 +6882,22 @@ static void command_setup_hci_callback(uint16_t opcode, const void *param,
 	test_setup_condition_complete(data);
 }
 
+static void command_hci_plus_callback(uint16_t opcode, const void *param,
+					uint8_t length, void *user_data)
+{
+	tester_print("Post HCI Command 0x%04x length %u", opcode, length);
+}
+
+static gboolean hci_command_idle(void *user_data)
+{
+	struct test_data *data = user_data;
+
+	hciemu_clear_master_post_command_hooks(data->hciemu);
+	hciemu_add_master_post_command_hook(data->hciemu,
+					command_hci_plus_callback, data);
+	return FALSE;
+}
+
 static void command_hci_callback(uint16_t opcode, const void *param,
 					uint8_t length, void *user_data)
 {
@@ -6896,6 +6912,8 @@ static void command_hci_callback(uint16_t opcode, const void *param,
 	if (opcode != test->expect_hci_command || data->unmet_conditions <= 0)
 		return;
 
+	g_idle_add(hci_command_idle, data);
+
 	if (test->expect_hci_func)
 		expect_hci_param = test->expect_hci_func(&expect_hci_len);
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [BlueZ] tools/mgmt-tester: Fix expected HCI command accounting
  2021-05-25  5:39 [PATCH BlueZ] tools/mgmt-tester: Fix expected HCI command accounting Inga Stotland
@ 2021-05-26  5:45 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2021-05-26  5:45 UTC (permalink / raw)
  To: linux-bluetooth, inga.stotland

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=487877

---Test result---

Test Summary:
CheckPatch                    PASS      0.34 seconds
GitLint                       PASS      0.12 seconds
Prep - Setup ELL              PASS      47.26 seconds
Build - Prep                  PASS      0.10 seconds
Build - Configure             PASS      8.34 seconds
Build - Make                  PASS      203.51 seconds
Make Check                    PASS      9.15 seconds
Make Distcheck                PASS      241.56 seconds
Build w/ext ELL - Configure   PASS      8.39 seconds
Build w/ext ELL - Make        PASS      192.19 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-26  5:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25  5:39 [PATCH BlueZ] tools/mgmt-tester: Fix expected HCI command accounting Inga Stotland
2021-05-26  5:45 ` [BlueZ] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.