From 48383377d17ed73ae7981e987840c5b755622ae0 Mon Sep 17 00:00:00 2001 From: Sangjung Woo Date: Mon, 5 Apr 2021 17:09:35 +0900 Subject: [PATCH] [Tizen.MachineLearning.Inference][Non-ACR] Check the privilege 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 --- .../Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) mode change 100644 => 100755 tct-suite-vs/Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs diff --git a/tct-suite-vs/Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs b/tct-suite-vs/Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs old mode 100644 new mode 100755 index f43339b..846d8b0 --- a/tct-suite-vs/Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs +++ b/tct-suite-vs/Tizen.MachineLearning.Inference.Tests/testcase/TSPipeline.cs @@ -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); } } } -- 2.7.4