summaryrefslogtreecommitdiff
path: root/harness
Commit message (Collapse)AuthorAgeFilesLines
* harness: add test for aio poll missed eventsEric Biggers2022-03-251-0/+255
| | | | | | | | | | | Add a regression test for a recently-fixed kernel bug where aio polls sometimes didn't complete even if the file is ready. This is a cleaned-up version of the test which I originally posted at https://lore.kernel.org/r/YbMKtAjSJdXNTzOk@sol.localdomain Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* cases/16.t: loongarch only supports eventfd2yehui ren2021-07-201-2/+2
| | | | | Signed-off-by: yehui ren <renyehui@uniontech.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Fix test issue with gcc-11Lee Duncan2021-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test 3.t exercises io_submit() with invalid addresses, and one test attempted to pass in "-1" as an invalid pointer. But gcc-11 realizes you cannot take an offset from an invalid pointer, making it impossible to compile or run this test: > sh# make CC=gcc-11 partcheck > make[1]: Entering directory '/alt/public_software/libaio/src' > make[1]: Nothing to be done for 'all'. > make[1]: Leaving directory '/alt/public_software/libaio/src' > make[1]: Entering directory '/alt/public_software/libaio/harness' > gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/2.t\" -o cases/2.p main.c ../src/libaio.a -lpthread > gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/3.t\" -o cases/3.p main.c ../src/libaio.a -lpthread > In file included from main.c:24: > cases/3.t: In function ‘test_main’: > cases/3.t:18:19: error: ‘attempt_io_submit’ accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=] > 18 | status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cases/3.t:18:19: note: referencing argument 3 of type ‘struct iocb **’ > In file included from cases/3.t:5, > from main.c:24: > cases/aio_setup.h:15:5: note: in a call to function ‘attempt_io_submit’ > 15 | int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect) > | ^~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > make[1]: *** [Makefile:19: cases/3.p] Error 1 > make[1]: Leaving directory '/alt/public_software/libaio/harness' > make: *** [Makefile:23: partcheck] Error 2 The fix is to tell gcc to relax it's stringop overflow testing for this one test. Changes since v1: * First version just skipped the test in question Signed-off-by: Lee Duncan <leeman.duncan@gmail.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Skip the test if io_pgetevents() is not implementedGuillem Jover2019-08-221-0/+7
| | | | | | | | | | | | Either the kernel or the syscall wrapper will return -ENOSYS when this syscall is not implemented. So we should cope with this in the test suite and SKIP the test case. This is currently the case for alpha and ia64, even though they have already been wired up very recently in the kernel mainline. Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Print better error messages on error conditions in 22.tGuillem Jover2019-08-221-6/+9
| | | | | | | | | | These should help diagnose problems when dealing with error failures. In particular this helped distinguish the problem with io_pgetevents() not being implemented and it failing due to the sigset_t layout bug. Signed-off-by: Guillem Jover <guillem@hadrons.org> [JEM: fix up 80 columns violations] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Fix PROT_WRITE mmap checkGuillem Jover2019-08-141-5/+4
| | | | | | | | | | | | | | | This partially reverts commit d7f5065448efb49b2a26e728ff735e12ea05b62e. The actual problem in the original code was that read() was being used to assert whether the buffer was readable, but the kernel was instead reading from the file descriptor and then writing into the buffer, so no EFAULT was being generated (on architectures that do so). We needed to use a write() so that the kernel would read from the buffer. Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: fix read into PROT_WRITE mmap testJeff Moyer2019-08-131-3/+3
| | | | | | | | | This test has been broken forever. Fix it up to perform an aio_read using the result of a regular read as the expected return code. Reported-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: skip 22.p if async_poll isn't supportedJeff Moyer2019-07-291-1/+13
| | | | | | | Use the new skip error code instead of failing the test. Also add in a Local variables: section for emacs. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Handle -ENOTSUP from io_submit() with RWF_NOWAITGuillem Jover2019-07-291-5/+7
| | | | | | | | | | On filesystems such as tmpfs the syscall might return -ENOTSUP instead of EINVAL when it does not support the RWF_NOWAIT flag. Signed-off-by: Guillem Jover <guillem@hadrons.org> [JEM: skip the test instead of returning success] [JEM: make the error message differentiate between kernel and fs support] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Add fallback code for filesystems not supporting O_DIRECTGuillem Jover2019-07-294-5/+23
| | | | | | | | | | When running the harness on a filesystem such as a tmpfs, which do not support O_DIRECT, fallback to calls without the flag. Signed-off-by: Guillem Jover <guillem@hadrons.org> [JEM: change from duplicating the open call to using F_SETFL] [JEM: 18 and 21 require O_DIRECT-skip if not present] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: add support for skipping testsJeff Moyer2019-07-292-6/+28
| | | | | | | | Skipped tests will not cause the test harness to return failure. An exit status of "3" was chosen for skipped tests. This doesn't conflict with any of the current tests. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Make the test exit with a code matching the pass/fail stateGuillem Jover2019-07-291-0/+2
| | | | | | | | This way we can use the exit code to check whether the tests passed or failed, and fail the package build. Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Make RISC-V use SYS_eventfd2 instead of unavailable SYS_eventfdGuillem Jover2019-07-291-3/+3
| | | | | | | | This is a recent architecture and as such does not provide legacy support for SYS_eventfd. Declare that we need to use the new syscall. Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Use run-time _SC_PAGE_SIZE instead of build-time PAGESIZEGuillem Jover2019-07-292-11/+25
| | | | | | | | | The getconf(1) command is inherently not cross-compilation friendly. In addition PAGESIZE depends on the specific system, even within a specific arch, so using a hard-coded value is never safe. Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: Use destination strncpy() expression for sizeof() argumentGuillem Jover2019-07-292-2/+2
| | | | | | | | | | | | | Even though this is the same size, as the sizeof() is derived from the source expression, recent gcc versions will emit a warning, which is turned into an error by -Werror: error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess] Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: allow running tests against the installed libraryJeff Moyer2019-07-291-1/+5
| | | | | | | A user can now specify "LIBAIO=/path/to/libaio.so" in order to run the test harness against the installed library. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: fix POLLIN test caseJeff Moyer2018-10-221-1/+1
| | | | | | The result is a bitmask, so just check for the bit we're interested in. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* add test for aio poll and io_pgeteventsaio-pollChristoph Hellwig2018-01-161-0/+149
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Add support for preadv2/pwritev2Jeff Moyer2017-12-141-0/+176
| | | | | | | | | | | preadv2 and pwritev2 allow the caller to specify per-io flags. The main driver for this support in libaio is RWF_NOWAIT, which allows applications to specify that they don't want the submission thread to block waiting for things such as page cache invalidation, block instantiation, etc. This should help reduce unexpected latencies in the submission path. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: add test for allocating aio-max-nr ioctxsJeff Moyer2017-07-071-0/+178
| | | | | | | | | Ensure that a user is able to allocate aio-max-nr events, even if they are spread out 1 to an io_context. This test code is based on a reproducer posted by Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* libaio: harness: fix build error due to linker search orderMauricio Faria de Oliveira2016-10-281-2/+2
| | | | | | | | | | | | Move '-lpthread' after 'main.c' in the compiler command line, so that the linker can search unresolved symbols from the test in the library. cases/18.t:98: undefined reference to `pthread_create' cases/18.t:103: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* libaio: harness: fix build errors due to attribute warn_unused_resultMauricio Faria de Oliveira2016-10-282-2/+5
| | | | | | | | | | | | | This patch fixes the following build errors: cases/18.t:94:2: error: ignoring return value of 'write', declared with attribute warn_unused_resultg [-Werror=unused-result] write(fd, buffer, PAGE_SIZE); cases/8.t:17:4: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Werror=unused-result] ftruncate(fd, 0); Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: add a test case for mremapJeff Moyer2015-07-011-0/+253
| | | | | | | | Checkpoint/Restart in userspace requires support for remapping the aio ring buffer. cases/19.t was added to ensure that this remapping works. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* harness: don't hardcode page sizeJeff Moyer2015-07-012-3/+1
| | | | | | | 18.t hard-coded PAGE_SIZE to 4096. This patch passes the PAGE_SIZE in from the Makefile. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Add two new tests to the test harnessJeff Moyer2014-09-093-1/+382
| | | | | | | | - Add a test for ring buffer overflows from Dan Aloni. - Add a test that ensures io_getevents waits for I/O completions from Anatol Pomozov. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* respect CFLAGS in the test harness directoryJeff Moyer2013-01-311-1/+1
| | | | | | | This is useful when, for example, testing the compat layer by building -m32 on a 64 bit platform. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* fix test case 16 to work on arm64Jeff Moyer2013-01-311-0/+10
| | | | | | | | aarch64 does not implement "legacy" system calls such as eventfd. It does, of course, support eventfd2, so use that instead. Reported-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* fix the testsuite buildFabio M. Di Nitto2011-04-192-0/+8
| | | | | | -Werror tripped up on unchecked return codes in fedora. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
* Instead of checking for __LP64__, the author of the test harnessJeff Moyer2009-06-091-2/+2
| | | | | | decided to check for __i386__ when deciding whether pointers should be 32 or 64 bits. I've fixed this so that the tests build and run properly on 32 bit platforms other than i386.
* - Fix the test harness (Rusty Russell)libaio.0-3-107.1Jeff Moyer2008-01-0912-45/+260
| | | | - Add eventfd support (Rusty Russell)
* fix up 14.t to actually print errorslibaio.0-3-93.4Ben LaHaise2003-02-171-5/+42
|
* initial test case from jbaronBen LaHaise2003-01-281-0/+53
|
* update test cases for ia64 quirksBen LaHaise2002-09-173-2/+10
|
* libaio now actually does work on ia64Ben LaHaise2002-09-162-5/+5
|
* more libredhat-kernel squashes, updates to final abiBen LaHaise2002-09-135-6/+4
|
* try to make an rpmlibaio.0-3-91.1Ben LaHaise2002-09-121-1/+2
|
* update changelog, set version to 0.3.15, sort test caseslibaio.0-3-15.1Ben LaHaise2002-08-291-1/+1
|
* testcase for aio write deadlockBen LaHaise2002-06-071-0/+66
|
* make clean should tidy harness up too.Ben LaHaise2002-04-254-23/+72
| | | | add 12.t: verify that ioctxs are inaccessible across fork()
* 11.t: check for memory leaks in accounting with many repeated read/writesBen LaHaise2002-04-235-9/+68
| | | | | | 6.t: don't memset (slows things down) aio_setup.h: support for _SILENT read/writes ext2-enospc.img: test filesystem image for ENOSPC case.
* coverage fix for ENOSPCBen LaHaise2002-04-201-0/+4
|
* - add FAILED messages in a few places to make certain failures more obvious.Ben LaHaise2002-04-2012-7/+184
| | | | | - EFBIG fixes for 2.4.9 - check ENOSPC
* more test casesBen LaHaise2002-04-196-20/+157
|
* add O_APPEND testBen LaHaise2002-04-182-11/+23
|
* add rw test perm test caseBen LaHaise2002-04-184-11/+73
|
* add test harnessBen LaHaise2002-04-188-0/+219