Commit Graph

6448 Commits

Author SHA1 Message Date
rillig b4747d0de9 tests/indent: don't create an unneeded file 2023-12-17 10:02:09 +00:00
mlelstv d233f49979 mmap() fails for size == 0 with EINVAL unless the mapping is anonymous. 2023-12-11 09:26:08 +00:00
rillig 35fd37d4b4 tests/libcurses: require 3 digits in octal character escapes
Previously, the string literal "\0" had been interpreted as "0", which
would have made the backslash redundant.  The tests don't use this form.
2023-12-10 18:04:55 +00:00
rillig 97817c96ae indent: be strict about options from profile files
Previously, the "option" 'xdi0' was treated the same as '-xdi0'.
2023-12-10 17:45:35 +00:00
rillig 08fd84594d tests/libcurses: constify 2023-12-10 15:51:13 +00:00
rillig 2209bb4284 tests/libcurses: fix typo in comment 2023-12-10 15:42:29 +00:00
rillig d7c2af39e9 tests/indent: fix name of test case 2023-12-10 15:39:25 +00:00
rillig 960c22026a lint: allow querying for 'static' followed by non-'static' declaration 2023-12-10 15:29:38 +00:00
rillig de4a7516ed lint: clean up comments
No functional change.
2023-12-10 14:59:47 +00:00
riastradh 29fd213712 t_setrlimit: Narrow the scope of stack-protector warning suppression. 2023-12-07 16:54:44 +00:00
rillig 0fde876303 tests/indent: test compound expressions 2023-12-03 14:26:10 +00:00
rillig 9cb5ea81fb tests/libcurses: sync documentation with reality
Unknown escape sequences in string literals trigger an error, since
testlang_conf.l 1.22 from 2021-02-25.

The '\b' is recognized since testlang_conf.l 1.26 from 2021-11-15.
2023-12-03 09:42:36 +00:00
rillig 8a47554360 tests/lint: add more test cases for nonportable character comparison 2023-12-02 23:54:49 +00:00
christos 20b493dddb remove dup copy. 2023-12-02 16:18:17 +00:00
christos 6a63b824ad PR/57735: Jose Louis Duran: mtree -f file1 -f file2 does not consider type
changes.
(FreeBSD https://github.com/freebsd/freebsd-src/commit/\
    4f4b548b1d21ae16955b09f9b717524167a7d97e)
2023-12-02 13:23:59 +00:00
riastradh 20941a42e9 pthread: Don't adjust user-allocated stack addresses by guardsize.
PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-28 02:54:33 +00:00
riastradh a76ca770cc libpthread/t_stack: Fix format string for size_t.
Tested this on i386 since that had been crashing before, but i386
doesn't see %zu for unsigned int as a problem.

PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-28 00:27:05 +00:00
riastradh 2852ab885f libpthread/t_stack: Appease gcc12 maybe-uninitialized warning.
The jmp_buf is not, in fact, uninitialized at the point of use, but
it doesn't hurt to narrow the scope a bit to between when the jmp_buf
is initialized by setjmp, and when the signal handler might be called
after sigaction.

Noted by prlw1.

PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-27 22:18:29 +00:00
riastradh 1ce2050a8e libpthread/t_stack: Omit needless cast in previous.
Arose from an earlier draft of the change.

PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-27 22:17:41 +00:00
riastradh 73a871b293 libpthread/t_stack: Make this more robust to the guard size bug.
Make sure to allocate enough space for the thread's stack for a guard
even though there shouldn't be one, so that when we run the thread,
it doesn't start with the stack pointer pointing into someone else's
allocation (like malloc) causing stack frames to trash another data
structure -- or causing the user of that data structure to trash the
stack frames.

PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-27 22:15:08 +00:00
christos ecbffb52ab Don't use fmtcheck for strfmon format strings. It does not work. Fix a broken
test.
2023-11-27 19:45:36 +00:00
riastradh c73729f0bb t_dlinfo, t_rtld_r_debug: Audit ATF_REQUIRE/CHECK, sprinkle messages.
Make sure to use ATF_REQUIRE when the subsequent code doesn't work if
the check fails.
2023-11-24 17:40:20 +00:00
riastradh e441ef5517 rtld tests: Don't use RZ for dlinfo.
Use

	ATF_REQUIRE_EQ_MSG(dlinfo(...), 0, "dlinfo: %s", dlerror())

instead, in order to accurately report the error on failure.  RZ is
only for functions like pthread_create(3) that return zero on success
and errno(3) code on failure, but dlinfo returns -1 on failure and
sets dlerror() to report the nature of the error.
2023-11-24 17:40:09 +00:00
riastradh ef23f679e4 tests: Audit RZ abuse.
RZ succeeds if x is zero, and fails if x is nonzero, treating a
nonzero value as a error number as in errno(3) to print the message.

The following library routines instead return -1 on failure and set
errno to the error code:

fuse_opt_add_arg
fuse_opt_add_opt
fuse_opt_add_opt_escaped
fuse_opt_insert_arg
lseek
system

So use RL instead for those -- succeeds if x is zero, and fails if x
is -1.

This shouldn't make any tests newly fail or newly succeed -- the
functions in question only ever return 0 or -1 -- but if the tests
were already failing anywhere, they will now fail with meaningful
messages.

