Re: CVS commit: src

2010-07-05 Thread Julio Merino
On Mon, Jul 5, 2010 at 1:53 PM, Nicolas Joly nj...@netbsd.org wrote:
 Module Name:    src
 Committed By:   njoly
 Date:           Mon Jul  5 12:53:59 UTC 2010

 Modified Files:
        src/distrib/sets/lists/tests: mi
        src/etc/mtree: NetBSD.dist.base
        src/tests/fs: Makefile
 Added Files:
        src/tests/fs/vfs: Atffile Makefile t_rmdirrace.c

 Log Message:
 Add test program that use sample code from kern/41937, and fs rump
 helpers to check currently supported filesystems.

 t_rmdirrace (1/1): 5 test cases
    ext2fs_race: Passed.
    ffs_race: Passed.
    msdosfs_race: Passed.
    sysvbfs_race: Passed.
    tmpfs_race: Passed.

Neat!

But one suggestion: test programs should have a generic name whereas
the test cases should carry the more specific name.  This makes it
possible to reuse a test program to provide several test cases and,
therefore, reduces the burden of adding new test programs every time
we want to test something.

In this particular case, it'd have made sense (imo) to name the test
program t_rmdir and the test case race.  This way, t_rmdir can
very easily accommodate future tests for rmdir(2) without the need to
create a test program -- and adding a single test case is trivial, but
adding a test program currently is not.

-- 
Julio Merino


Re: CVS commit: src/external/bsd/atf/dist

2010-08-26 Thread Julio Merino

On Aug 26, 2010, at 4:43 PM, Paul Goyette wrote:


On Thu, 26 Aug 2010, Julio Merino wrote:


Module Name:src
Committed By:   jmmv
Date:   Thu Aug 26 15:28:31 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-c++: io.cpp io.hpp io_test.cpp
src/external/bsd/atf/dist/atf-run: test-program.cpp

Log Message:
Partially pull up the following revisions that address ticket #53:

  996f9c26e07a86607f373c8f0243d57329c11543
  ef98529abaf16e40a2e684496bf3da8f9ff0d09c

These prevent atf-run from stalling/crashing when a subprocess of a  
test

case stays around after the test case itself exits.

Reported, and verified working, by po...@.


Just wondering - does this address PR bin/43802 that I just filed?


Yup, but I had no idea about this PR :-P



Re: CVS commit: src/tests/util/make

2010-12-03 Thread Julio Merino

On 12/3/10 1:29 AM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Fri Dec  3 01:29:55 UTC 2010

Modified Files:
src/tests/util/make: Makefile t_make.sh
Added Files:
src/tests/util/make: d_unmatchedvarparen.mk d_unmatchedvarparen.out

Log Message:
Add a new test for the latest variable expansion problem.
- Cannot test because make test prints:
   .: Can't open /usr/share/atf/atf.header.subr
- The shell script common code needs to be fixed to follow regular shell
   style.
   - variables are underquoted
   - uses `` instead of $()
   - does not use local for local variables, prefixes with undescore
   - needlessly uses braces for numeric and symbolic variables.
   - uses a fifo to grab output, and does not clean it up properly on error
   - should not exit with  127 !!!

===  2 extra files in DESTDIR  =
Files in DESTDIR but missing from flist.
File is obsolete or flist is out of date ?
--
./usr/tests/util/make/d_unmatchedvarparen.mk
./usr/tests/util/make/d_unmatchedvarparen.out
=  end of 2 extra files  ===



Re: CVS commit: src

2011-01-01 Thread Julio Merino
On Sat, Jan 1, 2011 at 2:09 PM, Adam Hamsik h...@netbsd.org wrote:
 Module Name:    src
 Committed By:   haad
 Date:           Sat Jan  1 13:09:13 UTC 2011

 Modified Files:
        src/distrib/sets/lists/base: mi
        src/etc/mtree: NetBSD.dist.base

 Log Message:
 Add /var/lock/lvm subdir for LVM it can be created automagically but I think
 that it's better to have it created before.

This broke the build:

http://www.gson.org/netbsd/bugs/build/build/2011.01.01.20.43.01/build.log.tail

-- 
Julio Merino


Re: CVS commit: src/tests/lib/libc

2011-01-08 Thread Julio Merino
On Sat, Jan 8, 2011 at 6:10 PM, Paul Goyette pgoye...@netbsd.org wrote:
 Module Name:    src
 Committed By:   pgoyette
 Date:           Sat Jan  8 18:10:32 UTC 2011

 Modified Files:
        src/tests/lib/libc: Makefile
 Added Files:
        src/tests/lib/libc/regex: README debug.c main.c split.c t_regex.awk
            t_regex.in test_regex.h
        src/tests/lib/libc/regex/data: anchor.in backref.in basic.in bracket.in
            c_comments.in complex.in error.in meta.in nospec.in nul.in paren.in
            regress.in repet_bounded.in repet_multi.in repet_ordinary.in
            startend.in subexp.in subtle.in word_bound.in

 Log Message:
 Atf-ify the regex test

I think there is a missing Makefile in this change in
src/tests/lib/libc/regex/.  I get complains in the checkflist stage
about missing files in destdir, but surprisingly not during the build.

-- 
Julio Merino


Re: CVS commit: src/sys/crypto/rijndael

2011-05-14 Thread Julio Merino

On 5/14/11 12:27 PM, Julio Merino wrote:

Module Name:src
Committed By:   jmmv
Date:   Sat May 14 16:27:50 UTC 2011

Modified Files:
src/sys/crypto/rijndael: rijndael-api-fst.c

Log Message:
Declare for-loop control variable outside of the for statement to prevent
a warning and therefore fix the build.


Ah!  I just saw your warns=4 change.  I presume my 'fix' goes against 
it, right?


Re: CVS commit: src/sys/crypto/rijndael

2011-05-14 Thread Julio Merino

On 5/14/11 12:31 PM, Christos Zoulas wrote:

On May 14, 12:29pm, j...@julipedia.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/sys/crypto/rijndael

|  Declare for-loop control variable outside of the for statement to prevent
|  a warning and therefore fix the build.
|
| Ah!  I just saw your warns=4 change.  I presume my 'fix' goes against
| it, right?

Yes, you should revert it. Kernel code is supposed to use c99 features.


OK; I'll do a test build before submitting the revert.  I just realized 
that my tree already had your change when I committed this, yet the 
build still failed.


Re: CVS commit: src/tests/lib/libposix

2011-05-16 Thread Julio Merino

On 5/16/11 1:03 AM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Mon May 16 00:03:36 UTC 2011

Modified Files:
src/tests/lib/libposix: t_rename.c

Log Message:
h_macros need strlcat and random ugh, please someone remove this header.
define _NETBSD_SOURCE so those are defined.


The original intent of h_macros was as a place to provide 
NetBSD-specific check macros that can't be part of the generic codebase 
of atf.  I'm not sure what it currently includes, but I presume it does 
not follow this rule any more.  I'll check later (FSVO later ;-) what 
pieces could be now moved to atf to clean this up a bit.


Re: CVS commit: src/tests/syscall

2011-05-18 Thread Julio Merino

On 5/18/11 4:15 AM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed May 18 03:15:12 UTC 2011

Modified Files:
src/tests/syscall: t_pselect.c

Log Message:
Don't depend on the atf timeout stuff, do it ourselves.


Why?  Could atf do something better here?


Re: CVS commit: src/distrib/sets/lists/xserver

2011-05-21 Thread Julio Merino

On 5/20/11 10:28 AM, Izumi Tsutsui wrote:

Module Name:src
Committed By:   tsutsui
Date:   Fri May 20 09:28:32 UTC 2011

Modified Files:
src/distrib/sets/lists/xserver: md.zaurus

Log Message:
Add /etc/X11/xorg.conf.


This should be in xetc, shouldn't it?  Otherwise people will lose any 
local changes they do when they extract xserver.tgz.


(I see other platforms installing xorg.conf-something from xserver.tgz, 
but I presume those are to be treated as examples.)


--
Julio Merino / @jmmv


Re: CVS commit: src/tests/lib/libobjc

2011-05-21 Thread Julio Merino

On 5/20/11 2:03 PM, Joerg Sonnenberger wrote:

Module Name:src
Committed By:   joerg
Date:   Fri May 20 13:03:45 UTC 2011

Modified Files:
src/tests/lib/libobjc: Makefile

Log Message:
Test case requires the GCC specific thread extension for Objective C, so
only enable the test if GCC is present and disable other compiler.


Tests should always run and report 'skipped' when they can't for 
whatever reason.  This test should have a #ifdef around the code and 
fall back to a simple atf_tc_skip.


--
Julio Merino / @jmmv


Re: CVS commit: src/tests/syscall

2011-05-21 Thread Julio Merino
On Wed, May 18, 2011 at 12:30:24PM +, Christos Zoulas wrote:
 In article 4dd39547.9010...@julipedia.org,
 Julio Merino  j...@julipedia.org wrote:
 On 5/18/11 4:15 AM, Christos Zoulas wrote:
  Module Name:   src
  Committed By:  christos
  Date:  Wed May 18 03:15:12 UTC 2011
 
  Modified Files:
 src/tests/syscall: t_pselect.c
 
  Log Message:
  Don't depend on the atf timeout stuff, do it ourselves.
 
 Why?  Could atf do something better here?
 
 1. It did not work. What units is the timeout anyway? I waited 2 seconds
and 2 minutes and it did not fire.

It's in seconds.  The default is 300.

You can override the timeout by setting the 'timeout' metadata property
to a different value.

 2. I need to do some cleanup if there is a timeout (kill the stuck process).
How do I register a cleanup function?

Use ATF_TC_WITH_CLEANUP and then provide an ATF_TC_CLEANUP function for
your test case.  Be aware that cleanup runs in a different process than
the body, so the only way to transfer state is through a file in the
current directory.

 3. No matter how the timeout is done (unless you start a watcher process and
kill -KILL the test process) it can break (masking signal mask, changing
timers, catching signal).

The timeout is enforced from atf-run, not from inside the test case; it is
already using a helper process in a sense, so it should work.  If it doesn't,
it is a bug that I'd like to debug.

-- 
Julio Merino


Re: CVS commit: src/distrib/sets/lists/xserver

2011-05-21 Thread Julio Merino

On 5/21/11 12:04 PM, Izumi Tsutsui wrote:

Modified Files:
src/distrib/sets/lists/xserver: md.zaurus

Log Message:
Add /etc/X11/xorg.conf.


This should be in xetc, shouldn't it?  Otherwise people will lose any
local changes they do when they extract xserver.tgz.


Hmm.

I chose xorg.conf because there were very few NetBSD/zaurus users
and there was no model specific hardware settings, so I thought
less manual configuration was better to start Xserver after install.


That's fine, but either the Xserver should just DTRT without a 
configuration file (like in does in other platforms), or the 
configuration file should really be treated as such.



But if guys really claim we should keep a correct style in any case
I'll rename it.


Keeping it as xorg.conf is fine as long as it is in xetc.tgz.  You don't 
want to screw up user-modified configuration files when they unpack 
xserver.tgz ;-)


--
Julio Merino / @jmmv


Re: CVS commit: src/tests/syscall

2011-05-21 Thread Julio Merino

On 5/21/11 3:19 PM, Christos Zoulas wrote:

In article20110521083602.ga24...@netbsd.org,
Julio Merinoj...@netbsd.org  wrote:

1. It did not work. What units is the timeout anyway? I waited 2 seconds
and 2 minutes and it did not fire.


It's in seconds.  The default is 300.


I think the unit is too long for modern hardware. Imaging having 300 tests
needing 1 second timeouts.


Yes, the timeout thing is broken.  It should really be a specification 
of the test case size (e.g. 'small', 'large') and allow the user to 
define his timeout preferences for every class, because they will vary 
from machine to machine.


That said, I don't see why you'd want to have 300 tests needing 1-second 
timeouts.  If a test times out, it's broken, so the only thing I can 
deduce is that you'd have 300 broken tests ;-)



3. No matter how the timeout is done (unless you start a watcher process and
kill -KILL the test process) it can break (masking signal mask, changing
timers, catching signal).


The timeout is enforced from atf-run, not from inside the test case; it is
already using a helper process in a sense, so it should work.  If it doesn't,
it is a bug that I'd like to debug.


Revert the latest revision in the test and boot a kernel before the pselect
changes, and see it getting stuck.


Any particular revision?  I have a machine that hasn't been updated for 
at least two weeks; will that be enough?


Thanks.

--
Julio Merino / @jmmv


Re: CVS commit: src/tests/syscall

2011-05-21 Thread Julio Merino

On 5/21/11 5:25 PM, David Laight wrote:

On Sat, May 21, 2011 at 05:14:07PM +0200, Manuel Bouyer wrote:

On Sat, May 21, 2011 at 03:34:22PM +0100, Julio Merino wrote:

Yes, the timeout thing is broken.  It should really be a
specification of the test case size (e.g. 'small', 'large') and
allow the user to define his timeout preferences for every class,
because they will vary from machine to machine.


Sure. I ran ATF on a machine with a 1Mhz CPU clock (this is a
simulator, the real hardware is expected to run faster :).
Lots of tests timed out just because on such hardware they can't
complete in less than 5mn.


Perhaps the timeout(s) should be settable units that default
to 1 second.
Them the timeouts can be scaled for very slow (or fast) systems.


Perhaps.  But timeouts in a measure of time do not make sense in this 
context.  There won't be any way to scale them in a reliable manner, so 
this will lead to flaky tests.  And anyway, the user will be required to 
have control over how long these deadlines are.


Again, there is no point in setting test timeouts to 1 second (except 
for very very rare cases).  Timeouts are only used to kill tests that 
get stuck; nothing should rely on them.  If there is many timeouts in 
your test suite (which will result in failed tests), something is broken 
and needs fixing.


--
Julio Merino / @jmmv


Re: CVS commit: src/tests/syscall

2011-05-21 Thread Julio Merino
On 05/21/11 15:44, Christos Zoulas wrote:
 On May 21,  3:34pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/tests/syscall
 
 | On 5/21/11 3:19 PM, Christos Zoulas wrote:
 |  Revert the latest revision in the test and boot a kernel before the 
 pselect
 |  changes, and see it getting stuck.
 | 
 | Any particular revision?  I have a machine that hasn't been updated for 
 | at least two weeks; will that be enough?
 
 Oh sure. revision 1.1

Alright, so I just tried this.  Downgraded the test to 1.1 and ensured
that my kernel does not have the fix (sys_select.c:1.30 and sys_sig.c:1.32).

And the timeout of 2 seconds works just fine.

Just to make sure we are talking about the same: you were running the
test program with atf-run; correct?  If yes, what platform was this in?
 (I'm testing with amd64.)  Otherwise, this is expected behavior: tests
are not supposed to be executed without atf-run.


Re: CVS commit: src/tests/syscall

2011-05-21 Thread Julio Merino
On 05/21/11 21:58, Christos Zoulas wrote:
 On May 21,  9:26pm, j...@julipedia.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/tests/syscall
 
 | Just to make sure we are talking about the same: you were running the
 | test program with atf-run; correct?  If yes, what platform was this in?
 |  (I'm testing with amd64.)  Otherwise, this is expected behavior: tests
 | are not supposed to be executed without atf-run.
 
 No, I am running it directly. Programs could warn if they figured out
 that they are not running under atf-run. Print something like: not running
 under atf-run, timeouts will not work.

Sounds like a good idea.  Note that there is *many* more things that
will not work.  The test case will dump garbage in the current directory
and it won't be cleaned, the environment won't be sanitized, child
processes won't be killed...

 Also it would be nice if programs
 when invoked with -l or something they would list all their tests, and if

That already works :-)  The output format is gly though

 invoked with -a they would run all the tests.

Tests used to do exactly that more than a year ago, but it turned out to
be a bad idea...

The test programs were extremely complex: they had to implement all the
test case isolation (work directory, timeouts, etc.) themselves, and
that meant having to implement the same thing in C, C++ and shell.

Also, and this is what bugged most people: debugging the test cases was
almost impossible due to all the black magic that was involved in them.
 The test cases would delete temporary files on failure and gdb was
unusable.

As a result, I moved all the isolation logic into atf-run and turned the
test programs into a 'dumb' frontend for the test cases.  Test programs
now don't do much more than just running test case bodies and exposing a
consistent interface, so they really should not be used directly unless
you need to debug a particular test case.  Oh, and the whole system
works much, much faster ;-P


Re: CVS commit: src/tests/syscall

2011-05-21 Thread Julio Merino

On 5/22/11 12:18 AM, Christos Zoulas wrote:

On May 21, 10:31pm, j...@julipedia.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/tests/syscall

| Sounds like a good idea.  Note that there is *many* more things that
| will not work.  The test case will dump garbage in the current directory
| and it won't be cleaned, the environment won't be sanitized, child
| processes won't be killed...

It could mention all of them.


atf-test-case(4) contains a description of these.  (Yeah, it could be 
improved.)



| Tests used to do exactly that more than a year ago, but it turned out to
| be a bad idea...
|
| The test programs were extremely complex: they had to implement all the
| test case isolation (work directory, timeouts, etc.) themselves, and
| that meant having to implement the same thing in C, C++ and shell.

I don't see why. You just put it all in a shared library written in c and
used from c++. Shell you have already.


That's what was done.  But in order to enforce the timeouts et. al. this 
library had to fork() on every test case.  This was really, really ugly 
(and slow) in shell.  It was also hard to keep the 3 implementations (c, 
c++, shell) in sync.


I'm not saying it's not possible, just that it was ugly _in the past_. 
We can revisit this later.  The renewed runtime I'm working on (atf v2, 
aka kyua) will support different test program styles, so we should be 
able to easily re-experiment with this approach.


Re: CVS commit: src/tests/syscall

2011-05-22 Thread Julio Merino

On 5/22/11 12:48 AM, Christos Zoulas wrote:

On May 22, 12:28am, j...@julipedia.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/tests/syscall
| That's what was done.  But in order to enforce the timeouts et. al. this
| library had to fork() on every test case.  This was really, really ugly
| (and slow) in shell.  It was also hard to keep the 3 implementations (c,
| c++, shell) in sync.

You should not have to fork if you don't set a timeout. Or you can fork
just one killer and have it timeout in 2x the last registered timeout and exit.
It listens to a socket for pid's and timeouts; if the socket is still
useable after the timeout it kills.


One of the original design goals of atf was to explicitly run every test 
case in a subprocess.  The idea was to prevent broken test cases from 
corrupting the results of other tests.  So yes, you have to fork (if 
only because it's in the requirements of the design) ;-)


I had actually thought about the alternative you mention not too long 
ago, but if you do that, then a misbehaving test case will result in the 
termination of the whole test program (you need to kill a particular 
process after all).  Maybe it's not a big deal since that's what other 
very-popular frameworks do, but it's a complete shift in how atf 
currently works.


Anyway.  We are getting side-tracked here; I was just trying to see if 
we had a bug in atf.  If you want to discuss this further, the topic 
needs to be moved to atf-devel.


Re: CVS commit: src

2011-05-26 Thread Julio Merino

On 5/26/11 5:25 AM, Masao Uebayashi wrote:

Module Name:src
Committed By:   uebayasi
Date:   Thu May 26 04:25:28 UTC 2011

Modified Files:
src/share/man/man5: boot.cfg.5
src/share/man/man8/man8.i386: boot.8
src/sys/arch/i386/stand/boot: boot2.c
src/sys/arch/i386/stand/lib: bootmenu.c exec.c libi386.h
src/sys/arch/i386/stand/pxeboot: main.c
src/sys/arch/x86/include: bootinfo.h cpu.h
src/sys/arch/x86/x86: x86_machdep.c
src/sys/kern: init_main.c subr_userconf.c
src/sys/sys: userconf.h

Log Message:
Support userconf(4) command in boot(8)/boot.cfg(5) on i386/amd64.

 From jmmv@, no objections seen in the proposed thread:

http://mail-index.netbsd.org/tech-kern/2009/01/22/msg004081.html


Wow.  Looks like I didn't remember to submit this at the time.

Thanks!


Re: CVS commit: src

2011-05-26 Thread Julio Merino

On 5/26/11 5:10 PM, Lars Heidieker wrote:

Hi,

with those changes I can't compile a kernel without USERCONF option set.
The changes in x86_machdep.c should be with in if defs on that options

Ok to commit the attached patch?

@@ -178,6 +182,7 @@ module_init_md(void)
  }
  #endif/* MODULAR */

+#if defined(USERCONF)
  void
  userconf_bootinfo(void)
  {
@@ -197,6 +202,7 @@ userconf_bootinfo(void)
userconf_parse(bi-text);
}
  }
+#endif /* defined USERCONF) */


