Commit Graph

3220 Commits

Author SHA1 Message Date
ozaki-r f86487ba70 Test implicit removals of ARP/NDP entries
One test case reproudces PR 51179.
2017-06-22 10:06:33 +00:00
ozaki-r 3659ef5665 Purge all related L2 caches on removing a route
The change addresses situations similar to PR 51179.
2017-06-22 09:56:48 +00:00
ozaki-r 68c930f9c3 Fix typo 2017-06-22 09:05:02 +00:00
ozaki-r dc9233b94b Don't create a permanent L2 cache entry on adding an address to an interface
It was created to copy FreeBSD, however actually the cache isn't
necessary. Remove it to simplify the code and reduce the cost to
maintain it (e.g., keep a consistency with a corresponding local
route).
2017-06-21 09:05:31 +00:00
ozaki-r 04ce7456cf Set net.inet.arp.keep only if it's required 2017-06-21 03:10:42 +00:00
ozaki-r 72ce3b3ae5 Add missing declarations for cleanup 2017-06-19 10:57:37 +00:00
ozaki-r 6bf9d9c9db Add test cases of TCP/IPsec on an IPv4-mapped IPv6 address
It reproduces the same panic reported in PR kern/52304
(but not sure that its cause is also same).
2017-06-19 10:05:04 +00:00
ozaki-r 9b188107de Do netstat -a for an appropriate protocol 2017-06-19 09:20:29 +00:00
kre d9c02a764f Add a new test to verify correct operation when a command substitution
produces output with a very large number of consecutive embegged \n
characters.

