| 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>
|
|
|
|
|
|
|
|
|
|
|
| |
With the recent changes in upstream kernel, it's no longer guaranteed
that /dev/vport0pNN will be the port dev names. So use the names given
by the host.
This still doesn't work for the sysfs and udev tests, fixes for those
will come later.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
fix typo in previous commit that used 'test0' instead of 'test1' as the
control channel name.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The control channel for the tests is named 'test0', and is always the
first port of the first device we add (/dev/vport0p0). However, the
device number can change based on pending upstream patches, so instead
of relying on the id, try opening by name first.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Similar to commit e694887f173b3c0548ff3c1383e3fe954ac62692 for
safewrite().
Some callers are interested in -EAGAIN return in nonblocking mode, like
the test that checks for nonblocking functionality.
For other tests, we should try to read from local storage again in case
of -EAGAIN.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
linux-2.6 doesn't make much sense anymore; upstream repo has changed to
'linux', so let's update the location.
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>
|
|
|
|
|
|
|
|
|
| |
Use virtio-blk with the -drive and -device virtio-blk-pci arguments
instead of the default ide device.
Also use cache=unsafe for the drive as we don't care about consistency.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
This doesn't work; bash isn't passing on parameters properly. Need to
find out how to do it properly.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some callers are interested in -EAGAIN return in nonblocking mode, like
the test that checks for nonblocking functionality.
For other tests, like the guest_send_bigfile should retry in case of
-EAGAIN since the host might be coping up with our rate of data
transfer.
This is a hack that's introduced here for completeness. Future work
should go to kvm-autotest.
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>
|
|
|
|
| |
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>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to store the 'active' file descriptor in g_fd, and all the file
operations used to be performed on this fd, which was stored after an
open call.
This restricted us to having a max. of one port open at a time for
operations.
Use the new g_open_fds[] array to get the fd for the read/write/close
calls, so that these basic operations can be performed on multiple open
ports.
This is useful for the multiple-port sigio test.
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>
|
|
|
|
|
|
| |
We leaked 30 bytes of memory for each open() call for a guest port.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
If using a newer host program than the guest which has a newer key, the
host can keep waiting for the guest to respond, and the guest never
will..
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>
|
|
|
|
|
|
|
| |
qemu upstream has gained the ability to handle smp with kvm, so
let's default to 2 vcpus.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qemu/auto-virtserial
We removed the sleep a couple of commits earlier but it's needed to
ensure we really kill off any stuck qemu/auto-virtserial processes
before we start another test.
Without the sleep, a new qemu process could be spawned before the kill
signal was sent to the older process.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
| |
We used to kill all processes that had 'qemu' in their name. This was
obviously not a good thing for other running qemu processes. Record the
pid of the spawned process to only kill that one later.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
We currently spent 5 mins sleeping after a previous test. This delay is
not needed; we can directly jump onto the next one.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
| |
All the tests for combinations of new and old qemu and kernels used
similar code; split it off into a function.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
executing tests
Lacking proper support for creating and destroying qemu and
auto-virtseiral processes, this crude way of ensuring no previous qemu
or auto-virtserial instances are running is employed. This should be
removed if/when all this is properly supported.
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>
|
|
|
|
|
|
|
| |
Some qemu processes get stuck due to test failures / etc., they don't
just go away with a simple pkill. pkill -9 them.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
|