From: Jan Cybulski Date: Wed, 4 Jun 2014 12:47:19 +0000 (+0200) Subject: Fix return value of smack_have_access X-Git-Tag: security-manager_5.5_testing~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=085ef65e4f5f9782e103dcd422f618c27efc7887;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Fix return value of smack_have_access Libsmack's smack_have_access returns 0 on no access and -1 on errors. Checking rule that does not exist should not return -1 Change-Id: I604eed75634c9bc1dfbeb41a70d0a11211be96f0 Signed-off-by: Jan Cybulski --- diff --git a/tests/libsmack-tests/test_cases.cpp b/tests/libsmack-tests/test_cases.cpp index ae1d8bf..503cb7e 100644 --- a/tests/libsmack-tests/test_cases.cpp +++ b/tests/libsmack-tests/test_cases.cpp @@ -530,9 +530,9 @@ RUNNER_TEST_SMACK(smack02_aplying_rules_into_kernel) //should have no access - wrong rule, should be "r" only result = smack_have_access("reader", "book", "rwx"); RUNNER_ASSERT_MSG_BT(result == 0, "Error while checking Smack access"); - //should fail - rule not exist + //should have no access - rule not exist result = smack_have_access("s02badsubjectlabel", "book", "rwx"); - RUNNER_ASSERT_MSG_BT(result == -1, "Error while checking Smack access"); + RUNNER_ASSERT_MSG_BT(result == 0, "Error while checking Smack access"); //this subject do not exist in kernel rules result = smack_revoke_subject("s02nonexistinglabel");