]> git.saurik.com Git - apple/xnu.git/blame_incremental - tools/tests/xnu_quick_test/README
xnu-2782.1.97.tar.gz
[apple/xnu.git] / tools / tests / xnu_quick_test / README
... / ...
CommitLineData
1xnu_quick_test - this tool will do a quick test of every (well, to be
2honest most) system calls we support in xnu.
3
4WARNING - this is not meant to be a full regression test of all the
5system calls. The intent is to have a quick test of each system call that
6can be run very easily and quickly when a new kernel is built.
7
8This tool is meant to grow as we find xnu problems that could have be
9caught before we submit to a build train. So please add more tests and
10make the existing ones better. Some of the original tests are nothing
11more than place holders and quite lame. Just keep in mind that the tool
12should run as fast as possible. If it gets too slow then most people
13will stop running it.
14
15LP64 testing tip - when adding or modifying tests, keep in mind the
16variants in the LP64 world. If xnu gets passed a structure the varies in
17size between 32 and 64-bit processes, try to test that a field in the
18structure contains valid data. For example, if we know foo structure
19looks like:
20struct foo {
21 int an_int;
22 long a_long;
23 int another_int;
24}
25And if we know what another_int should contain then test for the known
26value since it's offset will vary depending on whether the calling process
27is 32 or 64 bits.
28
29NOTE - we have several workarounds and test exceptions for some
30outstanding bugs in xnu. All the workarounds are marked with "todo" and
31some comments noting the radar number of the offending bug. Do a search
32for "todo" in the source files for this project to locate which tests have
33known failures. And please tag any new exceptions you find with "todo"
34in the comment and the radar number of the bug.
35
36Building:
37xnu_quick_test is built automatically by BNI for both Mac (10.9 and later), and
38iOS (7 and later) trains, and is delivered on AppleInternal builds in
39/AppleInternal/CoreOS/xnu_quick_test. It is built as part of the xnu_quick_test
40build alias, so you can also find a copy on ~rc at:
41~rc/Software/$RELEASE/Updates/$RELEASEVERSION/Roots/xnu_quick_test/AppleInternal/CoreOS/xnu_quick_test.
42
43Alternatively you can build it yourself using make like so:
44SDKROOT=/path/to/sdk make
45
46For example:
47# build for Mac, current OS
48SDKROOT=/ make
49# build for iOS
50SDKROOT=`xcodebuild -sdk iphoneos.internal -version Path` make
51
52By default xnu builds all-way fat, but you can restrict this by explicitly
53specifying architectures like so:
54# build for only armv7 and armv7s
55SDKROOT=`xcodebuild -sdk iphoneos.internal -version Path` make ARCH="armv7 armv7s"
56
57There are four defines which you can use at the compile line to build variants.
58DEBUG
59 turn on additional printfs
60CONFORMANCE_TESTS_IN_XNU
61 when conformance tests are in xnu, set this to 1
62TEST_SYSTEM_CALLS
63 test system calls (doesn't compile; a different bug)
64RUN_UNDER_TESTBOTS
65 when running under testbots, set this to 1
66by default, all four are set to 0, i.e. disabled. To build, export
67MORECFLAGS with the values you want set, e.g.
68 export MORECFLAGS="-D DEBUG=1 -D CONFORMANCE_TESTS_IN_XNU=1"
69
70todo:
71-- have folks with area expertise fix lame tests
72 (most of the networking related tests are pretty lame)
73-- mach system calls support
74
75
76USAGE: xnu_quick_test -target TARGET_PATH
77
78 -f[ailures] MAX_FAILS_ALLOWED # number of test cases that may fail before we give up. defaults to 0
79 -l[ist] # list all the tests this tool performs
80 -r[un] 1, 3, 10 - 19 # run specific tests. enter individual test numbers and/or range of numbers. use -list to list tests.
81 -s[kip] # skip setuid tests
82 -t[arget] TARGET_PATH # path to directory where tool will create test files. defaults to "/tmp/"
83 -testbot # output results in CoreOS TestBot compatible format
84
85examples:
86--- Place all test files and directories at the root of volume "test_vol" ---
87xnu_quick_test -t /Volumes/test_vol/
88
89--- Run the tool for tests 10 thru 15, test 18 and test 20 ---
90xnu_quick_test -r 10-15, 18, 20
91
92
93--- example of running the tool to list all the tests it currently supports ---
94xnu_quick_test -l
95List of all tests this tool performs...
96 1 syscall
97 2 fork, wait4, exit
98 3 fsync, ftruncate, lseek, pread, pwrite, read, readv, truncate, write, writev
99 4 close, fpathconf, fstat, open, pathconf
100 5 link, stat, unlink
101 6 chdir, fchdir
102 7 access, chmod, fchmod
103 8 chown, fchown, lchown, lstat, readlink, symlink
104 9 fstatfs, getattrlist, getfsstat, statfs
105 10 getpid, getppid, pipe
106 11 getauid, gettid, getuid, geteuid, issetugid, setaudit_addr, seteuid, settid, settid_with_pid, setuid
107 12 mkdir, rmdir, umask
108 13 mknod, sync
109 14 fsync, getsockopt, poll, select, setsockopt, socketpair
110 15 accept, bind, connect, getpeername, getsockname, listen, socket, recvmsg, sendmsg, sendto, sendfile
111 16 chflags, fchflags
112 17 kill, vfork, execve
113 18 getegid, getgid, getgroups, setegid, setgid, setgroups
114 19 dup, dup2, getdtablesize
115 20 getrusage, profil
116 21 getitimer, setitimer, sigaction, sigpending, sigprocmask, sigsuspend, sigwait
117 22 acct
118 23 ioctl
119 24 chroot
120 25 madvise, mincore, minherit, mlock, mlock, mmap, mprotect, msync, munmap
121 26 getpgrp, getpgid, getsid, setpgid, setpgrp, setsid
122 27 fcntl
123 28 getlogin, setlogin
124 29 getpriority, setpriority
125 30 futimes, gettimeofday, settimeofday, utimes
126 31 rename, stat
127 32 flock
128 33 mkfifo, read, write
129 34 quotactl
130 35 getrlimit, setrlimit
131 36 getattrlist, getdirentries, getdirentriesattr, setattrlist
132 37 exchangedata
133 38 searchfs
134 39 sem_close, sem_open, sem_post, sem_trywait, sem_unlink, sem_wait
135 40 semctl, semget, semop
136 41 shm_open, shm_unlink
137 42 shmat, shmctl, shmdt, shmget
138 43 fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, listxattr, removexattr, setxattr
139 44 aio_cancel, aio_error, aio_read, aio_return, aio_suspend, aio_write, fcntl, lio_listio
140 45 kevent, kqueue
141 46 msgctl, msgget, msgrcv, msgsnd
142
143
144--- example of a full test run ---
145cottje% ./BUILD/dst/xnu_quick_test
146created test directory at "/tmp/xnu_quick_test-1660251855"
147Will allow 0 failures before testing is aborted
148
149Begin testing - Tue Dec 13 15:56:50 2005
150
151test #1 - syscall
152test #2 - fork, wait4, exit
153test #3 - fsync, ftruncate, lseek, pread, pwrite, read, readv, truncate, write, writev
154test #4 - close, fpathconf, fstat, open, pathconf
155test #5 - link, stat, unlink
156test #6 - chdir, fchdir
157test #7 - access, chmod, fchmod
158test #8 - chown, fchown, lchown, lstat, readlink, symlink
159test #9 - fstatfs, getattrlist, getfsstat, statfs
160test #10 - getpid, getppid, pipe
161test #11 - getauid, gettid, getuid, geteuid, issetugid, setauid, seteuid, settid, settid_with_pid, setuid
162test #12 - mkdir, rmdir, umask
163test #13 - mknod, sync
164test #14 - fsync, getsockopt, poll, select, setsockopt, socketpair
165test #15 - accept, bind, connect, getpeername, getsockname, listen, socket, recvmsg, sendmsg, sendto
166test #16 - chflags, fchflags
167test #17 - kill, vfork, execve
168test #18 - getegid, getgid, getgroups, setegid, setgid, setgroups
169test #19 - dup, dup2, getdtablesize
170test #20 - getrusage, profil
171test #21 - ktrace
172test #22 - getitimer, setitimer, sigaction, sigpending, sigprocmask, sigsuspend, sigwait
173test #23 - acct
174test #24 - ioctl
175test #25 - chroot
176test #26 - madvise, mincore, minherit, mlock, mlock, mmap, mprotect, msync, munmap
177test #27 - getpgrp, getpgid, getsid, setpgid, setpgrp, setsid
178test #28 - fcntl
179test #29 - getlogin, setlogin
180test #30 - getpriority, setpriority
181test #31 - futimes, gettimeofday, settimeofday, utimes
182test #32 - rename, stat
183test #33 - flock
184test #34 - mkfifo, read, write
185test #35 - quotactl
186test #36 - getrlimit, setrlimit
187test #37 - getattrlist, getdirentries, getdirentriesattr, setattrlist
188test #38 - exchangedata
189test #39 - searchfs
190test #40 - sem_close, sem_open, sem_post, sem_trywait, sem_unlink, sem_wait
191test #41 - semctl, semget, semop
192test #42 - shm_open, shm_unlink
193test #43 - shmat, shmctl, shmdt, shmget
194test #44 - fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, listxattr, removexattr, setxattr
195test #45 - aio_cancel, aio_error, aio_read, aio_return, aio_suspend, aio_write, fcntl, lio_listio
196test #46 - kevent, kqueue
197test #47 - msgctl, msgget, msgrcv, msgsnd
198
199End testing - Tue Dec 13 15:57:08 2005