| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Instead of testing for -EMFILE, test for < 0 (error) for the multi-open
case: -EMFILE is a bad error to report, -EBUSY is the right one for this
case, and this was added to the upstream kernel in commit
2d57d36ef32e2d9073b0ca3e4e4b2dc32897932f so ensure we adapt to that
change.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
The test that checks for a console port to be opened shouldn't be fatal
-- we can go ahead and interact with the console even if open succeeded
or we got another error instead of -ENXIO.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
The tests were enabled at run-time to allow for some tests to be
disabled. However, no way exists to disable tests non-programmatically,
and any disabling can be done by just flipping the bit for that test.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The guest doesn't do anything with the first STATUS_OK message we send;
we anyway depend on the guest to contact us when it's up and running.
This worked OK so far, but with newer kernels, the guest actually is up
and running and sees this message from us, putting it in a confused
state.
Just don't send any message.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
It might take a while for the host to clear out the data from the vq to
a file on disk. The current timeout of 5s causes the poll to timeout
quite frequently recently, so bump it to 10s.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
For the guest and host file send functions, we could get EINTR or EAGAIN
on local file descriptors. Ensure we handle that.
Also, add a timeout to read() on the local descriptor to ensure we don't
block forever on a guest that gets stuck.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
These tests need qemu enhancements not yet upstream to work. They'll be
enabled when the changes land in qemu.git.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This testcase writes out lots of stuff to the host without reading
anything out on the host. The guest should just go wait while the host
clears out all the buffers. (Some badness caused the whole guest to
freeze in this case, but a patch that should make it to stable kernels
do just what's required.)
This testcase is very similar to the nonblocking write testcase, as they
check similar things.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test was added to test the case where a guest keeps writing to the
host while the host doesn't consume any of the data. Without the
nonblock patches, the guest used to freeze. Now, with the port fd
opened in nonblocking mode, the guest returns -EAGAIN. This wasn't
enabled so far as the guest just froze. All current kernels have this
patch now, so enable it.
Also ensure POLLOUT is set when some data from the host is consumed.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
A test might lazily not close open guest file descriptors (like the
older test_open() did on purpose or the test_multiple_open() does for
laziness). Ensure we close the fd and also clear out the buffers if
there were any queued up.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The post_test_cleanup operation should be able to close any open guest
file descriptors as part of a lousy test function. Doing open and close
in two different tests doesn't help that -- so let's combine them into
one function.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
lseek() on console ports should fail with -ESPIPE.
(This behaviour will be seen from kernel 2.6.37 onwards. Older kernels
just returned success without seeking.)
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
When testing for POLLHUP, we can also get POLLIN set, which makes our
error checks go wrong.
Make sure we unset POLLIN from the return value and then check for
POLLHUP.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
| |
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Older guest kernels will not have the guest program running to parse
KEY_SHUTDOWN. Send the shutdown command via the console itself.
(This requires first logging as root and then issuing the shutdown
command)
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
Currently we forcibly kill qemu from the run_test.sh script once each
test is done. Instead, give a chance to the guest to shut itself down
by sending a 'shutdown' command.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
With the process now capable of getting a SIGIO on incoming data, check
if a poll() for POLLIN that was blocked behaves properly.
This checks for both, the SIGIO delivery as well as poll output.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
We always invoked a guest poll with POLLIN|POLLOUT events. There's a
case where custom events might be necessary -- the sigio handler test,
for example. Add a new key to set the poll events.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
The guest can receive the SIGIO signal on host connection and
disconnection events. This commit just adds a simple test for one
open/close event. A lot more are to be added, as explained in the
comments.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
There's some hackery in the way test_blocking_read() works, document it
so that the move to autotest is easier.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
Give the guest to schedule in and react to input from the host before
sending off results. Not doing this can result in some IO being missed
and hence incorrect test results.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
Introduce a test that creates a new thread and blocks on a port for
read. The parent thread then writes to the port, and later the host
writes something to the port, unblocking the read.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
RHEL5 guests are slow to start. 90s seems to be a good timeout to get
contact from the guest. Haven't yet measured how much it really takes or
even tried to optimise rhel5 booting beyond disabling unnecessary
services.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
Let's see if this passes properly: The guest should get 'queue full'
quite a few times given writing to a disk on the host via qemu's
chardevs is slower than the guest giving us the data.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
Some basic tests like reading/writing from/to guests, opening files,
etc., have to succeed. If they fail, we shouldn't attempt to run other
tests.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
Until writes become nonblocking, this test will just make sure the guest
goes into an infinite loop in the kernel -- not something we want to
happen.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
In case of the nonblock test failing, we used to report both pass and
fail. Report only failure.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This new test puts a port in non-blocking mode in the guest and keeps
sending data till the host can't accept any more. In this case, the vq
is filled and the guest gets -EAGAIN on write. poll() should not return
POLLOUT.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The kernel module will gain blocking support for writes where an
unopened host port will cause a write on the guest to block.
This doesn't play well with the host caching test. And we don't cache
data anyway.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
For all the cases that aren't included in the upstream code yet,
switch off the tests so that we don't see failures for features
not yet implemented.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
20s is insufficient for the guest to boot from a cold cache.
Bump the timeout to 40s.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
With the design change in the kernel module to have IO vqs
for each port, guest throttling is no longer needed.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
| |
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
This is so that the main routine doesn't need to know the
function name of the test to run.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
| |
it's not an error; so let's not say there was an error
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
| |
Send file from guest->host and compare csums
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
| |
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
| |
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
| |
Not yet configurable from the command line
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
The return value from guest open should be >= 0, make sure we test
for that instead of being = 0.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
announcing result
In many cases the data got sent after the port was inspected for
any cached data that was available in the cache disabled case.
We can't rely on the sequence of the events; they can get rearranged
so let's close the port only after we know the data reached the
guest.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
been passed out
the check for throttled sometimes fails; for the same reason that
the guest caching test fails: less data is seen and the throttling
condition isn't reached when it should.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
even though this is not used, this is done
to suppress valgrind err messages
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
| |
This is a much better way of doing it
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
1. don't assign to 'ret' the o/p of fns that we don't intend to use later
2. Ensure 'ret' actually contains the value we want
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
messages
Using individual pass/fail() functions, checking for conditions,
printing debug message after fail each time can be optimised by
using a result() function that can do all of that.
This also allows us to make the test output format look prettier
since it's all now handled in one function. So make the output
prettier as well while we're at it.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit tests for:
1. sysfs entries created (the 'name' attribute)
2. debugfs entries created for ports (in /sys/kernel/debug/virtio-console/vconNN)
(this needs debugfs to be mounted in /sys/kernel/debug)
3. udev rule that creates a symlink based on the port 'name' attribute
(this needs a udev rule to create a symlink, like:
KERNEL==vcon*, SYMLINK+=virtio-console/{name}
in a file in the /etc/udev/rules.d/ directory)
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
| |
Code should allow for having a port open only once in the guest.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|