!1666 Appspawn踢狗UT用例失败修复

Merge pull request !1666 from 陈其文/HM_AddNwebspawnKickdog
This commit is contained in:
openharmony_ci 2024-11-07 08:11:40 +00:00 committed by Gitee
commit 3e4a510277
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 4 additions and 1 deletions

View File

@ -120,7 +120,7 @@ static int CheckKernelType(bool *isLinux)
return 0;
}
static int SpawnKickDogStart(AppSpawnMgr *mgrContent)
APPSPAWN_STATIC int SpawnKickDogStart(AppSpawnMgr *mgrContent)
{
APPSPAWN_CHECK(mgrContent != NULL, return 0, "content is null");
APPSPAWN_CHECK((mgrContent->content.mode == MODE_FOR_APP_SPAWN) ||

View File

@ -112,6 +112,7 @@ int RunBegetctlBootApp(AppSpawnMgr *content, AppSpawningCtx *property);
void SetSystemEnv(void);
void RunAppSandbox(const char *ptyName);
HOOK_MGR *GetAppSpawnHookMgr(void);
int SpawnKickDogStart(AppSpawnMgr *mgrContent);
#define STUB_NEED_CHECK 0x01
typedef int (*ExecvFunc)(const char *pathname, char *const argv[]);
enum {

View File

@ -99,6 +99,7 @@ HWTEST_F(AppSpawnKickDogTest, App_Spawn_AppSpawnKickDog_001, TestSize.Level0)
std::unique_ptr<OHOS::AppSpawnTestServer> testServer =
std::make_unique<OHOS::AppSpawnTestServer>("appspawn -mode appspawn");
AddPreloadHook(HOOK_PRIO_COMMON, SpawnKickDogStart);
testServer->Start(nullptr);
if (CheckDeviceInLinux()) {
EXPECT_EQ(CheckFileContent(HM_APPSPAWN_WATCHDOG_FILE, LINUX_APPSPAWN_WATCHDOG_ON), 0);
@ -139,6 +140,7 @@ HWTEST_F(AppSpawnKickDogTest, App_Spawn_AppSpawnKickDog_002, TestSize.Level0)
std::unique_ptr<OHOS::AppSpawnTestServer> testServer =
std::make_unique<OHOS::AppSpawnTestServer>("appspawn -mode nwebspawn");
AddPreloadHook(HOOK_PRIO_COMMON, SpawnKickDogStart);
testServer->Start(nullptr);
if (CheckDeviceInLinux()) {
EXPECT_EQ(CheckFileContent(HM_APPSPAWN_WATCHDOG_FILE, LINUX_APPSPAWN_WATCHDOG_ON), 0);