bug (and its fix (depending upon whether the test is run against
an unfixed, or fixed, shell).
An obvious indication of the failure is the following (one of the
new sub-tests)
p=A
cat <<EOF
${p+\%$p\%}
${p+%$p%}
EOF
which should output
\%A\%
%A%
as a here doc is treated as a double quoted string, except
that the " character is just a character. In such a string,
the \ is only an escape character when the following character
is special, otherwise it represents a literal \ (which is the
case here).
An unfixed shell will omit the backslashes in the output.
It gets even more wrong if the % chars are replaced by "
(double quote) chars, which should make no difference, other
than the corresponding change, in the output. But doesn't
(it doesn't even produce output broken in a similar way).
This one is a harder case to be specific about however,
as while the fixed (and expected in the test) output is what
is technically correct, only a few shells actually produce
it, most generate something different (but not all the same.)
when the locale is ru_RU.UTF-8 (which has ',' as its decimal radix char).
Inspired by a problem with rc.subr experiened by ru_RU.UTF-8 reported on
netbsd-users. These are in the "fraction" test case.
While here, add some more (sub-)tests of invalid input, to make sure they
fail (in the "nonnumeric" test case), and for fun, a couple of subtests
testing hex input fractional delays (in the "hex" test case).
1. "avail_start" and "start" were different, resulting in unreachable code in
uvm_page_physunload(), where the condition check "avail_start" < "end" fails.
The test has been fixed by setting "avail_start" and "start" to the same value.
2. If "start" is the address with end address being "start + 2", we can
unplug twice, the first paddr_t would be "start" and the second one would be
"start + 1". Modified the ATF_CHECK_EQ() to reflect these changes.
Reviewed by <cherry>
There is a condition check which failed for VM_PHYSSEG_MAX == 2 (not for
1 or 3 and above), in case of 2, pgs == slab + npages1 + npages3, so we
need to change ">" check to ">=" check.
Reviewed by <cherry>
expected failure referencing PR kern/53865, and force failure to avoid
reports of unexpected success as it does not realiably fail under
qemu. This makes the treatment of udf_renamerace_dirs the same as
that of udf_renamerace, only with a different PR. Also, make
whitespace consistent between the two.
when it is executing as part of the lib/libc/sys/t_ptrace_waitid test,
because that particular combination is not failing, at least not on amd64.
It is failing as part of other tests, so PR lib/53343 still applies.
including testing correct handling of error cases.
One of these new tests located a bug which will be fixed
within minutes of this commit ...
While doing this, move the test that was used only in the
echo builtin test case (testing if the NetBSD shell was being
tested) into a utility function, and also call it in the eval
test, so NetBSD specific behaviour of what is unspecified in
the standard can be checked to ensure it is not accidentally
altered.
job was never set, and so if the job actually got started before the
cancellation request came in, it would never finish and the cancellation
request would just hang forever.
Should address a spurious automated test failure reported by kre@.
tripping a KASSERT() failure in the i386-qemu test rig. It turns out this
is due to "rapid" simply being a buggy test that makes assumptions that
aren't always true, especially on slower / uniprocesor hardware. So, the
right thing to do is just remove the test.
* Change the Assist API. Rather than passing callbacks in each call, the
callbacks are now registered beforehand. Then change the I/O Assist to
fetch MMIO data via the Mem callback. This allows a guest to perform an
I/O string operation on a memory that is itself an MMIO.
* Introduce two new functions internal to libnvmm, read_guest_memory and
write_guest_memory. They can handle mapped memory, MMIO memory and
cross-page transactions.
* Allow nvmm_gva_to_gpa and nvmm_gpa_to_hva to take non-page-aligned
addresses. This simplifies a lot of things.
* Support the MOVS instruction, and add a test for it. This instruction
is special, in that it takes two implicit memory operands. In
particular, it means that the two buffers can both be in MMIO memory,
and we handle this case.
* Fix gross copy-pasto in nvmm_hva_unmap. Also fix a few things here and
there.
- De-_t'ify all of the structure types.
No functional chage, no ABI change (verified with old rump unit test
before and after new librump.so).
Per Taylor's request.
from librump and hooray for static linking semantics.
Fixes sun2 build issue reported by kre@.
(XXX WTF did this only start failing after the addition of t_threadpool?)
threads running at specific priorities, with support for unbound pools
and per-cpu pools.
Written by riastradh@, and based on the May 2014 draft, with a few changes
by me:
- Working on the assumption that a relative few priorities will actually
be used, reduce the memory footprint by using linked lists, rather than
2 large (and mostly empty) tables. The performance impact is essentially
nil, since these lists are consulted only when pools are created (and
destroyed, for DIAGNOSTIC checks), and the lists will have at most 225
entries.
- Make threadpool job object, which the caller must allocate storage for,
really opaque.
- Use typedefs for the threadpool types, to reduce the verbosity of the
API somewhat.
- Fix a bunch of pool / worker thread / job object lifecycle bugs.
Also include an ATF unit test, written by me, that exercises the basics
of the API by loading a kernel module that exposes several sysctls that
allow the ATF test script to create and destroy threadpools, schedule a
basic job, and verify that it ran.
And thus NetBSD 8.99.29 has arrived.
In particular, add a readonly test to detect the bug that was just fixed...
(but there is more than that one added here).
Also, allow zsh to run more of these tests than it did, what is a builtin
command most places (including in POSIX) can be a reserved word in zsh!
utilities. That is, not the low level ones that look like syntax,
but aren't: break/continue/return; not those which are really
just external programs that are built in for efficiency (printf,
test, and kill - though kill really needs to be built in) - those
should all have separate test programs (there is a test here for the
built-in echo, as that is an entirely different thing to /bin/echo);
and also not those for which there are other tests because of the
nature of the built-in (like exit, wait, shift, ...). Lastly not
"times" either as that just seems to be too hard to test rationally.
There is a test (well, framework) for ulimit and there's also t_ulimit.sh
one of those should go, but I am not yet sure which is the best way
to reconcile things.
Note: many (in fact) most of the test cases added here are either
entirely empty (no tests at all, beyond testing that the built-in is
in fact a shell built-in) or only very rudimentary tests - assistance
in fleshing those out would be welcome (the boilerplate is all here,
all that is needed is some actual tests to run...)
Use user flag UF_NODUMP instead of UF_IMMUTABLE for the test as it
is the only user flag supported by all tested file systems.
PR kern/47656 test zfs_flags.
(and a few more subtests in an existing test case).
The two new test cases currently fail, because of issues with
expanding "${1+$@}" which will (hopefully) be fixed soon.
(This looks to have been broken sometime during 2013 ... then I
made it even worse with some of the parser changes a while ago,
though the end result is that it appears less broken than it
really is.)
includion a test to make sure that the file doesn't get truncated.
Add new subtests to the "incorrect redirections" test case, to
validate correct behaviour of the shell when redirections fail in
various scenarios, including when the redirect is the whole command.
More along these lines are really needed, but this is better than nothing.
All the added tests pass on the /bin/sh currently in netbsd HEAD.
We use IPv6 NAT-T to avoid IPsec slowing down caused by dropping ESP packets
by some Customer Premises Equipments (CPE). I implement ATF to test such
situation.
I think it can also work with nat66, but I have not tested to the fine details.
was not being done properly (too many different code paths inside sh)
so add even more subtests to the case_matching test case to verify
that all (that I can think of for now anyway) get fixed when this
gets cleaned up. The case_matching test case still fails, but now
6 of its subtests should fail (until sh is corrected ... soon).
Martijn Dekker (private e-mail.) Variable expansions that are
double quoted result in literal characters (nver pattern matching
meta chars.) This includes '\' (that one was the bug.)
[On the other hand, a variable in a case pattern expansion that is
unquoted, produces a pattern, and in that the \ character can be
used to excape other pattern meta-chars (and itself.]
This addition will cause the case_matching test case to fail (two
of the newly added sub-tests fail) until fixes to /bin/sh are made.
(That is comiung soon, the code exists already.)
The x87 hardware uses a bad approximation to pi for argument
reduction, and consequently yields bad answers for inputs near pi or
pi/2.
Tweak one tanf test whose doubly rounded output is a little too far
from the correct answer on the doubly rounded input.
- Fix up last few digits of a lot of known-answer tests.
Confirmed with GNU mpfr to 200 bits of precision and cross-checked
with whatever libm Ubuntu ships with.
- Test relative error, not absolute error.
- Set bounds in terms of *_EPSILON, not magic numbers.
*_EPSILON is twice the largest relative error of a correctly
rounded operation, and equal to the largest relative error of an
operation with up to 1ulp error.
Most of the operations we're testing are not correctly rounded, but
they ought to be no more than 1ulp away. For the few cases where
that's not a priori clear (like comparing cbrt and pow(x, 1/3)),
use twice *_EPSILON to allow some leeway.
- Write the success condition positively as error <= eps.
This comes out false if the result is a NaN, meaning failure. In
contrast, if we write error > eps for the _failure_ condition, then
if the result is a NaN, it will also come out false, but meaning
success, which is not what we want.
- Fix the trigonometric test cases near bad spots.
sin(pi - d) for nonzero d is not zero; it is d + O(d^3). pi is not
a floating-point number, so these results should be approximately
the nonzero error of our approximation to pi. Likewise with
cos(pi/2 - d) and tan(pi + d).
(Yes, I know the sin _function_ is ill-conditioned near pi so you
shouldn't pass approximate inputs near there, but that's separate
from whether a sin _implementation_ gives an answer that is wrong
by quintillions of ulps.)
Since on x86 (i386 and amd64 alike) we currently use x87 hardware
trigonometric instructions, which are bad, these are marked xfail
on x86 for now until we switch to software implementations (coming
soon to a repository near you).
- Use %.8g, %.17g, %.35g to print float, double, long double in failures.
This should be enough to identify the problematic outputs and/or
reproduce the computation, even if long double is binary128 with
115 bits of precision.
If there are any new libm test failures after this, tell me what
architecture you're on and send me the atf output and I'll try to
figure it out.
This way they test libm, not whatever the compiler does.
We should _also_ have automatic integration tests for what the
compiler does, as a separate thing.
out of the %e test and into the NetBSD specific tests, while POSIX
once (apparently) required (or seemed to require) support for that,
it no longer does (and character value args to float conversions do
not make much sense - char valuse are always integers).
When char conversions are supported, test that \' (or \" ) (that is,
no character following the quote) works as an arg (should result in zero,
as there's a \0 in the arg after the quote char).
Add some big/small number %g conversion tests.
Two new test programs, one for the version of printf in /bin/sh
and one for the command /usr/bin/printf (t_builtin and t_command)
Each test program has 28 test cases (the same in each) of which
currently 27 pass, and 1 is skipped.
See the test scripts themselves for more information.