Missing ( before USERCONF.

Also, this is defining userconf_bootinfo conditionally.  Did you 
validate that all callers are protected by USERCONF as well?  (An 
alternative would be to make the body of userconf_bootinfo conditional, 
not the function itself.


Re: CVS commit: src/tests/kernel

2011-05-28 Thread Julio Merino

On 5/28/11 4:37 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sat May 28 15:37:11 UTC 2011

Modified Files:
src/tests/kernel: t_pollts.c

Log Message:
PR/44896 has been fixed.
BTW: We've created a mess here again with the directory structure of the
tests. What goes in syscalls, what goes in sys, and what goes in kernel?
I think we should follow the userland location for paths where those should
be defined, so everything should go into libc/sys.


Yes, we have.  It's in my to-do list to write a proposal to clean this 
mess (hopefully soon).  One thing is reorganizing the tests to match the 
tree structure, but the other is to move the tests right next to the 
source (like we did with manpages).


--
Julio Merino / @jmmv


Re: CVS commit: src

2011-05-28 Thread Julio Merino

On 5/28/11 10:46 PM, Christos Zoulas wrote:

In article20110528161256.ab89817...@cvs.netbsd.org,
Matthias Schelersource-changes-d@NetBSD.org  wrote:

+   assert(pipe(fds) == 0);

[...]

+   assert(write(fds[1], , 1) == 1);

[...]

+   assert(close(fds[0]) == 0);
+   assert(close(fds[1]) == 0);

[...]

+   assert(sigfillset(mask) == 0);

[...]

+   assert(sigprocmask(SIG_SETMASK, NULL,mask) == 0);

[...]

+   assert(close(fd) == 0);


Please don't create assertions that contain code, because compiled with
-DNDEBUG they vanish.


Are these test code?  If so, just replace assert by one of:

- ATF_REQUIRE(boolean_expression)
- ATF_REQUIRE_EQ(expected_value, actual_value)

like:

ATF_REQUIRE(pipe(fds) != 0);
ATF_REQUIRE_EQ(1, write(fds[1], , 1));

--
Julio Merino / @jmmv


Re: CVS commit: src/tests/syscall

2011-05-29 Thread Julio Merino

On 5/29/11 1:57 PM, Matthias Scheler wrote:

Modified Files:
src/tests/syscall: t_pollts.c

Log Message:
[...]
Also use ATF_REQUIRE_EQ_MSG() instead of ATF_REQUIRE_MSG() to avoid
crashes if one of the required conditions isn't met.


It could be a bug in the macro.  I tried changing the last 
ATF_REQUIRE_EQ_MSG call in the program to ATF_REQUIRE_MSG but it did not 
fail.  And I tried adding an explicitly-failing ATF_REQUIRE_MSG and did 
not see a crash either...


Could you provide some more details and/or a stack trace please?

--
Julio Merino / @jmmv


Re: CVS commit: src/tests/kernel

2011-05-31 Thread Julio Merino

On 5/31/11 7:06 PM, Jukka Ruohonen wrote:

On Sat, May 28, 2011 at 04:53:21PM +0100, Julio Merino wrote:

One thing is reorganizing the tests to match the tree structure, but the
other is to move the tests right next to the source


I don't quite understand the latter part. Why is this a bad thing?

I always thought that having a single unified tests-directory was a
benefit, not a disadvantage.


What is the advantage?  Just to make things clear, tests would still be 
installed to /usr/tests so that they can all be run at once.


 Moving the tests right next to the source

does not really solve any of the questions; for instance, where would
system calls go? libc? sys/kern?


Just like for manpages, it makes sense in some cases and it doesn't in 
others.


I don't think it'd be bad to keep cross-layer/tool tests in a src/tests 
directory but move anything that is clearly tool-specific next to the 
source.


(It's much easier for people to edit a cp_test.c file when they are 
editing cp.c if they see the file right there, whereas it is 
easy/annoying to have to hunt down the test file in a different subtree. 
 I've used/seen both approaches, if that matters at all.)


--
Julio Merino / @jmmv


Re: CVS commit: src/tests

2011-06-15 Thread Julio Merino

On 6/15/11 3:36 AM, Christos Zoulas wrote:

On Jun 14,  5:14am, jruoho...@iki.fi (Jukka Ruohonen) wrote:
-- Subject: Re: CVS commit: src/tests

| On Sat, Jun 11, 2011 at 02:03:20PM -0400, Christos Zoulas wrote:
|  Log Message:
|  Turn warns on for all tests and fix all the bugs.
|
| Thanks for the cleanup.
|
| Now the wscrl-test (lib/libcurses/t_curses) however fails:
|

Peeling though the layers and trying to figure out what's going on is really
annoying. So:

Let's start: t_curses is a shell script.

Try to run it from source:

$ cd /usr/src/tests/lib/libcurses
$ atf-run obj.amd64/t_curses
atf-run: ERROR: Cannot open Atffile


$ cd /usr/src/tests/lib/libcurses
$ make test


Beautiful, we have a command that takes arguments from the command line,
the environment, and has default arguments, that I need to read the source
to find them.

I won't bore you any more with this, but I am still peeling layers of brown
cylindrical items to find out what's going on with the test program.

Surely, there must be a simpler way to isolate the test program that is
running so that I can run it by hand and debug it! So what is it?


I'm not sure how the curses tests work, but based on what you show above 
they seem complex.  In general, just doing the t_foo bar dance is 
enough for debugging.


--
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-c/detail

2011-06-16 Thread Julio Merino
On 6/16/11 3:57 PM, Joerg Sonnenberger wrote:
 Module Name:  src
 Committed By: joerg
 Date: Thu Jun 16 14:57:22 UTC 2011
 
 Modified Files:
   src/external/bsd/atf/dist/atf-c/detail: test_helpers.c
 
 Log Message:
 Properly use a format string.

I presume you found this with clang, right?  I only hit the issue in OS
X and didn't bother to pull it up to NetBSD because gcc did not
encounter the problem.

Thanks!

-- 
Julio Merino / @jmmv


Re: CVS commit: src/crypto/external/bsd/netpgp/dist

2011-06-29 Thread Julio Merino
On 6/28/11 7:25 AM, Jukka Ruohonen wrote:
 On Tue, Jun 28, 2011 at 08:12:26AM +0200, Alistair Crooks wrote:
 3.  they are candidates for modifying to work under atf, I have yet to
 get the time to do that

 4. luke kindly made some gnu autotests for them a while ago

 [...]

 and if someone was to offer to convert these tests to atf style, that
 would be great, thanks.
 
 Ok.
 
 But I think this entails a wider discussion about how the tests shipped
 with third-party software could be integrated to atf(7). In case of netpgp(1)
 this is easy; a relatively small code base for which both in-house tests and
 /src/tests can be easily distributed. But then there are entirely different
 beasts like gcc(1).

One of the ideas floating around in my head is to make atf-run (well,
kyua) support foreign tests.  The most basic form of this would be
programs that just return 0 on success or 1 on failure, but maybe it'd
be extended to also support autotest programs, etc.

Sure, their functionality would be limited within the framework (as
compared to native atf tests, but this would allow us to mux all the
tests in one single run without much effort.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/crypto/external/bsd/netpgp/dist

2011-06-29 Thread Julio Merino
On 6/29/11 2:59 PM, Jukka Ruohonen wrote:
 On Tue, Jun 28, 2011 at 06:50:50AM +, David Holland wrote:
 Perhaps if atf were less intrusive...?
 
 What do you mean? I think it needs to be quite intrusive (sandboxing, etc.).
 Unquestionably the old /regress-style is not the way to go. Even if you
 dislike some parts of the API, already the consistency is a big win.

Yep, I had the same question here.  I don't know what the original
comment meant.

 On Wed, Jun 29, 2011 at 10:50:22AM +0100, Julio Merino wrote:
 One of the ideas floating around in my head is to make atf-run (well,
 kyua) support foreign tests.  The most basic form of this would be
 programs that just return 0 on success or 1 on failure, but maybe it'd
 be extended to also support autotest programs, etc.
 
 Wasn't there already a test or two doing something like this? Fine by me,
 as long as we do not regress to the old /regress-style in which it is usually
 hard to even know what is being tested.

Some atf-ified tests do look like this, yes, and it's ugly.  But if we
could do this, we could lower the barrier of entry (specially for
third-party projects): you could plug in a simple test program that you
already have and get it to work inside atf, later refining it.

Also, using foreign test programs does not preclude the sandboxing.
The sandboxing is something that must be in place all the time IMHO
regardless of how the tests are written.

 Sure, their functionality would be limited within the framework (as
 compared to native atf tests, but this would allow us to mux all the
 tests in one single run without much effort.
 
 But in reality, the gcc(1) test suite is probably the only one that would
 really be worth considering. NetBSD does not ship that much third-party
 software, and the availability of tests is generally quite limited among
 this group.

Maybe true, but I'd personally like to see all the available tests
running, even if they are not sophisticated enough.  (Otherwise, why are
we importing them at all?)

-- 
Julio Merino / @jmmv


Re: CVS commit: src/crypto/external/bsd/netpgp/dist

2011-07-21 Thread Julio Merino

On 7/21/11 4:49 AM, Martin Husemann wrote:

On Thu, Jul 21, 2011 at 07:11:56AM +0100, Iain Hibbert wrote:

I thought that I agreed with Jukka, it seemed to be a complaint with no
specific content except that you were uncomfortable (unfamilar?) with
atf.


I'm mostly with Iain here, though I have a vague idea and think I partly
understand the uncomfortableness on David's side.

However, from my very practical experience (from all relevant sides: running
tests, writing/extending them, and most importantly: fixing the troubles
they show) it is not the framework that causes most problems in solving
bugs, my top problem was:

  non working gdb (at least for threaded apps)


How so?  gdb with test programs should have been fixed a while ago.  Or 
are we talking about something different?


Re: CVS commit: src/crypto/external/bsd/netpgp/dist

2011-07-21 Thread Julio Merino

On 7/21/11 2:11 AM, Iain Hibbert wrote:

PS the predictable consequence that you cannot fold in external test
programs did not come true, see tests/lib/libevent/t_event.sh for example,
though I note that the number of libevent tests are misrepresented in the
atf-total since the test program prints OK rather than allowing the test
harness to do each one separately


And this particular concern is what has kept me busy for the last two 
weeks.  Still not there yet, but it should soon be possible to mux atf 
and non-atf test programs in the same suite.


Re: CVS commit: src/tests/net/net

2011-09-30 Thread Julio Merino

On 9/30/11 2:17 PM, Christos Zoulas wrote:

On Sep 30,  5:37pm, jruoho...@iki.fi (Jukka Ruohonen) wrote:
-- Subject: Re: CVS commit: src/tests/net/net

| This fails, probably because it does not follow the atf(7) API:
|
| tps-count: 1
| tp-start: t_unix, 2
| tc-start: sockaddr_un_len_exceed
| tc-end: sockaddr_un_len_exceed, passed
| tc-start: sockaddr_un_len_max
| tc-end: sockaddr_un_len_max, failed, Test case exited normally but failed to
| create the results file: Failed to open /tmp/atf-run.03735a/tcr
| tp-end: t_unix

Can you be more specific? What does it need to do?


Use ATF_FAIL instead of err() to signal errors.


Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-07 Thread Julio Merino

On 11/6/11 1:18 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sun Nov  6 18:18:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c: tc.c

Log Message:
don't truncate error messages to 1K.


The use of dprintf cannot be merged back upstream because this function 
does not appear to be widely available.  A bunch of write()s should have 
the same effect and remove the 1K limit; will do this.


Anyway, where have you spot error messages longer than 1K?  That 
seems... ugly.


Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-08 Thread Julio Merino
On 11/8/11 3:25 PM, Christos Zoulas wrote:
 In article 2007202432.ga7...@britannica.bec.de,
 Joerg Sonnenberger  jo...@britannica.bec.de wrote:
 On Mon, Nov 07, 2011 at 04:06:30PM +, Christos Zoulas wrote:
 Well, I tried to print the failing pattern in t_expand, and it silently
 got truncated. dprintf(3) has been part of TOG since 2006:
 (http://pubs.opengroup.org/onlinepubs/9699919799/functions/dprintf.html)
 So it would be preferable to implement it in terms of asprintf/write +
 or snprintf/malloc/write or even fdopen/fprintf instead of open coding it.

From reading the patch, there are three different brances, right?
 Why don't you use writev for this with up to 6 elements in the vector?
 
 Done.

Did you even run any tests after doing this?

This is broken.  The assertion you added triggers immediately.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-08 Thread Julio Merino
On 11/8/11 7:32 PM, Christos Zoulas wrote:
 Yes, I did. I actually wrote the test backwards 2ice because INV has inverted
 logic than regular assert for some reason.

It doesn't.  INV(x) is the same as assert(x) -- or it is supposed to be
-- but if it wasn't, things would have broken much earlier everywhere.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-09 Thread Julio Merino

On 11/9/11 9:42 AM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Nov  9 14:42:43 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c: tc.c

Log Message:
need || instead of


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-c/tc.c


Thanks; it seems to work now.


Re: CVS commit: src/tests/util/sh

2011-11-16 Thread Julio Merino

On 11/14/11 3:23 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Mon Nov 14 20:23:29 UTC 2011

Modified Files:
src/tests/util/sh: Makefile
Added Files:
src/tests/util/sh: t_evaltested.sh

Log Message:
Add a test for PR/45613 (eval failing in a tested context)


This looks like a poor name for the program: in general, if the test 
program contains a single test case and both have the same name, that's 
a bad symptom.  Following prior art in this same directory, the program 
should have probably been named t_eval and the single test that it 
currently has tested_context.  This would leave room for the future 
addition of eval-related tests, whereas the current naming does not.


Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Julio Merino

On 11/16/11 12:46 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Nov 16 17:46:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory


Could you run intrusive changes to atf for review please?

The current changes are incomplete and inappropriate, so they are going 
to make integration upstream a pain.



+int64_t
+impl::to_number(const std::string  str)
+{
+   int64_t num;
+   ::dehumanize_number(str.c_str(),num);


This adds a dependency on NetBSD that should not be there.

[...]

+static
+std::string
+check_memory(const std::string  memory)
+{
+// Make sure we have enough memory
+int64_t memneed = atf::text::to_number(memory);
+int64_t memavail;
+size_t len = sizeof(memavail);
+
+if (::sysctlbyname(hw.usermem64,memavail,len, NULL, 0) == -1) {


Same here and below in the same function.  This is NetBSD specific and 
there is no provisions to support other systems.


[...]

Lastly, this has been added without absolutely no tests and no 
documentation.  (And there seem to be whitespace issues, although I 
can't tell if these are my mua's fault...)


Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Julio Merino

On 11/16/11 1:51 PM, Christos Zoulas wrote:

In article4ec3f8f7.8020...@netbsd.org,
Julio Merinoj...@netbsd.org  wrote:

On 11/16/11 12:46 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Nov 16 17:46:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory


Could you run intrusive changes to atf for review please?

The current changes are incomplete and inappropriate, so they are going
to make integration upstream a pain.


Well, there is really no portable way to find the total available memory of
the system that I know of and I did not want to add ifdefs or machinery
to get this working on other OS's. If you know otherwise, feel free to fix it.


I know there is no portable way, but at least we can default to do 
nothing if this is not supported.  It's better than not building :-P



The changes are really small and they are additions only. I fail to see how
it is going to be difficult to integrate.


Yes, they are small because this is just one change.  But more may come. 
 I'll then have to go and rewrite all these local changes with 
portability in mind.  When the time to integrate a new release comes, 
I'll have to mess around with lots merge conflicts, because the upstream 
code will look nothing like what we have (hence why I asked for this to 
be reviewed first).


Of course, if we assume I keep good track of all local changes and 
integrate them upstream (I do try), I could ignore the local changes 
altogether during the conflicts resolution and use the upstream 
copies... but that's... dangerous because I can miss some little thing. 
 Specially if the local changes are made without tests, because then 
it'll be impossible for me to spot when such changes are not preserved.


Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Julio Merino

On 11/16/11 3:11 PM, Christos Zoulas wrote:

In article4ec40d98.4070...@netbsd.org,
Julio Merinoj...@netbsd.org  wrote:


I know there is no portable way, but at least we can default to do
nothing if this is not supported.  It's better than not building :-P


Oh, I can arrange that. #ifdef __NetBSD__ :-)
But in my view this is worse...


Yeah, leave it as is for now.  I'll have to do something similar anyway 
though, but if I can implement the code for the most common systems, 
that's probably good enough.



Yes, they are small because this is just one change.  But more may come.
  I'll then have to go and rewrite all these local changes with
portability in mind.  When the time to integrate a new release comes,
I'll have to mess around with lots merge conflicts, because the upstream
code will look nothing like what we have (hence why I asked for this to
be reviewed first).


Well, this is the world we live in. Next time be the one to upgrade gdb
or binutils or ssh and have to deal with 10-50K lines of diffs.
You will not be complaining about a 100 line conflict after that :-)


That's true... but do we have a chance of getting things integrated into 
gdb quickly and/or on our own to prevent those 10-50K diffs?  For atf 
we do ;-)  (OK, I can definitely try to improve on the quickly 
side...)  Anyway, just something to keep in mind.


Still, I'd appreciate running changes for review at least.  I'm open to 
overlooking details like these that don't fit upstream if that's going 
to make things easier temporarily.


Re: CVS commit: src/sys

2011-11-25 Thread Julio Merino
On 11/22/11 4:25 PM, Thor Lancelot Simon wrote:
 Module Name:  src
 Committed By: tls
 Date: Tue Nov 22 21:25:42 UTC 2011
 
 Modified Files:
[...]
   src/sys/conf: std
 
 Log Message:
 The rnd pseudo-device is not really optional, because it is in the same
 source file as the entropy-pool code itself.  Move it to std.  This
 will be cleaned up more when I split the sources up as they should be.
 
 This fixes build breaks on several ports.  Thanks to Havard Eidnes for
 pointing them out.

I think this deserves a note in UPDATING.  If people have their own
kernel configuration files, they need to know to remove 'rnd' from them
in order to be able to build kernels.  I just encountered this scenario
and had to dig down to see if removing the entry from the file was the
right thing to do.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Sun, Dec 18, 2011 at 10:34 PM, Christos Zoulas chris...@netbsd.orgwrote:

 Module Name:src
 Committed By:   christos
 Date:   Sun Dec 18 22:34:06 UTC 2011

 Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp timer.hpp

 Log Message:
 Don't use antiquated BSD API's that require global variable, use posix
 timers
 instead.


Interesting; didn't know about these.

But what's the point of this change?  It breaks OS X at least and does not
fix anything AFAICT.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Mon, Dec 19, 2011 at 5:58 PM, Christos Zoulas chris...@zoulas.comwrote:

 On Dec 19,  5:00pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

 | Interesting; didn't know about these.
 |
 | But what's the point of this change?  It breaks OS X at least and does
 not
 | fix anything AFAICT.

 I am just trying to use modern POSIX API's to improve portability


Well... modern has come to mean less portable in my book.  (I like using
modern APIs, but they tend to break grgrgr.)


 (and functionality in this case). For example, by using sigevent,
 one doesn't need to have global variables and he can pass the struct
 he wants to modify in the signal. In addition, one can use the
 monotonic clock, which is immune against time changes, and also
 use timespec which is more precise. Finally one is not limited to
 sigalrm for timers, but can send any signal.


Thanks.


 I am really suprised
 that OS/X does not have them; I would have expected it to work on
 more systems than it does currently...


I could only check with Snow Leopard and there is no timer_t there.  I
don't have access to Lion at the moment; when I do, I'll check again.  If
there is no support in it, I'll have to implement some conditional logic to
use the new timers only if available (unless you have a better
alternative?).  If there is support, then I won't care about backwards
compatibility.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Mon, Dec 19, 2011 at 8:32 PM, Christos Zoulas chris...@zoulas.comwrote:

 On Dec 19,  6:06pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

 | I could only check with Snow Leopard and there is no timer_t there.  I
 | don't have access to Lion at the moment; when I do, I'll check again.  If
 | there is no support in it, I'll have to implement some conditional logic
 to
 | use the new timers only if available (unless you have a better
 | alternative?).  If there is support, then I won't care about backwards
 | compatibility.

 Since it is my fault that I broke it, I will add a shim for OS/X that
 does not do anything fancy and implements the previous basic functionality
 that setitimer had.


Could you check if this support exists in Lion first?  If that's the case,
I personally don't think it is a big deal.  But thanks if you do that!

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-23 Thread Julio Merino
On 12/19/11 10:25 PM, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Mon Dec 19 22:25:46 UTC 2011
 
 Modified Files:
   src/external/bsd/atf/dist/atf-run: timer.cpp
 
 Log Message:
 - make all the ifdefs match
 - make it compile, and test

This was still broken.

timer_t and itimerspec do not exist, so the timer.hpp file is unusable.
 The definition of HAVE_POSIX_TIMER does not work because SIGEV_NONE is
defined in OS X.  The change of sys/time.h and signal.h to ctime and
csignal seems to cause issues too.

I have had to fix this by adding a configure test for timer_t, using the
pimpl idiom for the timer class definition to prevent further ifdef mess
in timer.hpp, and had to sprinkle some more ifdef stuff in the code.

The result is incredibly ugly, and I doubt there is any real benefit
other than using modern interfaces.  Was it really worth it?  (I have
not committed these fixes to the NetBSD tree because I cannot test
them at the moment.)

-- 
Julio Merino / @jmmv


Re: CVS commit: src

2012-02-10 Thread Julio Merino

On 2/7/12 2:37 PM, Joerg Sonnenberger wrote:

Module Name:src
Committed By:   joerg
Date:   Tue Feb  7 19:37:14 UTC 2012

Modified Files:
src: UPDATING
src/doc: CHANGES

Log Message:
Add note about new apropos and mandoc for formatting. Document failing
update builds due to the cat page removal.


This leaves tons of garbage behind in destdir (as you said), but 
provides no migration path for already-installed systems.


How do you expect people to clean up their system from the 
already-installed cat pages and databases?  I don't see any postinstall 
changes either.



Files in DESTDIR but missing from flist.
File is obsolete or flist is out of date ?
--
./usr/libexec/getNAME
./usr/libexec/makewhatis
./usr/share/man/cat*/*
./usr/share/man/html8/getNAME.html
./usr/share/man/html8/makewhatis.html
./usr/share/man/makewhatis.sed
./usr/share/man/man8/getNAME.8
./usr/share/man/man8/makewhatis.8
./usr/share/man/whatis.db


Re: CVS commit: src

2012-02-17 Thread Julio Merino

On 2/17/12 5:43 PM, Matt Thomas wrote:


On Feb 17, 2012, at 2:36 PM, Julio Merino wrote:


Module Name:src
Committed By:   jmmv
Date:   Fri Feb 17 22:36:50 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: module.mi
src/tests/modules: Makefile
Added Files:
src/tests/modules: t_abi_uvm.sh
src/tests/modules/k_uvm: Makefile k_uvm.c

Log Message:
Add a test to ensure that PAGE_SIZE is available in kernel modules.
This test reproduces the error condition in PR port-macppc/46041 and
therefore it is an xfail in this particular platform.


I explicitly made PAGE_SIZE unavailable for powerpc.  This was part
of having one consistent view for OEA,BOOKE,IBM4XX all which use
different page size.  So you can't rely on PAGE_SIZE.


So the modules are broken on purpose?


Re: CVS commit: src

2012-02-17 Thread Julio Merino

On 2/17/12 5:45 PM, Matt Thomas wrote:


On Feb 17, 2012, at 2:43 PM, Julio Merino wrote:


On 2/17/12 5:43 PM, Matt Thomas wrote:


On Feb 17, 2012, at 2:36 PM, Julio Merino wrote:


Module Name:src
Committed By:   jmmv
Date:   Fri Feb 17 22:36:50 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: module.mi
src/tests/modules: Makefile
Added Files:
src/tests/modules: t_abi_uvm.sh
src/tests/modules/k_uvm: Makefile k_uvm.c

Log Message:
Add a test to ensure that PAGE_SIZE is available in kernel modules.
This test reproduces the error condition in PR port-macppc/46041 and
therefore it is an xfail in this particular platform.


I explicitly made PAGE_SIZE unavailable for powerpc.  This was part
of having one consistent view for OEA,BOOKE,IBM4XX all which use
different page size.  So you can't rely on PAGE_SIZE.


So the modules are broken on purpose?


Yes.


Interesting.  If that's the case, shouldn't we break PAGE_SIZE for all 
platforms and keep things consistent?


The modules that are broken (see the referenced PR for a list) fail due 
to a missing uvmexp_pagesize symbol (*not* PAGE_SIZE itself), which I 
assumed was there to prevent depending on the PAGE_SIZE compile-time 
constant.  I understand this information not being statically-available 
because of variable-page sizes in these platforms.


Re: CVS commit: src

2012-02-17 Thread Julio Merino

On 2/17/12 5:58 PM, Matt Thomas wrote:


On Feb 17, 2012, at 2:54 PM, Julio Merino wrote:


On 2/17/12 5:45 PM, Matt Thomas wrote:


On Feb 17, 2012, at 2:43 PM, Julio Merino wrote:

So the modules are broken on purpose?


Yes.


Interesting.  If that's the case, shouldn't we break PAGE_SIZE for all 
platforms and keep things consistent?


For those with variable page sizes (like powerpc or mips), yes.


I was asking about *all* platforms regardless of whether they have 
static or variable page sizes.  Keeping this inconsistent seems like a 
very easy way of writing non-portable code...



The modules that are broken (see the referenced PR for a list) fail due to a 
missing uvmexp_pagesize symbol (*not* PAGE_SIZE itself), which I assumed was 
there to prevent depending on the PAGE_SIZE compile-time constant.  I 
understand this information not being statically-available because of 
variable-page sizes in these platforms.


properly should use uvmexp.pagesize instead.


Aha, I see.  Does it make sense to keep the test after renaming 
PAGE_SIZE to uvmexp.pagesize?  It's a public symbol after all and we 
really should have tests for these, I think.


Do we need to go over the broken modules one by one and replace 
PAGE_SIZE with uvmexp.pagesize?  (I'm expecting this won't be as easy as 
it sounds due to preprocessor conditionals et. al.)


Thanks!


Re: CVS commit: src

2012-02-17 Thread Julio Merino

On 2/17/12 7:11 PM, Julio Merino wrote:

On 2/17/12 6:42 PM, Matt Thomas wrote:


On Feb 17, 2012, at 3:11 PM, Julio Merino wrote:


On 2/17/12 6:06 PM, Matt Thomas wrote:


On Feb 17, 2012, at 3:02 PM, Julio Merino wrote:

Aha, I see. Does it make sense to keep the test after renaming
PAGE_SIZE to uvmexp.pagesize? It's a public symbol after all and we
really should have tests for these, I think.

Do we need to go over the broken modules one by one and replace
PAGE_SIZE with uvmexp.pagesize? (I'm expecting this won't be as
easy as it sounds due to preprocessor conditionals et. al.)


They should still use PAGE_SIZE which should evaluate to
uvmexp.pagesize


Now you lost me. You started saying that PAGE_SIZE is explicitly not
available, and now you say that the modules have to use PAGE_SIZE?

The problem is that PAGE_SIZE is NOT being evaluated to
uvmexp.pagesize as you mention. It's being evaluated to
uvmexp_pagesize, which does not exist and thus causes the module to
not load. And that's what this test is all about.


Hmmm. I think uvmexp_pagesize, etal is there to avoid needed uvmexp
defined.

The problem was:

--- uvm_param.h 29 Nov 2011 07:43:54 - 1.26
+++ uvm_param.h 17 Feb 2012 23:40:50 -
@@ -134,7 +134,7 @@
* If MIN_PAGE_SIZE and MAX_PAGE_SIZE are not equal, then we must use
* non-constant PAGE_SIZE, et al for LKMs.
*/
-#if (MIN_PAGE_SIZE != MAX_PAGE_SIZE) defined(_LKM)
+#if (MIN_PAGE_SIZE != MAX_PAGE_SIZE) (defined(_LKM) ||
defined(MODULAR))
#undef PAGE_SIZE
#undef PAGE_MASK
#undef PAGE_SHIFT



I have applied this patch and rebuilt the affected test module... and it
still won't load. Wasn't that supposed to be _MODULE instead of MODULAR?


Oh, but even doing that change, the module won't load either.  PAGE_SIZE 
still ends up being defined as uvmexp_pagesize... which I believe is 
correct, right? because the size must be represented as a variable... 
but that variable is not available in the built kernel.


Re: CVS commit: src/sbin/ifconfig

2012-03-18 Thread Julio Merino

On 3/18/12 1:53 AM, Jukka Ruohonen wrote:

On Fri, Mar 16, 2012 at 10:25:08PM -0400, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sat Mar 17 02:25:08 UTC 2012

Modified Files:
src/sbin/ifconfig: af_inetany.c

Log Message:
PR/43141: Tobias Nygren: Print an error on unknown interfaces.


Now this is trival and it is fixed. But I guess there is a bug here in ATF.
The test only checks that the exit code is not zero:

 atf_check -s not-exit:0 ifconfig nonexistent0 1.2.3.4/24

But why is stderr being involved?


If you really want to ignore stderr in the test, pass -e ignore to 
atf_check.  The default is -o empty -e empty.


Now, the question is: do you really want to ignore the message, or do 
you want to validate that the appropriate error message is printed?  If 
the later (which should be the preferred way), -e inline:'foo bar\n' 
or -e match:'foo bar' or -e file:experr (with experr being 
pre-populated with the expected message) will do the job.


Re: CVS commit: src/external/bsd/atf/lib/libatf-c++

2012-07-14 Thread Julio Merino
On Thu, Jul 12, 2012 at 12:15 PM, Christos Zoulas chris...@netbsd.orgwrote:

 Module Name:src
 Committed By:   christos
 Date:   Thu Jul 12 16:15:40 UTC 2012

 Modified Files:
 src/external/bsd/atf/lib/libatf-c++: Makefile

 Log Message:
 Properly include dependent library, unbreaks objdir build.


Does bsd.test.mk need a similar change?  It's also using DPADD.


Re: CVS commit: src/regress/lib/libc/cdb

2012-07-22 Thread Julio Merino
On Sat, Jul 21, 2012 at 7:12 PM, Mindaugas Rasiukevicius
rm...@netbsd.org wrote:
 Jukka Ruohonen jruoho...@iki.fi wrote:
  Module Name:src
  Committed By:   rmind
  Date:   Sat Jul 21 22:22:55 UTC 2012
 
  Added Files:
  src/regress/lib/libc/cdb: cdb_test.c
 
  Log Message:
  Add a simple test for cdb(5).

 Is there a particular reason why you do not use ATF but keep adding your
 custom test programs??  I recall some kind of resolution about this...

 (And IMO, even if you dislike ATF, you can not dislike the
 infrastructure.)

 Unfortunately, ATF is problematic and inconvenient to use for me.  I can
 share my thoughts on this, if there is an interest.

Please do.  Ignoring the problem is not going to fix it.  (Feel free
to reply privately or email the atf-devel list only if you do not want
to share at large for whatever reason.)

 Feel free to convert this to ATF.  As for resolution - if you insist,
 I can stop adding the tests.

Have you gone over http://wiki.netbsd.org/tutorials/atf/ ?  (I guess
you have, but just in case.)

-- 
Julio Merino / @jmmv


Re: CVS commit: src/tests/kernel

2013-02-19 Thread Julio Merino
On Tue, Feb 19, 2013 at 2:43 PM, Joerg Sonnenberger
jo...@britannica.bec.de wrote:
 On Tue, Feb 19, 2013 at 11:40:22AM -0800, Paul Goyette wrote:
 Most of the printf's were already there before this round of
 updates, and there's enough differentiation in them to figure out
 which process is responsible.  In any case, the printf's aren't
 critical to the test (until you need to debug it!).

 I am talking about the *new* printf in the child process.
 That should just be a plain write to STDERR_FILENO, it doesn't even have
 to include any more error details.

This is pure curiosity: isn't a fflush(stderr) right before the fork()
enough to make printf() safe in the child? If not, why not?

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd

2013-02-23 Thread Julio Merino
On Sat, Feb 23, 2013 at 9:18 AM, Julio Merino j...@netbsd.org wrote:
 Module Name:src
 Committed By:   jmmv
 Date:   Sat Feb 23 14:18:52 UTC 2013

 Modified Files:
 src/external/bsd: Makefile

 Log Message:
 Makefile

Fixed in the repository to read:

Descend into kyua-cli when MKKYUA!=no.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread Julio Merino
On Mon, Feb 25, 2013 at 1:54 PM, David Holland
dholland-sourcechan...@netbsd.org wrote:
 On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
   Log Message:
   Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
  
   Fix broken variable parsing with NetBSD's /bin/sh
  
   Quote the expansion of a $() command that was not properly surrounded
   by quotes so that this runs properly with NetBSD's /bin/sh.

 In what way was it broken? (And where's the PR?)

I was assuming my code was broken, not sh.  But I can file a PR with
the observed difference between sh and bash.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-26 Thread Julio Merino

On Feb 25, 2013, at 13:54, David Holland dholland-sourcechan...@netbsd.org 
wrote:

 On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
 Log Message:
 Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
 
 Fix broken variable parsing with NetBSD's /bin/sh
 
 Quote the expansion of a $() command that was not properly surrounded
 by quotes so that this runs properly with NetBSD's /bin/sh.
 
 In what way was it broken? (And where's the PR?)

FTR: bin/47597



Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-26 Thread Julio Merino
On Feb 25, 2013, at 15:40, Valeriy E. Ushakov u...@stderr.spb.ru wrote:

 On Mon, Feb 25, 2013 at 18:49:51 +, Julio Merino wrote:
 
 Module Name: src
 Committed By:jmmv
 Date:Mon Feb 25 18:49:51 UTC 2013
 
 Modified Files:
  src/external/bsd/kyua-atf-compat/dist: atf-run.sh
 
 Log Message:
 Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
 
 Fix broken variable parsing with NetBSD's /bin/sh
 
 Quote the expansion of a $() command that was not properly surrounded
 by quotes so that this runs properly with NetBSD's /bin/sh.
 
 grep|sed pipeline is ok on a command line where one is lazy, in a
 script it should be just sed :)

Heh, very true. I'll try to play with this a bit later.

 Your $ws doesn't do what you expect it to do.  Try your command on a
 line that actually has tabs.  This is because backslash has no special
 meaning inside [], so your \t is not a tab, but either a backslash or
 a letter 't'.

Thanks; this should be fixed now.


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-26 Thread Julio Merino

On Feb 25, 2013, at 14:01, Paul Goyette p...@whooppee.com wrote:

 On Mon, 25 Feb 2013, David Holland wrote:
 
 On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
  Log Message:
  Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
 
  Fix broken variable parsing with NetBSD's /bin/sh
 
  Quote the expansion of a $() command that was not properly surrounded
  by quotes so that this runs properly with NetBSD's /bin/sh.
 
 In what way was it broken? (And where's the PR?)
 
 And when do we get a regression test case to detect it?

Whenever we decide what the behavior should be! See the discussion that the PR 
started.

Re: CVS commit: src

2013-03-01 Thread Julio Merino
On Fri, Mar 1, 2013 at 1:26 PM, Joerg Sonnenberger jo...@netbsd.org wrote:
 Module Name:src
 Committed By:   joerg
 Date:   Fri Mar  1 18:26:12 UTC 2013

 Modified Files:

 Log Message:
 Retire OSI network stack. OK core@

Not sure if this is related, but this is the only recent commit I see
mentioning iso_var.h:

/home/jmmv/os/netbsd/amd64/tools/bin/x86_64--netbsd-gcc -O2  -g
-std=gnu99  -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Wno-sign-compare  -Wno-traditional
-Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual
-Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare
-Wold-style-definition -Wsign-compare -Wformat=2
-Wno-format-zero-length  -Werror
--sysroot=/home/jmmv/os/netbsd/amd64/destdir
-I/home/jmmv/os/netbsd/src/usr.bin/ktrace
-I/home/jmmv/os/netbsd/src/sys  -ckdump-ioctl.c
In file included from kdump-ioctl.c:85:0:
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_snpac.h:67:18:
error: field 'sr_isoa' has incomplete type
In file included from kdump-ioctl.c:86:0:
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:77:22:
error: field 'ia_addr' has incomplete type
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:78:22:
error: field 'ia_dstaddr' has incomplete type
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:80:22:
error: field 'ia_sockmask' has incomplete type
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:86:22:
error: field 'ifra_addr' has incomplete type
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:87:22:
error: field 'ifra_dstaddr' has incomplete type
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:88:22:
error: field 'ifra_mask' has incomplete type
/home/jmmv/os/netbsd/amd64/destdir/usr/include/netiso/iso_var.h:94:22:
error: field 'ifr_Addr' has incomplete type

-- 
Julio Merino / @jmmv


Re: CVS import: src/external/bsd/kyua-cli/dist

2013-10-19 Thread Julio Merino
On Sat, Oct 19, 2013 at 7:32 AM, Marc Balmer m...@msys.ch wrote:
 Am 19.10.13 01:40, schrieb Julio Merino:
 Module Name:  src
 Committed By: jmmv
 Date: Fri Oct 18 23:40:48 UTC 2013

 Update of /cvsroot/src/external/bsd/kyua-cli/dist
 In directory ivanova.netbsd.org:/tmp/cvs-serv22893

 Log Message:
 Update kyua-cli to 0.7:

 The major reason for this update is to support the just-imported lutok-0.3
 and, in turn, support the eventual update of the in-tree lua to 5.2.

 Changes:


 [...]


 * Switched to use Lutok 0.3 to gain compatibility with Lua 5.2.

 So your work would be safe and continue to build/work when Lua gets
 updated to 5.2?

Correct!

-- 
Julio Merino / @jmmv


CVS commit: src/libexec/httpd

2011-03-29 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Mar 29 07:22:31 UTC 2011

Modified Files:
src/libexec/httpd: bozohttpd.8 bozohttpd.c bozohttpd.h daemon-bozo.c
main.c

Log Message:
Add pid file support: if the new -P option is provided, it specifies the
location of the pid file to create.

OKed by mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.26 -r1.27 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.17 -r1.18 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.12 -r1.13 src/libexec/httpd/daemon-bozo.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/libexec/httpd/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.25 src/libexec/httpd/bozohttpd.8:1.26
--- src/libexec/httpd/bozohttpd.8:1.25	Thu Mar 10 14:37:16 2011
+++ src/libexec/httpd/bozohttpd.8	Tue Mar 29 07:22:31 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: bozohttpd.8,v 1.25 2011/03/10 14:37:16 reed Exp $
+.\	$NetBSD: bozohttpd.8,v 1.26 2011/03/29 07:22:31 jmmv Exp $
 .\
 .\	$eterna: bozohttpd.8,v 1.99 2010/09/20 22:26:28 mrg Exp $
 .\
@@ -26,7 +26,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd September 20, 2010
+.Dd March 25, 2011
 .Dt HTTPD 8
 .Os
 .Sh NAME
@@ -40,6 +40,7 @@
 .Op Fl I Ar port
 .Op Fl i Ar address
 .Op Fl M Ar suffix type encoding encoding11
+.Op Fl P Ar pidfile
 .Op Fl p Ar pubdir
 .Op Fl S Ar server_software
 .Op Fl t Ar chrootdir
@@ -181,6 +182,14 @@
 This option has no effect without the
 .Fl c
 option.
+.It Fl P Ar pidfile
+This option causes
+.Nm
+to create a pid file in
+.Ar pidfile
+when run in daemon mode with the
+.Fl b
+option.
 .It Fl p Ar pubdir
 This option changes the default user directory for
 .Em /~user/

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.26 src/libexec/httpd/bozohttpd.c:1.27
--- src/libexec/httpd/bozohttpd.c:1.26	Wed Jan 12 19:29:24 2011
+++ src/libexec/httpd/bozohttpd.c	Tue Mar 29 07:22:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.26 2011/01/12 19:29:24 pooka Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.27 2011/03/29 07:22:31 jmmv Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.176 2010/09/20 22:26:28 mrg Exp $	*/
 
@@ -1997,6 +1997,9 @@
 	strcmp(cp, true) == 0) {
 		httpd-foreground = 1;
 	}
+	if ((cp = bozo_get_pref(prefs, pid file)) != NULL) {
+		httpd-pidfile = strdup(cp);
+	}
 	if ((cp = bozo_get_pref(prefs, unknown slash)) != NULL 
 	strcmp(cp, true) == 0) {
 		httpd-unknown_slash = 1;

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.17 src/libexec/httpd/bozohttpd.h:1.18
--- src/libexec/httpd/bozohttpd.h:1.17	Mon Sep 20 23:11:38 2010
+++ src/libexec/httpd/bozohttpd.h	Tue Mar 29 07:22:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.17 2010/09/20 23:11:38 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.18 2011/03/29 07:22:31 jmmv Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.37 2010/09/20 22:26:28 mrg Exp $	*/
 
@@ -76,6 +76,7 @@
 	int		 logstderr;	/* log to stderr (even if not tty) */
 	int		 background;	/* drop into daemon mode */
 	int		 foreground;	/* keep daemon mode in foreground */
+	char		*pidfile;	/* path to the pid file, if any */
 	size_t		 page_size;	/* page size */
 	char		*slashdir;	/* www slash directory */
 	char		*bindport;	/* bind port; default http */

Index: src/libexec/httpd/daemon-bozo.c
diff -u src/libexec/httpd/daemon-bozo.c:1.12 src/libexec/httpd/daemon-bozo.c:1.13
--- src/libexec/httpd/daemon-bozo.c:1.12	Sun Feb  6 19:00:53 2011
+++ src/libexec/httpd/daemon-bozo.c	Tue Mar 29 07:22:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: daemon-bozo.c,v 1.12 2011/02/06 19:00:53 pooka Exp $	*/
+/*	$NetBSD: daemon-bozo.c,v 1.13 2011/03/29 07:22:31 jmmv Exp $	*/
 
 /*	$eterna: daemon-bozo.c,v 1.22 2010/06/21 06:45:45 mrg Exp $	*/
 
@@ -40,9 +40,11 @@
 
 #include netinet/in.h
 
+#include assert.h
 #include errno.h
 #include netdb.h
 #include poll.h
+#include stdio.h
 #include stdlib.h
 #include string.h
 #include unistd.h
@@ -61,6 +63,9 @@
 #define INFTIM -1
 #endif
 
+static const char* pidfile_path = NULL;
+static pid_t pidfile_pid = 0;
+
 /* ARGSUSED */
 static void
 sigchild(int signo)
@@ -69,6 +74,52 @@
 	}
 }
 
+/* Signal handler to exit in a controlled manner.  This ensures that
+ * any atexit(3) handlers are properly executed. */
+/* ARGSUSED */
+static void
+controlled_exit(int signo)
+{
+
+	exit(EXIT_SUCCESS);
+}
+
+static void
+remove_pidfile(void)
+{
+
+	if (pidfile_path != NULL  pidfile_pid == getpid()) {
+		(void)unlink(pidfile_path);
+		pidfile_path = NULL;
+	}
+}
+
+static void
+create_pidfile(bozohttpd_t *httpd)
+{
+	FILE *file;
+
+	assert(pidfile_path == NULL);
+
+	if (httpd-pidfile == NULL)
+		return;
+
+	if (atexit(remove_pidfile) == -1)
+		bozo_err(httpd, 1, Failed to install pidfile handler);
+
+	if ((file = fopen(httpd-pidfile, w)) == 

CVS commit: src

2011-03-29 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Mar 29 13:55:37 UTC 2011

Modified Files:
src/lib/libutil: pidfile.3 pidfile.c
src/tests/lib/libutil: t_pidfile.c

Log Message:
Extend pidfile(3) to support creating pid files in arbitrary locations.

If the argument provided to pidfile(3) contains a '/', then the value is
considered to be an absolute/relative path and the pid file is created
in the given location.

Otherwise, pidfile(3) behaves as before and treats the provided value as
a basename to construct a pid file in /var/run/basename.pid.  This means
that to create a pid file named foo.pid in the current directory, one
must specify ./foo.pid.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libutil/pidfile.3
cvs rdiff -u -r1.8 -r1.9 src/lib/libutil/pidfile.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libutil/t_pidfile.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/pidfile.3
diff -u src/lib/libutil/pidfile.3:1.12 src/lib/libutil/pidfile.3:1.13
--- src/lib/libutil/pidfile.3:1.12	Wed May  5 22:05:31 2010
+++ src/lib/libutil/pidfile.3	Tue Mar 29 13:55:37 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: pidfile.3,v 1.12 2010/05/05 22:05:31 wiz Exp $
+.\	$NetBSD: pidfile.3,v 1.13 2011/03/29 13:55:37 jmmv Exp $
 .\
 .\ Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 4, 2010
+.Dd March 23, 2011
 .Dt PIDFILE 3
 .Os
 .Sh NAME
@@ -38,34 +38,48 @@
 .Sh SYNOPSIS
 .In util.h
 .Ft int
-.Fn pidfile const char *basename
+.Fn pidfile const char *path
 .Sh DESCRIPTION
 .Fn pidfile
-writes a file containing the process ID of the program to the
+creates a file containing the process ID of the caller program.
+The pid file can be used as a quick reference if
+the process needs to be sent a signal.
+When the program exits, the pid file is removed automatically, unless
+the program receives a fatal signal.
+.Pp
+If
+.Ar path
+is
+.Dv NULL
+or a plain basename (a name containing no directory components), the pid file
+is created in the
 .Pa /var/run
 directory.
 The file name has the form
 .Pa /var/run/basename.pid .
-If the
-.Ar basename
-argument is
+The basename part is either the value of
+.Ar path
+if it was not
 .Dv NULL ,
-.Fn pidfile
-will determine the program name and use that instead.
+or the program name as returned by
+.Xr getprogname 3
+otherwise.
 .Pp
-The pid file can be used as a quick reference if
-the process needs to be sent a signal.
-When the program exits, the pid file will be removed automatically, unless
-the program receives a fatal signal.
+If
+.Ar path
+is an absolute or relative path (i.e. it contains the
+.Sq /
+character),
+the pid file is created in the provided location.
 .Pp
 Note that only the first invocation of
 .Fn pidfile
 causes a pid file to be written; subsequent invocations have no effect
 unless a new
-.Ar basename
+.Ar path
 is supplied.
 If called with a new
-.Ar basename ,
+.Ar path ,
 .Fn pidfile
 will remove the old pid file and write the new one.
 .Sh RETURN VALUES
@@ -78,11 +92,13 @@
 .Fn pidfile
 function call appeared in
 .Nx 1.5 .
+Support for creating pid files in any arbitrary path was added in
+.Nx 6.0 .
 .Sh BUGS
 .Fn pidfile
 uses
 .Xr atexit 3
-to ensure the pidfile is unlinked at program exit.
+to ensure the pid file is unlinked at program exit.
 However, programs that use the
 .Xr _exit 2
 function (for example, in signal handlers)

Index: src/lib/libutil/pidfile.c
diff -u src/lib/libutil/pidfile.c:1.8 src/lib/libutil/pidfile.c:1.9
--- src/lib/libutil/pidfile.c:1.8	Mon Apr 28 20:23:03 2008
+++ src/lib/libutil/pidfile.c	Tue Mar 29 13:55:37 2011
@@ -1,11 +1,11 @@
-/*	$NetBSD: pidfile.c,v 1.8 2008/04/28 20:23:03 martin Exp $	*/
+/*	$NetBSD: pidfile.c,v 1.9 2011/03/29 13:55:37 jmmv Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Matthias Scheler.
+ * by Jason R. Thorpe, Matthias Scheler and Julio Merino.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,90 +31,144 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: pidfile.c,v 1.8 2008/04/28 20:23:03 martin Exp $);
+__RCSID($NetBSD: pidfile.c,v 1.9 2011/03/29 13:55:37 jmmv Exp $);
 #endif
 
 #include sys/param.h
+
 #include paths.h
+#include stdbool.h
 #include stdlib.h
 #include stdio.h
 #include string.h
 #include unistd.h
 #include util.h
 
-static int   pidfile_atexit_done;
 static pid_t pidfile_pid;
-static char *pidfile_basename;
 static char *pidfile_path;
 
-static void pidfile_cleanup(void);
+/* Deletes an existent pidfile

CVS commit: src/tests/lib/librumphijack

2011-03-29 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Mar 29 15:43:45 UTC 2011

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
Make httpd create a pid file and use that to kill the server in a controlled
manner (instead of indirectly through rump.halt).  Suggested by pooka@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/librumphijack/t_tcpip.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/librumphijack/t_tcpip.sh
diff -u src/tests/lib/librumphijack/t_tcpip.sh:1.8 src/tests/lib/librumphijack/t_tcpip.sh:1.9
--- src/tests/lib/librumphijack/t_tcpip.sh:1.8	Tue Mar 22 17:07:11 2011
+++ src/tests/lib/librumphijack/t_tcpip.sh	Tue Mar 29 15:43:45 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_tcpip.sh,v 1.8 2011/03/22 17:07:11 pooka Exp $
+#   $NetBSD: t_tcpip.sh,v 1.9 2011/03/29 15:43:45 jmmv Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,12 +38,10 @@
 {
 
 	atf_check -s exit:0 ${rumpnetsrv} ${RUMP_SERVER}
-	# make sure clients die after we nuke the server
-	export RUMPHIJACK_RETRYCONNECT='die'
 
 	# start bozo in daemon mode
 	atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
-	/usr/libexec/httpd -b -s $(atf_get_srcdir)
+	/usr/libexec/httpd -P ./httpd.pid -b -s $(atf_get_srcdir)
 
 	atf_check -s exit:0 -o file:$(atf_get_srcdir)/netstat.expout \
 	rump.netstat -a
@@ -62,6 +60,11 @@
 http_cleanup()
 {
 	rump.halt
+
+	if [ -f httpd.pid ]; then
+		kill -9 $(cat httpd.pid)
+		rm -f httpd.pid
+	fi
 }
 
 #



CVS commit: src/tests/lib/librumphijack

2011-03-29 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Mar 29 16:03:32 UTC 2011

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
Halt the httpd server _before_ rump.  Per pooka@'s suggestion.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/librumphijack/t_tcpip.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/librumphijack/t_tcpip.sh
diff -u src/tests/lib/librumphijack/t_tcpip.sh:1.9 src/tests/lib/librumphijack/t_tcpip.sh:1.10
--- src/tests/lib/librumphijack/t_tcpip.sh:1.9	Tue Mar 29 15:43:45 2011
+++ src/tests/lib/librumphijack/t_tcpip.sh	Tue Mar 29 16:03:32 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: t_tcpip.sh,v 1.9 2011/03/29 15:43:45 jmmv Exp $
+#   $NetBSD: t_tcpip.sh,v 1.10 2011/03/29 16:03:32 jmmv Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -59,12 +59,12 @@
 
 http_cleanup()
 {
-	rump.halt
-
 	if [ -f httpd.pid ]; then
 		kill -9 $(cat httpd.pid)
 		rm -f httpd.pid
 	fi
+
+	rump.halt
 }
 
 #



CVS commit: src/external/bsd/atf/dist

2011-03-31 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Mar 31 16:41:17 UTC 2011

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv24817

Log Message:
Import atf-0.13:

Experimental version released on March 31st, 2011.

This is the first release after the creation of the Kyua project, a more
modular and reliable replacement for ATF.  From now on, ATF will change to
accomodate the transition to this new codebase, but ATF will still continue
to see development in the short/medium term.  Check out the project page at
http://code.google.com/p/kyua/ for more details.

The changes in this release are:

* Added support to run the tests with the Kyua runtime engine (kyua-cli), a
  new package that aims to replace atf-run and atf-report.  The ATF tests
  can be run with the new system by issuing a 'make installcheck-kyua' from
  the top-level directory of the project (assuming the 'kyua' binary is
  available during the configuration stage of ATF).

* atf-run and atf-report are now in maintenance mode (but *not* deprecated
  yet!).  Kyua already implements a new, much more reliable runtime engine
  that provides similar features to these tools.  That said, it is not
  complete yet so all development efforts should go towards it.

* If GDB is installed, atf-run dumps the stack trace of crashing test
  programs in an attempt to aid debugging.  Contributed by Antti Kantee.

* Reverted default timeout change in previous release and reset its value
  to 5 minutes.  This was causing several issues, specially when running
  the existing NetBSD test suite in qemu.

* Fixed the 'match' output checker in atf-check to properly validate the
  last line of a file even if it does not have a newline.

* Added the ATF_REQUIRE_IN and ATF_REQUIRE_NOT_IN macros to atf-c++ to
  check for the presence (or lack thereof) of an element in a collection.

* PR bin/44176: Fixed a race condition in atf-run that would crash atf-run
  when the cleanup of a test case triggered asynchronous modifications to
  its work directory (e.g. killing a daemon process that cleans up a pid
  file in the work directory).

* PR bin/44301: Fixed the sample XSLT file to report bogus test programs
  instead of just listing them as having 0 test cases.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-13

U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/NEWS
N src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c/error_fwd.h
U src/external/bsd/atf/dist/atf-c/build.h
U src/external/bsd/atf/dist/atf-c/check.h
U src/external/bsd/atf/dist/atf-c/config.h
U src/external/bsd/atf/dist/atf-c/error.h
U src/external/bsd/atf/dist/atf-c/atf-c-api.3
U src/external/bsd/atf/dist/atf-c/macros.h
U src/external/bsd/atf/dist/atf-c/tc.h
U src/external/bsd/atf/dist/atf-c/tp.h
U src/external/bsd/atf/dist/atf-c/utils.h
U src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
U src/external/bsd/atf/dist/atf-c/defs.h.in
U src/external/bsd/atf/dist/atf-c/build.c
U src/external/bsd/atf/dist/atf-c/check.c
U src/external/bsd/atf/dist/atf-c/config.c
U src/external/bsd/atf/dist/atf-c/error.c
U src/external/bsd/atf/dist/atf-c/tc.c
U src/external/bsd/atf/dist/atf-c/tp.c
U src/external/bsd/atf/dist/atf-c/utils.c
U src/external/bsd/atf/dist/atf-c/h_build.h
U src/external/bsd/atf/dist/atf-c/atf_c_test.c
U src/external/bsd/atf/dist/atf-c/build_test.c
U src/external/bsd/atf/dist/atf-c/check_test.c
U src/external/bsd/atf/dist/atf-c/config_test.c
U src/external/bsd/atf/dist/atf-c/tc_test.c
U src/external/bsd/atf/dist/atf-c/error_test.c
U src/external/bsd/atf/dist/atf-c/macros_test.c
U src/external/bsd/atf/dist/atf-c/tp_test.c
U src/external/bsd/atf/dist/atf-c/utils_test.c
U src/external/bsd/atf/dist/atf-c/atf-c.pc.in
C src/external/bsd/atf/dist/atf-c/Atffile
N src/external/bsd/atf/dist/atf-c/Kyuafile
U src/external/bsd/atf/dist/atf-c/macros_h_test.c
U src/external/bsd/atf/dist/atf-c/detail/process_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr.c
U src/external/bsd/atf/dist/atf-c/detail/dynstr.h
U src/external/bsd/atf/dist/atf-c/detail/env.c
U src/external/bsd/atf/dist/atf-c/detail/env.h
U src/external/bsd/atf/dist/atf-c/detail/fs.c
U src/external/bsd/atf/dist/atf-c/detail/fs.h
U src/external/bsd/atf/dist/atf-c/detail/list.c
U src/external/bsd/atf/dist/atf-c/detail/list.h
U src/external/bsd/atf/dist/atf-c/detail/map.c
U src/external/bsd/atf/dist/atf-c/detail/map.h
U src/external/bsd/atf/dist/atf-c/detail/process.c
U src/external/bsd/atf/dist/atf-c/detail/process.h
U src/external/bsd/atf/dist/atf-c/detail/sanity.c
U src/external/bsd/atf/dist/atf-c/detail/sanity.h
U src/external/bsd/atf/dist/atf-c/detail/text.c
U 

CVS commit: src/external/bsd/atf/dist

2011-03-31 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Mar 31 16:44:18 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: atf-run.cpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp atf-check_test.sh
src/external/bsd/atf/dist/doc: atf-test-case.4

Log Message:
Fix import conflicts.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-run/atf-run.cpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/doc/atf-test-case.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-run/atf-run.cpp
diff -u src/external/bsd/atf/dist/atf-run/atf-run.cpp:1.9 src/external/bsd/atf/dist/atf-run/atf-run.cpp:1.10
--- src/external/bsd/atf/dist/atf-run/atf-run.cpp:1.9	Fri Mar  4 09:04:06 2011
+++ src/external/bsd/atf/dist/atf-run/atf-run.cpp	Thu Mar 31 16:44:17 2011
@@ -1,7 +1,7 @@
 //
 // Automated Testing Framework (atf)
 //
-// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
@@ -99,6 +99,45 @@
 int main(void);
 };
 
+static void
+dump_stacktrace(const atf::fs::path tp, const atf::process::status s,
+const atf::fs::path workdir, impl::atf_tps_writer w)
+{
+PRE(s.signaled()  s.coredump());
+
+w.stderr_tc(Test program crashed; attempting to get stack trace);
+
+const atf::fs::path corename = workdir / (tp.leaf_name() + .core);
+if (!atf::fs::exists(corename)) {
+w.stderr_tc(Expected file  + corename.str() +  not found);
+return;
+}
+
+const atf::fs::path gdb(GDB);
+const atf::fs::path gdbout = workdir / gdb.out;
+const atf::process::argv_array args(gdb.leaf_name().c_str(), -batch,
+-q, -ex, bt, tp.c_str(),
+corename.c_str(), NULL);
+atf::process::status status = atf::process::exec(
+gdb, args,
+atf::process::stream_redirect_path(gdbout),
+atf::process::stream_redirect_path(atf::fs::path(/dev/null)));
+if (!status.exited() || status.exitstatus() != EXIT_SUCCESS) {
+w.stderr_tc(Execution of  GDB  failed);
+return;
+}
+
+std::ifstream input(gdbout.c_str());
+if (input) {
+std::string line;
+while (std::getline(input, line).good())
+w.stderr_tc(line);
+input.close();
+}
+
+w.stderr_tc(Stack trace complete);
+}
+
 const char* atf_run::m_description =
 atf-run is a tool that runs tests programs and collects their 
 results.;
@@ -370,8 +409,8 @@
 if (user.first != -1  user.second != -1) {
 if (::chown(workdir.get_path().c_str(), user.first,
 user.second) == -1) {
-throw atf::system_error(chmod( +
-workdir.get_path().str() + ), chmod(2) failed,
+throw atf::system_error(chown( +
+workdir.get_path().str() + ), chown(2) failed,
 errno);
 }
 resfile = workdir.get_path() / tcr;
@@ -380,45 +419,17 @@
 std::pair std::string, const atf::process::status  s =
 impl::run_test_case(tp, tcname, body, tcmd, config,
 resfile, workdir.get_path(), w);
+if (s.second.signaled()  s.second.coredump())
+dump_stacktrace(tp, s.second, workdir.get_path(), w);
+if (has_cleanup)
+(void)impl::run_test_case(tp, tcname, cleanup, tcmd,
+config, resfile, workdir.get_path(), w);
 
 // TODO: Force deletion of workdir.
 
 impl::test_case_result tcr = get_test_case_result(s.first,
 s.second, resfile);
 
-		/* if we have a core, scope out stacktrace */
-		size_t slashpos = tp.str().rfind(/);
-		std::string corename = workdir.get_path().str()
-		+ std::string(/) + tp.str().substr(slashpos+1)
-		+ std::string(.core);
-		if (s.second.signaled()  s.second.coredump() 
-		access(corename.c_str(), F_OK) == 0) {
-			std::string gdbcmd;
-			char buf[256];
-			char *p;
-
-			gdbcmd = std::string(gdb -batch -q -ex bt ) +
-			tp.str() + std::string( ) + corename +
-			std::string( 2 /dev/null | grep -v ) +
-			std::string('(no debugging symbols found)');
-			FILE *gdbstrm = popen(gdbcmd.c_str(), r);
-			if (gdbstrm) {
-w.stderr_tc(std::string(test program crashed, 
-autolisting stacktrace:));
-while 

CVS commit: src/external/bsd/atf

2011-03-31 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Mar 31 16:45:45 UTC 2011

Modified Files:
src/external/bsd/atf: prepare-import.sh
src/external/bsd/atf/lib/libatf-c: Makefile bconfig.h
src/external/bsd/atf/lib/libatf-c++: Makefile
src/external/bsd/atf/usr.bin/atf-run: Makefile

Log Message:
Adjust reachover build files with the import of atf-0.13.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/prepare-import.sh
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/lib/libatf-c/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/lib/libatf-c/bconfig.h
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/lib/libatf-c++/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/usr.bin/atf-run/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/prepare-import.sh
diff -u src/external/bsd/atf/prepare-import.sh:1.3 src/external/bsd/atf/prepare-import.sh:1.4
--- src/external/bsd/atf/prepare-import.sh:1.3	Wed Oct 20 08:56:16 2010
+++ src/external/bsd/atf/prepare-import.sh	Thu Mar 31 16:45:44 2011
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.3 2010/10/20 08:56:16 jmmv Exp $
+# $NetBSD: prepare-import.sh,v 1.4 2011/03/31 16:45:44 jmmv Exp $
 #
 # Use this script to recreate the 'dist' subdirectory from a newly released
 # distfile.  The script takes care of unpacking the distfile, removing any
@@ -13,7 +13,7 @@
 
 CLEAN_PATTERNS=
 CLEAN_PATTERNS=${CLEAN_PATTERNS} *.m4
-CLEAN_PATTERNS=${CLEAN_PATTERNS} INSTALL
+CLEAN_PATTERNS=${CLEAN_PATTERNS} INSTALL TODO
 CLEAN_PATTERNS=${CLEAN_PATTERNS} Makefile* */Makefile* */*/Makefile*
 CLEAN_PATTERNS=${CLEAN_PATTERNS} admin
 CLEAN_PATTERNS=${CLEAN_PATTERNS} bconfig.h.in

Index: src/external/bsd/atf/lib/libatf-c/Makefile
diff -u src/external/bsd/atf/lib/libatf-c/Makefile:1.9 src/external/bsd/atf/lib/libatf-c/Makefile:1.10
--- src/external/bsd/atf/lib/libatf-c/Makefile:1.9	Sun Feb 20 20:56:34 2011
+++ src/external/bsd/atf/lib/libatf-c/Makefile	Thu Mar 31 16:45:44 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2011/02/20 20:56:34 jmmv Exp $
+# $NetBSD: Makefile,v 1.10 2011/03/31 16:45:44 jmmv Exp $
 
 NOLINT=		# defined
 
@@ -86,7 +86,7 @@
 
 realall: atf-c.pc
 atf-c.pc: Makefile atf-c.pc.in
-	${TOOL_SED} -e 's,__ATF_VERSION__,0.12,g' \
+	${TOOL_SED} -e 's,__ATF_VERSION__,0.13,g' \
 	-e 's,__CC__,gcc,g' \
 	-e 's,__INCLUDEDIR__,/usr/include,g' \
 	-e 's,__LIBDIR__,/usr/lib,g' \

Index: src/external/bsd/atf/lib/libatf-c/bconfig.h
diff -u src/external/bsd/atf/lib/libatf-c/bconfig.h:1.7 src/external/bsd/atf/lib/libatf-c/bconfig.h:1.8
--- src/external/bsd/atf/lib/libatf-c/bconfig.h:1.7	Sun Nov  7 17:46:46 2010
+++ src/external/bsd/atf/lib/libatf-c/bconfig.h	Thu Mar 31 16:45:44 2011
@@ -90,13 +90,13 @@
 #define PACKAGE_BUGREPORT atf-de...@netbsd.org
 
 /* Define to the copyright string applicable to this package. */
-#define PACKAGE_COPYRIGHT Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
+#define PACKAGE_COPYRIGHT Copyright (c) 2007-2011 The NetBSD Foundation, Inc.
 
 /* Define to the full name of this package. */
 #define PACKAGE_NAME Automated Testing Framework
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING Automated Testing Framework 0.12
+#define PACKAGE_STRING Automated Testing Framework 0.13
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME atf
@@ -105,10 +105,10 @@
 #define PACKAGE_URL http://www.NetBSD.org/~jmmv/atf/;
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION 0.12
+#define PACKAGE_VERSION 0.13
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION 0.12
+#define VERSION 0.13

Index: src/external/bsd/atf/lib/libatf-c++/Makefile
diff -u src/external/bsd/atf/lib/libatf-c++/Makefile:1.8 src/external/bsd/atf/lib/libatf-c++/Makefile:1.9
--- src/external/bsd/atf/lib/libatf-c++/Makefile:1.8	Sun Feb 20 20:18:56 2011
+++ src/external/bsd/atf/lib/libatf-c++/Makefile	Thu Mar 31 16:45:45 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2011/02/20 20:18:56 jmmv Exp $
+# $NetBSD: Makefile,v 1.9 2011/03/31 16:45:45 jmmv Exp $
 
 NOLINT=		# defined
 
@@ -54,7 +54,7 @@
 
 realall: atf-c++.pc
 atf-c++.pc: Makefile atf-c++.pc.in
-	${TOOL_SED} -e 's,__ATF_VERSION__,0.12,g' \
+	${TOOL_SED} -e 's,__ATF_VERSION__,0.13,g' \
 	-e 's,__CXX__,g++,g' \
 	-e 's,__INCLUDEDIR__,/usr/include,g' \
 	-e 's,__LIBDIR__,/usr/lib,g' \

Index: src/external/bsd/atf/usr.bin/atf-run/Makefile
diff -u src/external/bsd/atf/usr.bin/atf-run/Makefile:1.9 src/external/bsd/atf/usr.bin/atf-run/Makefile:1.10
--- src/external/bsd/atf/usr.bin/atf-run/Makefile:1.9	Sun Feb 20 20:18:57 2011
+++ src/external/bsd/atf/usr.bin/atf-run/Makefile	Thu Mar 31 16:45:45 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 

CVS commit: src/doc

2011-03-31 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Mar 31 17:00:57 UTC 2011

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of atf-0.13.


To generate a diff of this commit:
cvs rdiff -u -r1.826 -r1.827 src/doc/3RDPARTY
cvs rdiff -u -r1.1531 -r1.1532 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.826 src/doc/3RDPARTY:1.827
--- src/doc/3RDPARTY:1.826	Wed Mar 23 20:22:33 2011
+++ src/doc/3RDPARTY	Thu Mar 31 17:00:57 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.826 2011/03/23 20:22:33 tron Exp $
+#	$NetBSD: 3RDPARTY,v 1.827 2011/03/31 17:00:57 jmmv Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -52,9 +52,9 @@
 Check src/usr.sbin/amd/include/config.h is correct after import.
 
 Package:	Automated Testing Framework (ATF)
-Version:	0.6
-Current Vers:	0.6
-Maintainer:	Julio M. Merino Vidal j...@netbsd.org
+Version:	0.13
+Current Vers:	0.13
+Maintainer:	Julio Merino j...@netbsd.org
 Archive site:	ftp://ftp.NetBSD.org/pub/NetBSD/misc/jmmv/atf/
 Home page:	http://www.NetBSD.org/~jmmv/atf/
 Mailing List:	atf-de...@netbsd.org
@@ -62,6 +62,7 @@
 License:	The NetBSD Foundation's license (BSD 2-clause)
 Notes:
 The source files are in external/bsd/atf/dist.
+Use external/bsd/atf/prepare-import.sh to regenerate the dist/ directory.
 Given that the primary goal of ATF is to provide a testing framework for
 NetBSD, no local changes should be ever needed.  Always direct them to the
 maintainer for integration in official releases.

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1531 src/doc/CHANGES:1.1532
--- src/doc/CHANGES:1.1531	Thu Mar 31 15:46:30 2011
+++ src/doc/CHANGES	Thu Mar 31 17:00:57 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1531 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1532 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -974,3 +974,4 @@
 	sparc: add TLS (thread locale storage) support.  [martin 20110330]
 	sparc64: add TLS (thread locale storage) support.  [martin 20110330]
 	alpha: add TLS (thread locale storage) support.  [skrll 20110331]
+	atf(7): Import 0.13.  [jmmv 20110331]



CVS commit: src/external/bsd/atf/lib/libatf-c++

2011-04-05 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Apr  5 16:37:07 UTC 2011

Modified Files:
src/external/bsd/atf/lib/libatf-c++: Makefile

Log Message:
Set LIBISCXX=yes; from joerg@.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/lib/libatf-c++/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/lib/libatf-c++/Makefile
diff -u src/external/bsd/atf/lib/libatf-c++/Makefile:1.9 src/external/bsd/atf/lib/libatf-c++/Makefile:1.10
--- src/external/bsd/atf/lib/libatf-c++/Makefile:1.9	Thu Mar 31 16:45:45 2011
+++ src/external/bsd/atf/lib/libatf-c++/Makefile	Tue Apr  5 16:37:06 2011
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.9 2011/03/31 16:45:45 jmmv Exp $
+# $NetBSD: Makefile,v 1.10 2011/04/05 16:37:06 jmmv Exp $
 
 NOLINT=		# defined
 
 .include bsd.own.mk
 
 LIB=		atf-c++
+LIBISCXX=	yes
 LDADD=		-L${.OBJDIR}/../libatf-c -latf-c
 DPADD=		${LIBATF_C}
 NOPIC=		# defined; interface is still too unstable



CVS commit: src/external/bsd/atf/dist

2011-04-05 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Apr  5 17:17:35 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: process.hpp
src/external/bsd/atf/dist/atf-c/detail: process.c process.h
process_test.c
src/external/bsd/atf/dist/atf-run: atf-run.cpp

Log Message:
Pull up revision b94e200f2a6ce3d47103339db1f3c8936b7238d3:

Unset TERM when running GDB

GDB inserts some funny control characters in its output when TERM is set to
e.g. xterm.  Workaround this by simply unsetting TERM.

Reported by martin@ and diagnosed by pooka@/martin@.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/atf/dist/atf-c++/detail/process.hpp
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/atf-c/detail/process.c \
src/external/bsd/atf/dist/atf-c/detail/process.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/atf/dist/atf-c/detail/process_test.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-run/atf-run.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c++/detail/process.hpp
diff -u src/external/bsd/atf/dist/atf-c++/detail/process.hpp:1.1.1.1 src/external/bsd/atf/dist/atf-c++/detail/process.hpp:1.2
--- src/external/bsd/atf/dist/atf-c++/detail/process.hpp:1.1.1.1	Wed Oct 20 09:14:21 2010
+++ src/external/bsd/atf/dist/atf-c++/detail/process.hpp	Tue Apr  5 17:17:35 2011
@@ -1,7 +1,7 @@
 //
 // Automated Testing Framework (atf)
 //
-// Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
@@ -118,7 +118,7 @@
 child fork(void (*)(void*), const OutStream, const ErrStream, void*);
 template class OutStream, class ErrStream  friend
 status exec(const atf::fs::path, const argv_array,
-const OutStream, const ErrStream);
+const OutStream, const ErrStream, void (*)(void));
 
 public:
 stream_capture(void);
@@ -130,7 +130,7 @@
 child fork(void (*)(void*), const OutStream, const ErrStream, void*);
 template class OutStream, class ErrStream  friend
 status exec(const atf::fs::path, const argv_array,
-const OutStream, const ErrStream);
+const OutStream, const ErrStream, void (*)(void));
 
 public:
 stream_connect(const int, const int);
@@ -142,7 +142,7 @@
 child fork(void (*)(void*), const OutStream, const ErrStream, void*);
 template class OutStream, class ErrStream  friend
 status exec(const atf::fs::path, const argv_array,
-const OutStream, const ErrStream);
+const OutStream, const ErrStream, void (*)(void));
 
 public:
 stream_inherit(void);
@@ -154,7 +154,7 @@
 child fork(void (*)(void*), const OutStream, const ErrStream, void*);
 template class OutStream, class ErrStream  friend
 status exec(const atf::fs::path, const argv_array,
-const OutStream, const ErrStream);
+const OutStream, const ErrStream, void (*)(void));
 
 public:
 stream_redirect_fd(const int);
@@ -166,7 +166,7 @@
 child fork(void (*)(void*), const OutStream, const ErrStream, void*);
 template class OutStream, class ErrStream  friend
 status exec(const atf::fs::path, const argv_array,
-const OutStream, const ErrStream);
+const OutStream, const ErrStream, void (*)(void));
 
 public:
 stream_redirect_path(const fs::path);
@@ -182,7 +182,7 @@
 friend class child;
 template class OutStream, class ErrStream  friend
 status exec(const atf::fs::path, const argv_array,
-const OutStream, const ErrStream);
+const OutStream, const ErrStream, void (*)(void));
 
 status(atf_process_status_t);
 
@@ -249,7 +249,8 @@
 template class OutStream, class ErrStream 
 status
 exec(const atf::fs::path prog, const argv_array argv,
- const OutStream outsb, const ErrStream errsb)
+ const OutStream outsb, const ErrStream errsb,
+ void (*prehook)(void))
 {
 atf_process_status_t s;
 
@@ -257,13 +258,22 @@
 atf_error_t err = atf_process_exec_array(s, prog.c_path(),
  argv.exec_argv(),
  outsb.get_sb(),
- errsb.get_sb());
+ errsb.get_sb(),
+ prehook);
 if (atf_is_error(err))
 throw_atf_error(err);
 
 return status(s);
 }
 
+template class OutStream, class ErrStream 
+status
+exec(const atf::fs::path prog, const argv_array argv,
+ const OutStream outsb, const ErrStream errsb)
+{
+return exec(prog, argv, outsb, errsb, NULL);
+}
+
 } // namespace process
 

