From af6f49a6cf54cdf76531eba26e605a9a1503d185 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Thu, 26 Aug 2010 06:54:41 +0530 Subject: auto-test: Add multiple open-close SIGIO tests Test if multiple SIGIOs are sent for multiple host chardev open/close events for open ports in the same process. Signed-off-by: Amit Shah --- auto-virtserial.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/auto-virtserial.c b/auto-virtserial.c index b064a98..e0a61f6 100644 --- a/auto-virtserial.c +++ b/auto-virtserial.c @@ -1261,6 +1261,50 @@ static int test_sigio_handler(int nr) ret, POLLHUP, POLLHUP, OP_EQ, true); guest_close_port(nr); + + /* Now opening multiple ports and watching for multiple SIGIOs */ + guest_open_port(2); + guest_open_port(3); + guest_open_port(4); + + sleep(2); + + host_connect_chardev(2); + host_connect_chardev(3); + host_connect_chardev(4); + + sleep(2); + + ret = guest_get_sigio_poll_result(2); + err = result(__func__, true, "multi-o2", + ret, POLLOUT, POLLOUT, OP_EQ, false); + ret = guest_get_sigio_poll_result(3); + err = result(__func__, true, "multi-o3", + ret, POLLOUT, POLLOUT, OP_EQ, false); + ret = guest_get_sigio_poll_result(4); + err = result(__func__, true, "multi-o4", + ret, POLLOUT, POLLOUT, OP_EQ, false); + + host_close_chardev(2); + host_close_chardev(3); + host_close_chardev(4); + + sleep(2); + + ret = guest_get_sigio_poll_result(2); + err = result(__func__, true, "multi-c2", + ret, POLLHUP, POLLHUP, OP_EQ, true); + ret = guest_get_sigio_poll_result(3); + err = result(__func__, true, "multi-c3", + ret, POLLHUP, POLLHUP, OP_EQ, true); + ret = guest_get_sigio_poll_result(4); + err = result(__func__, true, "multi-c4", + ret, POLLHUP, POLLHUP, OP_EQ, true); + + guest_close_port(2); + guest_close_port(3); + guest_close_port(4); + return err; } -- cgit