[PATCH BlueZ v2 4/4] shared/tester: shutdown tester IO before test teardown

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

 



Some tests may require shutdown of tester IO for proper teardown.
Add function tester_shutdown_io to accomplish that and call it
automatically when test finishes.
---
 src/shared/tester.c | 8 ++++++++
 src/shared/tester.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/shared/tester.c b/src/shared/tester.c
index 371ccaced..62a14d073 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -654,6 +654,8 @@ static void test_result(enum test_result result)
 		test->timeout_id = 0;
 	}
 
+	tester_shutdown_io();
+
 	if (test->result == TEST_RESULT_FAILED)
 		result = TEST_RESULT_FAILED;
 
@@ -1047,6 +1049,12 @@ struct io *tester_setup_io(const struct iovec *iov, int iovcnt)
 	return ios[0];
 }
 
+void tester_shutdown_io(void)
+{
+	io_shutdown(ios[0]);
+	io_shutdown(ios[1]);
+}
+
 void tester_io_send(void)
 {
 	struct test_case *test = tester_get_test();
diff --git a/src/shared/tester.h b/src/shared/tester.h
index 1f8138434..dfc1ca3a8 100644
--- a/src/shared/tester.h
+++ b/src/shared/tester.h
@@ -81,5 +81,6 @@ void tester_wait(unsigned int seconds, tester_wait_func_t func,
 							void *user_data);
 
 struct io *tester_setup_io(const struct iovec *iov, int iovcnt);
+void tester_shutdown_io(void);
 void tester_io_send(void);
 void tester_io_set_complete_func(tester_data_func_t func);
-- 
2.34.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