From: Hanish Mehla Date: Fri, 22 Sep 2023 07:37:47 +0000 (+0530) Subject: [UTC][fido-client][ACR-1778] Remove TCs for deprecated fido-client APIs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F299236%2F2;p=test%2Ftct%2Fnative%2Fapi.git [UTC][fido-client][ACR-1778] Remove TCs for deprecated fido-client APIs Change-Id: Ic445d86151259e712dc7f0d08b635f342aae320b --- diff --git a/packaging/utc/core-fido-client-tests.spec b/packaging/utc/core-fido-client-tests.spec deleted file mode 100755 index 62de92081..000000000 --- a/packaging/utc/core-fido-client-tests.spec +++ /dev/null @@ -1,90 +0,0 @@ -%define MODULE_NAME fido-client -%define MODULE_LIBNAME fido-client -Name: core-%{MODULE_NAME}-tests -Summary: Core API unit TC (%{name}) -Version: 0.1 -Release: 0 -Group: Development/Tools -License: Apache License, Version 2.0, Samsung Properietary -Source0: %{name}-%{version}.tar.gz - -%if "%{?profile}" == "tv" -ExcludeArch: %{arm} %ix86 x86_64 -%endif - -BuildRequires: cmake -BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(capi-system-info) -BuildRequires: pkgconfig(accounts-svc) -BuildRequires: pkgconfig(bundle) -BuildRequires: pkgconfig(capi-appfw-package-manager) -BuildRequires: pkgconfig(capi-base-common) -BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(json-glib-1.0) -BuildRequires: pkgconfig(fido-client) -BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(capi-system-info) -Requires : fido-client - -%description -Core API unit TC (%{name}) - -%prep -%setup -q - -%build - -%define PREFIX "%{_libdir}/%{name}" - -export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed" - -%if %{?ASAN_BUILD:1}0 - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%else - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%endif - -make %{?jobs:-j%jobs} - -%install -rm -rf %{buildroot} -%make_install -mkdir -p %{buildroot}/usr/share/license -cp LICENSE %{buildroot}/usr/share/license/%{name} -mkdir -p %{buildroot}/usr/share/packages/ -cp packaging/utc/%{name}.xml %{buildroot}/usr/share/packages/ -mkdir -p %{buildroot}/usr/apps/%{name}/bin -#cp templates/external_wrapper.sh %{buildroot}/usr/apps/%{name}/bin -%post - -%postun - - -%files -/usr/apps/%{name}/* -/usr/share/packages/%{name}.xml -/usr/share/license/%{name} diff --git a/packaging/utc/core-fido-client-tests.xml b/packaging/utc/core-fido-client-tests.xml deleted file mode 100755 index 47642367c..000000000 --- a/packaging/utc/core-fido-client-tests.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - test - Core API test Application - - - - - - - - - - http://tizen.org/privilege/fido.client - - diff --git a/src/utc/fido-client/CMakeLists.txt b/src/utc/fido-client/CMakeLists.txt deleted file mode 100644 index 791600e4b..000000000 --- a/src/utc/fido-client/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -SET(PKG_NAME "fido-client") - -SET(EXEC_NAME "tct-${PKG_NAME}-core") -SET(RPM_NAME "core-${PKG_NAME}-tests") - -SET(CAPI_LIB "fido-client") -SET(TC_SOURCES - utc-fido-client.c -) - -PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED - capi-appfw-application - capi-system-info - capi-appfw-package-manager - capi-base-common - bundle - glib-2.0 - dlog -) - -INCLUDE_DIRECTORIES( - ${${CAPI_LIB}_INCLUDE_DIRS} -) - -ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE}) -TARGET_LINK_LIBRARIES(${EXEC_NAME} - ${${CAPI_LIB}_LIBRARIES} - fido-client -) - -INSTALL(PROGRAMS ${EXEC_NAME} - DESTINATION ${BIN_DIR}/${RPM_NAME}/bin -) - -IF( DEFINED ASAN ) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address") -ELSE() -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") -ENDIF() diff --git a/src/utc/fido-client/public.list b/src/utc/fido-client/public.list deleted file mode 100755 index e5bddb565..000000000 --- a/src/utc/fido-client/public.list +++ /dev/null @@ -1,18 +0,0 @@ -fido_uaf_is_supported -fido_uaf_get_response_message -fido_uaf_set_server_result -fido_foreach_authenticator -fido_authenticator_get_title -fido_authenticator_get_aaid -fido_authenticator_get_description -fido_authenticator_get_assertion_scheme -fido_authenticator_get_algorithm -fido_authenticator_foreach_attestation_type -fido_authenticator_get_verification_method -fido_authenticator_get_key_protection_method -fido_authenticator_get_matcher_protection_method -fido_authenticator_get_attachment_hint -fido_authenticator_get_is_second_factor_only -fido_authenticator_get_tc_discplay -fido_authenticator_get_tc_display_type -fido_authenticator_get_icon diff --git a/src/utc/fido-client/tct-fido-client-core.c b/src/utc/fido-client/tct-fido-client-core.c deleted file mode 100644 index acf42ea42..000000000 --- a/src/utc/fido-client/tct-fido-client-core.c +++ /dev/null @@ -1,140 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include -#include -#include "tct_common.h" - -#ifdef MOBILE -#include "tct-fido-client-core_mobile.h" -#endif // MOBILE -#ifdef WEARABLE -#include "tct-fido-client-core_wearable.h" -#endif // WEARABLE -#ifdef TIZENIOT -#include "tct-fido-client-core_tizeniot.h" -#endif //TIZENIOT -#ifdef TV -#include "tct-fido-client-core_tv.h" -#endif // TV - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - - - - - - - -static bool app_create(void *data) -{ - return true; -} - -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { - DUMP_UTC_ERRLOG(); - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName); - if ( tc_array[i].startup ) - { - tc_array[i].startup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName); - if ( tc_array[i].cleanup ) - { - tc_array[i].cleanup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName); - - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; - } - } - - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; -} - -static void app_terminate(void *data) -{ - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); -} - -int main(int argc, char *argv[]) -{ - int ret = 0; - - - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - //setting gcda file location for coverage - setenv("GCOV_PREFIX","/tmp",1); - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, NULL); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; - } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} diff --git a/src/utc/fido-client/tct-fido-client-core_mobile.h b/src/utc/fido-client/tct-fido-client-core_mobile.h deleted file mode 100755 index d3d063224..000000000 --- a/src/utc/fido-client/tct-fido-client-core_mobile.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef __TCT_FIDO-CLIENT-NATIVE_H__ -#define __TCT_FIDO-CLIENT-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void utc_fido_client_startup(void); -extern void utc_fido_client_cleanup(void); - -extern int utc_fido_client_get_client_vendor_p(void); -extern int utc_fido_client_get_client_vendor_n(void); -extern int utc_fido_client_get_client_version_p(void); -extern int utc_fido_client_get_client_version_n(void); -extern int utc_fido_client_uaf_is_supported_p(void); -extern int utc_fido_client_uaf_is_supported_n(void); -extern int utc_fido_client_uaf_get_response_message_n1(void); -extern int utc_fido_client_uaf_get_response_message_n2(void); -extern int utc_fido_client_uaf_set_server_result_n(void); -extern int utc_fido_client_foreach_authenticator_n(void); -extern int utc_fido_client_authenticator_get_title_n(void); -extern int utc_fido_client_authenticator_get_aaid_n(void); -extern int utc_fido_client_authenticator_get_description_n(void); -extern int utc_fido_client_authenticator_get_assertion_scheme_n(void); -extern int utc_fido_client_authenticator_get_algorithm_n(void); -extern int utc_fido_client_authenticator_foreach_attestation_type_n(void); -extern int utc_fido_client_authenticator_get_verification_method_n(void); -extern int utc_fido_client_authenticator_get_key_protection_method_n(void); -extern int utc_fido_client_authenticator_get_matcher_protection_method_n(void); -extern int utc_fido_client_authenticator_get_attachment_hint_n(void); -extern int utc_fido_client_authenticator_get_is_second_factor_only_p(void); -extern int utc_fido_client_authenticator_get_tc_discplay_n(void); -extern int utc_fido_client_authenticator_get_tc_display_type_n(void); -extern int utc_fido_client_authenticator_get_icon_n(void); -extern int utc_fido_client_foreach_authenticator_p(void); - -testcase tc_array[] = { - {"utc_fido_client_get_client_vendor_p",utc_fido_client_get_client_vendor_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_vendor_n",utc_fido_client_get_client_vendor_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_version_p",utc_fido_client_get_client_version_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_version_n",utc_fido_client_get_client_version_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_is_supported_p",utc_fido_client_uaf_is_supported_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_is_supported_n",utc_fido_client_uaf_is_supported_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_get_response_message_n1",utc_fido_client_uaf_get_response_message_n1,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_get_response_message_n2",utc_fido_client_uaf_get_response_message_n2,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_set_server_result_n",utc_fido_client_uaf_set_server_result_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_foreach_authenticator_n",utc_fido_client_foreach_authenticator_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_title_n",utc_fido_client_authenticator_get_title_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_aaid_n",utc_fido_client_authenticator_get_aaid_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_description_n",utc_fido_client_authenticator_get_description_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_assertion_scheme_n",utc_fido_client_authenticator_get_assertion_scheme_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_algorithm_n",utc_fido_client_authenticator_get_algorithm_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_foreach_attestation_type_n",utc_fido_client_authenticator_foreach_attestation_type_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_verification_method_n",utc_fido_client_authenticator_get_verification_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_key_protection_method_n",utc_fido_client_authenticator_get_key_protection_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_matcher_protection_method_n",utc_fido_client_authenticator_get_matcher_protection_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_attachment_hint_n",utc_fido_client_authenticator_get_attachment_hint_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_is_second_factor_only_p",utc_fido_client_authenticator_get_is_second_factor_only_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_tc_discplay_n",utc_fido_client_authenticator_get_tc_discplay_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_tc_display_type_n",utc_fido_client_authenticator_get_tc_display_type_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_icon_n",utc_fido_client_authenticator_get_icon_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_foreach_authenticator_p",utc_fido_client_foreach_authenticator_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_FIDO-CLIENT-NATIVE_H__ diff --git a/src/utc/fido-client/tct-fido-client-core_tizeniot.h b/src/utc/fido-client/tct-fido-client-core_tizeniot.h deleted file mode 100755 index d3d063224..000000000 --- a/src/utc/fido-client/tct-fido-client-core_tizeniot.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef __TCT_FIDO-CLIENT-NATIVE_H__ -#define __TCT_FIDO-CLIENT-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void utc_fido_client_startup(void); -extern void utc_fido_client_cleanup(void); - -extern int utc_fido_client_get_client_vendor_p(void); -extern int utc_fido_client_get_client_vendor_n(void); -extern int utc_fido_client_get_client_version_p(void); -extern int utc_fido_client_get_client_version_n(void); -extern int utc_fido_client_uaf_is_supported_p(void); -extern int utc_fido_client_uaf_is_supported_n(void); -extern int utc_fido_client_uaf_get_response_message_n1(void); -extern int utc_fido_client_uaf_get_response_message_n2(void); -extern int utc_fido_client_uaf_set_server_result_n(void); -extern int utc_fido_client_foreach_authenticator_n(void); -extern int utc_fido_client_authenticator_get_title_n(void); -extern int utc_fido_client_authenticator_get_aaid_n(void); -extern int utc_fido_client_authenticator_get_description_n(void); -extern int utc_fido_client_authenticator_get_assertion_scheme_n(void); -extern int utc_fido_client_authenticator_get_algorithm_n(void); -extern int utc_fido_client_authenticator_foreach_attestation_type_n(void); -extern int utc_fido_client_authenticator_get_verification_method_n(void); -extern int utc_fido_client_authenticator_get_key_protection_method_n(void); -extern int utc_fido_client_authenticator_get_matcher_protection_method_n(void); -extern int utc_fido_client_authenticator_get_attachment_hint_n(void); -extern int utc_fido_client_authenticator_get_is_second_factor_only_p(void); -extern int utc_fido_client_authenticator_get_tc_discplay_n(void); -extern int utc_fido_client_authenticator_get_tc_display_type_n(void); -extern int utc_fido_client_authenticator_get_icon_n(void); -extern int utc_fido_client_foreach_authenticator_p(void); - -testcase tc_array[] = { - {"utc_fido_client_get_client_vendor_p",utc_fido_client_get_client_vendor_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_vendor_n",utc_fido_client_get_client_vendor_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_version_p",utc_fido_client_get_client_version_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_version_n",utc_fido_client_get_client_version_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_is_supported_p",utc_fido_client_uaf_is_supported_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_is_supported_n",utc_fido_client_uaf_is_supported_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_get_response_message_n1",utc_fido_client_uaf_get_response_message_n1,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_get_response_message_n2",utc_fido_client_uaf_get_response_message_n2,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_set_server_result_n",utc_fido_client_uaf_set_server_result_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_foreach_authenticator_n",utc_fido_client_foreach_authenticator_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_title_n",utc_fido_client_authenticator_get_title_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_aaid_n",utc_fido_client_authenticator_get_aaid_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_description_n",utc_fido_client_authenticator_get_description_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_assertion_scheme_n",utc_fido_client_authenticator_get_assertion_scheme_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_algorithm_n",utc_fido_client_authenticator_get_algorithm_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_foreach_attestation_type_n",utc_fido_client_authenticator_foreach_attestation_type_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_verification_method_n",utc_fido_client_authenticator_get_verification_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_key_protection_method_n",utc_fido_client_authenticator_get_key_protection_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_matcher_protection_method_n",utc_fido_client_authenticator_get_matcher_protection_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_attachment_hint_n",utc_fido_client_authenticator_get_attachment_hint_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_is_second_factor_only_p",utc_fido_client_authenticator_get_is_second_factor_only_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_tc_discplay_n",utc_fido_client_authenticator_get_tc_discplay_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_tc_display_type_n",utc_fido_client_authenticator_get_tc_display_type_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_icon_n",utc_fido_client_authenticator_get_icon_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_foreach_authenticator_p",utc_fido_client_foreach_authenticator_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_FIDO-CLIENT-NATIVE_H__ diff --git a/src/utc/fido-client/tct-fido-client-core_wearable.h b/src/utc/fido-client/tct-fido-client-core_wearable.h deleted file mode 100755 index d3d063224..000000000 --- a/src/utc/fido-client/tct-fido-client-core_wearable.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef __TCT_FIDO-CLIENT-NATIVE_H__ -#define __TCT_FIDO-CLIENT-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void utc_fido_client_startup(void); -extern void utc_fido_client_cleanup(void); - -extern int utc_fido_client_get_client_vendor_p(void); -extern int utc_fido_client_get_client_vendor_n(void); -extern int utc_fido_client_get_client_version_p(void); -extern int utc_fido_client_get_client_version_n(void); -extern int utc_fido_client_uaf_is_supported_p(void); -extern int utc_fido_client_uaf_is_supported_n(void); -extern int utc_fido_client_uaf_get_response_message_n1(void); -extern int utc_fido_client_uaf_get_response_message_n2(void); -extern int utc_fido_client_uaf_set_server_result_n(void); -extern int utc_fido_client_foreach_authenticator_n(void); -extern int utc_fido_client_authenticator_get_title_n(void); -extern int utc_fido_client_authenticator_get_aaid_n(void); -extern int utc_fido_client_authenticator_get_description_n(void); -extern int utc_fido_client_authenticator_get_assertion_scheme_n(void); -extern int utc_fido_client_authenticator_get_algorithm_n(void); -extern int utc_fido_client_authenticator_foreach_attestation_type_n(void); -extern int utc_fido_client_authenticator_get_verification_method_n(void); -extern int utc_fido_client_authenticator_get_key_protection_method_n(void); -extern int utc_fido_client_authenticator_get_matcher_protection_method_n(void); -extern int utc_fido_client_authenticator_get_attachment_hint_n(void); -extern int utc_fido_client_authenticator_get_is_second_factor_only_p(void); -extern int utc_fido_client_authenticator_get_tc_discplay_n(void); -extern int utc_fido_client_authenticator_get_tc_display_type_n(void); -extern int utc_fido_client_authenticator_get_icon_n(void); -extern int utc_fido_client_foreach_authenticator_p(void); - -testcase tc_array[] = { - {"utc_fido_client_get_client_vendor_p",utc_fido_client_get_client_vendor_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_vendor_n",utc_fido_client_get_client_vendor_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_version_p",utc_fido_client_get_client_version_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_get_client_version_n",utc_fido_client_get_client_version_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_is_supported_p",utc_fido_client_uaf_is_supported_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_is_supported_n",utc_fido_client_uaf_is_supported_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_get_response_message_n1",utc_fido_client_uaf_get_response_message_n1,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_get_response_message_n2",utc_fido_client_uaf_get_response_message_n2,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_uaf_set_server_result_n",utc_fido_client_uaf_set_server_result_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_foreach_authenticator_n",utc_fido_client_foreach_authenticator_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_title_n",utc_fido_client_authenticator_get_title_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_aaid_n",utc_fido_client_authenticator_get_aaid_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_description_n",utc_fido_client_authenticator_get_description_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_assertion_scheme_n",utc_fido_client_authenticator_get_assertion_scheme_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_algorithm_n",utc_fido_client_authenticator_get_algorithm_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_foreach_attestation_type_n",utc_fido_client_authenticator_foreach_attestation_type_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_verification_method_n",utc_fido_client_authenticator_get_verification_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_key_protection_method_n",utc_fido_client_authenticator_get_key_protection_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_matcher_protection_method_n",utc_fido_client_authenticator_get_matcher_protection_method_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_attachment_hint_n",utc_fido_client_authenticator_get_attachment_hint_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_is_second_factor_only_p",utc_fido_client_authenticator_get_is_second_factor_only_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_tc_discplay_n",utc_fido_client_authenticator_get_tc_discplay_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_tc_display_type_n",utc_fido_client_authenticator_get_tc_display_type_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_authenticator_get_icon_n",utc_fido_client_authenticator_get_icon_n,utc_fido_client_startup,utc_fido_client_cleanup}, - {"utc_fido_client_foreach_authenticator_p",utc_fido_client_foreach_authenticator_p,utc_fido_client_startup,utc_fido_client_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_FIDO-CLIENT-NATIVE_H__ diff --git a/src/utc/fido-client/utc-fido-client.c b/src/utc/fido-client/utc-fido-client.c deleted file mode 100755 index feb29edb4..000000000 --- a/src/utc/fido-client/utc-fido-client.c +++ /dev/null @@ -1,838 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "assert.h" -#include -#include -#include -#include - -#define STRING_SIZE_1024 1024 -#define STRING_SIZE_5000 5000 - -#define FIDO_CLIENT_UTC_LOG_TAG "NativeTCT" - -#define FIDO_CLIENT_UTC_LOG_RED "\033[0;31m" -#define FIDO_CLIENT_UTC_LOG_GREEN "\033[0;32m" -#define FIDO_CLIENT_UTC_LOG_END "\033[0;m" - -#define FIDO_CLIENT_UTC_INFO(fmt, arg...) \ - do { \ - dlog_print(DLOG_INFO, FIDO_CLIENT_UTC_LOG_TAG, FIDO_CLIENT_UTC_LOG_GREEN "[%s][Line : %d] " fmt FIDO_CLIENT_UTC_LOG_END, __FILE__, __LINE__, ##arg); \ - } while (0) - -#define FN_CALL \ - do { \ - dlog_print(DLOG_INFO, FIDO_CLIENT_UTC_LOG_TAG, FIDO_CLIENT_UTC_LOG_GREEN "[%s][Line : %d] %s >>>>>>> called " FIDO_CLIENT_UTC_LOG_END, __FILE__, __LINE__, __FUNCTION__); \ - } while (0) - -#define FIDO_CLIENT_UTC_ERR(fmt, arg...) \ - do { \ - dlog_print(DLOG_ERROR, FIDO_CLIENT_UTC_LOG_TAG, FIDO_CLIENT_UTC_LOG_RED "[%s][Line : %d] " fmt FIDO_CLIENT_UTC_LOG_END, __FILE__, __LINE__, ##arg); \ - } while (0) - -#define FIDO_CLIENT_UTC_ERR_CMP(var, ref) \ - if (var != ref) { \ - fprintf(stderr, \ - "\\n[%s][Line : %d] Fail: Values (%s == 0x%x) and (%s == 0x%x)\\n", \ - __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \ - dlog_print(DLOG_ERROR, FIDO_CLIENT_UTC_LOG_TAG, \ - FIDO_CLIENT_UTC_LOG_RED "\\n[%s:%d] Fail: Values (%s == 0x%x) and (%s == 0x%x)\\n" FIDO_CLIENT_UTC_LOG_END, \ - __FILE__, __LINE__, #var, (int)var, #ref, (int)ref); \ - } while (0) - -#define FIDO_CLIENT_UTC_ASSERT_EQ(var, ref) \ - if (var != ref) { \ - dlog_print(DLOG_ERROR, FIDO_CLIENT_UTC_LOG_TAG, \ - FIDO_CLIENT_UTC_LOG_RED "(%s == 0x%x) and (%s == 0x%x) are not equal" FIDO_CLIENT_UTC_LOG_END, \ - #var, (int)var, #ref, (int)ref); \ - assert_eq(var, ref); \ - } while (0) - - -#define FIDO_CLIENT_UTC_ASSERT_NEQ(var, ref) \ - if (var == ref) { \ - dlog_print(DLOG_ERROR, FIDO_CLIENT_UTC_LOG_TAG, \ - FIDO_CLIENT_UTC_LOG_RED "(%s == 0x%x) and (%s == 0x%x) are equal" FIDO_CLIENT_UTC_LOG_END, \ - #var, (int)var, #ref, (int)ref); \ - assert_neq(var, ref); \ - } while (0) - -#define FIDO_CLIENT_UTC_ASSERT_NULL(var) \ - if (NULL == var) { \ - dlog_print(DLOG_ERROR, FIDO_CLIENT_UTC_LOG_TAG, \ - FIDO_CLIENT_UTC_LOG_RED "%s is NULL" FIDO_CLIENT_UTC_LOG_END, #var); \ - assert(var); \ - } while (0) - -//& set: Fido -#define FIDO_FREE(ptr) \ - if (ptr != NULL) { \ - free(ptr); \ - ptr = NULL; \ - } - -static GMainLoop *g_pMainLoop; -static guint g_nTimeoutId; -static int g_CallbackRet = FIDO_ERROR_NONE; -static bool g_feature = true; -bool g_bProcessCallback; - -#define JSON_INVALID_STRING "\{\"improperjson\": []}" -#define CLIENT_VENDOR "samsung" -#define GMAINTIMEOUT 1000 -#define MAJOR_VERSION 1 -#define MINOR_VERSION 0 - -#define RUN_GMAIN_LOOP {\ - g_pMainLoop = g_main_loop_new(NULL, false);\ - g_nTimeoutId = g_timeout_add(GMAINTIMEOUT, _fido_callback_timeout, g_pMainLoop);\ - g_main_loop_run(g_pMainLoop);\ - g_source_remove(g_nTimeoutId);\ - g_pMainLoop = NULL;\ -} - -#define QUIT_GMAIN_LOOP {\ - if (g_pMainLoop) {\ - g_main_loop_quit(g_pMainLoop);\ - g_main_loop_unref(g_pMainLoop);\ - g_pMainLoop = NULL;\ - }\ -} - -static char * -__get_error_code(fido_error_e error_code) -{ - - char *error_str = calloc(1, 128); - - if(error_code == FIDO_ERROR_NONE) - strcpy(error_str, "SUCCESS"); - else if (error_code == FIDO_ERROR_OUT_OF_MEMORY) - strcpy(error_str, "FIDO_ERROR_OUT_OF_MEMORY"); - else if (error_code == FIDO_ERROR_INVALID_PARAMETER) - strcpy(error_str, "FIDO_ERROR_INVALID_PARAMETER"); - else if (error_code == FIDO_ERROR_NO_DATA) - strcpy(error_str, "FIDO_ERROR_NO_DATA"); - else if (error_code == FIDO_ERROR_PERMISSION_DENIED) - strcpy(error_str, "FIDO_ERROR_PERMISSION_DENIED"); - else if (error_code == FIDO_ERROR_NOT_SUPPORTED) - strcpy(error_str, "FIDO_ERROR_NOT_SUPPORTED"); - else if (error_code == FIDO_ERROR_USER_ACTION_IN_PROGRESS) - strcpy(error_str, "FIDO_ERROR_USER_ACTION_IN_PROGRESS"); - else if (error_code == FIDO_ERROR_USER_CANCELLED) - strcpy(error_str, "FIDO_ERROR_USER_CANCELLED"); - else if (error_code == FIDO_ERROR_UNSUPPORTED_VERSION) - strcpy(error_str, "FIDO_ERROR_UNSUPPORTED_VERSION"); - else if (error_code == FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR) - strcpy(error_str, "FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR"); - else if (error_code == FIDO_ERROR_PROTOCOL_ERROR) - strcpy(error_str, "FIDO_ERROR_PROTOCOL_ERROR"); - else if (error_code == FIDO_ERROR_UNTRUSTED_FACET_ID) - strcpy(error_str, "FIDO_ERROR_UNTRUSTED_FACET_ID"); - else - strcpy(error_str, "FIDO_ERROR_UNKNOWN"); - return error_str; -} - -static void fido_uaf_get_response_message_callback(fido_error_e tizen_error_code, const char *uaf_response, void *user_data) -{ - g_CallbackRet = tizen_error_code; - QUIT_GMAIN_LOOP; -} - -gboolean _fido_callback_timeout(gpointer data) -{ - GMainLoop* pMainLoop = (GMainLoop *)data; - g_CallbackRet = FIDO_ERROR_UNKNOWN; - if( pMainLoop != NULL ) - { - g_main_loop_quit(pMainLoop); - g_main_loop_unref(pMainLoop); - pMainLoop = NULL; - } - return false; -} - -/** - * @function utc_fido_client_startup - * @description Called before each test - * @parameter NA - * @return NA - */ -void utc_fido_client_startup(void) -{ - int ret = system_info_get_platform_bool("http://tizen.org/feature/fido.uaf", &g_feature); - if (SYSTEM_INFO_ERROR_NONE != ret) { - FIDO_CLIENT_UTC_ERR("system_info_get_platform_bool() Fail(%d)", ret); - return; - } - - // Launch fido-asm service daemon in advance - ret = FIDO_ERROR_NONE; - bool is_supported = true; - - ret = fido_uaf_is_supported(JSON_INVALID_STRING, &is_supported); - if(!g_feature) { - assert_eq_no_return(ret, FIDO_ERROR_NOT_SUPPORTED); - return ; - } - - assert_eq_no_return(ret, FIDO_ERROR_NONE); - assert_eq_no_return(is_supported, false); - - return ; -} - -/** - * @function utc_fido_client_cleanup - * @description Called before each test - * @parameter NA - * @return NA - */ -void utc_fido_client_cleanup(void) -{ -} - -/** - * @testcase utc_fido_client_get_client_vendor_p - * @since_tizen 3.0 - * @description Test gettting fido client vendor. - */ -int utc_fido_client_get_client_vendor_p(void) -{ - int ret = FIDO_ERROR_NONE; - char *vendor = NULL; - - ret = fido_get_client_vendor(&vendor); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_NONE); - assert_eq(strcmp(CLIENT_VENDOR, vendor), 0); - - return 0; -} - -/** - * @testcase utc_fido_client_get_client_vendor_n - * @since_tizen 3.0 - * @description Test fail getting fido client vendor with invalid parameter. - */ -int utc_fido_client_get_client_vendor_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_get_client_vendor(NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_get_client_version_p - * @since_tizen 3.0 - * @description Test gettting fido client version. - */ -int utc_fido_client_get_client_version_p(void) -{ - int ret = FIDO_ERROR_NONE; - int major_version = -1; - int minor_version = -1; - - ret = fido_get_client_version(&major_version, &minor_version); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_NONE); - assert_eq(major_version, MAJOR_VERSION); - assert_eq(minor_version, MINOR_VERSION); - - return 0; -} - -/** - * @testcase utc_fido_client_get_client_version_n - * @since_tizen 3.0 - * @description Test fail getting fido client version with invalid parameter. - */ -int utc_fido_client_get_client_version_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_get_client_version(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_uaf_is_supported_p - * @since_tizen 3.0 - * @description Test if uaf is supported. - */ -int utc_fido_client_uaf_is_supported_p(void) -{ - int ret = FIDO_ERROR_NONE; - bool is_supported = true; - - ret = fido_uaf_is_supported(JSON_INVALID_STRING, &is_supported); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_NONE); - assert_eq(is_supported, false); - - return 0; -} - -/** - * @testcase utc_fido_client_uaf_is_supported_n - * @since_tizen 3.0 - * @description Test fail if uaf is supported with invalid parameter. - */ -int utc_fido_client_uaf_is_supported_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_uaf_is_supported(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_uaf_get_response_message_n1 - * @since_tizen 3.0 - * @description Test fail getting fido client uaf response message with invalid parameter. - */ -int utc_fido_client_uaf_get_response_message_n1(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_uaf_get_response_message(NULL, NULL, NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_uaf_get_response_message_n2 - * @since_tizen 3.0 - * @description Test fail getting fido client uaf response message with invalid JSON string. - */ -int utc_fido_client_uaf_get_response_message_n2(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_uaf_get_response_message(JSON_INVALID_STRING, NULL, fido_uaf_get_response_message_callback, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_NONE); - RUN_GMAIN_LOOP - assert_eq(g_CallbackRet, FIDO_ERROR_PROTOCOL_ERROR); - - g_CallbackRet = FIDO_ERROR_NONE; - - return 0; -} - -/** - * @testcase utc_fido_client_uaf_set_server_result_n - * @since_tizen 3.0 - * @description Test fail setting fido client uaf server result with invalid parameter. - */ -int utc_fido_client_uaf_set_server_result_n(void) -{ - int ret = FIDO_ERROR_NONE; - int set_val = 0; - - ret = fido_uaf_set_server_result(set_val, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_foreach_authenticator_n - * @since_tizen 3.0 - * @description Test fail fido client foreach authenticator with invalid parameter. - */ -int utc_fido_client_foreach_authenticator_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_foreach_authenticator(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_title_n - * @since_tizen 3.0 - * @description Test fail getting authenticator title with invalid parameter. - */ -int utc_fido_client_authenticator_get_title_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_title(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_aaid_n - * @since_tizen 3.0 - * @description Test fail getting authenticator aaid with invalid parameter. - */ -int utc_fido_client_authenticator_get_aaid_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_aaid(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_description_n - * @since_tizen 3.0 - * @description Test fail getting authenticator description with invalid parameter. - */ -int utc_fido_client_authenticator_get_description_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_description(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_assertion_scheme_n - * @since_tizen 3.0 - * @description Test fail getting authenticator assertion scheme with invalid parameter. - */ -int utc_fido_client_authenticator_get_assertion_scheme_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_assertion_scheme(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_algorithm_n - * @since_tizen 3.0 - * @description Test fail getting authenticator algorithm with invalid parameter. - */ -int utc_fido_client_authenticator_get_algorithm_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_algorithm(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_foreach_attestation_type_n - * @since_tizen 3.0 - * @description Test fail authenticator foreach attestation with invalid parameter. - */ -int utc_fido_client_authenticator_foreach_attestation_type_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_foreach_attestation_type(NULL, NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_verification_method_n - * @since_tizen 3.0 - * @description Test fail getting authenticator verification method with invalid parameter. - */ -int utc_fido_client_authenticator_get_verification_method_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_verification_method(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_key_protection_method_n - * @since_tizen 3.0 - * @description Test fail getting authenticator key protection method with invalid parameter. - */ -int utc_fido_client_authenticator_get_key_protection_method_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_key_protection_method(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_matcher_protection_method_n - * @since_tizen 3.0 - * @description Test fail getting authenticator matcher protection method with invalid parameter. - */ -int utc_fido_client_authenticator_get_matcher_protection_method_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_matcher_protection_method(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_attachment_hint_n - * @since_tizen 3.0 - * @description Test fail getting fido client authenticator attachment hint with invalid parameter. - */ -int utc_fido_client_authenticator_get_attachment_hint_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_attachment_hint(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_is_second_factor_only_p - * @since_tizen 3.0 - * @description Test getting fido client authenticator is second factor only. - */ -int utc_fido_client_authenticator_get_is_second_factor_only_p(void) -{ - - bool ret = fido_authenticator_get_is_second_factor_only(NULL); - assert_eq(ret, false); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_tc_discplay_n - * @since_tizen 3.0 - * @description Test fail getting fido client authenticator tc display with invalid parameter. - */ -int utc_fido_client_authenticator_get_tc_discplay_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_tc_discplay(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_tc_display_type_n - * @since_tizen 3.0 - * @description Test fail getting fido client authenticator tc display type with invalid parameter. - */ -int utc_fido_client_authenticator_get_tc_display_type_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_tc_display_type(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_client_authenticator_get_icon_n - * @since_tizen 3.0 - * @description Test fail getting fido client authenticator icon with invalid parameter. - */ -int utc_fido_client_authenticator_get_icon_n(void) -{ - int ret = FIDO_ERROR_NONE; - - ret = fido_authenticator_get_icon(NULL, NULL); - if(!g_feature) { - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, FIDO_ERROR_INVALID_PARAMETER); - - return 0; -} - -/** - * @testcase utc_fido_foreach_authenticator_p - * @since_tizen 3.0 - * @description Test success fido client find authenticators - */ -void fido_attestation_type_cb_list(fido_auth_attestation_type_e att_type, void *user_data) -{ - int *res = (int*)user_data; - *res = 0; - - if (att_type == -1) { - *res = 1; - } - return; -} - -static int -__get_authinfo_string(const fido_authenticator_h auth) -{ - char *title = NULL; - fido_authenticator_get_title(auth, &title); - if (!title) { - return false; - } - free(title); - - char *aaid = NULL; - fido_authenticator_get_aaid(auth, &aaid); - if (!aaid) { - return false; - } - free(aaid); - - char *description = NULL; - fido_authenticator_get_description(auth, &description); - if (!description) { - return false; - } - free(description); - - char *scheme = NULL; - fido_authenticator_get_assertion_scheme(auth, &scheme); - if (!scheme) { - return false; - } - free(scheme); - - int *res = (int*)calloc(1, 4); - *res = 0; - - fido_authenticator_foreach_attestation_type(auth, fido_attestation_type_cb_list, res); - if(*res == 1) { - goto error; - } - - fido_auth_algo_e get_algo = -1; - fido_authenticator_get_algorithm(auth, &get_algo); - if (get_algo == -1) { - goto error ; - } - - fido_auth_user_verify_type_e user_ver = -1; - fido_authenticator_get_verification_method(auth, &user_ver); - if (user_ver == -1) { - goto error; - } - - fido_auth_key_protection_type_e key_protection = -1; - fido_authenticator_get_key_protection_method(auth, &key_protection); - if (key_protection == -1) { - goto error ; - } - - fido_auth_matcher_protection_type_e matcher_protection = -1; - fido_authenticator_get_matcher_protection_method(auth, &matcher_protection); - if (matcher_protection == -1) { - goto error ; - } - - fido_auth_attachment_hint_e attachment_hint = -1; - fido_authenticator_get_attachment_hint(auth, &attachment_hint); - if (attachment_hint == -1) { - goto error ; - } - - fido_auth_tc_display_type_e tc_discplay = -1; - fido_authenticator_get_tc_discplay(auth, &tc_discplay); - if (tc_discplay == -1) { - goto error ; - } - - char *tc_display_type = NULL; - fido_authenticator_get_tc_display_type(auth, &tc_display_type); - if (!tc_display_type) { - goto error ; - } - free(tc_display_type); - - char *icon = NULL; - fido_authenticator_get_icon(auth, &icon); - if (!icon) { - goto error ; - } - free(icon); - free(res); - return true; - -error: - free(res); - return false; -} - -static void -auth_list_cb(const fido_authenticator_h auth, void *user_data) -{ - int *res = (int*)user_data; - *res = 0; - - int ret = __get_authinfo_string(auth); - - if(ret == false) - *res = 1; - return; -} - -int utc_fido_client_foreach_authenticator_p(void) -{ - - int *res = (int*)calloc(1, 4); - *res = 0; - - int ret = fido_foreach_authenticator(auth_list_cb, res); - if(!g_feature) { - free(res); - assert_eq(ret, FIDO_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(ret, 0); - assert_eq(*res, 0); - free(res); - return 0; -} diff --git a/tct_unsupported.txt b/tct_unsupported.txt index 52e4d7dc6..a0a73c40b 100755 --- a/tct_unsupported.txt +++ b/tct_unsupported.txt @@ -247,7 +247,6 @@ tv:armv7l:utc:messages; tv:armv7l:utc:context; tv:armv7l:utc:sync-manager; tv:armv7l:utc:oauth2; -tv:armv7l:utc:fido-client; tv:armv7l:utc:softap; tv:armv7l:utc:stc; tv:armv7l:utc:asp;