CVS commit: src/libexec/httpd

2011-04-24 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Apr 24 07:17:02 UTC 2011

Modified Files:
src/libexec/httpd: bozohttpd.8

Log Message:
Remove the This option... sentence prefix for all option definitions.
Adjust some sentences so that the new text makes sense.  OK mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/libexec/httpd/bozohttpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.27 src/libexec/httpd/bozohttpd.8:1.28
--- src/libexec/httpd/bozohttpd.8:1.27	Sat Apr  2 07:44:15 2011
+++ src/libexec/httpd/bozohttpd.8	Sun Apr 24 07:17:02 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: bozohttpd.8,v 1.27 2011/04/02 07:44:15 mbalmer Exp $
+.\	$NetBSD: bozohttpd.8,v 1.28 2011/04/24 07:17:02 jmmv Exp $
 .\
 .\	$eterna: bozohttpd.8,v 1.99 2010/09/20 22:26:28 mrg Exp $
 .\
@@ -26,7 +26,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd April 2, 2011
+.Dd April 23, 2011
 .Dt HTTPD 8
 .Os
 .Sh NAME
@@ -79,12 +79,12 @@
 The following options are available:
 .Bl -tag -width xxxcgibin
 .It Fl b
-This option enables daemon mode, where
+Enables daemon mode, where
 .Nm
 detaches from the current terminal, running in the background and
 servicing HTTP requests.
 .It Fl C Ar suffix cgihandler
