Commit Graph

371 Commits

Author SHA1 Message Date
jruoho
16327d2721 As per PR bin/45180, do not traverse too deep. 2011-07-27 05:04:11 +00:00
christos
b7b6a059c7 make sum volatile to avoid printing 2011-07-24 14:00:36 +00:00
martin
04bb4b5206 gcc optimizes away the side effect free call to the "poke" function which
is supposed to smash our stack in this test case.
So: make it print out some dummy value based on the smashing changes.
2011-07-23 22:17:43 +00:00
jym
3c92ae0499 Modify exec test to be more resilient regarding partial exec protection:
skip test instead of returning a failure that could be misinterpreted.

Suggested by Jukka in private mail.
2011-07-20 22:53:44 +00:00
jym
ca453df649 Add a simple test case to check executable mapping rights for mprotect(2).
- provide an exec_prot_support() routine so $ARCH can indicate whether
it supports execution protection or not, and skip test accordingly.

- have a trivial 'return_one' shellcode to copy anywhere in a page, and
call it. The decision to keep the assembly solution is mine, reasons are
twofold:

   - all pure-C implementations cannot be controlled easily:
     bounds detection (beginning/end) of return_one is unpredictable,
     or requires the use of overkill solutions like libelf. Using
     dlsym(3) was a good proposal, however I can't use it to know the
     end address of the payload. It makes copying of the shellcode a bit
     more difficult: using a constant may be too small (code has not been
     entirely copied, and can lead to errors that can be erroneously
     detected as "test passed"), or too big (depending on where it is mapped
     in memory, copying past the end of the function may trigger SIGSEGV).

   - I have to ensure that the resulting assembly is the most compact
     possible, especially as it will be reused to test other parts of
     memory (stack, data, rodata, etc.).

Only i386 and amd64 are implemented so far. Others will come in due time.
FWIW, writing the exec_prot_support() callback and the return_one payload
should be enough. Writing callback requires good knowledge of the platform,
depending on chip revision, CPU, board, MMU... the protection level may vary.

