[Tizen.MachineLearning.Inference][Non-ACR] Check the privilege 85/256485/3
authorSangjung Woo <sangjung.woo@samsung.com>
Mon, 5 Apr 2021 08:09:35 +0000 (17:09 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Tue, 6 Apr 2021 08:08:27 +0000 (17:08 +0900)
If Privilege API is not supported on the target device,
Pipeline_INIT_CHECK_UnauthorizedAccessException test case should be
passed.

Change-Id: I456661dee90f229394a1e151b049b57648639ad8
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
tct-suite-vs/Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index f43339b..846d8b0
@@ -30,6 +30,7 @@ namespace Tizen.MachineLearning.Inference.Tests {
     {
         private const string TAG = "Tizen.MachineLearning.Inference.Tests";
         private const string FeatureKey = "http://tizen.org/feature/machine_learning.inference";
+        private const string PrivilegeFeatureKey = "http://tizen.org/feature/security.privacy_privilege";
         private const int SleepTime = 1000; // default sleep time to run the pipeline
 
         private readonly string _generalPipeline = "videotestsrc is-live=true ! videoconvert ! valve name=valvex ! tensor_converter ! tensor_sink name=sinkx async=false";
@@ -221,8 +222,12 @@ namespace Tizen.MachineLearning.Inference.Tests {
         [Property("AUTHOR", "Gichan Jang, gichan2.jang@samsung.com")]
         public void Pipeline_INIT_CHECK_UnauthorizedAccessException()
         {
+            bool _isPrivacyPrivilegeSupported = false;
             try
             {
+                /* Check the privilege support */
+                Information.TryGetValue(PrivilegeFeatureKey, out _isPrivacyPrivilegeSupported);
+
                 string description = "tizencamvideosrc ! videoconvert ! videoscale ! video/x-raw,format=RGB,width=320,height=240 ! tensor_converter ! tensor_sink";
 
                 /* TEST CODE */
@@ -243,7 +248,7 @@ namespace Tizen.MachineLearning.Inference.Tests {
                 }
                 else
                 {
-                    Assert.Fail(e.Message);
+                    Assert.IsTrue(_isPrivacyPrivilegeSupported == false, e.Message);
                 }
             }
         }