-This option adds a new CGI handler program for a particular file type.
+Adds a new CGI handler program for a particular file type.
 The
 .Ar suffix
 should be any normal file suffix, and the
@@ -96,7 +96,7 @@
 .Fl C
 options may be passed.
 .It Fl c Ar cgibin
-This option enables the CGI/1.1 interface.
+Enables the CGI/1.1 interface.
 The
 .Ar cgibin
 directory is expected to contain the CGI programs to be used.
@@ -114,7 +114,7 @@
 .Em ~user
 translation.
 .It Fl e
-This option causes
+Causes
 .Nm
 to not clear the environment when used with either the
 .Fl t
@@ -122,32 +122,29 @@
 .Fl U
 options.
 .It Fl f
-This option stops the
+Stops the
 .Fl b
 flag from
 .Nm
 detaching from the tty and going into the background.
 .It Fl H
-This option causes directory index mode to hide files and directories
+Causes directory index mode to hide files and directories
 that start with a period, except for
 .Pa .. .
 Also see
 .Fl X .
 .It Fl I Ar port
-This option is only valid with the
-.Fl b
-option.
-It causes
+Causes
 .Ar port
 to use used as the port to bind daemon mode.
 The default is the
 .Dq http
 port.
-.It Fl i Ar address
 This option is only valid with the
 .Fl b
 option.
