[ovs-dev] [PATCH] tests: Report core dumps during tests as failures.

Ben Pfaff blp at nicira.com
Mon Jun 9 18:13:52 UTC 2014


On Thu, May 29, 2014 at 05:16:09PM -0700, Jarno Rajahalme wrote:
> On May 29, 2014, at 3:06 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > Jarno, you might want to take a look at this, since it is a simple
> > patch that improves the test cases in a way that you suggested.
> > 
> 
> And I wondered why was this not in yet!
> 
> Comments below:
> 
> > On Wed, May 21, 2014 at 5:05 PM, Ben Pfaff <blp at nicira.com> wrote:
> >> This will only catch core dumps in tests that start and stop ovs-vswitchd,
> >> but that covers the ones most likely to have problems.
> >> 
> >> Suggested-by: Jarno Rajahalme <jrajahalme at nicira.com>
> >> Signed-off-by: Ben Pfaff <blp at nicira.com>
> >> ---
> >> tests/ofproto-macros.at |   20 +++++++++++++++++++-
> >> 1 file changed, 19 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
> >> index 4b16907..7e9d10e 100644
> >> --- a/tests/ofproto-macros.at
> >> +++ b/tests/ofproto-macros.at
> >> @@ -98,6 +98,20 @@ check_logs () {
> >> /|ERR|/p
> >> /|EMER|/p" ovs-vswitchd.log ovsdb-server.log
> >> }
> >> +
> >> +check_cores () {
> >> +    for core in core*; do
> >> +        if test -f "$core"; then
> >> +            echo "$core: core dumped during test"
> >> +
> >> +            # If "file" is installed then this is likely to give a little
> >> +            # extra information about it, such as the program's name and
> >> +            # command line.  If "file" isn't installed then it should be
> >> +            # harmless
> >> +            (file "./$core") 2>/dev/null
> >> +        fi
> >> +    done
> >> +}
> 
> 
> I made a deliberate core-producing error to test this out. As a result I have three core files:
> 
> $ ls -l tests/testsuite.dir/*/core
> -rw------- 1 jrajahalme jrajahalme 20344832 May 29 16:53 tests/testsuite.dir/0352/core
> -rw------- 1 jrajahalme jrajahalme 20353024 May 29 16:53 tests/testsuite.dir/0353/core
> -rw------- 1 jrajahalme jrajahalme 20357120 May 29 16:53 tests/testsuite.dir/0764/core
> 
> But I don?t seem to find the string ?core dumped? from the make output, nor from testsuite.log. Where should it be?

I believe that this is not being reported because the test failed
before we got to the point of the log scan or checking for cores.
That is OK: the cores will be found when the developer investigates
the test failure.  We only need to report any cores that appear when
the test would otherwise pass.



More information about the dev mailing list