diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-08-26 05:41:57 +0530 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2010-08-26 09:43:58 +0530 |
commit | fa6dce3c8cfe718a0ed54e08d6ae384c5185ca6c (patch) | |
tree | a77ca75497acc584219a110d872165d71152d34f | |
parent | f50f751a4980447a465e5039272ae0b0d8708aed (diff) | |
download | test-virtserial-fa6dce3c8cfe718a0ed54e08d6ae384c5185ca6c.tar.gz test-virtserial-fa6dce3c8cfe718a0ed54e08d6ae384c5185ca6c.tar.xz test-virtserial-fa6dce3c8cfe718a0ed54e08d6ae384c5185ca6c.zip |
auto-virtserial: Add test for testing SIGIO on new data
The guest process should receive a SIGIO on not only host
connect/disconnect events, but also on new data arrival on the port.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
-rw-r--r-- | auto-virtserial.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/auto-virtserial.c b/auto-virtserial.c index 811bfd5..b064a98 100644 --- a/auto-virtserial.c +++ b/auto-virtserial.c @@ -1245,6 +1245,14 @@ static int test_sigio_handler(int nr) err = result(__func__, true, "open", ret, POLLOUT, POLLOUT, OP_EQ, true); + /* Write something; guest should receive a POLLIN SIGIO */ + write(chardevs[nr].sock, &ret, sizeof(ret)); + + ret = guest_get_sigio_poll_result(nr); + err = result(__func__, true, "in", + ret, POLLIN|POLLOUT, POLLIN|POLLOUT, OP_EQ, true); + + guest_read(nr, sizeof(ret)); host_close_chardev(nr); sleep(2); |