1#ifndef _TESTS_H_
2#define	_TESTS_H_
3
4#ifndef DEBUG
5#define DEBUG                          0
6#endif
7#ifndef CONFORMANCE_TESTS_IN_XNU
8#define CONFORMANCE_TESTS_IN_XNU       0
9#endif
10#ifndef TEST_SYSTEM_CALLS
11#define TEST_SYSTEM_CALLS              0
12#endif
13
14#include <errno.h>
15#include <fcntl.h>
16#include <signal.h>		/* Install signal handlers*/
17#include <spawn.h>
18#include <stdio.h>
19#include <stdlib.h>
20#include <string.h>
21#include <unistd.h>
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>
50#include <TargetConditionals.h> /* for TARGET_OS_EMBEDDED */
51
52#define MY_BUFFER_SIZE (1024 * 10)
53#define ARM 	100  /* I am not sure if the value really matters? */
54#define POWERPC	238947
55#define INTEL	38947			/*
56					 * Random values used by execve tests to
57					 * determine architecture of machine.
58					 */
59
60typedef int (*test_rtn_t)(void *);
61
62int access_chmod_fchmod_test( void * the_argp );
63int acct_test( void * the_argp );
64int aio_tests( void * the_argp );
65int bsd_shm_tests( void * the_argp );
66int chdir_fchdir_test( void * the_argp );
67int chflags_fchflags_test( void * the_argp );
68int chroot_test( void * the_argp );
69int chown_fchown_lchown_lstat_symlink_test( void * the_argp );
70int create_file_with_name( char *the_pathp, char *the_namep, int remove_existing );
71int create_random_name( char *the_pathp, int do_open );
72int directory_tests( void * the_argp );
73int do_execve_test(char * path, char * argv[], void * envpi, int killwait);
74int dup_test( void * the_argp );
75int exchangedata_test( void * the_argp );
76int execve_kill_vfork_test( void * the_argp );
77int fcntl_test( void * the_argp );
78int fork_wait4_exit_test( void * the_argp );
79int fs_stat_tests( void * the_argp );
80int get_architecture(void);				/* Intel or PPC */
81int get_bits(void);					/* 64 or 32 */
82int getlogin_setlogin_test( void * the_argp );
83int getpid_getppid_pipe_test( void * the_argp );
84int getpriority_setpriority_test( void * the_argp );
85int getrusage_profil_test( void * the_argp );
86int groups_test( void * the_argp );
87int ioctl_test( void * the_argp );
88int kqueue_tests( void * the_argp );
89int limit_tests( void * the_argp );
90int link_stat_unlink_test( void * the_argp );
91int locking_test( void * the_argp );
92int memory_tests( void * the_argp );
93int message_queue_tests( void * the_argp );
94int mkdir_rmdir_umask_test( void * the_argp );
95int mkfifo_test( void * the_argp );
96int mknod_sync_test( void * the_argp );
97int open_close_test( void * the_argp );
98int process_group_test( void * the_argp );
99int quotactl_test( void * the_argp );
100int read_write_test( void * the_argp );
101int rename_test( void * the_argp );
102int searchfs_test( void * the_argp );
103int sema_tests( void * the_argp );
104int sema2_tests( void * the_argp );
105int shm_tests( void * the_argp );
106int signals_test( void * the_argp );
107int socket_tests( void * the_argp );
108int socket2_tests( void * the_argp );
109int syscall_test( void * the_argp );
110int time_tests( void * the_argp );
111int uid_tests( void * the_argp );
112int xattr_tests( void * the_argp );
113
114struct test_entry
115{
116	int				test_run_it;		/* 0 means do not run this test, else run it */
117	test_rtn_t		test_routine;		/* routine to call */
118	void *			test_input;			/* optional input to test_routine */
119	char *			test_infop;			/* information about what is tested */
120};
121typedef struct test_entry * test_entryp;
122
123#endif /* !_TESTS_H_ */
124