Current files are put under lib/libc/arch/* and lib/libc/common/. Feel free to
move them around the tests/ tree. Keep in mind that the common/ and arch/ code
will be used outside of libc, so please do not hide them too deep in the tree.

I checked a few architectures via build.sh cross-compile, and will keep an
eye on buildbot for potential build breakage. Feel free to contact me in
case you see any, of course.
2011-07-18 23:16:08 +00:00
jruoho
650c5cb762 Verify that dup2(2) and dup3(2) fail with EBADF if the "new descriptor" is
specified to be larger than RLIMIT_NOFILE.
2011-07-18 04:29:37 +00:00
jruoho
ce5544e745 PR lib/45148 was fixed; remove xfail. 2011-07-16 14:29:15 +00:00
jruoho
450530506c Fix wrong linker flag that has always been lurking here. 2011-07-15 14:00:41 +00:00
jruoho
dacd6ba8f0 Split out the -lpthread tests to a separate file.
XXX: The only thing gained from this is seeing whether -lpthread breaks
     the getenv(3) family. Yet, a strict hypothesis about this would require
     that the two test files are identical, which they are not.
2011-07-15 13:54:31 +00:00
jruoho
11ee5754de Add two more naive tests. 2011-07-15 11:27:23 +00:00
jruoho
844c18226d Add some cases for dup2(2) and dup3(2). 2011-07-15 09:40:16 +00:00
jruoho
31e0c3fb7c Split the test to two contextually different tests. 2011-07-15 07:39:26 +00:00
jruoho
1ea16e5059 Rename two test files to get functional scope (and avoid confusion
with ctype(3)). No functional change.
2011-07-15 07:35:21 +00:00
jruoho
8a16de8dc8 Few naive unit tests for the getprotoent(3) family. 2011-07-15 06:41:29 +00:00
jruoho
943257c643 Move the uvm "loan" test to tests(7). 2011-07-14 11:08:44 +00:00
jruoho
fba4fe8aa3 Remove the 't_mincore' test case, as it is essentially a less elegant
version of the recently added page residency checks.
2011-07-14 10:24:56 +00:00
jruoho
c198c89355 Add the test cases from the old ../regress/sys/uvm/mmap/mmap.c. 2011-07-14 08:09:48 +00:00
jruoho
99db6ea634 Use ATF_CHECK() when appropriate. 2011-07-14 07:33:20 +00:00
jruoho
5fb118d0d5 Add few simple test cases. 2011-07-14 05:46:04 +00:00
jruoho
717eba57b8 Adjust. 2011-07-14 04:59:14 +00:00
jruoho
d808fe5f3c Rename few test case names. No functional change. 2011-07-13 11:17:03 +00:00
njoly
247e3a69b7 Fix off-by-one in strlen_huge testcase. 2011-07-12 12:08:07 +00:00
jruoho
aa3f9890b8 Split out 't_printf' and 't_scanf' from 't_format' to gain the common
"functional scope" for the test files.
2011-07-08 06:38:03 +00:00
jruoho
8caf60c4cf Remove the amd64-part from the Qemu checks. The following tests fail also on
i386/qemu: 'strtold_inf', 'strtold_nan', and 'infinity_long_double'. It seems
that more than anything else, these are dependent on the used Qemu version.
2011-07-08 05:10:05 +00:00
jruoho
8b5271a3be Fix previous. 2011-07-07 19:29:58 +00:00
jruoho
b238e6b2f8 Rename test case names. 2011-07-07 16:31:11 +00:00
jruoho
cc0041648e Move 't_glob_star' to 't_glob' for glob(3). 2011-07-07 15:53:27 +00:00
jruoho
9b5c52594e Merge 't_environment' and 't_environment_pth'. 2011-07-07 15:50:23 +00:00
jruoho
6836bf7807 Rename some test case names. No functional change. 2011-07-07 11:12:18 +00:00
jruoho
f7ca1d1262 Improve the QEMU/amd64 detection. 2011-07-07 11:04:30 +00:00
jruoho
34b08852ac Rewrite the limit-test. 2011-07-07 10:27:31 +00:00
jruoho
1b9f2dc9c1 Move 't_syslog_pthread' to 't_syslog' for consistency with libc. 2011-07-07 10:02:52 +00:00
jruoho
9a514225a1 Rename some test case names for consistency. No functional change. 2011-07-07 09:49:59 +00:00
jruoho
2b91d03e47 Few basic checks, including a case for strnlen(3). 2011-07-07 09:31:27 +00:00
jruoho
b34acef418 Add one simple test case. 2011-07-07 09:16:06 +00:00
jruoho
54bb10746c Split out the string tests from t_string.c for consistency. 2011-07-07 08:59:30 +00:00
jruoho
1c3ef2c741 Rename some test case names for consistency. 2011-07-07 08:27:36 +00:00
jruoho
4f84d54f76 Add some errno-checks. 2011-07-07 07:27:49 +00:00
jruoho
e32f731829 Remove 't_cerror' (this is tested by numerous individual tests).
Rename 't_context' to 't_getcontext' for consistency.
2011-07-07 07:06:21 +00:00
jruoho
068fb4f133 Add the syscall tests back. Couple of files and tests were also renamed for
consistency. All of these now mimic the libc structure.
2011-07-07 06:57:53 +00:00
mrg
8aa4955581 XXX: ugly hack to make these valid for vax fp.
XXX: could consolidate some of this into a common header, but i'll
     leave that clean up for another time.
2011-07-04 22:33:29 +00:00
mrg
634f9d1313 apply some -Wno-enum-compare. 2011-06-29 02:36:26 +00:00
joerg
208082f32c Try to initialize retval to something sensible. 2011-06-18 20:05:56 +00:00
joerg
2df16a8d62 input() isn't used 2011-06-18 20:05:28 +00:00
christos
355eb06ba8 Remove environment variable settings.
Now that we are not abusing $HOME to get to the terminfo db, make it visible.
2011-06-17 16:59:51 +00:00
christos
046bfa491c vis'ify the excess byte printing so that xstlproc does not barf. 2011-06-17 16:32:31 +00:00
christos
ab526f5155 turn off verbose 2011-06-17 16:30:58 +00:00
christos
e8b3e7091a turn on warnings 2011-06-17 16:30:30 +00:00
christos
23bea5092d - pass things in arguments instead of environment
- sanity check arguments
- disable extra data warning, old tests gave it too
- print more detailed errors
- use err/warn more
*some tests still fail; more than they used to*
2011-06-17 02:15:28 +00:00
joerg
afc8527716 Use proper format strings. 2011-06-16 15:33:24 +00:00