mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
zdtm: Simple test for AIO ring
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
9594595096
commit
bbc38f3dac
3 changed files with 40 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ static/cwd00
|
|||
static/cwd01
|
||||
static/cwd02
|
||||
static/env00
|
||||
static/aio00
|
||||
static/maps00
|
||||
static/maps01
|
||||
static/maps02
|
||||
|
|
@ -190,6 +191,7 @@ static/remap_dead_pid
|
|||
TEST_CR_KERNEL="
|
||||
ns/static/tun
|
||||
static/timerfd
|
||||
static/aio00
|
||||
"
|
||||
|
||||
cat /proc/self/fdinfo/1 | grep -q mnt_id
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ TST_NOFILE = \
|
|||
dumpable01 \
|
||||
dumpable02 \
|
||||
remap_dead_pid \
|
||||
aio00 \
|
||||
fd \
|
||||
# jobctl00 \
|
||||
|
||||
|
|
@ -272,6 +273,7 @@ wait_stop:
|
|||
|
||||
$(TST): $(LIB)
|
||||
|
||||
aio00: override LDFLAGS += -laio
|
||||
futex.o: override CFLAGS += -pthread
|
||||
futex: override LDFLAGS += -pthread
|
||||
futex-rl.o: override CFLAGS += -pthread
|
||||
|
|
|
|||
36
test/zdtm/live/static/aio00.c
Normal file
36
test/zdtm/live/static/aio00.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include <libaio.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "zdtmtst.h"
|
||||
|
||||
const char *test_doc = "Check that plain io_setup works";
|
||||
const char *test_author = "Pavel Emelianov <xemul@parallels.com>";
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
io_context_t ctx = 0;
|
||||
|
||||
test_init(argc, argv);
|
||||
|
||||
if (io_setup(1, &ctx) < 0) {
|
||||
err("Can't setup io ctx");
|
||||
return 1;
|
||||
}
|
||||
|
||||
test_daemon();
|
||||
test_waitsig();
|
||||
|
||||
ret = io_getevents(ctx, 0, 1, NULL, NULL);
|
||||
if (ret != 0) {
|
||||
if (ret < 0)
|
||||
fail("IO ctx lost (%d)", ret);
|
||||
else
|
||||
fail("IO ctx screwed up (%d)", ret);
|
||||
} else
|
||||
pass();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue