From ea4718bf40f45c65605742a4df10fa77f56ae828 Mon Sep 17 00:00:00 2001
From: Piotr Bartosiewicz
Date: Tue, 12 Nov 2013 17:46:49 +0100
Subject: [PATCH] Fix set_app_privilege tests
[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 | 4 ----
tests/libprivilege-control-tests/test_cases_nosmack.cpp | 8 --------
2 files changed, 12 deletions(-)
diff --git a/tests/libprivilege-control-tests/test_cases.cpp b/tests/libprivilege-control-tests/test_cases.cpp
index 3c452fd..1ed8e0d 100644
--- a/tests/libprivilege-control-tests/test_cases.cpp
+++ b/tests/libprivilege-control-tests/test_cases.cpp
@@ -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);
diff --git a/tests/libprivilege-control-tests/test_cases_nosmack.cpp b/tests/libprivilege-control-tests/test_cases_nosmack.cpp
index e237a3e..7185034 100644
--- a/tests/libprivilege-control-tests/test_cases_nosmack.cpp
+++ b/tests/libprivilege-control-tests/test_cases_nosmack.cpp
@@ -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);
--
2.7.4