static void test_io(unsigned int n) { int status; struct testcase *tc = testcases + n; status = io_tio("file", tc->flags, tc->operation); if (status) tst_res(TFAIL, "%s, status = %d", tc->desc, status); else tst_res(TPASS, "%s", tc->desc); }
int test_main(void) { int status = 0; tst_resm(TINFO, "Running test 1\n"); status = io_tio("file1", O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE, AIO_MAXIO, IO_CMD_PWRITE); if (status) { return status; } tst_resm(TINFO, "Running test 2\n"); status = io_tio("file1", O_RDONLY | O_DIRECT | O_LARGEFILE, AIO_MAXIO, IO_CMD_PREAD); if (status) { return status; } tst_resm(TINFO, "Running test 3\n"); status = io_tio("file1", O_TRUNC | O_RDWR, AIO_MAXIO, IO_CMD_PWRITE); if (status) { return status; } tst_resm(TINFO, "Running test 4\n"); status = io_tio("file1", O_RDWR, AIO_MAXIO, IO_CMD_PREAD); if (status) { return status; } tst_resm(TINFO, "Running test 5\n"); status = io_tio("file1", O_TRUNC | O_WRONLY, AIO_MAXIO, IO_CMD_PWRITE); if (status) { return status; } tst_resm(TINFO, "Running test 6 \n"); status = io_tio("file1", O_RDONLY, AIO_MAXIO, IO_CMD_PREAD); if (status) { return status; } return status; }