On Wed, Oct 20, 2010 at 5:55 AM, Serge E. Hallyn
<[email protected]> wrote:
> Quoting ARJIT SHARMA ([email protected]):
>> Hi,
>>
>>      Inside the smack testcase, the sript "smack_common.sh" has a function
>> named "check_onlycap()" , please tell me its functionality  as every time
>> this function is reporting that   onlycap is "" not the expected "".
>>
>> the log of the testcase is as follows---
>
> Yeah the check seems backward.  Does this patch help?
>
> From efe6116a6b284bb409b7fe9946cf990092183650 Mon Sep 17 00:00:00 2001
> From: Serge Hallyn <[email protected]>
> Date: Wed, 20 Oct 2010 07:54:21 -0500
> Subject: [PATCH 1/1] Fix inverted logic testing for string which is NOT empty
>
> Signed-off-by: Serge Hallyn <[email protected]>
> ---
>  testcases/kernel/security/smack/smack_common.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/testcases/kernel/security/smack/smack_common.sh 
> b/testcases/kernel/security/smack/smack_common.sh
> index eb339f3..25405fe 100755
> --- a/testcases/kernel/security/smack/smack_common.sh
> +++ b/testcases/kernel/security/smack/smack_common.sh
> @@ -36,7 +36,7 @@ check_mounted() {
>
>  check_onlycap() {
>        onlycap=`cat "$smackfsdir/onlycap" 2>/dev/null`
> -       if [ -z "$onlycap" ]; then
> +       if [ ! -z "$onlycap" ]; then
>                cat <<EOM
>  The smack label reported for $smackfsdir/onlycap is "$onlycap", not the 
> expected "".
>  EOM

    Yes, the logic was backwards. Please try the code I just pushed to
git to see whether or not it works for you (its intent is like
Serge's, but I improved the mount check as well, as it previously just
checked to see whether or not the directory existed, which was silly).
Thanks!
-Garrett

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to