Appspawn踢狗UT用例失败修复

Signed-off-by: 陈其文 <chenqiwen6@huawei.com>
This commit is contained in:
陈其文 2024-11-06 20:17:47 +08:00
parent 54f7a1a2dd
commit ec2927c82d
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);