Fix set_app_privilege tests
authorPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Tue, 12 Nov 2013 16:46:49 +0000 (17:46 +0100)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 23 Jan 2014 14:19:10 +0000 (15:19 +0100)
[Issue#]        N/A
[Bug/Feature]   privilege_control05_set_app_privilege tests fails
[Cause]         perm_end fails after perm_app_set_privilege call
[Solution]      Remove transaction around perm_app_set_privilege calls
[Verification]  Build, install, run tests

Change-Id: Ida1b94eff78180a217f9410f1d168d75a43179e3

tests/libprivilege-control-tests/test_cases.cpp
tests/libprivilege-control-tests/test_cases_nosmack.cpp

index 3c452fd..1ed8e0d 100644 (file)
@@ -441,14 +441,10 @@ void set_app_privilege(int line_no,
     result = test_have_all_accesses(rules);
     RUNNER_ASSERT_MSG(result == 1, "Permissions not added.");
 
-    DB_BEGIN
-
     result = perm_app_set_privilege(app_id, type, app_path);
     RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Line: " << line_no <<
             " Error in perm_app_set_privilege. Error: " << result);
 
-    DB_END
-
     // Check if SMACK label really set
     char *label;
     result = smack_new_label_from_self(&label);
index e237a3e..7185034 100644 (file)
@@ -212,14 +212,10 @@ void set_app_privilege_nosmack(int line_no,
     RUNNER_ASSERT_MSG(result == -1, "Line: " << line_no <<
             " Permissions shouldn't be added. Result: " << result);
 
-    DB_BEGIN
-
     result = perm_app_set_privilege(app_id, type, app_path);
     RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Line: " << line_no <<
             " Error in perm_app_set_privilege. Error: " << result);
 
-    DB_END
-
     //Even though app privileges are set, no smack label should be extracted.
     char* label = NULL;
     result = smack_new_label_from_self(&label);
@@ -247,15 +243,11 @@ RUNNER_CHILD_TEST_NOSMACK(privilege_control05_set_app_privilege_nosmack)
     smack_lsetlabel(APP_SET_PRIV_PATH_REAL, APP_ID, SMACK_LABEL_EXEC);
     smack_lsetlabel(APP_SET_PRIV_PATH, APP_ID "_symlink", SMACK_LABEL_EXEC);
 
-    DB_BEGIN
-
     //Set app privileges
     result = perm_app_set_privilege(APP_ID, NULL, APP_SET_PRIV_PATH);
     RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS,
             "Error in perm_app_set_privilege. Error: " << result);
 
-    DB_END
-
     //Even though app privileges are set, no smack label should be extracted.
     char* label = NULL;
     result = smack_new_label_from_self(&label);