Commit Graph

47 Commits

Author SHA1 Message Date
pooka 68e1e43ec7 add test for PR kern/44369 2011-01-11 10:51:45 +00:00
martin 7e35902cb8 Use raw buffer size (not aligned value) to limit packet size 2011-01-05 14:43:40 +00:00
martin db69e273a2 Fix alignment of sndbuf (sparc64 got a SIGBUS in this test) 2011-01-05 14:08:12 +00:00
christos 00a6054507 PR/44310: Alexander Nasonov: write to /dev/bpf truncates size_t to int 2011-01-03 02:53:15 +00:00
pooka bc1c80f7e8 Substitute a surgical rump_server configuration for rump_allserver
now that it's possible.  With warm fs cache, the startup time of
the former is 0.01s and the latter 0.1s.  With cold caches it's
0.2s vs 2s.
2010-12-30 16:58:07 +00:00
pooka 5a30a389c0 atf-check => atf_check 2010-12-18 08:35:53 +00:00
pooka 91ed45ab3f use ping -n, since technically we don't have dns 2010-12-14 19:08:22 +00:00
pooka 756d5b62e3 Add another version of the simple ping test, this time written as a
shell script and using rump_server, rump.ifconfig and rump.ping.

XXX: uses rump_allserver for now, though, since i noticed a problem
where the rump kernel syscall vector does not get updated for
dlopen()'d libraries (and hence if you dlopen librumpnet.so, socket()
still gives ENOSYS).  Me be fixink it later.
2010-12-14 11:03:17 +00:00
pooka 1a21107ad9 Add an xfail test for the mbuf leak described in PR kern/44196.
This is yet another example of a simple test which would be much
trickier to execute against the host kernel.  You would either need
to put networking in a complete lockdown, or do some "statistical"
methods where you trigger the bug many many times and attempt to
ascertain a rising trend in mbuf count.  And, of course, the leaked
mbufs don't go away from the host kernel once the test ends.  In
contrast, we *know* that there is no other networking activity in
a rump kernel, so we can execute the operation exactly once, plus
the leaked mbuf "disappears" when the test is done.
2010-12-06 11:32:01 +00:00
pooka 7119e5be14 convert program in PR kern/44054 to an atf test case 2010-11-07 19:53:42 +00:00
jmmv decf2b5e0f Adjusts tests after import of atf-0.12:
- The use.fs property is gone.
- Mark the tests/fs/t_create:attrs test as broken when using the default
  unprivileged-user:_atf setting.  This probably deserves a fix somehow
  but I'm not sure at this point.
2010-11-07 17:51:16 +00:00
christos fb0d4bcc11 make that u_int, because it is passed as a socket option. 2010-11-03 21:44:46 +00:00
christos 0f10aa9dce add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing
how many bugs this found :-)
2010-11-03 16:10:19 +00:00
pooka cf1237d3ad setsockopt() wants int instead of size_t. Should fix this on LP64. 2010-08-26 17:24:14 +00:00
pooka b846a386dc Add a delay between startup of pinger and pingee here too.
XXX: there's apparently some race condition which appears to trigger
if a broadcast arp arrives around the same time as the arpwhohas
is sent.  This causes original packet to never be sent by the
arpwhohas requestor.  If this rings a bell to someone, please let
me know.
2010-08-23 10:49:27 +00:00
pooka 217080730a .. put a timeout here just in case the receive does not increase
the counter.
2010-08-18 21:23:48 +00:00
pooka b3495ecc48 Add a test for the "ping of death". Declare the test a success
when the receiver increases the "ip toolong" stat counter.
2010-08-18 21:22:34 +00:00
pooka cfe11fb280 send pings in ascending order 2010-08-18 17:49:03 +00:00
pooka 9a3c295ef2 Add a two-way floodping test and a test which sends icmp echos with
various sizes.
2010-08-18 16:39:22 +00:00
pooka 75487b056b add a test which floodpings another host 2010-08-17 15:51:11 +00:00
pooka 5b778e8098 * add interface for virtif creation (in addition to the already present shmif)
* don't leak sockets
2010-08-17 12:04:34 +00:00
pooka 7c8855f1e2 Put some sleeps between forking the hosts. Otherwise a race may
be triggered which appears to cause one host to go berzerk with
sending carp advertisements and ignore ping requests.

I'll get to the bottom of this eventually, but this is a stopgap
to prevent the test from failing, hopefully -- the race doesn't
appear to trigger for me even with 0.1s on a loaded machine, so
0.5s should be better than fine.

