Use new function app_setup_path() in place of old app_label_dir() and app_label_share...
authorRafal Krypa <r.krypa@samsung.com>
Wed, 22 May 2013 16:51:53 +0000 (18:51 +0200)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 23 Jan 2014 13:43:53 +0000 (14:43 +0100)
Change-Id: I75538d3405337a23c307de526d9a68318cb26b68

tests/libprivilege-control-tests/test_cases.cpp

index c8ecb56..91a30a5 100644 (file)
@@ -491,17 +491,14 @@ RUNNER_TEST(privilege_control02_app_label_dir)
 {
     int result;
 
-    result = app_label_shared_dir(APP_ID, APP_ID, TEST_APP_DIR);
-    RUNNER_ASSERT_MSG(result != 0, "app_label_shared_dir(APP_ADD, APP_ID) == " << result);
-
     result = nftw(TEST_APP_DIR, &nftw_remove_labels, FTW_MAX_FDS, FTW_PHYS);
     RUNNER_ASSERT_MSG(result == 0, "Unable to clean up Smack labels in " << TEST_APP_DIR);
 
     result = nftw(TEST_NON_APP_DIR, &nftw_set_labels_non_app_dir, FTW_MAX_FDS, FTW_PHYS);
     RUNNER_ASSERT_MSG(result == 0, "Unable to clean up Smack labels in " << TEST_NON_APP_DIR);
 
-    result = app_label_dir(APPID_DIR, TEST_APP_DIR);
-    RUNNER_ASSERT_MSG(result == 0, "app_label_dir() failed");
+    result = app_setup_path(APPID_DIR, TEST_APP_DIR, APP_PATH_PRIVATE);
+    RUNNER_ASSERT_MSG(result == 0, "app_setup_path() failed");
 
     result = nftw(TEST_APP_DIR, &nftw_check_labels_app_dir, FTW_MAX_FDS, FTW_PHYS);
     RUNNER_ASSERT_MSG(result == 0, "Unable to check Smack labels for app dir");
@@ -514,14 +511,17 @@ RUNNER_TEST(privilege_control03_app_label_shared_dir)
 {
     int result;
 
+    result = app_setup_path(APP_ID, TEST_APP_DIR, APP_PATH_GROUP_RW, APP_ID);
+    RUNNER_ASSERT_MSG(result != 0, "app_setup_path(APP_ID, APP_ID) didn't fail");
+
     result = nftw(TEST_APP_DIR, &nftw_remove_labels, FTW_MAX_FDS, FTW_PHYS);
     RUNNER_ASSERT_MSG(result == 0, "Unable to clean up Smack labels in " << TEST_APP_DIR);
 
     result = nftw(TEST_NON_APP_DIR, &nftw_set_labels_non_app_dir, FTW_MAX_FDS, FTW_PHYS);
     RUNNER_ASSERT_MSG(result == 0, "Unable to clean up Smack labels in " << TEST_NON_APP_DIR);
 
-    result = app_label_shared_dir(APP_ID, APPID_SHARED_DIR, TEST_APP_DIR);
-    RUNNER_ASSERT_MSG(result == 0, "app_label_shared_dir() failed");
+    result = app_setup_path(APP_ID, TEST_APP_DIR, APP_PATH_GROUP_RW, APPID_SHARED_DIR);
+    RUNNER_ASSERT_MSG(result == 0, "app_setup_path() failed");
 
     result = nftw(TEST_APP_DIR, &nftw_check_labels_app_shared_dir, FTW_MAX_FDS, FTW_PHYS);
     RUNNER_ASSERT_MSG(result == 0, "Unable to check Smack labels for shared app dir");