Commit Graph

2077 Commits

Author SHA1 Message Date
he ac0941c572 Fix the test for "inf" output, also include newline in printf format... 2023-04-04 19:39:38 +00:00
christos 30cc241785 Add a test for PR/57250 from Havard Eidnes 2023-04-04 19:30:11 +00:00
hannken 86c75e95c0 Adjust pc/npc before syscall allowing EJUSTRETURN to return
to the next instruction.  Only ERESTART should return to
the same instruction.  Differences to sparc64 reduced.

Test t_ptrace_wait:syscallemu1 now passes on sparc.

Fixes PR kern/52166 "syscallemu does not work on sparc (32-bit)"

Ok: Martin Husemann
2023-03-20 11:19:29 +00:00
christos 36c8de9256 New optval test from des @ FreeBSD 2023-02-20 15:47:56 +00:00
christos e20f737644 PR/57205: Dag-Erling Smørgrav: Add tests strchrnul(3), fix strchr pasto
from strlen.
2023-01-30 19:49:49 +00:00
riastradh ddb0a7e7a7 swab(3): Rewrite this to be understandable.
And make the tests work, and exercise all lengths up to 100.

Evidently the previous definition, presumably tightly optimized for
1980s-era compilers and CPUs, was too hard to understand, because it
was incorrectly tested for two decades and broken for years.

PR lib/57141

XXX pullup-8
XXX pullup-9
XXX pullup-10
2022-12-28 15:34:19 +00:00
wiz c1acb3b3a5 adapt mbstowcs_basic test for unicode table update
reformat so it's easier to find which result data belongs to which input
2022-12-21 09:33:34 +00:00
kre 1cba94e3a4 This test makes (made) a false assumption about the way that
process scheduling works.   That a process (or in this case,
a thread) is no longer blocked at time T does not mean that it
will resume execution at time T.   The OS is free to devote
resources to other processes/threads instead - all we should
normally be able to expect is that if it is not unblocked before
time T, that it will not start running before then.

In general though, the pthread_cond_*wait() functions don't guarantee
even that - but for this test, the possibility of something else
randomly signalling the condvar isn't believable, so don't worry about
that possibility (but do fail without calling strerror(0) on the off
chance it does happen).

Once we cease testing that the process resumed running before some
particular time, we can stop dealing with qemu timekeeping issues,
it might (seem to) take qemu twice as long as was requested before
the thread resumes, but that's OK - the same thing could happen on
a loaded system for other reasons.

Beyond that, the test also has (had) a race condition.   When using
CLOCK_REALTIME though that clock needed to have advanced to T before
the ETIMEDOUT should happen, there is no guarantee that it will stay >T
(CLOCK_REALTIME is allowed to be reset backwards).   So, only test
that the current time (after ETIMEDOUT) >= T when we're using
CLOCK_MONOTONIC - for CLOCK_REALTIME the time might have stepped
back between when the ETIMEDOUT happened and when the thread
obtains the current clock reading.  For that case, all we can test
is that the ETIMEDOUT actually happens.

With much of what was there now gone, the code can be simplified,
we no longer need to do timespec arithmetic, just one comparison
(simpler to test that Tend >= Tstart+period than Tend-Tstart > period
as we need Tstart+period for the abstime value for the timeout anyway).

Note that this still tests for the issue reported in PR lib/47703
which is where the test came from in the first place.

ps: we seem to be missing pthread_cond_clockwait() which is the same
as pthread_cond_timedwait() except that the clock to use is passed
as a parameter, rather than as an attribute of the condition variable.
2022-12-11 10:02:53 +00:00
blymn c6e199d915 Update check files due to reversion of a libcurses change. 2022-12-05 21:15:07 +00:00
jschauma de630815c5 allow testing of files other than those in /etc
To test e.g., the file "/some/where/protocols" instead of "/etc/protocols",
set TEST_FILE=/some/where/protocols in your environment.

