fix(test): 修复sys部分用例因依赖passwd、group文件而失败

【背景】
1.sys部分用例因依赖passwd、group文件而失败

【修改方案】
1.用例执行前检查是否存在这些配置文件,不存在就跳过该用例

re#I48IUC

Change-Id: I787ce4b200f2a7546e57290b7dd073127caa07bb
Signed-off-by: lnlan <lanleinan@163.com>
This commit is contained in:
lnlan
2021-10-20 01:29:32 +00:00
parent ca8909b8e3
commit f249db759d
12 changed files with 398 additions and 248 deletions

View File

@@ -34,6 +34,10 @@
#include "It_test_sys.h"
CHAR *g_groupFileStream = "root:x:0:\ndaemon:x:1:\nbin:x:2:\n";
CHAR *g_passwdFileStream = "root:x:0:0:root:/root:/bin/bash\n" \
"daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\nbin:x:2:2:bin:/bin:/usr/sbin/nologin\n";
using namespace testing::ext;
namespace OHOS {
class SysTest : public testing::Test {
@@ -343,14 +347,14 @@ HWTEST_F(SysTest, ItTestSys027, TestSize.Level0)
}
/* *
* @tc.name: IT_TEST_SYS_028
* @tc.name: ItTestSys028
* @tc.desc: function for nice:set pthread priority
* @tc.type: FUNC
* @tc.require: AR000EEMQ9
*/
HWTEST_F(SysTest, IT_TEST_SYS_028, TestSize.Level0)
HWTEST_F(SysTest, ItTestSys028, TestSize.Level0)
{
IT_TEST_SYS_028();
ItTestSys028();
}
#endif
} // namespace OHOS