-It causes
+.It Fl i Ar address
+Causes
 .Ar address
 to use used as the address to bind daemon mode.
 If otherwise unspecified, the address used to bind is derived from the
@@ -157,8 +154,11 @@
 Only the last
 .Fl i
 option is used.
+This option is only valid with the
+.Fl b
+option.
 .It Fl M Ar suffix type encoding encoding11
-This option adds a new entry to the table that converts file suffixes to
+Adds a new entry to the table that converts file suffixes to
 content type and encoding.
 This option takes four additional arguments containing
 the file prefix, its
@@ -174,7 +174,7 @@
 .Fl M
 options may be passed.
 .It Fl n
-This option stops
+Stops
 .Nm
 from doing IP address to name resolution of hosts for setting the
 .Ev REMOTE_HOST
@@ -183,7 +183,7 @@
 .Fl c
 option.
 .It Fl P Ar pidfile
-This option causes
+Causes
 .Nm
 to create a pid file in
 .Ar pidfile
@@ -191,14 +191,14 @@
 .Fl b
 option.
 .It Fl p Ar pubdir
-This option changes the default user directory for
+Changes the default user directory for
 .Em /~user/
 translations from
 .Dq public_html
 to
 .Ar pubdir .
 .It Fl r
-This option forces pages besides the
+Forces pages besides the
 .Dq index.html
 (see the
 .Fl X
@@ -207,14 +207,14 @@
 .Dq index.html
 page will be returned instead.
 .It Fl S Ar server_software
-This option sets the internal server version to
+Sets the internal server version to
 .Ar server_software .
 .It Fl s
-This option forces logging to be set to stderr always.
+Forces logging to be set to stderr always.
 .It Fl t Ar chrootdir
-When this option is used,
+Makes
 .Nm
-will chroot to the specified directory
+chroot to the specified directory
 before answering requests.
 Every other path should be specified relative
 to the new root, if this option is used.
@@ -223,7 +223,7 @@
 .Fl e
 option is also used.
 .It Fl U Ar username
-This option causes
+Causes
 .Nm
 to switch to the user and the groups of
 .Ar username
@@ -236,7 +236,7 @@
 .Fl e
 option is given.
 .It Fl u
-This option enables the transformation of Uniform Resource Locators of
+Enables the transformation of Uniform Resource Locators of
 the form
 .Em /~user/
 into the directory
@@ -245,7 +245,7 @@
 .Fl p
 option above).
 .It Fl V
-This option sets the default virtual host directory to
+Sets the default virtual host directory to
 .Ar slashdir .
 If no directory exists in
 .Ar 

CVS commit: src/libexec/httpd

2011-04-24 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Apr 24 07:19:00 UTC 2011

Modified Files:
src/libexec/httpd: bozohttpd.8

Log Message:
List myself as a contributor.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/libexec/httpd/bozohttpd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.28 src/libexec/httpd/bozohttpd.8:1.29
--- src/libexec/httpd/bozohttpd.8:1.28	Sun Apr 24 07:17:02 2011
+++ src/libexec/httpd/bozohttpd.8	Sun Apr 24 07:18:59 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: bozohttpd.8,v 1.28 2011/04/24 07:17:02 jmmv Exp $
+.\	$NetBSD: bozohttpd.8,v 1.29 2011/04/24 07:18:59 jmmv Exp $
 .\
 .\	$eterna: bozohttpd.8,v 1.99 2010/09/20 22:26:28 mrg Exp $
 .\
@@ -26,7 +26,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd April 23, 2011
+.Dd April 24, 2011
 .Dt HTTPD 8
 .Os
 .Sh NAME
@@ -594,6 +594,8 @@
 provided chroot and change-to-user support, and other various fixes
 .It
 Coyote Point provided various CGI fixes
+.It
+Julio Merino added pidfile support and provided some man page fixes
 .El
 .Pp
 There are probably others I have forgotten (let me know if you care)



CVS commit: src/tests/util/sh

2011-04-29 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Apr 29 12:49:36 UTC 2011

Modified Files:
src/tests/util/sh: t_exit.sh

Log Message:
Add test cases for PR bin/6764: 'trap ... 0' is supposed to execute the
command when the shell exits but it does not work in ksh when the shells
exits implicitly (without an explicit exit/return statement).

These new tests cover both sh and ksh.  The ksh part of this does not
strictly belong to this directory, but I think it'd be nice to extend
all the tests in here to cover both interpreters whenever that makes
sense, much like we do with the file system tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/util/sh/t_exit.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/util/sh/t_exit.sh
diff -u src/tests/util/sh/t_exit.sh:1.1 src/tests/util/sh/t_exit.sh:1.2
--- src/tests/util/sh/t_exit.sh:1.1	Tue Oct 20 21:58:35 2009
+++ src/tests/util/sh/t_exit.sh	Fri Apr 29 12:49:36 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_exit.sh,v 1.1 2009/10/20 21:58:35 jmmv Exp $
+# $NetBSD: t_exit.sh,v 1.2 2011/04/29 12:49:36 jmmv Exp $
 #
 # Copyright (c) 2007 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -62,8 +62,33 @@
 	'( trap echo exiting EXIT; /usr/bin/true )'
 }
 
