fix: 修复获取容器信息失败

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: Ie612d14337f7c24812c74f1510c0a8e6fca1c200
This commit is contained in:
zhushengle
2023-04-20 22:35:20 +08:00
parent 5fb9165c08
commit 338f5d7e7d
4 changed files with 37 additions and 17 deletions

View File

@@ -30,19 +30,13 @@
#include <gtest/gtest.h>
#include "It_process_fs_test.h"
static const int ini_process_max = 3;
void ItProcessFs013(void)
{
std::string path;
DIR *dirp = nullptr;
for (int i = 1; i <= ini_process_max; i++) {
if (i != 2) { /* 2: skip kernel process */
path = GenProcPidPath(i);
printf("path: %s\n", path.c_str());
dirp = opendir(path.data());
ASSERT_NE(dirp, nullptr);
(void)closedir(dirp);
};
}
path = GenProcPidPath(1);
printf("path: %s\n", path.c_str());
dirp = opendir(path.data());
ASSERT_NE(dirp, nullptr);
(void)closedir(dirp);
}