From: SukhyungKang Date: Mon, 6 Jan 2025 08:41:46 +0000 (+0900) Subject: Change to use cynara api instead of direct access to check privilege X-Git-Tag: accepted/tizen/unified/20250219.035253~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3cd5d24ee8a9dc34503b4c43c160f1cd6e4dcaf;p=platform%2Fcore%2Fappfw%2Fwidget-service.git Change to use cynara api instead of direct access to check privilege Change-Id: I290831491bb2a28d7f77903755a13cf051a86c67 Signed-off-by: SukhyungKang --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 50051b2..56c01be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ PKG_CHECK_MODULES(AUL_DEPS REQUIRED aul) PKG_CHECK_MODULES(PLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config) PKG_CHECK_MODULES(UUID_DEPS REQUIRED uuid) PKG_CHECK_MODULES(CYNARA_CLIENT_DEPS REQUIRED cynara-client) +PKG_CHECK_MODULES(CYNARA_CREDS_SELF_DEPS REQUIRED cynara-creds-self) PKG_CHECK_MODULES(INIPARSER_DEPS REQUIRED iniparser) PKG_CHECK_MODULES(SMACK_DEPS REQUIRED libsmack) PKG_CHECK_MODULES(XML_DEPS REQUIRED libxml-2.0) diff --git a/packaging/libwidget_service.spec b/packaging/libwidget_service.spec index 7042b93..339fdff 100644 --- a/packaging/libwidget_service.spec +++ b/packaging/libwidget_service.spec @@ -25,6 +25,7 @@ BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(aul) BuildRequires: pkgconfig(cynara-client) +BuildRequires: pkgconfig(cynara-creds-self) BuildRequires: pkgconfig(pkgmgr-installer) BuildRequires: pkgconfig(iniparser) BuildRequires: pkgconfig(libsmack) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d830c6e..3569d7f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,7 @@ APPLY_PKG_CONFIG(${TARGET_WIDGET_SERVICE} PUBLIC PLATFORM_CONFIG_DEPS UUID_DEPS CYNARA_CLIENT_DEPS + CYNARA_CREDS_SELF_DEPS INIPARSER_DEPS SMACK_DEPS DATABASE_DEPS diff --git a/src/widget_service.c b/src/widget_service.c index 9bf6bfc..34f161b 100644 --- a/src/widget_service.c +++ b/src/widget_service.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -157,11 +158,8 @@ static inline bool _is_widget_feature_enabled(void) static int check_privilege(const char *privilege) { cynara *p_cynara = NULL; - - int fd = 0; int ret = 0; - - char subject_label[SMACK_LABEL_LEN + 1] = ""; + char *cynara_client = NULL; char uid[10] = {0,}; char *client_session = ""; @@ -172,29 +170,17 @@ static int check_privilege(const char *privilege) goto out; } - fd = open("/proc/self/attr/current", O_RDONLY); - if (fd < 0) { -/* LCOV_EXCL_START */ - LOGE("open [%d] failed!", errno); - ret = -1; -/* LCOV_EXCL_STOP */ - goto out; - } + ret = cynara_creds_self_get_client(CLIENT_METHOD_DEFAULT, &cynara_client); + if (ret != CYNARA_API_SUCCESS) { + LOGD("failed to get cynara client : %d", ret); - ret = read(fd, subject_label, SMACK_LABEL_LEN); - if (ret < 0) { -/* LCOV_EXCL_START */ - LOGE("read [%d] failed!", errno); - close(fd); ret = -1; goto out; -/* LCOV_EXCL_STOP */ } - close(fd); snprintf(uid, 10, "%d", getuid()); - ret = cynara_check(p_cynara, subject_label, client_session, uid, + ret = cynara_check(p_cynara, cynara_client, client_session, uid, privilege); if (ret != CYNARA_API_ACCESS_ALLOWED) { LOGE("cynara access check [%d] failed!", ret); @@ -207,6 +193,9 @@ out: if (p_cynara) cynara_finish(p_cynara); + if (cynara_client) + free(cynara_client); + return ret; } diff --git a/src/widget_service_manager.cc b/src/widget_service_manager.cc index b9616b0..265ce7d 100644 --- a/src/widget_service_manager.cc +++ b/src/widget_service_manager.cc @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -260,11 +261,9 @@ std::string WidgetServiceManager::GetLangPath() { } int WidgetServiceManager::CheckPrivilege(std::string privilege) { - int fd = 0; int ret = 0; cynara* p_cynara = nullptr; - - char subject_label[SMACK_LABEL_LEN + 1] = ""; + char* cynara_client = nullptr; char uid[10] = {0,}; std::string client_session = ""; @@ -274,33 +273,27 @@ int WidgetServiceManager::CheckPrivilege(std::string privilege) { return -1; } - fd = open("/proc/self/attr/current", O_RDONLY); - if (fd < 0) { - LOGE("open [%d] failed!", errno); - cynara_finish(p_cynara); - return -1; - } + ret = cynara_creds_self_get_client(CLIENT_METHOD_DEFAULT, &cynara_client); + if (ret != CYNARA_API_SUCCESS) { + LOGD("failed to get cynara client : %d", ret); - ret = read(fd, subject_label, SMACK_LABEL_LEN); - if (ret < 0) { - LOGE("read [%d] failed!", errno); - close(fd); cynara_finish(p_cynara); return -1; } - close(fd); snprintf(uid, 10, "%d", getuid()); - ret = cynara_check(p_cynara, subject_label, client_session.c_str(), uid, + ret = cynara_check(p_cynara, cynara_client, client_session.c_str(), uid, privilege.c_str()); if (ret != CYNARA_API_ACCESS_ALLOWED) { LOGE("cynara access check [%d] failed!", ret); cynara_finish(p_cynara); + free(cynara_client); return -1; } cynara_finish(p_cynara); + free(cynara_client); return 0; } diff --git a/unittest/mock/cynara_mock.cc b/unittest/mock/cynara_mock.cc index 7dc3e08..c150dda 100644 --- a/unittest/mock/cynara_mock.cc +++ b/unittest/mock/cynara_mock.cc @@ -30,4 +30,8 @@ extern "C" int cynara_finish(cynara* arg1) { extern "C" int cynara_check(cynara* arg1, const char* arg2, const char* arg3, const char* arg4, const char* arg5) { return MOCK_HOOK_P5(CynaraMock, cynara_check, arg1, arg2, arg3, arg4, arg5); -} \ No newline at end of file +} + +extern "C" int cynara_creds_self_get_client(enum cynara_client_creds arg1, char **arg2) { + return MOCK_HOOK_P2(CynaraMock, cynara_creds_self_get_client, arg1, arg2); +} diff --git a/unittest/mock/cynara_mock.h b/unittest/mock/cynara_mock.h index cdcc962..b90be37 100644 --- a/unittest/mock/cynara_mock.h +++ b/unittest/mock/cynara_mock.h @@ -19,6 +19,7 @@ #include #include +#include #include "module_mock.h" @@ -30,6 +31,7 @@ class CynaraMock : public virtual ModuleMock { MOCK_METHOD1(cynara_finish, int (cynara*)); MOCK_METHOD5(cynara_check, int (cynara*, const char*, const char*, const char*, const char*)); + MOCK_METHOD2(cynara_creds_self_get_client, int (enum cynara_client_creds, char**)); }; #endif // UNIT_TESTS_MOCK_CYNARA_MOCK_H_ \ No newline at end of file diff --git a/unittest/src/test_widget_service.cc b/unittest/src/test_widget_service.cc index 8e718d1..79a6838 100644 --- a/unittest/src/test_widget_service.cc +++ b/unittest/src/test_widget_service.cc @@ -58,6 +58,10 @@ int __fake_cynara_initialize(cynara** cyn, const cynara_configuration* conf) { return CYNARA_API_SUCCESS; } +int __fake_cynara_creds_self_get_client(enum cynara_client_creds method, char **client) { + return CYNARA_API_SUCCESS; +} + int __fake_cynara_check(cynara* cyn, const char* client, const char* client_session, const char* user, const char* privilege) { return CYNARA_API_ACCESS_ALLOWED; @@ -247,6 +251,8 @@ TEST_F(WidgetServiceTest, GetDisabled) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -287,6 +293,8 @@ TEST_F(WidgetServiceTest, SetDisabledEventCallback) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -304,6 +312,8 @@ TEST_F(WidgetServiceTest, UnsetDisabledEventCallback) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -360,6 +370,8 @@ TEST_F(WidgetServiceTest, GetNeedOfMouseEvent) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -378,6 +390,8 @@ TEST_F(WidgetServiceTest, GetNeedOfTouchEffect) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -396,6 +410,8 @@ TEST_F(WidgetServiceTest, GetNeedOfFrame) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -414,6 +430,8 @@ TEST_F(WidgetServiceTest, TriggerUpdate) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -472,6 +490,8 @@ TEST_F(WidgetServiceTest, GetWidgetList) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -512,6 +532,8 @@ TEST_F(WidgetServiceTest, GetMainAppId) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -557,6 +579,8 @@ TEST_F(WidgetServiceTest, GetWidgetListByPkgId) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -585,6 +609,8 @@ TEST_F(WidgetServiceTest, GetWidgetId) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -612,6 +638,8 @@ TEST_F(WidgetServiceTest, GetWidgetId_N) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -649,6 +677,8 @@ TEST_F(WidgetServiceTest, GetAppIdOfSetupApp) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -670,6 +700,8 @@ TEST_F(WidgetServiceTest, GetAppIdOfSetupApp_N) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -696,6 +728,8 @@ TEST_F(WidgetServiceTest, GetPackageId) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -724,6 +758,8 @@ TEST_F(WidgetServiceTest, GetName) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -750,6 +786,8 @@ TEST_F(WidgetServiceTest, GetName2) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -774,6 +812,8 @@ TEST_F(WidgetServiceTest, GetPreviewImagePath) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -808,6 +848,8 @@ TEST_F(WidgetServiceTest, GetIcon) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -836,6 +878,8 @@ TEST_F(WidgetServiceTest, GetNodisplay) { .Times(2) .WillOnce(Invoke(__fake_cynara_initialize)) .WillOnce(Return(1)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -861,6 +905,8 @@ TEST_F(WidgetServiceTest, GetSupportedSizes) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -884,6 +930,8 @@ TEST_F(WidgetServiceTest, GetSupportedSizes_N) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -905,6 +953,8 @@ TEST_F(WidgetServiceTest, GetSupportedSizeTypes) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -926,6 +976,8 @@ TEST_F(WidgetServiceTest, GetSupportedSizeTypes_N1) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -958,6 +1010,8 @@ TEST_F(WidgetServiceTest, GetInstanceList) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -1036,6 +1090,8 @@ TEST_F(WidgetServiceTest, GetWidgetMaxCount) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_)) @@ -1055,6 +1111,8 @@ TEST_F(WidgetServiceTest, GetInstanceCount) { .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); EXPECT_CALL(GetMock(), cynara_initialize(_, _)) .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock(), cynara_creds_self_get_client(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_creds_self_get_client)); EXPECT_CALL(GetMock(), cynara_check(_, _, _, _, _)) .WillRepeatedly(Invoke(__fake_cynara_check)); EXPECT_CALL(GetMock(), cynara_finish(_))