Skip to contentSkip to conversation

tools/mgmt-tester: Adjust test setup complete check

PATCH Applied Inga Stotland 4 participants 5 messages Jun 3, 2021 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tools/mgmt-tester: Adjust test setup complete check

This changes check for setup complete in client_cmd_complete() callback from tester_setup_complete() to test_setup_condition_complete(). This allows for combining setup conditions when setup_bthost() is called.

---
 tools/mgmt-tester.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/mgmt-tester.c +2 -1
index 4dd3490c2..657b7aaa0 100644
@@ -5831,7 +5831,7 @@ static void client_cmd_complete(uint16_t opcode, uint8_t status,
 	if (status)
 		tester_setup_failed();
 	else
-		tester_setup_complete();
+		test_setup_condition_complete(data);
 }
 
 static void setup_bthost(void)
@@ -5842,6 +5842,7 @@ static void setup_bthost(void)
 
 	bthost = hciemu_client_get_host(data->hciemu);
 	bthost_set_cmd_complete_cb(bthost, client_cmd_complete, data);
+	test_add_setup_condition(data);
 
 	if (data->hciemu_type == HCIEMU_TYPE_LE ||
 		test->client_enable_adv) {
Signature · 1 line
2.26.3
#1 lore raw

PATCH 2/2 tools/mgmt-tester: Add setup condition to resolve list

This adds expected setup HCI command condition to
"Start Discovery - Disable Resolve List" case.

Check that on setup HCI command Set LE Resolve Enable is complete with "enable" parameter set to 1.

---
 tools/mgmt-tester.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/mgmt-tester.c +10 -0
index 657b7aaa0..d659d7eb0 100644
@@ -2076,6 +2076,9 @@ static const struct generic_data start_discovery_ll_privacy_disable_resolv = {
 	.expect_status = MGMT_STATUS_SUCCESS,
 	.expect_param = start_discovery_le_param,
 	.expect_len = sizeof(start_discovery_le_param),
+	.setup_expect_hci_command = BT_HCI_CMD_LE_SET_RESOLV_ENABLE,
+	.setup_expect_hci_param = set_resolv_on_param,
+	.setup_expect_hci_len = sizeof(set_resolv_on_param),
 	.expect_hci_command = BT_HCI_CMD_LE_SET_RESOLV_ENABLE,
 	.expect_hci_param = set_resolv_off_param,
 	.expect_hci_len = sizeof(set_resolv_off_param),
@@ -9442,6 +9445,7 @@ static void setup_add_device_callback(uint8_t status, uint16_t length,
 static void setup_ll_privacy_device(const void *test_data)
 {
 	struct test_data *data = tester_get_data();
+	const struct generic_data *test = data->test_data;
 	unsigned char param[] = { 0x01 };
 	const uint8_t *ext_feat_param;
 	size_t ext_feat_len;
@@ -9453,6 +9457,12 @@ static void setup_ll_privacy_device(const void *test_data)
 			0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
 			0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
 
+	tester_print("Setup expected HCI command 0x%04x",
+					 test->setup_expect_hci_command);
+	hciemu_add_master_post_command_hook(data->hciemu,
+					command_setup_hci_callback, data);
+	test_add_setup_condition(data);
+
 	tester_print("Enabling LL Privacy feature");
 
 	ext_feat_param = set_exp_feat_param_ll_privacy;
Signature · 1 line
2.26.3
#2 lore raw
In reply to Inga Stotland

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=492919

---Test result---

Test Summary:

CheckPatch                    PASS      0.45 seconds
GitLint                       PASS      0.21 seconds
Prep - Setup ELL              PASS      41.15 seconds
Build - Prep                  PASS      0.10 seconds
Build - Configure             PASS      7.19 seconds
Build - Make                  PASS      177.68 seconds
Make Check                    PASS      8.92 seconds
Make Distcheck                PASS      210.21 seconds
Build w/ext ELL - Configure   PASS      7.21 seconds
Build w/ext ELL - Make        PASS      167.43 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

Reviewed-by on v1 1/2
#3 lore raw
In reply to Inga Stotland

Hi Inga,

Quoted 3 lines · Inga Stotland

This changes check for setup complete in client_cmd_complete() callback from tester_setup_complete() to test_setup_condition_complete(). This allows for combining setup conditions when setup_bthost() is called.

Quoted 18 lines
---
 tools/mgmt-tester.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/mgmt-tester.c +1 -1
index 4dd3490c2..657b7aaa0 100644
@@ -5831,7 +5831,7 @@ static void client_cmd_complete(uint16_t opcode, uint8_t status,
 	if (status)
 		tester_setup_failed();
 	else
-		tester_setup_complete();
+		test_setup_condition_complete(data);
 }
 
 static void setup_bthost(void)

tools/mgmt-tester.c static void setup_bthost(void) · line 5848

Quoted 7 lines
tools/mgmt-tester.c +1 -0
@@ -5842,6 +5842,7 @@ static void setup_bthost(void)
 
 	bthost = hciemu_client_get_host(data->hciemu);
 	bthost_set_cmd_complete_cb(bthost, client_cmd_complete, data);
+	test_add_setup_condition(data);
 
 	if (data->hciemu_type == HCIEMU_TYPE_LE ||
 		test->client_enable_adv) {

Regards,
Tedd

maintainer Applied
#4 lore raw

Hi Inga,

Quoted 33 lines · Tedd Ho-Jeong An

Hi Inga,

Quoted 3 lines · Inga Stotland

This changes check for setup complete in client_cmd_complete() callback from tester_setup_complete() to test_setup_condition_complete(). This allows for combining setup conditions when setup_bthost() is called.

Quoted 23 lines
---
 tools/mgmt-tester.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/mgmt-tester.c +2 -1
index 4dd3490c2..657b7aaa0 100644
@@ -5831,7 +5831,7 @@ static void client_cmd_complete(uint16_t opcode, uint8_t status,
      if (status)
              tester_setup_failed();
      else
-             tester_setup_complete();
+             test_setup_condition_complete(data);
 }
 
 static void setup_bthost(void)
@@ -5842,6 +5842,7 @@ static void setup_bthost(void)
 
      bthost = hciemu_client_get_host(data->hciemu);
      bthost_set_cmd_complete_cb(bthost, client_cmd_complete, data);
+     test_add_setup_condition(data);
 
Quoted 6 lines

tools/mgmt-tester.c static void setup_bthost(void) · line 5848

Quoted 2 lines
tools/mgmt-tester.c +0 -0
      if (data->hciemu_type == HCIEMU_TYPE_LE ||
              test->client_enable_adv) {

Regards,
Tedd

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz