[apparmor] [patch] regression tests: fix environ fail case

Seth Arnold seth.arnold at canonical.com
Thu Feb 2 02:39:28 UTC 2017


On Wed, Feb 01, 2017 at 04:48:39PM -0800, Steve Beattie wrote:
> Hi,
> 
> While researching
> https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1661030 I
> discovered that when the exec() of the child process, we don't report
> FAIL to stdout, so the regression tests consider it an error rather than
> a failure and abort, short-circuiting the test script.
> 
> This patch fixes this by emitting the FAIL message when the result from
> the wait() syscall indicates the child process did not succeed.
> 
> Nominated for 2.11, 2.10, and 2.9.
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>

Nice find. Acked for all three branches.

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

Thanks

> 
> ---
>  tests/regression/apparmor/environ.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: b/tests/regression/apparmor/environ.c
> ===================================================================
> --- a/tests/regression/apparmor/environ.c
> +++ b/tests/regression/apparmor/environ.c
> @@ -63,6 +63,8 @@ int main(int argc, char *argv[])
>  		if (retval == RET_CHLD_SUCCESS) {
>  			printf("PASS\n");
>  			retval = 0;
> +		} else {
> +			printf("FAIL: Child failed\n");
>  		}
>  
>  	} else if (pid == 0) {
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20170201/39032a91/attachment.pgp>


More information about the AppArmor mailing list