This test is currently expected to fail (as of commit date) but is not
marked as atf_expect_fail as the shell should be fixed to avoid the
problem quite soon.   Until then almost anything might happen to the
sh that runs this test (from just plain wrong results, to core dumps,
even possibly the right results, though that's unlikely).

Whie doing this, get rid of the duplicate implementation of the
nested_cmdsubs_in_heredoc test (which was achieving nothing).  I know
how I managed to do that, but on advice of counsel, I ...   (it was
just a harmless waste of a tiny amount of CPU time "compiling" the test,
just like writing "x=0;" on consecutive lines....)
2017-06-16 07:37:41 +00:00
kre a238581652 Fix a really stupid typo/thinko that was preventing many of the
redirect syntax sub-tests from being attempted.
2017-06-16 07:30:32 +00:00
ozaki-r e40a78484b Test routing messages emitted on operations of ARP/NDP entries 2017-06-16 04:41:02 +00:00
christos 97ebf3e411 constify more to avoid gcc stupidity. 2017-06-14 21:43:02 +00:00
ozaki-r 388744f33f Enable DEBUG for babylon5 2017-06-14 02:33:37 +00:00
ozaki-r 1c8c9db525 Add test cases for vlan(4)
From s-yamaguchi@IIJ
2017-06-14 02:32:29 +00:00
martin a3b64c360a Avoid variable lenght buffers to help the stack protector (hopefully no
functional change)
2017-06-13 08:16:16 +00:00
kre e045f926b6 Add two new sub-tests to the c_line_wrapping test case.
These should detect if the errors that caused MAKDEV to fail and
pkgsrc/pkgtools/cwrappers to fail to build (problem detected in
libnbcompat/configure) ever return.

Also fixed one of the other sub-tests so that it actually does what
it should - no idea how this one has been passing, it did not for me
when I was checking the new ones (but perhaps in the interim I have
fixed something else in sh, the problem was in the area I have been
playing, and I originally debugged the new tests using a newer version
of /bin/sh than has yet been committed.)
2017-06-09 23:49:58 +00:00
bouyer bc73b88a51 Test bind()ing to a non-existent interface. 2017-06-09 08:23:45 +00:00
knakahara 1c9c125617 add tests of ioctl for /dev/crypto 2017-06-09 06:09:01 +00:00
perseant 8b7adb7bf9 Change t_sprintf to an expected failure, since we don't respect the empty
thousands separator of the C/POSIX locale (PR standards/52282).
2017-06-07 22:59:42 +00:00
kre 9817a5b1e5 Paranoia: add a new test case testing that $(( )) results get split
by IFS just the same as any other expansion (split when they should be,
and not when they shouldn't).

Good thing I did ... this discovered a regression in the new expand
code (from an hour or three ago) where quoted arith expansions are
being split, and shouldn't be.  (on the other hand, when they should
be split, they are being split correctly, so that's good...)

No need to worry too much about this, in real life (as opposed to
torture tests) no-one ever puts digits in IFS, and a $(( )) expansion
only ever contains digits, so in practice, splitting never happens,
whether because it is quoted, or just becaue there is nothing to split.

The FreeBSD shell does it correctly (they do word splitting using a
totally different mechanism than we do) - I will find where I missed
testing for quoted expansions later tonight.  Until that happens,
expect a test failure from t_fsplit:split_arith

While here add more comments in the other test casess (one had a comment
already) that our shell parses incorrectly (this is a parsing problem,
not an expansion problem, and the bug has existed forever .. and is
shared by bash).

That is, in an expression like "${var:-word}" the whole thing (including
word) is quoted by the double quotes, and in "${var:-"word"}" the
expansion is quoted, but 'word' is not, the 2nd " (the one before 'w')
ends the opening quote, and the third (before }) turns quoting on
again (it is required that there be an even number of unquoted quotes inside
a ${} expression, so things like "${var:-"word} are simply invalid.)
Another way of saying this, is that if the { is quoted (for which the
only way is using " to get to this kind of expansion at all) the }
must also be quoted (" quoted).  There is no quote nesting here.

This also means that in "${var:-'word'}" the single quotes are just
characters, they are quoted by the "" that surround them, just as in
"a 'string' containing quotes", but "${var:-"'word'"}} is valid and
contains a single quoted word.

Note that this is different than the patetrn-match/trim expansions
( ${var%pattern} etc) where any surrounding quotes do not affect the
pattern, and all forms of quoting can be used in it - but it always
parses as a pattern, and is never subject to filename expansion, so
a '*' in it that is to mean "match any string" does not need special
quoting to avoid it expanding to file names, regardless of whether
the ${var%*} is quoted or not, but a * that is to be matched as a
character literally does need to be quoted.

I will probably file a PR about this bug sometime, but as it is
very old, and doesn't every seem to bother anyone (and is shared by
bash) there isn't any big hurry to open yet another verry messy can
of excrement to fix it...

This does mean that the FreeBSD shell "fails" some of our tests.
(The test is wrong, their shell is correct.)
2017-06-03 15:15:49 +00:00
kre a12c6cfae6 Complete the special request by quoting chapter & verse from POSIX
as to why ${011} is ${11} and not ${9} (that is, why we interpret it
that way, the "why could it not be the other way?" is just "because
that is not how it was ever implemented".
2017-06-03 14:45:59 +00:00
kre 25950655c8 By special request, add a check that ${011} is ${11} not ${9} (etc) and
that ${08} is not an error.
2017-06-03 11:23:01 +00:00
kre 3806d6f4e4 Add some extra sub-tests checking splitting of ${#var} - just for my
piece of mind (to verify I was not breaking anything here.)

Also added some commentary better explaining why one of the tests of splitting
quoted variable expansions is almost certainly incorrect (both the tests,
and what sh does) ... though bash does the same as us, so all is not lost!
2017-06-03 10:27:05 +00:00
kre f0acc68ec6 Add a new test case "nested_arith" (that is, things like $(( 1 + $(( 2 )) ))
which will currently fail (some of the sub-tests, but this one stops on
first failure, so the test simply fails.)  This will be corrected later today.
2017-06-02 01:50:48 +00:00
kre 3782bd48c9 Add 3 new subtests to the shell_params test case. These test currently
broken behaviour (so for now, 3 of 15 subtests will fail).   This will
be corrected later today.
2017-06-02 01:48:13 +00:00
kre 06627d31e7 One more weird test of parsing (and correctly understanding) words
whose meaning is defined entirely by context.

For those who read commit messages, and want a (small) challenge,
work out where (and what) to insert as punctuation/operator chars
in the following to produce 3 ines of output, and what those will be:

	for in in in do in do case in in in echo do do echo in esac done

(There are no comments, quotes of any kind, or any kind of sub-shell,
including cmd substitutions)  With correct non alpha-numeric chars added,
it works.
2017-06-02 01:45:06 +00:00
kre bdbf3d66ba Guard against EVN being set, and possibly referencing an unset
variable, when we are running tests with sh -u
2017-06-02 01:38:44 +00:00
ozaki-r 56383415f1 Add IPSEC_KEY_DEBUG
Enable the debugging feature of IPsec key (sysctl net.key.debug)
on rump kernels if the ATF test is run with IPSEC_KEY_DEBUG=true.
2017-06-02 01:18:51 +00:00
perseant d4f6523beb Add tests for btowc(3)/wctob(3) and enable compilation of the test for
digittoint(3).

The digittoint(3) test is skipped since we don't provide that function yet.

One of the test cases for btowc(3) is also skipped, since it tests conversion
to Unicode---whereas our wchar_t representation is locale-dependent.
2017-06-01 15:45:02 +00:00
ozaki-r 946f090610 Test TCP communications over IPsec transport mode with ESP or AH
This tests SP caches of PCB.
2017-06-01 03:56:47 +00:00
ozaki-r 8504d69233 Remove a unused local variable 2017-06-01 03:51:47 +00:00
martin b40441be27 In the -m32 test, additionally test profiled binaries. 2017-05-31 11:08:35 +00:00
perseant ce11903f24 Add test cases for sprintf/sscanf/strto{d,l} and the is* and isw* ctype functions, for single-byte encodings 2017-05-30 23:44:02 +00:00
perseant 4f17535a14 Add simple test case for toupper/tolower 2017-05-30 02:11:03 +00:00
kre 6768e34b73 Add a new test case wrap_strip based upon strip (ie: cut&paste.. to start)
but with \ newline line continuations inserted at strange places.

For the shell as it is today, since strip passes, wrap_strip should
automaticallty pass as well (and does), as the \ newline combination
is simply removed, producing identical input to that of strip.

However, for accurate line counting ($LINENO: coming soon) newlines (no
matter the context) cannot simply "go away" - we have to know where they
occur(ed) (perhaps long after the text was read)  so we know what line
number we are actually processing.   This new test case is (perhaps just
part) of future-proofing that the modified code does not break anything.
2017-05-29 22:27:47 +00:00
christos 1e8894c3ea undo previous; we don't have any archs where socklen_t != uint32_t. 2017-05-28 14:53:13 +00:00
christos 35f2dad6cc fix format. 2017-05-28 14:49:00 +00:00
kre a5e8ad6bb0 Needs %zu fix for sizeof as well. 2017-05-28 13:55:07 +00:00
martin bb62327044 Fix size_t format strings 2017-05-28 09:35:01 +00:00
bouyer 6e4cb2b9ab merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used
in automation and automotive fields. For example, the NMEA2000 standard
developped for marine devices uses a CAN network as the link layer.

This is an implementation of the linux socketcan API:
https://www.kernel.org/doc/Documentation/networking/can.txt
you can also see can(4).

This adds a new socket family (AF_CAN) and protocol (PF_CAN),
as well as the canconfig(8) utility, used to set timing parameter of
CAN hardware. Also inclued is a driver for the CAN controller
found in the allwinner A20 SoC (I tested it with an Olimex lime2 board,
connected with PIC18-based CAN devices).

There is also the canloop(4) pseudo-device, which allows to use
the socketcan API without CAN hardware.

At this time the CANFD part of the linux socketcan API is not implemented.
Error frames are not implemented either. But I could get the cansend and
canreceive utilities from the canutils package to build and run with minimal
changes. tcpudmp(8) can also be used to record frames, which can be
decoded with etherreal.
2017-05-27 21:02:54 +00:00
kre ff906b151f Skip the test of non-posix behaviour if we are deliberately trying
to be posix compatible (POSIXLY_CORRECT is set).
2017-05-27 13:11:50 +00:00
perseant 4e3374a73f Add simple expect-fail test case for strcoll(3) 2017-05-26 01:24:19 +00:00
ozaki-r b8bb1e4f6c Change the default value of DEBUG of stable tests to false 2017-05-26 01:14:38 +00:00
perseant 80f1b646c3 Add a member to the test data structure that indicates whether the given
encoding is state-dependent, and test the results of wctomb(NULL, '\0') and
mbtowc(NULL, NULL, 0) against this instead of against each other.
2017-05-25 18:28:54 +00:00
christos f54caa8bd5 give it more time. 2017-05-24 15:29:51 +00:00
ozaki-r 1104a9e5a4 Enable DEBUG to know what is happening on anita/sparc 2017-05-24 09:34:48 +00:00
christos 505231416e Add the error in syscall failure. 2017-05-23 16:01:46 +00:00
christos 535d7bd162 not allowed to map RWX anymore. 2017-05-23 15:56:55 +00:00
christos c415a8906b Handle dk disks and print errors. 2017-05-23 13:04:29 +00:00
christos 268abfe922 there is no more UsePrivilegeSeparation 2017-05-22 21:22:30 +00:00