+atf_test_case trap_zero__implicit_exit
+trap_zero__implicit_exit_body() {
+	echo '( trap echo exiting 0 )' helper.sh
+	atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
+	atf_expect_fail PR bin/6764: sh works but ksh does not
+	atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
+atf_test_case trap_zero__explicit_exit
+trap_zero__explicit_exit_body() {
+	echo '( trap echo exiting 0; exit )' helper.sh
+	atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
+	atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
+atf_test_case trap_zero__explicit_return
+trap_zero__explicit_return_body() {
+	echo '( trap echo exiting 0; return )' helper.sh
+	atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
+	atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
 atf_init_test_cases() {
 	atf_add_test_case function
 	atf_add_test_case readout
 	atf_add_test_case trap_subshell
+	atf_add_test_case trap_zero__implicit_exit
+	atf_add_test_case trap_zero__explicit_exit
+	atf_add_test_case trap_zero__explicit_return
 }



CVS commit: src/sys/crypto/rijndael

2011-05-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat May 14 16:27:50 UTC 2011

Modified Files:
src/sys/crypto/rijndael: rijndael-api-fst.c

Log Message:
Declare for-loop control variable outside of the for statement to prevent
a warning and therefore fix the build.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/crypto/rijndael/rijndael-api-fst.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/crypto/rijndael/rijndael-api-fst.c
diff -u src/sys/crypto/rijndael/rijndael-api-fst.c:1.22 src/sys/crypto/rijndael/rijndael-api-fst.c:1.23
--- src/sys/crypto/rijndael/rijndael-api-fst.c:1.22	Sat May 14 01:59:19 2011
+++ src/sys/crypto/rijndael/rijndael-api-fst.c	Sat May 14 16:27:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rijndael-api-fst.c,v 1.22 2011/05/14 01:59:19 christos Exp $	*/
+/*	$NetBSD: rijndael-api-fst.c,v 1.23 2011/05/14 16:27:49 jmmv Exp $	*/
 
 /**
  * rijndael-api-fst.c
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rijndael-api-fst.c,v 1.22 2011/05/14 01:59:19 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: rijndael-api-fst.c,v 1.23 2011/05/14 16:27:49 jmmv Exp $);
 
 #include sys/param.h
 #ifdef _KERNEL
@@ -54,7 +54,9 @@
 
 static void xor16(uint8_t *d, const uint8_t *a, const uint8_t* b)
 {
-	for (size_t i = 0; i  4; i++) {
+	size_t i;
+
+	for (i = 0; i  4; i++) {
 		*d++ = *a++ ^ *b++;
 		*d++ = *a++ ^ *b++;
 		*d++ = *a++ ^ *b++;



CVS commit: src/sys/crypto/rijndael

2011-05-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat May 14 16:46:55 UTC 2011

Modified Files:
src/sys/crypto/rijndael: rijndael-api-fst.c

Log Message:
Revert my previous change.  christos@ submitted a different fix pretty much
at the same time.  Did an update amd64 release build to ensure my change was
really not needed.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/crypto/rijndael/rijndael-api-fst.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/crypto/rijndael/rijndael-api-fst.c
diff -u src/sys/crypto/rijndael/rijndael-api-fst.c:1.23 src/sys/crypto/rijndael/rijndael-api-fst.c:1.24
--- src/sys/crypto/rijndael/rijndael-api-fst.c:1.23	Sat May 14 16:27:49 2011
+++ src/sys/crypto/rijndael/rijndael-api-fst.c	Sat May 14 16:46:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rijndael-api-fst.c,v 1.23 2011/05/14 16:27:49 jmmv Exp $	*/
+/*	$NetBSD: rijndael-api-fst.c,v 1.24 2011/05/14 16:46:55 jmmv Exp $	*/
 
 /**
  * rijndael-api-fst.c
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rijndael-api-fst.c,v 1.23 2011/05/14 16:27:49 jmmv Exp $);
+__KERNEL_RCSID(0, $NetBSD: rijndael-api-fst.c,v 1.24 2011/05/14 16:46:55 jmmv Exp $);
 
 #include sys/param.h
 #ifdef _KERNEL
@@ -54,9 +54,7 @@
 
 static void xor16(uint8_t *d, const uint8_t *a, const uint8_t* b)
 {
-	size_t i;
-
-	for (i = 0; i  4; i++) {
+	for (size_t i = 0; i  4; i++) {
 		*d++ = *a++ ^ *b++;
 		*d++ = *a++ ^ *b++;
 		*d++ = *a++ ^ *b++;



CVS commit: src/tests

2011-05-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat May 14 17:42:29 UTC 2011

Modified Files:
src/tests/dev/cgd: t_cgd.sh
src/tests/dev/md: t_md.sh
src/tests/dev/raidframe: t_raid.sh
src/tests/lib/librumphijack: t_tcpip.sh
src/tests/net/route: t_change.sh
src/tests/usr.bin/rump_server: t_disk.sh
src/tests/util/grep: t_grep.sh

Log Message:
Instead of doing 'atf_check ... sh -c foo', just do 'atf_check ... -x foo'.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/dev/cgd/t_cgd.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/dev/md/t_md.sh
cvs rdiff -u -r1.7 -r1.8 src/tests/dev/raidframe/t_raid.sh
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/librumphijack/t_tcpip.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/net/route/t_change.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/rump_server/t_disk.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/util/grep/t_grep.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/dev/cgd/t_cgd.sh
diff -u src/tests/dev/cgd/t_cgd.sh:1.8 src/tests/dev/cgd/t_cgd.sh:1.9
--- src/tests/dev/cgd/t_cgd.sh:1.8	Tue Mar 22 16:16:30 2011
+++ src/tests/dev/cgd/t_cgd.sh	Sat May 14 17:42:28 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_cgd.sh,v 1.8 2011/03/22 16:16:30 jmmv Exp $
+#	$NetBSD: t_cgd.sh,v 1.9 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -45,9 +45,9 @@
 	${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
 
 	export RUMP_SERVER=unix://csock
-	atf_check -s exit:0 sh -c echo 12345 | \
+	atf_check -s exit:0 -x echo 12345 | \
 	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	dd if=${d}/t_cgd count=2 | rump.dd of=${rawcgd}
 	atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
 	atf_check -s exit:0 -e ignore -o file:testfile \
@@ -76,14 +76,14 @@
 	${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
 
 	export RUMP_SERVER=unix://csock
-	atf_check -s exit:0 sh -c echo 12345 | \
+	atf_check -s exit:0 -x echo 12345 | \
 	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	dd if=${d}/t_cgd | rump.dd of=${rawcgd} count=2
 
 	# unconfig and reconfig cgd
 	atf_check -s exit:0 rump.cgdconfig -u cgd0
-	atf_check -s exit:0 sh -c echo 54321 | \
+	atf_check -s exit:0 -x echo 54321 | \
 	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
 
 	atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
@@ -112,11 +112,11 @@
 	${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
 
 	export RUMP_SERVER=unix://csock
-	atf_check -s exit:0 sh -c echo 12345 | \
+	atf_check -s exit:0 -x echo 12345 | \
 	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
 
 	atf_expect_fail PR kern/44515
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	echo die hard | rump.dd of=${rawcgd} bs=123 conv=sync
 }
 

Index: src/tests/dev/md/t_md.sh
diff -u src/tests/dev/md/t_md.sh:1.6 src/tests/dev/md/t_md.sh:1.7
--- src/tests/dev/md/t_md.sh:1.6	Fri Feb  4 19:44:00 2011
+++ src/tests/dev/md/t_md.sh	Sat May 14 17:42:28 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_md.sh,v 1.6 2011/02/04 19:44:00 pooka Exp $
+#	$NetBSD: t_md.sh,v 1.7 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -45,9 +45,9 @@
 	atf_check -s exit:0 $(atf_get_srcdir)/h_mdserv ${rawmd}
 
 	export RUMP_SERVER=unix://commsock
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	dd if=/bin/ls count=10 | rump.dd of=${rawmd} seek=100
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	rump.dd if=${rawmd} skip=100 count=10 | dd of=testfile
 	atf_check -s exit:0 -e ignore -o file:testfile dd if=/bin/ls count=10
 }

Index: src/tests/dev/raidframe/t_raid.sh
diff -u src/tests/dev/raidframe/t_raid.sh:1.7 src/tests/dev/raidframe/t_raid.sh:1.8
--- src/tests/dev/raidframe/t_raid.sh:1.7	Tue Mar  1 22:52:54 2011
+++ src/tests/dev/raidframe/t_raid.sh	Sat May 14 17:42:28 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_raid.sh,v 1.7 2011/03/01 22:52:54 riz Exp $
+#	$NetBSD: t_raid.sh,v 1.8 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -96,7 +96,7 @@
 	# put some data there
 	atf_check -s exit:0 -e ignore \
 	dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	dd if=testfile | rump.dd of=${rawraid} conv=sync
 
 	# restart server with failed component
@@ -183,7 +183,7 @@
 	# put some data there
 	atf_check -s exit:0 -e ignore \
 	dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
-	atf_check -s exit:0 -e ignore sh -c \
+	atf_check -s exit:0 -e ignore -x \
 	dd 

CVS commit: src/share/mk

2011-05-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat May 14 17:47:28 UTC 2011

Modified Files:
src/share/mk: bsd.test.mk

Log Message:
Remove any stale .fifo files when doing 'test'.  These may be leaked if
the user aborts the execution of atf-run with Ctrl+C, which will prevent
a subsequent 'make test' from working at all.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/mk/bsd.test.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.test.mk
diff -u src/share/mk/bsd.test.mk:1.17 src/share/mk/bsd.test.mk:1.18
--- src/share/mk/bsd.test.mk:1.17	Sun Mar 27 14:22:02 2011
+++ src/share/mk/bsd.test.mk	Sat May 14 17:47:28 2011
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.test.mk,v 1.17 2011/03/27 14:22:02 plunky Exp $
+# $NetBSD: bsd.test.mk,v 1.18 2011/05/14 17:47:28 jmmv Exp $
 #
 
 .include bsd.init.mk
@@ -139,6 +139,7 @@
 	@echo
 	@set -e; \
 	cd ${DESTDIR}${TESTSDIR}; \
+	rm -f ${_TESTS_FIFO}; \
 	mkfifo ${_TESTS_FIFO}; \
 	cat ${_TESTS_FIFO} | tee ${_TESTS_LOG} | \
 	${TESTS_ENV} ${DESTDIR}/usr/bin/atf-report  \



CVS commit: src/tests/lib/libc/stdlib

2011-06-05 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sun Jun  5 07:58:03 UTC 2011

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Do not blindly skip test code.

Tests are not supposed to skip whole parts of code to later report a success.
Instead, they need to report a 'skipped' result so that it is clear to the
user that some part of the tests were not run.

To do this, add proper calls to atf_tc_skip where some pieces of code are
skipped.  Also, make the strtod/strtof/strtold inf and nan tests more granular
so that the *ld versions can be skipped altogether when there is no support
for them.  As a result of this, the atf_tc_expect_fail becomes accurate; it
could have hidden bugs in strtod and strtof before.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/lib/libc/stdlib/t_strtod.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.17 src/tests/lib/libc/stdlib/t_strtod.c:1.18
--- src/tests/lib/libc/stdlib/t_strtod.c:1.17	Sun Jun  5 00:02:05 2011
+++ src/tests/lib/libc/stdlib/t_strtod.c	Sun Jun  5 07:58:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.17 2011/06/05 00:02:05 christos Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.18 2011/06/05 07:58:03 jmmv Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 /* Public domain, Otto Moerbeek o...@drijf.net, 2006. */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_strtod.c,v 1.17 2011/06/05 00:02:05 christos Exp $);
+__RCSID($NetBSD: t_strtod.c,v 1.18 2011/06/05 07:58:03 jmmv Exp $);
 
 #include errno.h
 #include math.h
@@ -47,6 +47,13 @@
 #include fenv.h
 #endif
 
+#if !defined(__vax__)
+static const char * const inf_strings[] =
+{ Inf, INF, -Inf, -INF, Infinity, +Infinity,
+  INFINITY, -INFINITY, InFiNiTy, +InFiNiTy };
+const char *nan_string = NaN(x)y;
+#endif
+
 ATF_TC(strtod_basic);
 ATF_TC_HEAD(strtod_basic, tc)
 {
@@ -105,10 +112,6 @@
 ATF_TC_BODY(strtod_inf, tc)
 {
 #ifndef __vax__
-	static const char * const str[] =
-	{ Inf, INF, -Inf, -INF, Infinity, +Infinity,
-	  INFINITY, -INFINITY, InFiNiTy, +InFiNiTy };
-
 	/*
 	 * See the closed PR lib/33262.
 	 *
@@ -117,19 +120,68 @@
 	if (system(cpuctl identify 0 | grep -q QEMU) == 0)
 		atf_tc_expect_fail(PR misc/44767);
 
-	for (size_t i = 0; i  __arraycount(str); i++) {
-
-		double d = strtod(str[i], NULL);
+	for (size_t i = 0; i  __arraycount(inf_strings); i++) {
+		double d = strtod(inf_strings[i], NULL);
 		ATF_REQUIRE(isinf(d) != 0);
+	}
+#else
+	atf_tc_skip(vax not supported);
+#endif
+}
+
+ATF_TC(strtof_inf);
+ATF_TC_HEAD(strtof_inf, tc)
+{
+	atf_tc_set_md_var(tc, descr, A strtof(3) with INF);
+}
+
+ATF_TC_BODY(strtof_inf, tc)
+{
+#ifndef __vax__
+	/*
+	 * See the closed PR lib/33262.
+	 *
+	 * This may also fail under QEMU; cf. PR misc/44767.
+	 */
+	if (system(cpuctl identify 0 | grep -q QEMU) == 0)
+		atf_tc_expect_fail(PR misc/44767);
 
-		float f = strtof(str[i], NULL);
+	for (size_t i = 0; i  __arraycount(inf_strings); i++) {
+		float f = strtof(inf_strings[i], NULL);
 		ATF_REQUIRE(isinf(f) != 0);
+	}
+#else
+	atf_tc_skip(vax not supported);
+#endif
+}
+
+ATF_TC(strtold_inf);
+ATF_TC_HEAD(strtold_inf, tc)
+{
+	atf_tc_set_md_var(tc, descr, A strtold(3) with INF);
+}
+
+ATF_TC_BODY(strtold_inf, tc)
+{
+#ifndef __vax__
+#   ifdef __HAVE_LONG_DOUBLE
+	/*
+	 * See the closed PR lib/33262.
+	 *
+	 * This may also fail under QEMU; cf. PR misc/44767.
+	 */
+	if (system(cpuctl identify 0 | grep -q QEMU) == 0)
+		atf_tc_expect_fail(PR misc/44767);
 
-#ifdef __HAVE_LONG_DOUBLE
-		long double ld = strtold(str[i], NULL);
+	for (size_t i = 0; i  __arraycount(inf_strings); i++) {
+		long double ld = strtold(inf_strings[i], NULL);
 		ATF_REQUIRE(isinf(ld) != 0);
-#endif
 	}
+#   else
+	atf_tc_skip(Requires long double support);
+#   endif
+#else
+	atf_tc_skip(vax not supported);
 #endif
 }
 
@@ -142,25 +194,58 @@
 ATF_TC_BODY(strtod_nan, tc)
 {
 #ifndef __vax__
-	const char *str = NaN(x)y;
 	char *end;
 
-	atf_tc_expect_fail(PR lib/45020);
-
-	double d = strtod(str, end);
+	double d = strtod(nan_string, end);
 	ATF_REQUIRE(isnan(d) != 0);
 	ATF_REQUIRE(strcmp(end, y) == 0);
+#else
+	atf_tc_skip(vax not supported);
+#endif
+}
+
+ATF_TC(strtof_nan);
+ATF_TC_HEAD(strtof_nan, tc)
+{
+	atf_tc_set_md_var(tc, descr, A strtof(3) with NaN);
+}
+
+ATF_TC_BODY(strtof_nan, tc)
+{
+#ifndef __vax__
+	char *end;
 
-	float f = strtof(str, end);
+	float f = strtof(nan_string, end);
 	ATF_REQUIRE(isnanf(f) != 0);
 	ATF_REQUIRE(strcmp(end, y) == 0);
+#else
+	atf_tc_skip(vax not supported);
+#endif
+}
+
+ATF_TC(strtold_nan);
+ATF_TC_HEAD(strtold_nan, tc)
+{
+	atf_tc_set_md_var(tc, descr, A strtold(3) with NaN);
+}
 
-#ifdef __HAVE_LONG_DOUBLE
-	long double ld = strtold(str, end);
+ATF_TC_BODY(strtold_nan, tc)
+{
+#ifndef __vax__
+#   ifdef __HAVE_LONG_DOUBLE
+	

CVS commit: src/external/bsd/atf/dist

2011-06-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Jun 14 15:23:30 UTC 2011

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv17790

Log Message:
Import atf-0.14:

Experimental version released on June 14th, 2011.

* Added a pkg-config file for atf-sh and an aclocal file to ease the
  detection of atf-sh from autoconf scripts.

* Made the default test case body defined by atf_sh fail.  This is to
  ensure that test cases are properly defined in test programs and helps
  in catching typos in the names of the body functions.

* PR bin/44882: Made atf-run connect the stdin of test cases to /dev/zero.
  This provides more consistent results with normal execution (in
  particular, when tests are executed detached from a terminal).

* Made atf-run hardcode TZ=UTC for test cases.  It used to undefine TZ, but
  that does not take into account that libc determines the current timezone
  from a configuration file.

* All test programs will now print a warning when they are not run through
  atf-run(1) stating that this is unsupported and may deliver incorrect
  results.

* Added support for the 'require.files' test-case property.  This allows
  test cases to specify installed files that must be present for the test
  case to run.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-14

U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c/error_fwd.h
U src/external/bsd/atf/dist/atf-c/build.h
U src/external/bsd/atf/dist/atf-c/check.h
U src/external/bsd/atf/dist/atf-c/config.h
U src/external/bsd/atf/dist/atf-c/error.h
U src/external/bsd/atf/dist/atf-c/atf-c-api.3
U src/external/bsd/atf/dist/atf-c/macros.h
C src/external/bsd/atf/dist/atf-c/tc.h
U src/external/bsd/atf/dist/atf-c/tp.h
U src/external/bsd/atf/dist/atf-c/utils.h
U src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
C src/external/bsd/atf/dist/atf-c/defs.h.in
U src/external/bsd/atf/dist/atf-c/build.c
U src/external/bsd/atf/dist/atf-c/check.c
U src/external/bsd/atf/dist/atf-c/config.c
U src/external/bsd/atf/dist/atf-c/error.c
U src/external/bsd/atf/dist/atf-c/tc.c
U src/external/bsd/atf/dist/atf-c/tp.c
U src/external/bsd/atf/dist/atf-c/utils.c
U src/external/bsd/atf/dist/atf-c/h_build.h
U src/external/bsd/atf/dist/atf-c/atf_c_test.c
U src/external/bsd/atf/dist/atf-c/build_test.c
U src/external/bsd/atf/dist/atf-c/check_test.c
U src/external/bsd/atf/dist/atf-c/config_test.c
U src/external/bsd/atf/dist/atf-c/tc_test.c
U src/external/bsd/atf/dist/atf-c/error_test.c
U src/external/bsd/atf/dist/atf-c/macros_test.c
U src/external/bsd/atf/dist/atf-c/tp_test.c
U src/external/bsd/atf/dist/atf-c/utils_test.c
U src/external/bsd/atf/dist/atf-c/atf-c.pc.in
U src/external/bsd/atf/dist/atf-c/Atffile
U src/external/bsd/atf/dist/atf-c/Kyuafile
U src/external/bsd/atf/dist/atf-c/macros_h_test.c
U src/external/bsd/atf/dist/atf-c/detail/process_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr.c
U src/external/bsd/atf/dist/atf-c/detail/dynstr.h
U src/external/bsd/atf/dist/atf-c/detail/env.c
U src/external/bsd/atf/dist/atf-c/detail/env.h
U src/external/bsd/atf/dist/atf-c/detail/fs.c
U src/external/bsd/atf/dist/atf-c/detail/fs.h
U src/external/bsd/atf/dist/atf-c/detail/list.c
U src/external/bsd/atf/dist/atf-c/detail/list.h
U src/external/bsd/atf/dist/atf-c/detail/map.c
U src/external/bsd/atf/dist/atf-c/detail/map.h
C src/external/bsd/atf/dist/atf-c/detail/process.c
C src/external/bsd/atf/dist/atf-c/detail/process.h
U src/external/bsd/atf/dist/atf-c/detail/sanity.c
U src/external/bsd/atf/dist/atf-c/detail/sanity.h
U src/external/bsd/atf/dist/atf-c/detail/text.c
U src/external/bsd/atf/dist/atf-c/detail/text.h
U src/external/bsd/atf/dist/atf-c/detail/tp_main.c
U src/external/bsd/atf/dist/atf-c/detail/user.c
U src/external/bsd/atf/dist/atf-c/detail/user.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr_test.c
U src/external/bsd/atf/dist/atf-c/detail/env_test.c
U src/external/bsd/atf/dist/atf-c/detail/fs_test.c
U src/external/bsd/atf/dist/atf-c/detail/list_test.c
U src/external/bsd/atf/dist/atf-c/detail/map_test.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers_test.c
C src/external/bsd/atf/dist/atf-c/detail/process_test.c
U src/external/bsd/atf/dist/atf-c/detail/sanity_test.c
U src/external/bsd/atf/dist/atf-c/detail/text_test.c
U src/external/bsd/atf/dist/atf-c/detail/user_test.c
U src/external/bsd/atf/dist/atf-c/detail/Atffile
U src/external/bsd/atf/dist/atf-c/detail/Kyuafile
U src/external/bsd/atf/dist/atf-c++/atf-c++-api.3
U src/external/bsd/atf/dist/atf-c++/build.hpp
U src/external/bsd/atf/dist/atf-c++/check.hpp
U 

CVS commit: src/external/bsd/atf/dist

2011-06-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Jun 14 15:26:21 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c: defs.h.in tc.h
src/external/bsd/atf/dist/atf-c++: tests.cpp
src/external/bsd/atf/dist/atf-c/detail: process.c
src/external/bsd/atf/dist/atf-run: atf-run.cpp integration_test.sh
test-program.cpp test_program_test.cpp
src/external/bsd/atf/dist/doc: atf-test-case.4

Log Message:
Post-import merge of atf-0.14.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c/defs.h.in \
src/external/bsd/atf/dist/atf-c/tc.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c/detail/process.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/atf/dist/atf-run/atf-run.cpp
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/atf/dist/atf-run/integration_test.sh \
src/external/bsd/atf/dist/atf-run/test_program_test.cpp
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/dist/atf-run/test-program.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/doc/atf-test-case.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/defs.h.in
diff -u src/external/bsd/atf/dist/atf-c/defs.h.in:1.2 src/external/bsd/atf/dist/atf-c/defs.h.in:1.3
--- src/external/bsd/atf/dist/atf-c/defs.h.in:1.2	Sat Jun 11 18:03:57 2011
+++ src/external/bsd/atf/dist/atf-c/defs.h.in	Tue Jun 14 15:26:20 2011
@@ -1,7 +1,7 @@
 /*
  * Automated Testing Framework (atf)
  *
- * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,7 @@
 #if !defined(ATF_C_DEFS_H)
 #define ATF_C_DEFS_H
 
+#define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(a, b) @ATTRIBUTE_FORMAT_PRINTF@
 #define ATF_DEFS_ATTRIBUTE_NORETURN @ATTRIBUTE_NORETURN@
 #define ATF_DEFS_ATTRIBUTE_PRINTF(a,b) @ATTRIBUTE_PRINTF(a,b)@
 
Index: src/external/bsd/atf/dist/atf-c/tc.h
diff -u src/external/bsd/atf/dist/atf-c/tc.h:1.2 src/external/bsd/atf/dist/atf-c/tc.h:1.3
--- src/external/bsd/atf/dist/atf-c/tc.h:1.2	Sat Jun 11 18:03:57 2011
+++ src/external/bsd/atf/dist/atf-c/tc.h	Tue Jun 14 15:26:20 2011
@@ -1,7 +1,7 @@
 /*
  * Automated Testing Framework (atf)
  *
- * Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -104,33 +104,33 @@
 
 /* To be run from test case bodies only. */
 void atf_tc_fail(const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(1, 2)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_fail_nonfatal(const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2);
 void atf_tc_pass(void)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_require_prog(const char *);
 void atf_tc_skip(const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(1, 2)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_expect_pass(void);
 void atf_tc_expect_fail(const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2);
 void atf_tc_expect_exit(const int, const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(2, 3);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 3);
 void atf_tc_expect_signal(const int, const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(2, 3);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 3);
 void atf_tc_expect_death(const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2);
 void atf_tc_expect_timeout(const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2);
 
 /* To be run from test case bodies only; internal to macros.h. */
 void atf_tc_fail_check(const char *, const size_t, const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(3, 4);
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(3, 4);
 void atf_tc_fail_requirement(const char *, const size_t, const char *, ...)
-ATF_DEFS_ATTRIBUTE_PRINTF(3, 4)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(3, 4)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 void atf_tc_check_errno(const char *, const size_t, const int,
 const char *, const bool);

Index: src/external/bsd/atf/dist/atf-c++/tests.cpp
diff -u src/external/bsd/atf/dist/atf-c++/tests.cpp:1.6 src/external/bsd/atf/dist/atf-c++/tests.cpp:1.7
--- src/external/bsd/atf/dist/atf-c++/tests.cpp:1.6	Sun Nov  7 17:45:22 2010
+++ src/external/bsd/atf/dist/atf-c++/tests.cpp	Tue Jun 14 15:26:20 2011
@@ -1,7 +1,7 @@
 //
 // Automated Testing Framework (atf)
 //
-// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007, 2008, 2009, 2010, 2011 The 

CVS commit: src/external/bsd/atf

2011-06-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Jun 14 15:27:11 UTC 2011

Modified Files:
src/external/bsd/atf: prepare-import.sh
src/external/bsd/atf/lib/libatf-c: Makefile bconfig.h
src/external/bsd/atf/lib/libatf-c++: Makefile
src/external/bsd/atf/usr.bin/atf-sh: Makefile

Log Message:
Update reachover build files for atf-0.14.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/prepare-import.sh
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/atf/lib/libatf-c/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/lib/libatf-c/bconfig.h
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/lib/libatf-c++/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/usr.bin/atf-sh/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/prepare-import.sh
diff -u src/external/bsd/atf/prepare-import.sh:1.4 src/external/bsd/atf/prepare-import.sh:1.5
--- src/external/bsd/atf/prepare-import.sh:1.4	Thu Mar 31 16:45:44 2011
+++ src/external/bsd/atf/prepare-import.sh	Tue Jun 14 15:27:11 2011
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.4 2011/03/31 16:45:44 jmmv Exp $
+# $NetBSD: prepare-import.sh,v 1.5 2011/06/14 15:27:11 jmmv Exp $
 #
 # Use this script to recreate the 'dist' subdirectory from a newly released
 # distfile.  The script takes care of unpacking the distfile, removing any
@@ -16,6 +16,7 @@
 CLEAN_PATTERNS=${CLEAN_PATTERNS} INSTALL TODO
 CLEAN_PATTERNS=${CLEAN_PATTERNS} Makefile* */Makefile* */*/Makefile*
 CLEAN_PATTERNS=${CLEAN_PATTERNS} admin
+CLEAN_PATTERNS=${CLEAN_PATTERNS} atf-sh/atf-sh.m4
 CLEAN_PATTERNS=${CLEAN_PATTERNS} bconfig.h.in
 CLEAN_PATTERNS=${CLEAN_PATTERNS} bootstrap
 CLEAN_PATTERNS=${CLEAN_PATTERNS} configure*

Index: src/external/bsd/atf/lib/libatf-c/Makefile
diff -u src/external/bsd/atf/lib/libatf-c/Makefile:1.11 src/external/bsd/atf/lib/libatf-c/Makefile:1.12
--- src/external/bsd/atf/lib/libatf-c/Makefile:1.11	Sat Jun 11 18:03:57 2011
+++ src/external/bsd/atf/lib/libatf-c/Makefile	Tue Jun 14 15:27:11 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2011/06/11 18:03:57 christos Exp $
+# $NetBSD: Makefile,v 1.12 2011/06/14 15:27:11 jmmv Exp $
 
 NOLINT=		# defined
 
@@ -76,8 +76,8 @@
 
 defs.h: defs.h.in
 	${TOOL_SED} \
+	-e 's|@ATTRIBUTE_FORMAT_PRINTF@|__attribute__((__format__(__printf__, a, b)))|g' \
 	-e 's|@ATTRIBUTE_NORETURN@|__attribute__((__noreturn__))|g' \
-	-e 's|@ATTRIBUTE_PRINTF(a,b)@|__attribute__((__format__(__printf__,a,b)))|g' \
 	 ${.ALLSRC}  ${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}
 
@@ -87,7 +87,7 @@
 
 realall: atf-c.pc
 atf-c.pc: Makefile atf-c.pc.in
-	${TOOL_SED} -e 's,__ATF_VERSION__,0.13,g' \
+	${TOOL_SED} -e 's,__ATF_VERSION__,0.14,g' \
 	-e 's,__CC__,gcc,g' \
 	-e 's,__INCLUDEDIR__,/usr/include,g' \
 	-e 's,__LIBDIR__,/usr/lib,g' \

Index: src/external/bsd/atf/lib/libatf-c/bconfig.h
diff -u src/external/bsd/atf/lib/libatf-c/bconfig.h:1.8 src/external/bsd/atf/lib/libatf-c/bconfig.h:1.9
--- src/external/bsd/atf/lib/libatf-c/bconfig.h:1.8	Thu Mar 31 16:45:44 2011
+++ src/external/bsd/atf/lib/libatf-c/bconfig.h	Tue Jun 14 15:27:11 2011
@@ -96,7 +96,7 @@
 #define PACKAGE_NAME Automated Testing Framework
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING Automated Testing Framework 0.13
+#define PACKAGE_STRING Automated Testing Framework 0.14
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME atf
@@ -105,10 +105,10 @@
 #define PACKAGE_URL http://www.NetBSD.org/~jmmv/atf/;
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION 0.13
+#define PACKAGE_VERSION 0.14
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION 0.13
+#define VERSION 0.14

Index: src/external/bsd/atf/lib/libatf-c++/Makefile
diff -u src/external/bsd/atf/lib/libatf-c++/Makefile:1.10 src/external/bsd/atf/lib/libatf-c++/Makefile:1.11
--- src/external/bsd/atf/lib/libatf-c++/Makefile:1.10	Tue Apr  5 16:37:06 2011
+++ src/external/bsd/atf/lib/libatf-c++/Makefile	Tue Jun 14 15:27:11 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2011/04/05 16:37:06 jmmv Exp $
+# $NetBSD: Makefile,v 1.11 2011/06/14 15:27:11 jmmv Exp $
 
 NOLINT=		# defined
 
@@ -55,7 +55,7 @@
 
 realall: atf-c++.pc
 atf-c++.pc: Makefile atf-c++.pc.in
-	${TOOL_SED} -e 's,__ATF_VERSION__,0.13,g' \
+	${TOOL_SED} -e 's,__ATF_VERSION__,0.14,g' \
 	-e 's,__CXX__,g++,g' \
 	-e 's,__INCLUDEDIR__,/usr/include,g' \
 	-e 's,__LIBDIR__,/usr/lib,g' \

Index: src/external/bsd/atf/usr.bin/atf-sh/Makefile
diff -u src/external/bsd/atf/usr.bin/atf-sh/Makefile:1.4 src/external/bsd/atf/usr.bin/atf-sh/Makefile:1.5
--- src/external/bsd/atf/usr.bin/atf-sh/Makefile:1.4	Sun Feb 20 20:18:57 2011
+++ src/external/bsd/atf/usr.bin/atf-sh/Makefile	Tue Jun 14 15:27:11 

CVS commit: src/distrib/sets/lists/comp

2011-06-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Jun 14 15:27:47 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Register a new file in atf-0.14.


To generate a diff of this commit:
cvs rdiff -u -r1.1629 -r1.1630 src/distrib/sets/lists/comp/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1629 src/distrib/sets/lists/comp/mi:1.1630
--- src/distrib/sets/lists/comp/mi:1.1629	Mon Jun  6 13:43:48 2011
+++ src/distrib/sets/lists/comp/mi	Tue Jun 14 15:27:46 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1629 2011/06/06 13:43:48 spz Exp $
+#	$NetBSD: mi,v 1.1630 2011/06/14 15:27:46 jmmv Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -2983,6 +2983,7 @@
 ./usr/lib/pkgconfigcomp-c-lib
 ./usr/lib/pkgconfig/atf-c++.pc			comp-atf-lib		atf,share
 ./usr/lib/pkgconfig/atf-c.pc			comp-atf-lib		atf,share
+./usr/lib/pkgconfig/atf-sh.pc			comp-atf-lib		atf,share
 ./usr/lib/pkgconfig/atf.pc			comp-obsolete		obsolete
 ./usr/libdata/debug/bin/cat.debug		comp-util-debug		debug
 ./usr/libdata/debug/bin/chio.debug		comp-util-debug		debug



CVS commit: src/doc

2011-06-14 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Jun 14 15:29:11 UTC 2011

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of atf-0.14.


To generate a diff of this commit:
cvs rdiff -u -r1.845 -r1.846 src/doc/3RDPARTY
cvs rdiff -u -r1.1562 -r1.1563 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.845 src/doc/3RDPARTY:1.846
--- src/doc/3RDPARTY:1.845	Mon Jun 13 19:49:34 2011
+++ src/doc/3RDPARTY	Tue Jun 14 15:29:11 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.845 2011/06/13 19:49:34 spz Exp $
+#	$NetBSD: 3RDPARTY,v 1.846 2011/06/14 15:29:11 jmmv Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -52,8 +52,8 @@
 Check src/usr.sbin/amd/include/config.h is correct after import.
 
 Package:	Automated Testing Framework (ATF)
-Version:	0.13
-Current Vers:	0.13
+Version:	0.14
+Current Vers:	0.14
 Maintainer:	Julio Merino j...@netbsd.org
 Archive site:	ftp://ftp.NetBSD.org/pub/NetBSD/misc/jmmv/atf/
 Home page:	http://www.NetBSD.org/~jmmv/atf/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1562 src/doc/CHANGES:1.1563
--- src/doc/CHANGES:1.1562	Tue Jun 14 12:29:48 2011
+++ src/doc/CHANGES	Tue Jun 14 15:29:11 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1562 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1563 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1033,3 +1033,4 @@
 	openssl(1): Import openssl-1.0.1-stable-SNAP-20110605 [spz 20110605]
 	powerpc: Switch to using direct-mapped uareas (pcb + kernel stacks).
 		[matt 20110613]
+	atf(7): Import 0.14.  [jmmv 20110614]



CVS commit: src/tests/lib/libc/net/getaddrinfo

2011-06-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jun 15 07:54:33 UTC 2011

Modified Files:
src/tests/lib/libc/net/getaddrinfo: t_getaddrinfo.sh

Log Message:
Fix obvious typo in test case name.  Uncovered by atf 0.14.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh
diff -u src/tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh:1.1 src/tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh:1.2
--- src/tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh:1.1	Wed Jan 12 02:58:41 2011
+++ src/tests/lib/libc/net/getaddrinfo/t_getaddrinfo.sh	Wed Jun 15 07:54:32 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_getaddrinfo.sh,v 1.1 2011/01/12 02:58:41 pgoyette Exp $
+#	$NetBSD: t_getaddrinfo.sh,v 1.2 2011/06/15 07:54:32 jmmv Exp $
 
 #
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, and 2002 WIDE Project.
@@ -154,7 +154,7 @@
 	check_output sock_raw hosts
 }
 
-atf_test_case unspported_family
+atf_test_case unsupported_family
 unsupported_family_head()
 {
 	atf_set descr Testing unsupported family
@@ -193,6 +193,6 @@
 	atf_add_test_case empty_hostname
 	atf_add_test_case empty_servname
 	atf_add_test_case sock_raw
-	atf_add_test_case unspported_family
+	atf_add_test_case unsupported_family
 	atf_add_test_case scopeaddr
 }



CVS commit: src/tests/util/sort

2011-06-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jun 15 07:58:03 UTC 2011

Modified Files:
src/tests/util/sort: t_sort.sh

Log Message:
Fix definition of the plus_tflag test case.  Uncovered by atf 0.14.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/util/sort/t_sort.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/util/sort/t_sort.sh
diff -u src/tests/util/sort/t_sort.sh:1.3 src/tests/util/sort/t_sort.sh:1.4
--- src/tests/util/sort/t_sort.sh:1.3	Sat Dec 18 12:47:21 2010
+++ src/tests/util/sort/t_sort.sh	Wed Jun 15 07:58:03 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_sort.sh,v 1.3 2010/12/18 12:47:21 pooka Exp $
+# $NetBSD: t_sort.sh,v 1.4 2011/06/15 07:58:03 jmmv Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -938,12 +938,12 @@
 }
 
 atf_test_case plus_tflag
-plus_tflag()
+plus_tflag_head()
 {
 	atf_set descr Tests +- addressing: using -T caused a 'No such file \
 	or directory' error
 }
-plus_tflag()
+plus_tflag_body()
 {
 	mkdir ./+
 	yes | sed 20q | sort -T + /dev/null || atf_fail program failed



CVS commit: src/external/bsd/atf/dist

2011-06-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jun 15 08:48:36 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c/detail: process.c
src/external/bsd/atf/dist/atf-run: test-program.cpp
src/external/bsd/atf/dist/atf-sh: atf-check_test.sh

Log Message:
Pull up part of revision f621bc0489ac3e4ef364f840a852a6a5290e8e12:

-
Only silence stdin for test programs

atf-check is expected to accept data in its stdin, and a previous change
broke this behavior.
-

This should fix a few tests that broke during the 0.14 import.  In
particularly, the tests in libc/stdlib and libc/ssp that redirect stuff
to atf_check.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-c/detail/process.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-run/test-program.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/detail/process.c
diff -u src/external/bsd/atf/dist/atf-c/detail/process.c:1.3 src/external/bsd/atf/dist/atf-c/detail/process.c:1.4
--- src/external/bsd/atf/dist/atf-c/detail/process.c:1.3	Tue Jun 14 15:26:20 2011
+++ src/external/bsd/atf/dist/atf-c/detail/process.c	Wed Jun 15 08:48:35 2011
@@ -412,24 +412,6 @@
 }
 
 static
-atf_error_t
-silence_stdin(void)
-{
-atf_error_t err;
-
-close(STDIN_FILENO);
-int fd = open(/dev/zero, O_RDONLY);
-if (fd == -1)
-err = atf_libc_error(errno, Could not open /dev/zero);
-else {
-INV(fd == STDIN_FILENO);
-err = atf_no_error();
-}
-
-return err;
-}
-
-static
 void
 do_child(void (*)(void *),
  void *,
@@ -445,10 +427,6 @@
 {
 atf_error_t err;
 
-err = silence_stdin();
-if (atf_is_error(err))
-goto out;
-
 err = child_connect(outsp, STDOUT_FILENO);
 if (atf_is_error(err))
 goto out;

Index: src/external/bsd/atf/dist/atf-run/test-program.cpp
diff -u src/external/bsd/atf/dist/atf-run/test-program.cpp:1.9 src/external/bsd/atf/dist/atf-run/test-program.cpp:1.10
--- src/external/bsd/atf/dist/atf-run/test-program.cpp:1.9	Tue Jun 14 15:26:21 2011
+++ src/external/bsd/atf/dist/atf-run/test-program.cpp	Wed Jun 15 08:48:36 2011
@@ -31,6 +31,7 @@
 #include sys/types.h
 #include sys/stat.h
 
+#include fcntl.h
 #include signal.h
 #include unistd.h
 }
@@ -220,6 +221,17 @@
 
 static
 void
+silence_stdin(void)
+{
+::close(STDIN_FILENO);
+int fd = ::open(/dev/null, O_RDONLY);
+if (fd == -1)
+throw std::runtime_error(Could not open /dev/null);
+INV(fd == STDIN_FILENO);
+}
+
+static
+void
 prepare_child(const atf::fs::path workdir)
 {
 const int ret = ::setpgid(::getpid(), 0);
@@ -244,6 +256,8 @@
 atf::env::set(__RUNNING_INSIDE_ATF_RUN, internal-yes-value);
 
 impl::change_directory(workdir);
+
+silence_stdin();
 }
 
 static

Index: src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
diff -u src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.3 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.4
--- src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.3	Thu Mar 31 16:44:17 2011
+++ src/external/bsd/atf/dist/atf-sh/atf-check_test.sh	Wed Jun 15 08:48:36 2011
@@ -400,6 +400,17 @@
 h_fail echo foo bar 12 -e not-match:foo
 }
 
+atf_test_case stdin
+stdin_head()
+{
+atf_set descr Tests that stdin is preserved
+}
+stdin_body()
+{
+echo hello | ${Atf_Check} -o match:hello cat || \
+atf_fail atf-check does not seem to respect stdin
+}
+
 atf_test_case invalid_umask
 invalid_umask_head()
 {
@@ -444,6 +455,8 @@
 atf_add_test_case eflag_multiple
 atf_add_test_case eflag_negated
 
+atf_add_test_case stdin
+
 atf_add_test_case invalid_umask
 }
 



CVS commit: src/etc

2010-12-03 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Dec  3 21:40:04 UTC 2010

Modified Files:
src/etc: passwd.conf

Log Message:
Set the default localcypher to sha1 as discussed in current-us...@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/etc/passwd.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/passwd.conf
diff -u src/etc/passwd.conf:1.2 src/etc/passwd.conf:1.3
--- src/etc/passwd.conf:1.2	Mon Apr 15 07:48:00 2002
+++ src/etc/passwd.conf	Fri Dec  3 21:40:04 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: passwd.conf,v 1.2 2002/04/15 07:48:00 ad Exp $
+#	$NetBSD: passwd.conf,v 1.3 2010/12/03 21:40:04 jmmv Exp $
 #
 # passwd.conf(5) -
 #	password configuration file
 #
 
-#default:
-#	localcipher = md5
-#	ypcipher = old
+default:
+	localcipher = sha1
+	ypcipher = old



CVS commit: src/share/man/man5

2010-12-03 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Dec  3 21:41:40 UTC 2010

Modified Files:
src/share/man/man5: passwd.conf.5

Log Message:
Document what the default values for localcipher and ypcipher are.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man5/passwd.conf.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man5/passwd.conf.5
diff -u src/share/man/man5/passwd.conf.5:1.9 src/share/man/man5/passwd.conf.5:1.10
--- src/share/man/man5/passwd.conf.5:1.9	Sat Oct  3 12:45:15 2009
+++ src/share/man/man5/passwd.conf.5	Fri Dec  3 21:41:40 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: passwd.conf.5,v 1.9 2009/10/03 12:45:15 zafer Exp $
+.\	$NetBSD: passwd.conf.5,v 1.10 2010/12/03 21:41:40 jmmv Exp $
 .\
 .\ Copyright 1997 Niels Provos pro...@physnet.uni-hamburg.de
 .\ All rights reserved.
@@ -28,7 +28,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd September 4, 2005
+.Dd December 3, 2010
 .Dt PASSWD.CONF 5
 .Os
 .Sh NAME
@@ -57,6 +57,7 @@
 .Bl -tag -width localcipher
 .It Sy localcipher
 The cipher to use for local passwords.
+.Pp
 Possible values are:
 .Dq old ,
 .Dq newsalt,\*[Lt]rounds\*[Gt] ,
@@ -75,9 +76,16 @@
 .Dq blowfish
 the value can be between 4 and 31.
 It specifies the base 2 logarithm of the number of rounds.
+.Pp
+If not specified, the default value is
+.Dq old .
 .It Sy ypcipher
 The cipher to use for YP passwords.
+.Pp
 The possible values are the same as for localcipher.
+.Pp
+If not specified, the default value is
+.Dq old .
 .El
 .Pp
 To retrieve information from this file use
@@ -87,11 +95,11 @@
 .It Pa /etc/passwd.conf
 .El
 .Sh EXAMPLES
-Use MD5 as the local cipher and old-style DES as the YP cipher.
+Use SHA1 as the local cipher and old-style DES as the YP cipher.
 Use blowfish with 2^5 rounds for root:
 .Bd -literal
  default:
-  localcipher = md5
+  localcipher = sha1
   ypcipher = old
 
  root:
@@ -107,3 +115,12 @@
 .Nm
 configuration file first appeared in
 .Nx 1.6 .
+.Pp
+The default value of
+.Sy localcipher
+was set to
+.Dq sha1
+in
+.Pa /etc/passwd.conf
+starting from
+.Nx 6.0 .



CVS commit: src/distrib/utils/sysinst

2010-12-04 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Dec  4 14:57:57 UTC 2010

Modified Files:
src/distrib/utils/sysinst: defs.h install.c menus.mi msg.mi.de
msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl util.c

Log Message:
Remove password cipher selection as discussed in current-us...@.

Users who really really really want to change the default setting can
continue to change their cipher algorithm right after a clean install
by modifying /etc/passwd.conf and regenerating the root password if
previously set by sysinst.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.43 -r1.44 src/distrib/utils/sysinst/install.c
cvs rdiff -u -r1.38 -r1.39 src/distrib/utils/sysinst/menus.mi
cvs rdiff -u -r1.52 -r1.53 src/distrib/utils/sysinst/msg.mi.de
cvs rdiff -u -r1.160 -r1.161 src/distrib/utils/sysinst/msg.mi.en
cvs rdiff -u -r1.29 -r1.30 src/distrib/utils/sysinst/msg.mi.es
cvs rdiff -u -r1.110 -r1.111 src/distrib/utils/sysinst/msg.mi.fr
cvs rdiff -u -r1.68 -r1.69 src/distrib/utils/sysinst/msg.mi.pl
cvs rdiff -u -r1.165 -r1.166 src/distrib/utils/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.148 src/distrib/utils/sysinst/defs.h:1.149
--- src/distrib/utils/sysinst/defs.h:1.148	Wed Jan 27 11:02:03 2010
+++ src/distrib/utils/sysinst/defs.h	Sat Dec  4 14:57:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.148 2010/01/27 11:02:03 jmmv Exp $	*/
+/*	$NetBSD: defs.h,v 1.149 2010/12/04 14:57:56 jmmv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -409,7 +409,6 @@
 int 	get_and_unpack_sets(int, msg, msg, msg);
 int	sanity_check(void);
 int	set_timezone(void);
-void	set_crypt_type(void);
 int	set_root_password(void);
 int	set_root_shell(void);
 void	scripting_fprintf(FILE *, const char *, ...);

Index: src/distrib/utils/sysinst/install.c
diff -u src/distrib/utils/sysinst/install.c:1.43 src/distrib/utils/sysinst/install.c:1.44
--- src/distrib/utils/sysinst/install.c:1.43	Sat Sep 19 14:57:27 2009
+++ src/distrib/utils/sysinst/install.c	Sat Dec  4 14:57:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: install.c,v 1.43 2009/09/19 14:57:27 abs Exp $	*/
+/*	$NetBSD: install.c,v 1.44 2010/12/04 14:57:56 jmmv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -123,8 +123,6 @@
 
 	set_timezone();
 
-	set_crypt_type();
-
 	set_root_password();
 	set_root_shell();
 	

Index: src/distrib/utils/sysinst/menus.mi
diff -u src/distrib/utils/sysinst/menus.mi:1.38 src/distrib/utils/sysinst/menus.mi:1.39
--- src/distrib/utils/sysinst/menus.mi:1.38	Tue Mar 30 20:09:25 2010
+++ src/distrib/utils/sysinst/menus.mi	Sat Dec  4 14:57:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.38 2010/03/30 20:09:25 martin Exp $	*/
+/*	$NetBSD: menus.mi,v 1.39 2010/12/04 14:57:56 jmmv Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -293,13 +293,6 @@
 	option MSG_Set_finished, exit, action { *(int *)arg = SET_OK; };
 	option MSG_Abort_fetch, exit, action { *(int *)arg = SET_RETRY; };
 
-menu crypttype, title MSG_Password_cipher, y=15;
-	option MSG_SHA1, exit, action { yesno = 4; };
-	option MSG_DES, exit, action { yesno = 1; };
-	option MSG_MD5, exit, action { yesno = 2; };
-	option MSG_Blowfish_2_7_round, exit, action { yesno = 3; };
-	option MSG_do_not_change, exit, action { yesno = 0; };
-
 menu fd_type, title MSG_fd_type, y=16;
 	option msdos, exit, action { fd_type = msdos; };
 	option ffs,   exit, action { fd_type = ffs; };

Index: src/distrib/utils/sysinst/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.52 src/distrib/utils/sysinst/msg.mi.de:1.53
--- src/distrib/utils/sysinst/msg.mi.de:1.52	Tue Mar 30 20:09:25 2010
+++ src/distrib/utils/sysinst/msg.mi.de	Sat Dec  4 14:57:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.52 2010/03/30 20:09:25 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.53 2010/12/04 14:57:56 jmmv Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -890,22 +890,6 @@
 message tz_back
 { Zurück zum Zeitzonenmenü.}
 
-message choose_crypt
-{Bitte wählen Sie den gewünschten Ver-/Entschlüsselungsalgorithmus (Cipher)
-für Benutzerpassworte. NetBSD kann DES, MD5, Blowfish oder SHA1 benutzen.
-
-Das traditionelle DES-System ist mit den meisten anderen UNIX-ähnlichen
-Betriebssystemen kompatibel, allerdings werden nur die ersten 8 Zeichen eines
-jeden Passworts berücksichtigt. Das MD5, Blowfish und SHA1 System erlaubt
-längere Passwörter, was unter Umständen als sicherer interpretiert werden kann.
-
-Wenn Sie ein Netzwerk haben und planen, NIS zu nutzen, berücksichtigen
-Sie hier bitte auch die Möglichkeiten der anderen Maschinen im Netzwerk.
-
-Wenn Sie NetBSD aktualisieren und die bestehende Konfiguration nicht
-verändern möchten, so wählen Sie Beibehalten.
-}
-
 message swapactive
 {Das Laufwerk, das Sie 

CVS commit: src/doc

2010-12-04 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Dec  4 14:59:48 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
Note that the default local cipher for passwords is now sha1 in
/etc/passwd.conf and that sysinst does not ask for a setting any more.


To generate a diff of this commit:
cvs rdiff -u -r1.1467 -r1.1468 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1467 src/doc/CHANGES:1.1468
--- src/doc/CHANGES:1.1467	Sat Dec  4 10:03:17 2010
+++ src/doc/CHANGES	Sat Dec  4 14:59:47 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1467 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1468 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -794,4 +794,8 @@
 	module: Rename module.prop to module.plist.  [jnemeth 20101127]
 	bind: Update to 9.7.2-P3. Bug and security fixes since 9.7.2b1. See
 		src/external/bsd/bind/dist/CHANGES [christos 20101202]
+	passwd.conf(5): Set the default local cipher for passwords to 'sha1'.
+		[jmmv 20101201]
 	raid(4):  Add support for non 512-byte sector devices.  [mrg 20101203]
+	sysinst(8): Drop the question to select a password cipher algorithm.
+		[jmmv 20101204]



CVS commit: src/external/bsd/atf/dist/atf-sh

2010-12-06 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Dec  6 18:04:02 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp atf-check_test.sh

Log Message:
Pull up revision c917871de7dd67ba57c17496ad68fe4e4aa8b239:

Fix atf-check match checker to validate lines without newline

Problem found by po...@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/atf/dist/atf-sh/atf-check_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.2 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.3
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.2	Fri Nov 26 12:04:36 2010
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Mon Dec  6 18:04:02 2010
@@ -378,7 +378,7 @@
 bool found = false;
 
 std::string line;
-while (!found  std::getline(stream, line).good()) {
+while (!found  !std::getline(stream, line).fail()) {
 if (atf::text::match(line, regexp))
 found = true;
 }

Index: src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
diff -u src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.1.1.2 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.2
--- src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.1.1.2	Sun Nov  7 17:43:29 2010
+++ src/external/bsd/atf/dist/atf-sh/atf-check_test.sh	Mon Dec  6 18:04:02 2010
@@ -234,6 +234,7 @@
 }
 oflag_match_body()
 {
+h_pass printf no-newline -o match:^no-newline
 h_pass echo line1; echo foo bar -o match:^foo
 h_pass echo foo bar -o match:o b
 h_fail echo foo bar -o match:baz
@@ -365,6 +366,7 @@
 }
 eflag_match_body()
 {
+h_pass printf no-newline 12 -e match:^no-newline
 h_pass echo line1 12; echo foo bar 12 -e match:^foo
 h_pass echo foo bar 12 -e match:o b
 h_fail echo foo bar 12 -e match:baz



CVS commit: src/external/bsd/atf/dist/atf-sh

2010-12-27 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Dec 27 20:36:17 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp

Log Message:
Pull up revision 869e092e4986eb5dce90331ca9a64e125d7796eb from mainstream:

Revision: 869e092e4986eb5dce90331ca9a64e125d7796eb
Parent:   cca40eb08e7469dfe9d6ca982613458f24c1de28
Author:   j...@netbsd.org
Date: 12/27/10 21:19:19
Branch:   org.NetBSD.atf.src

Changelog:

Recognize sigabrt in the signal checker

Problem found by Paul Goyette.

Changes against parent cca40eb08e7469dfe9d6ca982613458f24c1de28

  patched  atf-sh/atf-check.cpp


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-sh/atf-check.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.3 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.4
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.3	Mon Dec  6 18:04:02 2010
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Mon Dec 27 20:36:17 2010
@@ -184,6 +184,7 @@
 { int, SIGINT },
 { quit, SIGQUIT },
 { trap, SIGTRAP },
+{ abrt, SIGABRT },
 { kill, SIGKILL },
 { segv, SIGSEGV },
 { pipe, SIGPIPE },



CVS commit: src/external/bsd/atf/dist/atf-report

2011-01-05 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jan  5 14:03:08 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-report: tests-results.xsl

Log Message:
Cherry-pick upstream revision f791048924a1b68da070f17dfd5e5c2d825dd018:

Report bogus test programs in the HTML output

From Paul Goyette in private mail.  Fixes PR bin/44301.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-report/tests-results.xsl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-report/tests-results.xsl
diff -u src/external/bsd/atf/dist/atf-report/tests-results.xsl:1.4 src/external/bsd/atf/dist/atf-report/tests-results.xsl:1.5
--- src/external/bsd/atf/dist/atf-report/tests-results.xsl:1.4	Wed Oct 20 09:17:23 2010
+++ src/external/bsd/atf/dist/atf-report/tests-results.xsl	Wed Jan  5 14:03:08 2011
@@ -86,6 +86,9 @@
 xsl:if test=$ntcs-skipped  0
   xsl:call-template name=skipped-tcs-summary /
 /xsl:if
+xsl:if test=$ntps-failed  0
+  xsl:call-template name=failed-tps-summary /
+/xsl:if
 xsl:call-template name=info-bottom /
 
 xsl:apply-templates select=tp mode=details /
@@ -167,14 +170,16 @@
 td class=numericpxsl:value-of select=$ntps //p/td
   /tr
   tr class=entry
-tdpBogus test programs/p/td
 xsl:choose
   xsl:when test=$ntps-failed  0
+tdpa href=#failed-tps-summaryBogus test
+programs/a/p/td
 td class=numeric-error
   pxsl:value-of select=$ntps-failed //p
 /td
   /xsl:when
   xsl:otherwise
+tdpBogus test programs/p/td
 td class=numeric
   pxsl:value-of select=$ntps-failed //p
 /td
@@ -314,6 +319,20 @@
 /table
   /xsl:template
 
+  xsl:template name=failed-tps-summary
+a name=failed-tps-summary /
+h2 id=failed-tps-summaryBogus test programs summary/h2
+
+table class=tcs-summary
+  tr
+thTest program/th
+  /tr
+  xsl:apply-templates select=tp mode=summary
+xsl:with-param name=whichbogus/xsl:with-param
+  /xsl:apply-templates
+/table
+  /xsl:template
+
   xsl:template name=skipped-tcs-summary
 a name=skipped-tcs-summary /
 h2 id=skipped-tcs-summarySkipped test cases summary/h2
@@ -335,6 +354,7 @@
 
 xsl:variable name=chosen
   xsl:choose
+xsl:when test=$which = 'bogus' and failedyes/xsl:when
 xsl:when test=$which = 'passed' and tc/passedyes/xsl:when
 xsl:when test=$which = 'failed' and tc/failedyes/xsl:when
 xsl:when test=$which = 'xfail' and
@@ -359,9 +379,11 @@
   pxsl:value-of select=@id //p
 /td
   /tr
-  xsl:apply-templates select=tc mode=summary
-xsl:with-param name=which select=$which /
-  /xsl:apply-templates
+  xsl:if test=$which != 'bogus'
+xsl:apply-templates select=tc mode=summary
+  xsl:with-param name=which select=$which /
+/xsl:apply-templates
+  /xsl:if
 /xsl:if
   /xsl:template
 



CVS commit: src/bin/sh

2011-01-07 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Jan  7 22:21:56 UTC 2011

Modified Files:
src/bin/sh: histedit.c

Log Message:
Call el_source before initializing sh-specific editline properties (i.e.
the editor type and the tab completion binding).

This allows tab completion to work when a user has an ~/.editrc file.

Addresses PR bin/43404.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/bin/sh/histedit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.41 src/bin/sh/histedit.c:1.42
--- src/bin/sh/histedit.c:1.41	Wed Feb 13 12:57:16 2008
+++ src/bin/sh/histedit.c	Fri Jan  7 22:21:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.41 2008/02/13 12:57:16 joerg Exp $	*/
+/*	$NetBSD: histedit.c,v 1.42 2011/01/07 22:21:56 jmmv Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)histedit.c	8.2 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: histedit.c,v 1.41 2008/02/13 12:57:16 joerg Exp $);
+__RCSID($NetBSD: histedit.c,v 1.42 2011/01/07 22:21:56 jmmv Exp $);
 #endif
 #endif /* not lint */
 
@@ -149,13 +149,13 @@
 			INTON;
 		}
 		if (el) {
+			el_source(el, NULL);
 			if (Vflag)
 el_set(el, EL_EDITOR, vi);
 			else if (Eflag)
 el_set(el, EL_EDITOR, emacs);
 			el_set(el, EL_BIND, ^I, 
 			tabcomplete ? rl-complete : ed-insert, NULL);
-			el_source(el, NULL);
 		}
 	} else {
 		INTOFF;



CVS commit: src/sys/arch/x86/x86

2011-01-17 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Jan 17 22:21:25 UTC 2011

Modified Files:
src/sys/arch/x86/x86: platform.c

Log Message:
Fix year correction in platform_add_date so that:
* Years in the [90,99] range are considered to be in 1900.
* Years in the [0,89] range are considered to be in 2000.

This makes my MacBookPro2,2 be recognized as from 2007 instead of 1907, which
in turn lets ACPI (and many other things!) work.

Fix proposed by jmcneill@ as an alternative to my workaround in acpi_quirks.c
sent to port-i386@.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/platform.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/platform.c
diff -u src/sys/arch/x86/x86/platform.c:1.9 src/sys/arch/x86/x86/platform.c:1.10
--- src/sys/arch/x86/x86/platform.c:1.9	Mon Sep  6 15:54:27 2010
+++ src/sys/arch/x86/x86/platform.c	Mon Jan 17 22:21:25 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.c,v 1.9 2010/09/06 15:54:27 jmcneill Exp $ */
+/* $NetBSD: platform.c,v 1.10 2011/01/17 22:21:25 jmmv Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include isa.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: platform.c,v 1.9 2010/09/06 15:54:27 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: platform.c,v 1.10 2011/01/17 22:21:25 jmmv Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -165,10 +165,12 @@
 		return;
 	if (month == 0 || month  12 || day == 0 || day  31)
 		return;
-	if (year  100)
-		year += 1900;
 	if (year  )
 		return;
+	if (year  90)
+		year += 2000;
+	else if (year  100)
+		year += 1900;
 	sprintf(datestr, %04u%02u%02u, year, month, day);
 	pmf_set_platform(key, datestr);
 }



CVS commit: src/sys/arch/x86/x86

2011-01-17 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Jan 18 07:47:17 UTC 2011

Modified Files:
src/sys/arch/x86/x86: platform.c

Log Message:
Ammend previous to be more accurate in platform_add_date by using the epoch:
* Years in the [70,99] range are considered to be in 1900.
* Years in the [0,69] range are considered to be in 2000.

I don't think we may have hit any machine where the previous numbers were
a problem, but these seem to be the correct ones.

From christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/platform.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/platform.c
diff -u src/sys/arch/x86/x86/platform.c:1.10 src/sys/arch/x86/x86/platform.c:1.11
--- src/sys/arch/x86/x86/platform.c:1.10	Mon Jan 17 22:21:25 2011
+++ src/sys/arch/x86/x86/platform.c	Tue Jan 18 07:47:16 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.c,v 1.10 2011/01/17 22:21:25 jmmv Exp $ */
+/* $NetBSD: platform.c,v 1.11 2011/01/18 07:47:16 jmmv Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -29,7 +29,7 @@
 #include isa.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: platform.c,v 1.10 2011/01/17 22:21:25 jmmv Exp $);
+__KERNEL_RCSID(0, $NetBSD: platform.c,v 1.11 2011/01/18 07:47:16 jmmv Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -167,7 +167,7 @@
 		return;
 	if (year  )
 		return;
-	if (year  90)
+	if (year  70)
 		year += 2000;
 	else if (year  100)
 		year += 1900;



CVS commit: src/share/man/man7

2010-06-26 Thread Julio Merino
 commands to run the whole test suite:
+.Bd -literal -offset indent
+$ cd /usr/tests
+$ atf-run | atf-report
+.Ed
+.Pp
+The above will go through all test programs in
+.Pa /usr/tests
+recursive, execute them, and, at the very end, show a report of the results of
+the test suite.
+These results include the count of tests that succeeded (passed), the names of
+the tests that failed, and the count of the tests that were not executed
+(skipped) because the system configuration did not meet their requirements.
+.Pp
+If you are interested in saving the whole output of the test suite execution so
+that you can later investigate failures, use the following idiom instead:
+.Bd -literal -offset indent
+$ cd /usr/tests
+$ atf-run | tee ~/tests.log | atf-report
+.Ed
+.Pp
+The above command will save the raw output of the test suite in
+.Pa ~/tests.log ,
+which you can later inspect manually to look for failures.
+Note that the file contains a copy of the
+.Sq stdout
+and
+.Sq stderr
+of each test case, which becomes valuable during debugging.
+.Pp
+It is also possible to restrict which tests to execute so that only a small
+subsystem is tested; see
+.Xr atf-run 1
+for details.
+Additionally, it is also possible to run the test programs themselves by hand;
+see
+.Xr atf-test-program 1
+for more details, but be aware that you should only be doing this if you are
+debugging failing tests.
+.Ss Configuring the tests
+Some test cases in the
+.Nx
+test suite require the administrator to manually set up some configuration
+properties before they can run.
+Unless these properties are defined, the tests that require them will be marked
+as skipped and thus they will not be really executed.
+.Pp
+Each test suite is configured through a separate file that lives under
+.Pa /etc/atf/
+and that carries the name of the test suite.
+Henceforth, to configure the properties that affect the execution of the
+.Nx
+test suite, you need to edit
+.Pa /etc/atf/NetBSD.conf .
+These files conform to the configuration file format described in
+.Xr atf-formats 5 .
+.Pp
+The following properties are recognized:
+.Bl -tag -offset indent -width unprivilegedXuserXX
+.It Va unprivileged_user
+Specifies the name of a local, unprivileged user, that will be used by those
+tests that need to perform checks as non-root.
+.El
+.Sh SEE ALSO
+.Xr atf 7
+.Sh HISTORY
+The
+.Xr tests 7
+manual page first appeared in
+.Nx 6.0 .
+.Pp
+The ATF testing framework was first distributed with
+.Nx 5.0
+and the collection of test programs in
+.Pa /usr/tests
+has been growing since then.
+.Sh AUTHORS
+.An Julio Merino Aq j...@netbsd.org



CVS commit: src/distrib/sets/lists/man

2010-06-26 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Jun 26 11:15:59 UTC 2010

Modified Files:
src/distrib/sets/lists/man: mi

Log Message:
Register the tests(7) manual page.


To generate a diff of this commit:
cvs rdiff -u -r1.1220 -r1.1221 src/distrib/sets/lists/man/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1220 src/distrib/sets/lists/man/mi:1.1221
--- src/distrib/sets/lists/man/mi:1.1220	Thu Jun 24 16:37:48 2010
+++ src/distrib/sets/lists/man/mi	Sat Jun 26 11:15:59 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1220 2010/06/24 16:37:48 skrll Exp $
+# $NetBSD: mi,v 1.1221 2010/06/26 11:15:59 jmmv Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1949,6 +1949,7 @@
 ./usr/share/man/cat7/sticky.0			man-reference-catman	.cat
 ./usr/share/man/cat7/symlink.0			man-reference-catman	.cat
 ./usr/share/man/cat7/sysctl.0			man-reference-catman	.cat
+./usr/share/man/cat7/tests.0			man-reference-catman	.cat
 ./usr/share/man/cat8/MAKEDEV.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/MAKEDEV.local.0		man-sysutil-catman	.cat
 ./usr/share/man/cat8/ac.0			man-sysutil-catman	.cat
@@ -4515,6 +4516,7 @@
 ./usr/share/man/html7/sticky.html		man-reference-htmlman	html
 ./usr/share/man/html7/symlink.html		man-reference-htmlman	html
 ./usr/share/man/html7/sysctl.html		man-reference-htmlman	html
+./usr/share/man/html7/tests.html		man-reference-htmlman	html
 ./usr/share/man/html8/MAKEDEV.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/MAKEDEV.local.html	man-sysutil-htmlman	html
 ./usr/share/man/html8/ac.html			man-sysutil-htmlman	html
@@ -7064,6 +7066,7 @@
 ./usr/share/man/man7/sticky.7			man-reference-man	.man
 ./usr/share/man/man7/symlink.7			man-reference-man	.man
 ./usr/share/man/man7/sysctl.7			man-reference-man	.man
+./usr/share/man/man7/tests.7			man-reference-man	.man
 ./usr/share/man/man8/MAKEDEV.8			man-sysutil-man		.man
 ./usr/share/man/man8/MAKEDEV.local.8		man-sysutil-man		.man
 ./usr/share/man/man8/ac.8			man-sysutil-man		.man



CVS commit: src/share/man

2010-06-26 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Jun 26 11:26:17 UTC 2010

Modified Files:
src/share/man/man7: tests.7
src/share/man/man8: afterboot.8

Log Message:
Move testing instructions from afterboot(8) to tests(7) and change the
former to only provide a link to the latter.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man7/tests.7
cvs rdiff -u -r1.46 -r1.47 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/tests.7
diff -u src/share/man/man7/tests.7:1.1 src/share/man/man7/tests.7:1.2
--- src/share/man/man7/tests.7:1.1	Sat Jun 26 11:15:27 2010
+++ src/share/man/man7/tests.7	Sat Jun 26 11:26:17 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: tests.7,v 1.1 2010/06/26 11:15:27 jmmv Exp $
+.\	$NetBSD: tests.7,v 1.2 2010/06/26 11:26:17 jmmv Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -91,6 +91,18 @@
 third-party packages or manual modifications to configuration files) do not
 introduce unexpected failures.
 .El
+.Ss Installing the tests
+If you chose to install the
+.Pa tests.tgz
+distribution set while setting up your
+.Nx
+system, the tests are already available in
+.Pa /usr/tests .
+Otherwise, install the set now by running:
+.Bd -literal -offset indent
+# cd /
+# tar xzpf /path/to/tests.tgz
+.Ed
 .Ss Running the tests
 Use the following commands to run the whole test suite:
 .Bd -literal -offset indent
@@ -155,6 +167,30 @@
 Specifies the name of a local, unprivileged user, that will be used by those
 tests that need to perform checks as non-root.
 .El
+.Ss What to do if something fails?
+If there is
+.Em any failure
+during the execution of the test suite, please considering reporting it to the
+.Nx
+developers so that the failure can be analyzed and fixed.
+To do so, either send a message to the appropriate mailing list or file a
+problem report.
+For more details please refer to:
+.Bl -bullet -offset indent -compact
+.It
+.Pa http://www.netbsd.org/mailinglists/
+.It
+.Pa http://www.netbsd.org/support/send-pr.html
+.El
+.Sh FILES
+.Bl -tag -compact -width etcXatfXNetBSDXconfXX
+.It Pa /etc/atf/NetBSD.conf
+Configuration file for the
+.Nx
+test suite.
+.It Pa /usr/tests/
+Location of the test suites.
+.El
 .Sh SEE ALSO
 .Xr atf 7
 .Sh HISTORY

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.46 src/share/man/man8/afterboot.8:1.47
--- src/share/man/man8/afterboot.8:1.46	Wed Feb 17 00:49:21 2010
+++ src/share/man/man8/afterboot.8	Sat Jun 26 11:26:17 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: afterboot.8,v 1.46 2010/02/17 00:49:21 snj Exp $
+.\	$NetBSD: afterboot.8,v 1.47 2010/06/26 11:26:17 jmmv Exp $
 .\	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\
 .\ Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -59,7 +59,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd January 20, 2010
+.Dd June 26, 2010
 .Dt AFTERBOOT 8
 .Os
 .Sh NAME
@@ -956,45 +956,10 @@
 At this point, the system should be fully configured to your liking.
 It is now a good time to ensure that the system behaves according to
 its specifications and that it is stable on your hardware.
-You can easily do so by running the test suites available at
-.Pa /usr/tests/ ,
-assuming that you installed the
-.Pa tests.tgz
-set.
-If not, you can install it now by running:
-.Bd -literal -offset indent
-# cd /
-# tar xzpf /path/to/tests.tgz
-.Ed
-.Pp
-Once done, edit the
-.Pa /etc/atf/NetBSD.conf
-file to tune the configuration of the test suite, go to
-.Pa /usr/tests/
-hierarchy and use the
-.Xr atf-run 1
-and
-.Xr atf-report 1
-utilities to run all the tests in an automated way:
-.Bd -literal -offset indent
-# cd /usr/tests/
-# atf-run | atf-report
-.Ed
-.Pp
-Should any problems appear when running the test suite, please let the
-.Nx
-developers know by sending a message to the appropriate mailing list or
-by sending a problem report.
-For more details see:
-.Bl -bullet -offset indent
-.It
-.Pa http://www.netbsd.org/mailinglists/
-.It
-.Pa http://www.netbsd.org/support/send-pr.html
-.El
+Please refer to
+.Xr tests 7
+for details on how to do so.
 .Sh SEE ALSO
-.Xr atf-report 1 ,
-.Xr atf-run 1 ,
 .Xr chgrp 1 ,
 .Xr chmod 1 ,
 .Xr config 1 ,
@@ -1035,6 +1000,7 @@
 .Xr hier 7 ,
 .Xr hostname 7 ,
 .Xr pkgsrc 7 ,
+.Xr tests 7 ,
 .Xr amd 8 ,
 .Xr ccdconfig 8 ,
 .Xr chown 8 ,



  1   2   3   4   5   6   7   >