[PATCH BlueZ] iso-tester: Test BT_DEFER_SETUP works with getsockopt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

This attempts to test BT_DEFER_SETUP is properly set when the test has
defer flag set.
---
 tools/iso-tester.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index cae5fb4b7..56c17b78b 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -1240,6 +1240,19 @@ static void setup_connect(struct test_data *data, uint8_t num, GIOFunc func)
 	}
 
 	if (isodata->defer) {
+		int defer;
+		socklen_t len;
+
+		/* Check if socket has DEFER_SETUP set */
+		len = sizeof(defer);
+		if (getsockopt(sk, SOL_BLUETOOTH, BT_DEFER_SETUP, &defer,
+				&len) < 0) {
+			tester_warn("getsockopt: %s (%d)", strerror(errno),
+								errno);
+			tester_test_failed();
+			return;
+		}
+
 		memset(&pfd, 0, sizeof(pfd));
 		pfd.fd = sk;
 		pfd.events = POLLOUT;
-- 
2.37.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux