diff --git a/test/fuzztest/executors/userauthdrivermanager_fuzzer/user_auth_driver_manager_fuzzer.cpp b/test/fuzztest/executors/userauthdrivermanager_fuzzer/user_auth_driver_manager_fuzzer.cpp index 85dbbb58d26bbec31f44ac022749a33fe22b7786..7cf98d903c6e890a39c5ef5030e826c787521bc3 100644 --- a/test/fuzztest/executors/userauthdrivermanager_fuzzer/user_auth_driver_manager_fuzzer.cpp +++ b/test/fuzztest/executors/userauthdrivermanager_fuzzer/user_auth_driver_manager_fuzzer.cpp @@ -223,65 +223,25 @@ void FuzzStart(std::shared_ptr parcel) IAM_LOGI("begin"); // driver manager forbids multiple invoke of Start(), it's config must be valid Singleton::GetInstance().Start(GLOBAL_HDI_NAME_TO_CONFIG); - Singleton::GetInstance().SubscribeHdiDriverStatus(); - IAM_LOGI("end"); -} - -void FuzzOnFrameworkReady(std::shared_ptr parcel) -{ - IAM_LOGI("begin"); Singleton::GetInstance().OnFrameworkReady(); - IAM_LOGI("end"); -} - -void FuzzOnAllHdiDisconnect(std::shared_ptr parcel) -{ - IAM_LOGI("begin"); - Singleton::GetInstance().OnAllHdiDisconnect(); - IAM_LOGI("end"); -} - -void FuzzGetDriverByServiceName(std::shared_ptr parcel) -{ - IAM_LOGI("begin"); + Singleton::GetInstance().SubscribeHdiDriverStatus(); std::string serviceName; parcel->ReadString(serviceName); Singleton::GetInstance().GetDriverByServiceName(serviceName); - IAM_LOGI("end"); -} - -void FuzzDriverConnect(std::shared_ptr parcel) -{ - IAM_LOGI("begin"); uint32_t index = parcel->ReadUint32() % (sizeof(GLOBAL_SERVICE_NAMES) / sizeof(GLOBAL_SERVICE_NAMES[0])); std::shared_ptr driver = Singleton::GetInstance().GetDriverByServiceName(GLOBAL_SERVICE_NAMES[index]); // Since config is valid, GetDriverByServiceName should never return null. // If it happens to be null, let fuzz process crash. driver->OnHdiConnect(); - IAM_LOGI("end"); -} - -void FuzzDriverDisconnect(std::shared_ptr parcel) -{ - IAM_LOGI("begin"); - uint32_t index = parcel->ReadUint32() % (sizeof(GLOBAL_SERVICE_NAMES) / sizeof(GLOBAL_SERVICE_NAMES[0])); - std::shared_ptr driver = - Singleton::GetInstance().GetDriverByServiceName(GLOBAL_SERVICE_NAMES[index]); - // Since config is valid, GetDriverByServiceName should never return null. - // If it happens to be null, let fuzz process crash. driver->OnHdiDisconnect(); + Singleton::GetInstance().OnAllHdiDisconnect(); IAM_LOGI("end"); } -using FuzzFunc = decltype(FuzzGetDriverByServiceName); +using FuzzFunc = decltype(FuzzStart); FuzzFunc *g_fuzzFuncs[] = { FuzzStart, - FuzzOnFrameworkReady, - FuzzOnAllHdiDisconnect, - FuzzGetDriverByServiceName, - FuzzDriverConnect, - FuzzDriverDisconnect, }; void UserAuthDriverManagerFuzzTest(const uint8_t *data, size_t size) diff --git a/test/fuzztest/services/coauthservice_fuzzer/co_auth_service_fuzzer.cpp b/test/fuzztest/services/coauthservice_fuzzer/co_auth_service_fuzzer.cpp index 8319148e74bb0a74c89018cdfa3ed6af90827bdb..768751452d2c924512072d8cea9ed3f19accf2ef 100644 --- a/test/fuzztest/services/coauthservice_fuzzer/co_auth_service_fuzzer.cpp +++ b/test/fuzztest/services/coauthservice_fuzzer/co_auth_service_fuzzer.cpp @@ -156,7 +156,6 @@ void FuzzOther(Parcel &parcel) AuthType authType = static_cast(parcel.ReadInt32()); ExecutorRole executorRole = static_cast(parcel.ReadInt32()); g_coAuthService->AddExecutorDeathRecipient(executorIndex, authType, executorRole, callback); - g_coAuthService->OnStart(); g_coAuthService->OnStop(); IAM_LOGI("end"); }