summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* auto-test: check for <0 return for multi_open caseHEADmasterAmit Shah2013-04-241-1/+1
| | | | | | | | | | 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>
* auto-test: console open not failing isn't fatalAmit Shah2013-03-151-2/+0
| | | | | | | | 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>
* auto-guest: use port names to open portsAmit Shah2013-03-151-2/+2
| | | | | | | | | | | 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>
* auto-guest: control port is named 'test1' (fix typo)Amit Shah2013-02-111-1/+1
| | | | | | | 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>
* auto-guest: try opening port by name before opening by idAmit Shah2013-02-111-5/+14
| | | | | | | | | 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>
* auto-guest: don't return -EAGAIN for all saferead() callersAmit Shah2013-02-111-9/+9
| | | | | | | | | | | | | 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>
* run-test: Update default kernel dir. to 'linux' instead of 'linux-2.6'Amit Shah2011-09-141-1/+1
| | | | | | | 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>
* auto-virtserial: Enable all tests at compile-time (instead of run-time)Amit Shah2011-09-141-4/+19
| | | | | | | | 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>
* auto-virtserial: Don't send OK message to guestAmit Shah2011-09-142-15/+2
| | | | | | | | | | | | | 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>
* auto-test: Bump poll timeout to 10s for guest->host big fileAmit Shah2011-05-241-2/+2
| | | | | | | | 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>
* run-test: Switch to using virtio-blk for the h/dAmit Shah2011-02-231-4/+6
| | | | | | | | | 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>
* run-test: Don't append console= params to guest kernelAmit Shah2011-02-231-1/+2
| | | | | | | 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>
* auto-guest: Don't return -EAGAIN for all safewrite() callersAmit Shah2011-01-281-9/+9
| | | | | | | | | | | | | | 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>
* auto-virtserial: Ensure we handle EINTR/EAGAIN on local file descriptorsAmit Shah2011-01-131-2/+30
| | | | | | | | | | 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>
* auto-test: Disable blocking and nonblocking write flood testsAmit Shah2010-10-201-0/+2
| | | | | | | 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>
* auto-test: Add test for blocking write caseAmit Shah2010-10-201-1/+61
| | | | | | | | | | | | | 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>
* virtio: console: Enable non-blocking write "flooding" testAmit Shah2010-10-191-3/+21
| | | | | | | | | | | | | 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>
* auto-test-guest: Add missing 'break' for the KEY_LSEEK caseAmit Shah2010-10-011-0/+1
| | | | Signed-off-by: Amit Shah <amit.shah@redhat.com>
* auto-test: Close guest file descriptor if a test left it openAmit Shah2010-09-301-1/+1
| | | | | | | | | 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>
* auto-test: combine open and close tests into oneAmit Shah2010-09-301-22/+8
| | | | | | | | | 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>
* auto-test: Add test for lseek()Amit Shah2010-09-283-0/+49
| | | | | | | | | 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>
* auto-test: poll() may have POLLIN set on host disconnectAmit Shah2010-09-161-0/+5
| | | | | | | | | | 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>
* auto-test: don't poll further if last read() returned 0 in cleanupAmit Shah2010-09-161-3/+5
| | | | Signed-off-by: Amit Shah <amit.shah@redhat.com>
* auto-test: Shut down guest in case of running old kernel via virtio_consoleAmit Shah2010-09-161-0/+17
| | | | | | | | | | 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>
* run-test: comment about bash's "-s file" conditionalAmit Shah2010-09-131-0/+1
| | | | Signed-off-by: Amit Shah <amit.shah@redhat.com>
* auto-test: Shut down a guest after all tests are done.Amit Shah2010-09-133-0/+17
| | | | | | | | 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>
* auto-test: Add a test to check for blocking poll with SIGIO being invokedAmit Shah2010-08-261-0/+37
| | | | | | | | | 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>
* auto-test: Add a key to specify poll events to poll forAmit Shah2010-08-263-8/+31
| | | | | | | | 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>
* auto-test-guest: make open, read, write, close safe for multiple opensAmit Shah2010-08-261-3/+3
| | | | | | | | | | | | | | | | | 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>
* auto-test: Add multiple open-close SIGIO testsAmit Shah2010-08-261-0/+44
| | | | | | | 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>
* auto-virtserial: Add test for testing SIGIO on new dataAmit Shah2010-08-261-0/+8
| | | | | | | 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>
* auto-virtserial: Add guest SIGIO testsAmit Shah2010-08-263-2/+166
| | | | | | | | | 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>
* auto-virtserial: Explain how test_blocking_read() worksAmit Shah2010-08-261-0/+13
| | | | | | | 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>
* auto-virtserial: Add a few sleep(2)s between host-guest commandsAmit Shah2010-08-261-0/+14
| | | | | | | | 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>
* auto-virtserial-guest: Fix a memleak in port open functionAmit Shah2010-08-251-1/+3
| | | | | | We leaked 30 bytes of memory for each open() call for a guest port. Signed-off-by: Amit Shah <amit.shah@redhat.com>
* auto-virtserial-guest: Add a 'default' target for key switchAmit Shah2010-08-231-0/+3
| | | | | | | | 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>
* auto-test: Introduce a threaded read/write testAmit Shah2010-08-234-0/+148
| | | | | | | | 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>
* auto-virtserial: Wait for 90s instead of 40s for guest contactAmit Shah2010-08-041-2/+2
| | | | | | | | | 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>
* run-test: Default to -smp 2Amit Shah2010-08-041-1/+1
| | | | | | | 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>
* run-test: Update default qemu pathsAmit Shah2010-05-291-3/+3
| | | | Signed-off-by: Amit Shah <amit.shah@redhat.com>
* auto-test: Open guest->host file transfer in nonblocking mode on guestAmit Shah2010-05-051-0/+2
| | | | | | | | 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>
* auto-test: Don't run further tests if basic ones failAmit Shah2010-04-221-7/+27
| | | | | | | | 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>
* run-test: Sleep for a while after sending kill instructions for ↵Amit Shah2010-04-221-0/+5
| | | | | | | | | | | | | 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>
* run-test: Store pid of spawned qemu process to only kill that pid laterAmit Shah2010-04-221-2/+22
| | | | | | | | 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>
* run-test: Remove unnecessary wait before starting testsAmit Shah2010-04-201-3/+0
| | | | | | | 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>
* run-test: Split common code in a functionAmit Shah2010-04-201-38/+18
| | | | | | | 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>
* run-test: Kill any earlier qemu or auto-virtserial instances before ↵Amit Shah2010-04-191-3/+12
| | | | | | | | | | | 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>
* auto-test: Disable nonblocking write test till nonblock patches are upstreamAmit Shah2010-04-071-1/+1
| | | | | | | | 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>
* auto-test: nonblocking write: Report 'pass' only if everything did passAmit Shah2010-04-071-1/+2
| | | | | | | 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>
* run_test: pkill -9 qemu processes after test is doneAmit Shah2010-04-071-3/+3
| | | | | | | 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>