1*043036a2SApple OSS Distributions #include "perf_index.h" 2*043036a2SApple OSS Distributions #include "fail.h" 3*043036a2SApple OSS Distributions #include "test_file_helper.h" 4*043036a2SApple OSS Distributions #include "ramdisk.h" 5*043036a2SApple OSS Distributions #include <sys/param.h> 6*043036a2SApple OSS Distributions #include <stdio.h> 7*043036a2SApple OSS Distributions 8*043036a2SApple OSS Distributions const char ramdisk_name[] = "StressRAMDisk"; 9*043036a2SApple OSS Distributions char ramdisk_path[MAXPATHLEN]; 10*043036a2SApple OSS Distributions 11*043036a2SApple OSS Distributions DECL_SETUP { 12*043036a2SApple OSS Distributions int retval; 13*043036a2SApple OSS Distributions 14*043036a2SApple OSS Distributions retval = setup_ram_volume(ramdisk_name, ramdisk_path); 15*043036a2SApple OSS Distributions VERIFY(retval == PERFINDEX_SUCCESS, "setup_ram_volume failed"); 16*043036a2SApple OSS Distributions 17*043036a2SApple OSS Distributions printf("ramdisk: %s\n", ramdisk_path); 18*043036a2SApple OSS Distributions 19*043036a2SApple OSS Distributions return test_file_write_setup(ramdisk_path, num_threads, length); 20*043036a2SApple OSS Distributions } 21*043036a2SApple OSS Distributions 22*043036a2SApple OSS Distributions DECL_TEST { 23*043036a2SApple OSS Distributions return test_file_write(ramdisk_path, thread_id, num_threads, length, 0L); 24*043036a2SApple OSS Distributions } 25*043036a2SApple OSS Distributions 26*043036a2SApple OSS Distributions DECL_CLEANUP { 27*043036a2SApple OSS Distributions int retval; 28*043036a2SApple OSS Distributions 29*043036a2SApple OSS Distributions retval = test_file_write_cleanup(ramdisk_path, num_threads, length); 30*043036a2SApple OSS Distributions VERIFY(retval == PERFINDEX_SUCCESS, "test_file_read_cleanup failed"); 31*043036a2SApple OSS Distributions 32*043036a2SApple OSS Distributions retval = cleanup_ram_volume(ramdisk_path); 33*043036a2SApple OSS Distributions VERIFY(retval == 0, "cleanup_ram_volume failed"); 34*043036a2SApple OSS Distributions 35*043036a2SApple OSS Distributions return PERFINDEX_SUCCESS; 36*043036a2SApple OSS Distributions } 37