[apparmor] [patch] error out on failing libapparmor test_multi tests

John Johansen john.johansen at canonical.com
Sat Dec 12 06:14:51 UTC 2015


On 12/08/2015 03:24 PM, Christian Boltz wrote:
> Hello,
> 
> this patch adds a check-local target to libapparmor/testsuite/Makefile.am
> that checks the logfile generated by the test_multi tests
> (libaalogparse.log) and errors out if
> - the logfile doesn't exist (which might mean that dejagnu isn't installed
> - the logfile contains 'ERROR'
> 
> This isn't the best solution I can imagine, but it's the only/easiest
> way I found that doesn't need changing of autogenerated files.
> 
> 
> Also extend clean-local to delete libaalogparse.{log,sum}
> 
> 
> Note: with this patch applied, libapparmor make check fails with
> 
>     ERROR: Missing file ./test_multi/testcase_changehat_01.err
>     ERROR: Missing file ./test_multi/testcase_syslog_read.err
> 
> I'll add those as empty files when commiting this patch.
> 
> 
Acked-by: John Johansen <john.johansen at canonical.com>

> 
> [ libapparmor-error-out-on-failing-test-multi.diff ]
> 
> === modified file 'libraries/libapparmor/testsuite/Makefile.am'
> --- libraries/libapparmor/testsuite/Makefile.am 2014-01-06 22:08:55 +0000
> +++ libraries/libapparmor/testsuite/Makefile.am 2015-12-08 22:31:23 +0000
> @@ -15,5 +15,10 @@
>  
>  clean-local:
>         rm -rf tmp.err.* tmp.out.* site.exp site.bak test_multi/out
> +       rm -f libaalogparse.log libaalogparse.sum
> +
> +check-local:
> +       if ! test -f libaalogparse.log ; then echo '*** libaalogparse.log not found - is dejagnu installed? ***'; exit 1; fi
> +       if grep ERROR libaalogparse.log ; then exit 1 ; fi
>  
>  EXTRA_DIST = test_multi/*.in test_multi/*.out test_multi/*.err
> 
> 
> 
> Regards,
> 
> Christian Boltz
> 




More information about the AppArmor mailing list