summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-08-26 06:54:41 +0530
committerAmit Shah <amit.shah@redhat.com>2010-08-26 09:43:58 +0530
commitaf6f49a6cf54cdf76531eba26e605a9a1503d185 (patch)
tree39e6a51a3f2c466ad1f03d0a4a8feba9dd655aad
parentfa6dce3c8cfe718a0ed54e08d6ae384c5185ca6c (diff)
downloadtest-virtserial-af6f49a6cf54cdf76531eba26e605a9a1503d185.tar.gz
test-virtserial-af6f49a6cf54cdf76531eba26e605a9a1503d185.tar.xz
test-virtserial-af6f49a6cf54cdf76531eba26e605a9a1503d185.zip
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 <amit.shah@redhat.com>
-rw-r--r--auto-virtserial.c44
1 files changed, 44 insertions, 0 deletions
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;
}