t_io.c revision 272343
1272343Sngie/* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */ 2272343Sngie 3272343Sngie#include <sys/types.h> 4272343Sngie#include <sys/mount.h> 5272343Sngie#include <sys/socket.h> 6272343Sngie 7272343Sngie#include <assert.h> 8272343Sngie#include <atf-c.h> 9272343Sngie#include <err.h> 10272343Sngie#include <errno.h> 11272343Sngie#include <fcntl.h> 12272343Sngie#include <pthread.h> 13272343Sngie#include <puffs.h> 14272343Sngie#include <puffsdump.h> 15272343Sngie#include <stdio.h> 16272343Sngie#include <unistd.h> 17272343Sngie#include <string.h> 18272343Sngie#include <stdlib.h> 19272343Sngie 20272343Sngie#include <rump/rump.h> 21272343Sngie#include <rump/rump_syscalls.h> 22272343Sngie 23272343Sngie#include "../../h_macros.h" 24272343Sngie#include "../common/h_fsmacros.h" 25272343Sngie 26272343Sngie#define MAKEOPTS(...) \ 27272343Sngie char *theopts[] = {NULL, "-s", __VA_ARGS__, "dtfs", "n/a", NULL} 28272343Sngie 29272343SngieATF_TC(nocache); 30272343SngieATF_TC_HEAD(nocache, tc) 31272343Sngie{ 32272343Sngie 33272343Sngie atf_tc_set_md_var(tc, "descr", "tests large i/o without page cache"); 34272343Sngie} 35272343Sngie 36272343SngieATF_TC_BODY(nocache, tc) 37272343Sngie{ 38272343Sngie MAKEOPTS("-o", "nopagecache"); 39272343Sngie char data[1024*1024]; 40272343Sngie void *args; 41272343Sngie int fd; 42272343Sngie 43272343Sngie FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts); 44272343Sngie FSTEST_ENTER(); 45272343Sngie 46272343Sngie RL(fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0755)); 47272343Sngie RL(rump_sys_write(fd, data, sizeof(data))); 48272343Sngie rump_sys_close(fd); 49272343Sngie 50272343Sngie FSTEST_EXIT(); 51272343Sngie FSTEST_DESTRUCTOR(tc, puffs, args); 52272343Sngie} 53272343Sngie 54272343Sngie 55272343SngieATF_TP_ADD_TCS(tp) 56272343Sngie{ 57272343Sngie 58272343Sngie ATF_TP_ADD_TC(tp, nocache); 59272343Sngie 60272343Sngie return atf_no_error(); 61272343Sngie} 62