Modyfing tests to new libprivilege feature to file name mapping
authorZofia Abramowska <z.abramowska@samsung.com>
Thu, 23 May 2013 11:25:59 +0000 (13:25 +0200)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 23 Jan 2014 13:43:52 +0000 (14:43 +0100)
[Issue#] SSDWSSP-292
[Feature/Bug] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build. Run libprivilege-control tests. Tests for
add_api_feature should pass

Depends on : http://slp-info.sec.samsung.net/gerrit/#/c/209603/1

Change-Id: I5c225e0bfeba9ce4d5cca2cdfafc9d8278d9273c

tests/libprivilege-control-tests/test_cases.cpp

index b001fb8..8f20ba5 100644 (file)
@@ -232,10 +232,10 @@ namespace {
 
 typedef std::unique_ptr<smack_accesses,std::function<void(smack_accesses*)>> SmackUniquePtr;
 
-const char* OSP_BLAHBLAH = "/usr/share/privilege-control/OSP_blahblah.smack";
+const char* OSP_BLAHBLAH = "/usr/share/privilege-control/OSP_feature.blah.blahblah.smack";
 const char* WRT_BLAHBLAH = "/usr/share/privilege-control/WGT_blahblah.smack";
 const char* OTHER_BLAHBLAH = "/usr/share/privilege-control/blahblah.smack";
-const char* OSP_BLAHBLAH_DAC = "/usr/share/privilege-control/OSP_blahblah.dac";
+const char* OSP_BLAHBLAH_DAC = "/usr/share/privilege-control/OSP_feature.blah.blahblah.dac";
 const char* WRT_BLAHBLAH_DAC = "/usr/share/privilege-control/WGT_blahblah.dac";
 const char* OTHER_BLAHBLAH_DAC = "/usr/share/privilege-control/blahblah.dac";
 const char* BLAHBLAH_FEATURE = "http://feature/blah/blahblah";
@@ -1069,16 +1069,22 @@ RUNNER_TEST(privilege_control11_add_api_feature)
 
 
     // already existing features
-    result = add_api_feature(APP_TYPE_OSP,"messaging" , NULL, NULL, 0);
+    result = add_api_feature(APP_TYPE_OSP,"http://tizen.org/privilege/messaging.read" , NULL, NULL, 0);
     RUNNER_ASSERT(result == PC_ERR_INVALID_PARAM);
 
-    result = add_api_feature(APP_TYPE_OSP,"blahblah/messaging" , NULL, NULL, 0);
+    result = add_api_feature(APP_TYPE_WGT,"http://tizen.org/privilege/messaging.sms" , NULL, NULL, 0);
     RUNNER_ASSERT(result == PC_ERR_INVALID_PARAM);
 
-    result = add_api_feature(APP_TYPE_WGT,"blahblahblah/messaging" , NULL, NULL, 0);
-    RUNNER_ASSERT(result == PC_ERR_INVALID_PARAM);
+    result = add_api_feature(APP_TYPE_OTHER,"http://tizen.org/privilege/messaging" , NULL, NULL, 0);
+    RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
+
+    result = add_api_feature(APP_TYPE_OTHER,"http://tizen.org/messaging" , NULL, NULL, 0);
+    RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
+
+    result = add_api_feature(APP_TYPE_OTHER,"http://messaging" , NULL, NULL, 0);
+    RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);
 
-    result = add_api_feature(APP_TYPE_OTHER,"blah/messaging" , NULL, NULL, 0);
+    result = add_api_feature(APP_TYPE_OTHER,"messaging.read" , NULL, NULL, 0);
     RUNNER_ASSERT(result == PC_OPERATION_SUCCESS);