Commit Graph

6438 Commits

Author SHA1 Message Date
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
riastradh 5ba0017fa5 t_fdrestart: New test of closing fd with another thread in I/O on it.
Adapted from regress/sys/kern/dislodgefd.

PR kern/57659
2023-10-15 13:22:52 +00:00
christos 9a3e6516d0 PR/57633: Jose Luis Duran: Add strfmon tests from FreeBSD 2023-10-14 20:19:31 +00:00
blymn fc8a227a5a Update check files affected by a fix to addbyte.c in libcurses. 2023-10-05 06:15:58 +00:00
christos 0630eb1ffb Add testing for pad resetting (Jose Luis Duran) 2023-09-28 13:31:11 +00:00
knakahara 4743d3462c Update for sys/net/if_ipsec.c:r1.35 2023-09-27 08:48:01 +00:00
kre 5ae58755a4 Perform quoting of variable expansions, etc correctly. That includes
(some) removing of quotes from where they're useless (superstition).

This should be NFC for these tests, as the data being quoted doesn't
happen to require it, but depending upon the data not altering, or the
code not being copied to a different environment is unwise, when it is
so easy to simply do it correctly.

A few line wrapping and white space changes as well.

Nothing changed here is intended to alter the way that the tests run,
or results generated.
2023-09-26 12:15:44 +00:00
gson d9ed1423c3 Don't expect the net/carp/t_basic/carp_handover_ipv6_halt_nocarpdevip
and carp_handover_ipv6_ifdown_nocarpdevip test cases to fail.  At
least on the TNF i386 and amd64 testbeds, they pass more often than
not since the commit of src/sys/netinet/ip_carp.c 1.119 by mlelstv on
2023.04.07.06.44.08.
2023-09-19 11:55:14 +00:00
rillig 4f890ce92c lint: fix wording of diagnostics about 'C99 extension'
The term 'extension' means an extension to a C standard.  C99 by itself
is not an extension but a revision of the C standard.
2023-09-14 21:53:02 +00:00
rillig a479246e62 lint: mark unreachable function call arguments as used as well
Previously, in a '?:' expression with a constant condition, the branch
that is not taken was skipped but any identifiers in there were intended
to be marked as used.  In function call expressions, this only worked
for the last argument, as the PUSH operator is not a binary operator
(see ops.def).  Cover this case as well.
2023-09-12 22:01:05 +00:00
rillig f88aa15bf2 lint: mark symbols that are only used in untaken '?:' branch as used 2023-09-12 07:23:27 +00:00