TBD: dlinfo, which isn't fit for RL or RZ since it reports errors via
dlerror() rather than errno.
2023-11-24 17:31:03 +00:00
christos e757b4ce33 t_setrlimit uses alloca now 2023-11-24 17:19:55 +00:00
riastradh 8f4b2a189f t_rnd: Nix trailing whitespace.
No functional change intended.
2023-11-24 16:36:23 +00:00
riastradh 290ca0f2a9 t_rnd: Fix misuse of RZ.
Not likely to matter, but in the unlikely event that rump_sys_close
fails, it will return -1 and set errno as RL expects, not return the
error code as RZ expects.
2023-11-24 16:35:51 +00:00
riastradh 5b36b4ea47 pthread: Add tests for pthread user stack allocation.
PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-24 16:21:17 +00:00
riastradh 6cfac959ea t_setrlimit: Fix typos in comments and messages.
No substantive change intended.  Suggested by rillig@.

PR kern/57711

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-22 02:20:34 +00:00
riastradh bf53af405a exec: Map noaccess part of stack with prot=NONE, maxprot=READ|WRITE.
This way, setrlimit(RLIMT_STACK) can grant READ|WRITE access when
increasing the stack size.

PR kern/57711

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-21 00:09:18 +00:00
riastradh 2fb69068d1 t_setrlimit: Verify changing RLIMIT_STACK affects access to stack.
PR kern/57711

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-20 13:05:17 +00:00
riastradh 8328a6ed14 t_fdrestart: Mark some tests no longer xfail.
Backing out ad's changes last month seemed to fix the symptoms
(although I'm pretty sure this logic is still broken, more to come).

PR kern/57659
2023-11-18 19:46:55 +00:00
christos 8cbc788f24 PR/57689: RVP: getcwd() not overridable with -D_FORTIFY_SOURCE 2023-11-10 23:03:25 +00:00
riastradh 1eb7667c84 t_fenv: Factor checks out of switch in checkrounding.
No functional change intended, just tidies up a bit.

PR port-mips/57680

XXX pullup-10
2023-11-06 13:48:12 +00:00
riastradh 519833e0d7 t_fenv: Use volatile intermediate to force rounding to double.
See comment for details about why this is necessary.

Should fix these tests on i386 (and perhaps m68k too).

PR port-mips/57680

XXX pullup-10
2023-11-06 13:48:00 +00:00
riastradh 8fde1c3f4c t_fenv: Improve diagnostics when rounding mode tests fail.
Print the correct input, and print the rounding mode for clarity so
you don't have to cross-reference it by line number.

PR port-mips/57680

XXX pullup-10
2023-11-05 21:13:06 +00:00
riastradh 40e521dfc3 t_fenv: Add #pragma STDC FENV_ACCESS ON and verify FLT_RADIX is 2.
Except gcc doesn't implement this pragma, so make it conditional.

And clang only supports it on some architectures, so just leave it
out for now with a comment about why.

PR port-mips/57680

XXX pullup-10
2023-11-05 16:28:05 +00:00
riastradh f6d88030b5 t_fenv: Verify rounding mode takes effect.
At least for addition operations, anyway.

Somewhat redundant with the test t_fe_round added by maya@ but this
gives two minimal pairs to easily diagnose exactly what the rounding
mode is when the wrong one was selected.

PR port-mips/57680

XXX pullup-10
2023-11-05 16:06:27 +00:00
riastradh f7171b7a20 t_fenv: Check FLT_ROUNDS whenever we touch the rounding mode.
PR port-mips/57680

XXX pullup-10
2023-11-05 15:28:17 +00:00
riastradh 1865a6485e t_fenv: Print wrong values if tests fail.
XXX pullup-10
2023-11-05 15:27:40 +00:00
yamaguchi 63162a40fe Added the test for vlan over l2tp 2023-11-02 09:50:50 +00:00
rillig 49e867d6b1 tests/lint: test GCC attributes after abstract function type 2023-10-22 21:30:32 +00:00
rillig 0fce8157b2 tests/indent: clean up comments 2023-10-22 21:03:08 +00:00
rin fa6a6a38f1 ifconfig/t_capabilities: s/if_capabilities/if_capenable/ in message 2023-10-18 08:52:46 +00:00
rin e782b7c6e7 ifconfig/t_capabilities: Skip unless run_unsafe is configured to yes
The test modifies if_capabilities for all available interfaces.
This is not a behavior we expect for normal ATF runs.

Similar tests modifying living network configurations are already
skipped by default. This is the last one remained for ifconfig(8).

Also, I'm not sure whether this is a test for ifconfig(8).

XXX
Pullup to netbsd-10 ASAP. No other branches are affected.
2023-10-18 08:25:14 +00:00
yamaguchi e8037d3f57 Update the test case for MTU of lag to adapt new behavior 2023-10-18 06:41:00 +00:00
rjs 1b17496e10 The t_fdrestart test requires rump. 2023-10-17 13:51:52 +00:00
yamaguchi ca0a5f7dd4 Make the lagg interface up before change its MTU
This change is related to PR kern/57650
2023-10-16 07:57:40 +00:00
riastradh 349eda5c97 t_fdrestart: Rework this to be a little more robust.
For the write test, need to make sure the pipe's buffer is full first
before the write that blocks, so that it doesn't return partial
progress rather than ERESTART if woken.
2023-10-15 15:18:17 +00:00
riastradh d37c22e105 t_fdrestart: Verify rump_sys_write failed second time around.
PR kern/57659
2023-10-15 14:30:51 +00:00