(hi jmmv ;)
2010-08-11 13:10:03 +00:00
pooka 1a6a53bd1a Add a most elementary carp test: it forks off two processes,
configures carp in each of them, and after verifying that the shared
address responds to ping it brutally kills the master like a proper
carnivore (none of that ifconfig down sissy vegan nonsense).  Then
the test checks if the backup got its act together by pinging the
shared address and passes verdict.
2010-08-10 21:55:28 +00:00
pooka a2530e0bfd may be __unused 2010-08-09 15:39:41 +00:00
pooka 96f76684bb test that kernel reponds to ping 2010-08-09 15:08:43 +00:00
pooka 576ad32eba add a simple pingtest 2010-08-09 15:07:51 +00:00
pooka 3c23c993d0 Remove stuff handled by common code now. 2010-07-26 14:10:31 +00:00
pooka 6b62441252 Calculate broadcast IP instead of requiring it as a config parameter. 2010-07-26 14:07:04 +00:00
pooka e8fbc2f15e necessary headers 2010-07-25 22:28:48 +00:00
pooka 3185d2a443 Add xfail test for kernel diagnostic panic described in PR kern/43664 2010-07-25 21:42:08 +00:00
pooka 772871ea1c make interface/routing configuration a bit more generic 2010-07-25 21:39:20 +00:00
pooka 1d14124dd5 fix routine name in error message 2010-07-18 12:43:22 +00:00
jmmv 9d0b4b5bb8 Get rid of static Atffiles and let bsd.test.mk generate them on the fly. 2010-07-13 21:13:21 +00:00
pooka 369e70628a descend into icmp 2010-07-04 19:31:30 +00:00
pooka 3665ca1dbf Add test case for PR kern/43548
Due to the nature of the feature under test, this one is a little
different, so let me explain how it works.

The test program forks and bootstraps a rump kernel in both processes.
It then configures shared memory interfaces in both.  shmif is nice
in that it uses a mmaped file as the bus and does not require root
privileges for communication between two (or more) processes.  The
child process then proceeds to increase icmp.returndatabytes as
indicated by the PR, while the parent process sets the global TTL
of the rump kernel to 1 (note: both values only affect the respective
rump kernels, not each other or more importantly the host kernel).
The parent then sends the bad packet which is supposed to be routed
by the child.  If ip_icmp.c was too old, *boom* + fail; otherwise
nothing bad happens and the test exists with success after one
second.

Eventually this test can be extended into a framework for automated
testing of any networking code which requires (arbitrarily complex)
routing setups.
2010-07-04 19:30:59 +00:00
wiz 8506af6473 Fix typo in comment. 2010-06-12 15:01:04 +00:00
pooka ab4e506810 Connect to localhost instead of www.netbsd.org to a) make this work
in non-routed setups b) avoid the dubious security implications.
Also, to make the test actually do what it claims to do, call
getsockname() and verify we got a low port.
2010-06-12 14:31:29 +00:00
pooka f896df40fc tp-glob t_* instead of * (so that atf-run works in the source directory) 2010-06-12 14:18:21 +00:00
pooka 2f75110c81 Add bpf program source in a comment. 2010-04-21 11:19:44 +00:00
pooka 513ca2875b Check that bpf doesn't accept programs with divide-by-zero in them.
Example filter from Guy Harris via PR kern/43185.
2010-04-21 11:07:34 +00:00
jmmv 5a5601438b Convert NetBSD-specific tests that were previously written in C++ to C now
that ATF provides a C-only binding (comes with 0.5).
2008-05-01 15:38:17 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
jmmv 91374a77e7 Fix headers: add NetBSD CVS id tag and drop ATF title. 2008-01-04 18:37:15 +00:00
jmmv 5166760e85 Re-add the NetBSD CVS Id tag to the header. It just had to be quoted to
be accepted by the parser; i.e. no bug in the code :-)

Note to self: do not try to "fix" stuff the last minute before going to
sleep.
2007-12-30 09:13:32 +00:00
jmmv 24b05c38e9 Back out the change to introduce the X-NetBSD-Id header entry. For some
reason the parser does not accept its contents...  You know, one should
always test even trivial changes!

Will review this in more depth tomorrow to find the real root cause of the
problem and rule out a fix for ATF.
2007-12-29 23:02:51 +00:00
jmmv 4178bab5b6 Add the NetBSD Id tag to the Atffiles. Issue raised by pooka@ a while ago. 2007-12-26 21:04:47 +00:00
jmmv e44ee884d0 Add regression tests for low-port allocation in connect and listen, which
was broken and fixed recently in:
http://mail-index.netbsd.org/source-changes/2007/12/16/0011.html

Test-case code provided by elad@.
2007-12-23 13:50:22 +00:00