linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] sco-tester: Add tests for sending data
@ 2021-09-15 23:01 Luiz Augusto von Dentz
  2021-09-15 23:36 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2021-09-15 23:01 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds tests for sending data over the socket.
---
 tools/sco-tester.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tools/sco-tester.c b/tools/sco-tester.c
index b341fa49f..b31fd5aac 100644
--- a/tools/sco-tester.c
+++ b/tools/sco-tester.c
@@ -43,6 +43,8 @@ struct test_data {
 
 struct sco_client_data {
 	int expect_err;
+	const uint8_t *send_data;
+	uint16_t data_len;
 };
 
 static void print_debug(const char *str, void *user_data)
@@ -248,6 +250,14 @@ static const struct sco_client_data connect_failure = {
 	.expect_err = EOPNOTSUPP
 };
 
+const uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
+
+static const struct sco_client_data connect_send_success = {
+	.expect_err = 0,
+	.data_len = sizeof(data),
+	.send_data = data
+};
+
 static void client_connectable_complete(uint16_t opcode, uint8_t status,
 					const void *param, uint8_t len,
 					void *user_data)
@@ -600,6 +610,20 @@ static gboolean sco_connect_cb(GIOChannel *io, GIOCondition cond,
 	else
 		tester_print("Successfully connected");
 
+	if (scodata->send_data) {
+		ssize_t ret;
+
+		tester_print("Writing %u bytes of data", scodata->data_len);
+
+		ret = write(sk, scodata->send_data, scodata->data_len);
+		if (scodata->data_len != ret) {
+			tester_warn("Failed to write %u bytes: %zu %s (%d)",
+					scodata->data_len, ret, strerror(errno),
+					errno);
+			err = -errno;
+		}
+	}
+
 	if (-err != scodata->expect_err)
 		tester_test_failed();
 	else
@@ -749,6 +773,9 @@ int main(int argc, char *argv[])
 	test_sco_11("SCO mSBC 1.1 - Failure", &connect_failure, setup_powered,
 							test_connect_transp);
 
+	test_sco("SCO CVSD Send - Success", &connect_send_success,
+					setup_powered, test_connect);
+
 	test_offload_sco("Basic SCO Get Socket Option - Offload - Success",
 				NULL, setup_powered, test_codecs_getsockopt);
 
-- 
2.31.1


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

* RE: [BlueZ] sco-tester: Add tests for sending data
  2021-09-15 23:01 [PATCH BlueZ] sco-tester: Add tests for sending data Luiz Augusto von Dentz
@ 2021-09-15 23:36 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2021-09-15 23:36 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- 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=547625

---Test result---

Test Summary:
CheckPatch                    PASS      1.45 seconds
GitLint                       PASS      0.88 seconds
Prep - Setup ELL              PASS      48.09 seconds
Build - Prep                  PASS      0.48 seconds
Build - Configure             PASS      8.66 seconds
Build - Make                  PASS      207.03 seconds
Make Check                    PASS      9.95 seconds
Make Distcheck                PASS      244.27 seconds
Build w/ext ELL - Configure   PASS      8.75 seconds
Build w/ext ELL - Make        PASS      195.58 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-09-15 23:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 23:01 [PATCH BlueZ] sco-tester: Add tests for sending data Luiz Augusto von Dentz
2021-09-15 23:36 ` [BlueZ] " bluez.test.bot

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