[apparmor] [PATCH 1/2] tests: Add an optional final check to checktestfg and checktestbg

Seth Arnold seth.arnold at canonical.com
Fri Aug 9 19:57:34 UTC 2013


On Thu, Aug 01, 2013 at 02:01:38AM -0700, Tyler Hicks wrote:
> Allows for the test script to specify a final check to be performed
> after checking the output of the test binary. This may be useful, for
> example, if the test script wants to compare logging output of the test
> binary to known-good logging output.
> 
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks

> ---
> 
> I'm not real happy about this patch. It is definitely a shortcut to what I need
> for the dbus tests, which is a way to compare two log files after the test
> program status is checked and before the test is declared a failure or not. The
> log comparison function itself may also decide if the test was a failure or
> not.
> 
> That said, this isn't all that bad so I'm not sure if it is worth it to spend
> more time on coming up with a cleaner solution.
> 
>  tests/regression/apparmor/prologue.inc | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/regression/apparmor/prologue.inc b/tests/regression/apparmor/prologue.inc
> index 150ac1e..7068298 100755
> --- a/tests/regression/apparmor/prologue.inc
> +++ b/tests/regression/apparmor/prologue.inc
> @@ -129,7 +129,7 @@ checktestbg()
>  	then
>  		echo "SIGNAL$(($rc - 128))" > $outfile
>  	fi
> -	checktestfg
> +	checktestfg "$@"
>  }
>  
>  runtestfg()
> @@ -207,6 +207,15 @@ checktestfg()
>  			;;
>  	esac
>  
> +	if [ $# -gt 0 ]
> +	then
> +		$1
> +		if [ "$teststatus" != "pass" ]
> +		then
> +			return
> +		fi
> +	fi
> +
>  	if [ -n "$VERBOSE" ]; then
>  		echo "ok: ${_testdesc}"
>  	fi
> -- 
> 1.8.3.2
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130809/6b21327d/attachment.pgp>


More information about the AppArmor mailing list