ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/tests/lib/libc/ssp (fwd)

On Mon, 27 Dec 2010, Julio Merino wrote:

In this case, I need to use

       atf_check -x -s signal:6 "echo foo | test_prog"

Even though test_prog exits with signal 6 (SIGABRT), the shell process does
not (it exits normally).  The test case reports

       tc-se:Fail: program did not receive a signal

Ah, I see what you mean.  So wouldn't this work?

echo foo | atf_check -s signal:6 test_prog

Yes, that would work, except not all of the tests have the "echo foo" part. So my syntax replaces the "echo foo |" with $2 substitution. I think I need eval here, since the | doesn't show up until after the symbol is substituted.

I _could_ use two separate functions, h_fail() and h_fail_echo() but didn't really want to duplicate things. (I'd also need two separate h_pass() and h_pass_echo() functions...)

Hmm, I guess I probably could use

        echo "$2" | atf_check ...

which would provide an empty line for stdin if $2 is empty. It should not hurt anything.

Either way, I'm not sure it makes much difference.

BTW, it does not appear that "-s signal:name" works.  I've tried ABRT,
ABORT, SIGABRT, and SIGABORT and all fail with

       tc-se:atf-check: ERROR: Invalid signal name or number in -s option

Mea culpa.  The SIGABRT name was not defined in atf-sh/atf-check.cpp.
I've added support for this upstream; would you like the change pulled
up to NetBSD also?  It's a one-liner.

It would be nice to pull this up when you get a chance.  No hurry.

| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at |
| Kernel Developer |                          | pgoyette at  |

Home | Main Index | Thread Index | Old Index