]>
Commit | Line | Data |
---|---|---|
2d21ac55 A |
1 | #ifndef _TESTS_H_ |
2 | #define _TESTS_H_ | |
3 | ||
2d21ac55 A |
4 | #ifndef CONFORMANCE_TESTS_IN_XNU |
5 | #define CONFORMANCE_TESTS_IN_XNU 0 | |
6 | #endif | |
7 | #ifndef TEST_SYSTEM_CALLS | |
8 | #define TEST_SYSTEM_CALLS 0 | |
9 | #endif | |
10 | ||
11 | #include <errno.h> | |
12 | #include <fcntl.h> | |
13 | #include <signal.h> /* Install signal handlers*/ | |
14 | #include <spawn.h> | |
15 | #include <stdio.h> | |
16 | #include <stdlib.h> | |
17 | #include <string.h> | |
18 | #include <unistd.h> | |
6d2010ae A |
19 | #include <stdbool.h> |
20 | #include <assert.h> | |
b0d623f7 | 21 | #include <stdarg.h> /* Used to support printf() in misc.c */ |
2d21ac55 A |
22 | #include <mach/machine.h> /* Used to determine host properties */ |
23 | #include <mach/vm_inherit.h> | |
24 | #include <sys/acct.h> | |
25 | #include <sys/aio.h> | |
26 | #include <sys/attr.h> | |
27 | #include <sys/dirent.h> | |
28 | #include <sys/disk.h> | |
29 | #include <sys/uio.h> | |
30 | #include <sys/kauth.h> | |
31 | #include <sys/mman.h> | |
32 | #include <sys/mount.h> | |
33 | #include <sys/param.h> | |
34 | #include <sys/ptrace.h> | |
35 | #include <sys/quota.h> | |
36 | #include <sys/resource.h> | |
37 | #include <sys/select.h> | |
38 | #include <sys/signal.h> | |
39 | #include <sys/socket.h> | |
40 | #include <sys/stat.h> | |
41 | #include <sys/syscall.h> | |
42 | #include <sys/sysctl.h> /* Used to determine host properties */ | |
43 | #include <sys/syslimits.h> | |
44 | #include <sys/time.h> | |
45 | #include <sys/ttycom.h> | |
46 | #include <sys/types.h> | |
47 | #include <sys/ucred.h> | |
48 | #include <sys/vnode.h> | |
49 | #include <sys/wait.h> | |
cf7d32b8 A |
50 | #include <TargetConditionals.h> /* for TARGET_OS_EMBEDDED */ |
51 | ||
2d21ac55 | 52 | #define MY_BUFFER_SIZE (1024 * 10) |
cf7d32b8 | 53 | #define ARM 100 /* I am not sure if the value really matters? */ |
2d21ac55 A |
54 | #define INTEL 38947 /* |
55 | * Random values used by execve tests to | |
56 | * determine architecture of machine. | |
57 | */ | |
316670eb A |
58 | |
59 | #define FILE_NOTME "/private/tmp/notme" /* file in /private/tmp not owned by the current user */ | |
60 | #define FILE_ME "/private/tmp/me" /* file in /private/tmp owned by the current user */ | |
2d21ac55 A |
61 | |
62 | typedef int (*test_rtn_t)(void *); | |
63 | ||
64 | int access_chmod_fchmod_test( void * the_argp ); | |
65 | int acct_test( void * the_argp ); | |
66 | int aio_tests( void * the_argp ); | |
67 | int bsd_shm_tests( void * the_argp ); | |
68 | int chdir_fchdir_test( void * the_argp ); | |
69 | int chflags_fchflags_test( void * the_argp ); | |
70 | int chroot_test( void * the_argp ); | |
71 | int chown_fchown_lchown_lstat_symlink_test( void * the_argp ); | |
72 | int create_file_with_name( char *the_pathp, char *the_namep, int remove_existing ); | |
73 | int create_random_name( char *the_pathp, int do_open ); | |
74 | int directory_tests( void * the_argp ); | |
75 | int do_execve_test(char * path, char * argv[], void * envpi, int killwait); | |
316670eb | 76 | int do_spawn_test(int arch, int shouldfail); |
2d21ac55 A |
77 | int dup_test( void * the_argp ); |
78 | int exchangedata_test( void * the_argp ); | |
79 | int execve_kill_vfork_test( void * the_argp ); | |
80 | int fcntl_test( void * the_argp ); | |
81 | int fork_wait4_exit_test( void * the_argp ); | |
82 | int fs_stat_tests( void * the_argp ); | |
83 | int get_architecture(void); /* Intel or PPC */ | |
84 | int get_bits(void); /* 64 or 32 */ | |
85 | int getlogin_setlogin_test( void * the_argp ); | |
86 | int getpid_getppid_pipe_test( void * the_argp ); | |
87 | int getpriority_setpriority_test( void * the_argp ); | |
b0d623f7 | 88 | int getrusage_test( void * the_argp ); |
2d21ac55 A |
89 | int groups_test( void * the_argp ); |
90 | int ioctl_test( void * the_argp ); | |
91 | int kqueue_tests( void * the_argp ); | |
92 | int limit_tests( void * the_argp ); | |
93 | int link_stat_unlink_test( void * the_argp ); | |
94 | int locking_test( void * the_argp ); | |
95 | int memory_tests( void * the_argp ); | |
96 | int message_queue_tests( void * the_argp ); | |
97 | int mkdir_rmdir_umask_test( void * the_argp ); | |
98 | int mkfifo_test( void * the_argp ); | |
99 | int mknod_sync_test( void * the_argp ); | |
100 | int open_close_test( void * the_argp ); | |
101 | int process_group_test( void * the_argp ); | |
102 | int quotactl_test( void * the_argp ); | |
103 | int read_write_test( void * the_argp ); | |
104 | int rename_test( void * the_argp ); | |
105 | int searchfs_test( void * the_argp ); | |
106 | int sema_tests( void * the_argp ); | |
107 | int sema2_tests( void * the_argp ); | |
108 | int shm_tests( void * the_argp ); | |
109 | int signals_test( void * the_argp ); | |
110 | int socket_tests( void * the_argp ); | |
111 | int socket2_tests( void * the_argp ); | |
112 | int syscall_test( void * the_argp ); | |
113 | int time_tests( void * the_argp ); | |
114 | int uid_tests( void * the_argp ); | |
115 | int xattr_tests( void * the_argp ); | |
b0d623f7 A |
116 | int data_exec_tests( void * the_argp ); |
117 | int machvm_tests( void * the_argp ); | |
118 | int getdirentries_test( void * the_argp ); | |
119 | int statfs_32bit_inode_tests( void * the_argp ); | |
6d2010ae A |
120 | int commpage_data_tests( void * the_argp ); |
121 | int atomic_fifo_queue_test( void * the_argp ); | |
122 | int sched_tests( void * the_argp ); | |
316670eb A |
123 | int content_protection_test( void * the_argp ); |
124 | int pipes_test( void * the_argp ); | |
125 | int kaslr_test( void * the_argp ); | |
fe8ab488 A |
126 | int getattrlistbulk_test( void * the_argp ); |
127 | int openat_close_test( void * the_argp ); | |
128 | int linkat_fstatat_unlinkat_test( void * the_argp ); | |
129 | int faccessat_fchmodat_fchmod_test( void * the_argp ); | |
130 | int fchownat_fchown_symlinkat_test( void * the_argp ); | |
131 | int mkdirat_unlinkat_umask_test( void * the_argp ); | |
132 | int renameat_test( void * the_argp ); | |
133 | int set_exception_ports_test( void * the_argp ); | |
2d21ac55 A |
134 | |
135 | struct test_entry | |
136 | { | |
137 | int test_run_it; /* 0 means do not run this test, else run it */ | |
138 | test_rtn_t test_routine; /* routine to call */ | |
139 | void * test_input; /* optional input to test_routine */ | |
140 | char * test_infop; /* information about what is tested */ | |
141 | }; | |
142 | typedef struct test_entry * test_entryp; | |
143 | ||
b0d623f7 A |
144 | /* Special replacement printf with date/time stamp */ |
145 | int my_printf(const char * __restrict fmt, ...); | |
146 | #define printf my_printf | |
147 | ||
6d2010ae A |
148 | /* |
149 | If running xnu_quick_test under testbots, disable special | |
150 | printf defined in the previous step. This is done in order | |
151 | to generate log messages in a format which testbots understands | |
152 | */ | |
153 | ||
154 | #if RUN_UNDER_TESTBOTS | |
155 | #undef printf | |
156 | #endif | |
157 | ||
2d21ac55 | 158 | #endif /* !_TESTS_H_ */ |