diff mbox series

[BlueZ] tools/mgmt-tester: Fix expected HCI command accounting

Message ID 20210525053905.53138-1-inga.stotland@intel.com (mailing list archive)
State Superseded
Headers show
Series [BlueZ] tools/mgmt-tester: Fix expected HCI command accounting | expand

Commit Message

Stotland, Inga May 25, 2021, 5:39 a.m. UTC
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(+)

Comments

bluez.test.bot@gmail.com May 26, 2021, 5:45 a.m. UTC | #1
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
diff mbox series

Patch

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);