Note: this now compares the contents of the file you gave versus what
getprotoent(3)/getservent(3) uses (which still is /etc/protocols via
h_protoent.c / /etc/services or /var/db/services.cdb via h_servent.c).

When you have expected changes in the services or protocols file that
you're generating, this necessarily produces a difference.  To really
allow testing the file versus what the library function returns, you'd
have to install the file on the system running the test, but at least
with this change you can now generate the file and verify that it didn't
caused unexpected differences.
2022-12-04 02:53:17 +00:00
jschauma 76292795b2 whitespace 2022-12-04 02:42:39 +00:00
blymn 731bbb483f Update the check files due to bug fix in libcurses. 2022-11-30 06:20:17 +00:00
jschauma 0adaf508e8 whoops, we don't want an extra space here
(erroneously introduced in my previous commit)
2022-11-28 17:41:00 +00:00
jschauma a8b3b3348f whitespace 2022-11-28 17:09:52 +00:00
christos 902698381c fix vax 2022-11-23 18:18:57 +00:00
rin 867b834377 Sync style between Lua script and C source code.
Fix false positive for some tests.
2022-11-22 15:57:03 +00:00
christos ae082add65 lua libm API from Phil Rulon 2022-11-21 22:01:32 +00:00
blymn a90239df44 Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.
2022-11-10 06:13:29 +00:00
blymn ea7ddd486e * Uncomment the slk_wset test which was previously commented out due
to incorrect output as this bug has been fixed.
* Added a check file to verify the slk_wset output.
2022-11-08 06:06:54 +00:00
msaitoh 175c89d22f Sync with if_dl.h rev. 1.31's change. 2022-11-07 08:34:30 +00:00
blymn a3f4239604 Update check files to allow for changes due to fixes to libcurses. 2022-11-04 06:17:58 +00:00
msaitoh 838c32b638 Revert for if_dl.h's change. 2022-10-27 12:59:59 +00:00
msaitoh 5b130b9d06 Sync with if_dl.h rev. 1.29's change. 2022-10-24 13:42:55 +00:00
blymn 7adc35708b Updates to account for changes resulting from fixes to libcurses. 2022-10-19 06:10:43 +00:00
ryo f5b5fa5b34 add tests for PR/57046. 2022-10-06 06:05:31 +00:00
christos 5dd94c5e95 Add sincos{,f,l} from FreeBSD 2022-08-27 08:31:58 +00:00
riastradh fdfb7cab0e membar(3): Fix t_spinlock for machines with hash-locked atomics.
Regular stores don't participate in the hash-locking scheme, so use
atomic_swap instead of a regular store here.
2022-08-12 11:21:44 +00:00
kre 52acc68675 Provide _GNU_SOURCE for t_clone now that is required to make clone()
visible.
2022-08-01 15:48:39 +00:00
riastradh 9f0a763c4a t_sig_backtrace: Pacify vfork clobber warning with volatile. 2022-07-25 22:43:01 +00:00
riastradh 2edbbc6f32 execinfo(3): Mark sig_backtrace_jump test as xfail.
PR lib/56940
2022-07-25 22:37:37 +00:00
riastradh d14f9f0135 execinfo: Fix mistake in previous: match `the_loop*' as prefix.
Now that there are two functions we need to catch either one.
2022-07-25 11:02:41 +00:00
riastradh 03353bf482 execinfo: Test stack traces through null pointer jump too. 2022-07-25 10:38:17 +00:00
thorpej 75d451f371 Make kqueue event status for vnodes shareable, and for stacked file systems
like nullfs, make the upper vnode share that status with the lower vnode.

And, lo, NetBSD 9.99.99.

Fixes PR kern/56713.
2022-07-18 04:30:30 +00:00
wiz 3a171c57ac test: fix typo and improve wording 2022-06-22 21:11:41 +00:00
skrll f927c76aaf Support ifunc on aarch64. The tests pass at least. 2022-06-21 06:52:17 +00:00
skrll 810da4c4dd Wrap long #if defined(...) || ... and sort. NFCI. 2022-06-21 06:47:37 +00:00
martin c95185db45 Restore arm in the list of architectures supporting ifunc, accidently
lost in the OABI removal.
2022-06-13 12:55:06 +00:00
skrll 1e0947f9a9 There are two hard problems in computer science cache invalidation, naming
and off-by-one errors.

Fix a naming and off-by-one bug... Thanks to Tom Lane for spotting my typo.
2022-06-09 17:39:21 +00:00
skrll a4e4e3ca93 PR/56865: hppa: t_ptrace_core_wait test doesn't know it must advance PC after breakpoint
Add __hppa__ to the list of architectures that need to advance to the instruction
after the breakpoint

Thanks to Tom Lane for the fix.
2022-06-07 05:39:16 +00:00
riastradh d86c108395 tests/lib/libc: Test mmap(2) with bad hints. 2022-06-04 23:09:18 +00:00
pgoyette 36267b45c1 Fix syntax error 2022-06-04 20:32:49 +00:00
riastradh 2b5e567d9c libc: Reintroduce getentropy.
This was introduced two years ago when the getrandom/getentropy API
question was still open, and removed because the discussion was
ongoing.  Now getentropy is more widely adopted and soon to be in
POSIX.  So reintroduce the symbol into libc since we'll be keeping it
anyway.  Discussion of details of the semantics, as interpreted by
NetBSD, is ongoing, but the symbol needs to get in before the
netbsd-10 branch.  The draft POSIX text is
(https://www.opengroup.org/austin/docs/austin_1110.pdf):

    SYNOPSIS
        #include <unistd.h>

        int getentropy(void *buffer, size_t length);

    DESCRIPTION
        The getentropy() function shall write length bytes of data
        starting at the location pointed to by buffer. The output
        shall be unpredictable high quality random data, generated by
        a cryptographically secure pseudo-random number
        generator. The maximum permitted value for the length
        argument is given by the {GETENTROPY_MAX} symbolic constant
        defined in <limits.h>.

    RETURN VALUES
        Upon successful completion, getentropy() shall return 0;
        otherwise, -1 shall be retunred and errno set to indicate the
        error.

    ERRORS
        The getentropy() function shall fail if:

        [EINVAL]        The value of length is greater than
                        {GETENTROPY_MAX}.

        The getentropy() function may fail if:

        [ENOSYS]        The system does not provide the necessary
                        source of entropy.

    RATIONALE
        The getentropy() function is not a cancellation point.

Minor changes from the previous introduction of getentropy into libc:

- Return EINVAL, not EIO, on buflen > 256.
- Define GETENTROPY_MAX in limits.h.

The declaration of getentropy in unistd.h and definition of
GETENTROPY_MAX in limits.h are currently conditional on
_NETBSD_SOURCE.  When the next revision of POSIX is finalized, we can
expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this
can be done as a pullup without breaking existing compiled programs.
2022-05-31 13:42:58 +00:00
andvar bc2346d6b2 s/disbale/disable/ and s/enbale/enable/ in comments. also one more typo fix. 2022-05-31 11:22:33 +00:00
skrll 8279d5c63e Avoid plabels on hppa to make some tests not crash 2022-05-31 07:12:15 +00:00
skrll 3fed35fccd whitespace including space before delay slot instruction. 2022-05-31 07:10:50 +00:00
pgoyette 78744a3f2d More factoring of common code. NFCI 2022-05-30 14:28:31 +00:00
pgoyette 1e05f6937d Update test so all four combinations of update_{upper, lower} x
monitor_{upper, lower}} can be verified.  Currently update_upper
is expected to fail regardless of which file is being monitored.

PR kern/56713
2022-05-30 03:33:07 +00:00
andvar 5fb5f516a8 fix various typos in comments and log messages. 2022-05-29 10:47:39 +00:00
andvar cdc507f0d2 fix various typos in comment, documentation and log messages. 2022-05-24 20:50:17 +00:00
andvar 00831369bc s/estabilishing/establishing/ in copy pasted comment. 2022-05-24 20:08:38 +00:00