diff options
Diffstat (limited to 'auto-virtserial.c')
-rw-r--r-- | auto-virtserial.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/auto-virtserial.c b/auto-virtserial.c index f04a834..54c35a2 100644 --- a/auto-virtserial.c +++ b/auto-virtserial.c @@ -510,6 +510,9 @@ static int test_nonblocking_read(int nr) /* Write out anything -- doesn't matter what it is */ write(chardevs[nr].sock, &gpkt, sizeof(gpkt)); + /* Give the guest a chance to be scheduled in and react */ + sleep(2); + ret = guest_read(nr, sizeof(gpkt)); err = result(__func__, true, "read", ret, sizeof(gpkt), 0, OP_EQ, true); out: @@ -588,13 +591,23 @@ static int test_poll(int nr) if (err) goto out; + /* + * Give the guest a chance to be scheduled in and give correct + * results for the previous test -- else it'll find the host + * chardev connected. + */ + sleep(2); host_connect_chardev(nr); + /* Give the guest a chance to be scheduled in and react */ + sleep(2); ret = guest_poll(nr, 0); err = result(__func__, true, "POLLOUT", ret, POLLOUT, 0, OP_EQ, true); if (err) goto out_close; write(chardevs[nr].sock, &ret, sizeof(ret)); + /* Give the guest a chance to be scheduled in and react */ + sleep(2); ret = guest_poll(nr, 0); err = result(__func__, true, "POLLIN", ret, POLLIN|POLLOUT, 0, OP_EQ, true); @@ -714,6 +727,7 @@ static int test_guest_caching(int nr) error(errno, errno, "%s: write", __func__); /* Make sure the data made its way to the port in the guest */ + sleep(2); ret = guest_poll(nr, 10000); err = result(__func__, chardevs[nr].caching, "guest poll", ret, POLLIN|POLLOUT, POLLIN|POLLOUT, OP_EQ, false); |