From 7c577d8963d2b8f14269d85dae433ceaaa18527d Mon Sep 17 00:00:00 2001 From: wjj <502004968@qq.com> Date: Wed, 25 Aug 2021 15:40:03 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0sys=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 把测试用例放在full中,需要依赖文件group和passwd,放在/etc下 Change-Id: Ie038b64db96180b52ee10d70d494da42207d3b92 Signed-off-by: wjj <502004968@qq.com> --- testsuites/unittest/sys/BUILD.gn | 24 ++-- .../sys/{smoke => full}/sys_test_001.cpp | 0 .../sys/{smoke => full}/sys_test_018.cpp | 0 .../sys/{smoke => full}/sys_test_019.cpp | 0 .../sys/{smoke => full}/sys_test_020.cpp | 0 .../sys/{smoke => full}/sys_test_021.cpp | 0 .../sys/{smoke => full}/sys_test_022.cpp | 0 .../sys/{smoke => full}/sys_test_023.cpp | 2 + .../sys/{smoke => full}/sys_test_024.cpp | 0 .../sys/{smoke => full}/sys_test_025.cpp | 0 .../sys/{smoke => full}/sys_test_026.cpp | 0 .../sys/{smoke => full}/sys_test_027.cpp | 2 +- .../sys/{smoke => full}/sys_test_028.cpp | 0 testsuites/unittest/sys/sys_unit_test.cpp | 134 ++++++++++++++++++ 14 files changed, 149 insertions(+), 13 deletions(-) rename testsuites/unittest/sys/{smoke => full}/sys_test_001.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_018.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_019.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_020.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_021.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_022.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_023.cpp (99%) rename testsuites/unittest/sys/{smoke => full}/sys_test_024.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_025.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_026.cpp (100%) rename testsuites/unittest/sys/{smoke => full}/sys_test_027.cpp (98%) rename testsuites/unittest/sys/{smoke => full}/sys_test_028.cpp (100%) diff --git a/testsuites/unittest/sys/BUILD.gn b/testsuites/unittest/sys/BUILD.gn index 8f439d55..d59e4d18 100644 --- a/testsuites/unittest/sys/BUILD.gn +++ b/testsuites/unittest/sys/BUILD.gn @@ -42,7 +42,6 @@ sources_entry = [ ] sources_smoke = [ - "smoke/sys_test_001.cpp", "smoke/sys_test_004.cpp", "smoke/sys_test_005.cpp", "smoke/sys_test_006.cpp", @@ -56,23 +55,24 @@ sources_smoke = [ "smoke/sys_test_015.cpp", "smoke/sys_test_016.cpp", "smoke/sys_test_017.cpp", - "smoke/sys_test_018.cpp", - "smoke/sys_test_019.cpp", - "smoke/sys_test_020.cpp", - "smoke/sys_test_021.cpp", - "smoke/sys_test_022.cpp", - "smoke/sys_test_023.cpp", - "smoke/sys_test_024.cpp", - "smoke/sys_test_025.cpp", - "smoke/sys_test_026.cpp", - "smoke/sys_test_027.cpp", - "smoke/sys_test_028.cpp", "smoke/sys_test_029.cpp", "smoke/sys_test_030.cpp", "smoke/sys_test_031.cpp", ] sources_full = [ + "full/sys_test_001.cpp", + "full/sys_test_018.cpp", + "full/sys_test_019.cpp", + "full/sys_test_020.cpp", + "full/sys_test_021.cpp", + "full/sys_test_022.cpp", + "full/sys_test_023.cpp", + "full/sys_test_024.cpp", + "full/sys_test_025.cpp", + "full/sys_test_026.cpp", + "full/sys_test_027.cpp", + "full/sys_test_028.cpp", ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { diff --git a/testsuites/unittest/sys/smoke/sys_test_001.cpp b/testsuites/unittest/sys/full/sys_test_001.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_001.cpp rename to testsuites/unittest/sys/full/sys_test_001.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_018.cpp b/testsuites/unittest/sys/full/sys_test_018.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_018.cpp rename to testsuites/unittest/sys/full/sys_test_018.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_019.cpp b/testsuites/unittest/sys/full/sys_test_019.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_019.cpp rename to testsuites/unittest/sys/full/sys_test_019.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_020.cpp b/testsuites/unittest/sys/full/sys_test_020.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_020.cpp rename to testsuites/unittest/sys/full/sys_test_020.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_021.cpp b/testsuites/unittest/sys/full/sys_test_021.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_021.cpp rename to testsuites/unittest/sys/full/sys_test_021.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_022.cpp b/testsuites/unittest/sys/full/sys_test_022.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_022.cpp rename to testsuites/unittest/sys/full/sys_test_022.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_023.cpp b/testsuites/unittest/sys/full/sys_test_023.cpp similarity index 99% rename from testsuites/unittest/sys/smoke/sys_test_023.cpp rename to testsuites/unittest/sys/full/sys_test_023.cpp index 745eaf58..92f953c2 100644 --- a/testsuites/unittest/sys/smoke/sys_test_023.cpp +++ b/testsuites/unittest/sys/full/sys_test_023.cpp @@ -57,10 +57,12 @@ static UINT32 TestCase(VOID) ICUNIT_ASSERT_EQUAL(grp3->gr_gid, 2, -1); setgrent(); + grp4 = getgrent(); ICUNIT_ASSERT_NOT_EQUAL(grp4, nullptr, -1); ICUNIT_ASSERT_STRING_EQUAL(grp1->gr_name, grp4->gr_name, -1); + setgrent(); return 0; } diff --git a/testsuites/unittest/sys/smoke/sys_test_024.cpp b/testsuites/unittest/sys/full/sys_test_024.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_024.cpp rename to testsuites/unittest/sys/full/sys_test_024.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_025.cpp b/testsuites/unittest/sys/full/sys_test_025.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_025.cpp rename to testsuites/unittest/sys/full/sys_test_025.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_026.cpp b/testsuites/unittest/sys/full/sys_test_026.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_026.cpp rename to testsuites/unittest/sys/full/sys_test_026.cpp diff --git a/testsuites/unittest/sys/smoke/sys_test_027.cpp b/testsuites/unittest/sys/full/sys_test_027.cpp similarity index 98% rename from testsuites/unittest/sys/smoke/sys_test_027.cpp rename to testsuites/unittest/sys/full/sys_test_027.cpp index 5abb0f3d..6ebe8f73 100644 --- a/testsuites/unittest/sys/smoke/sys_test_027.cpp +++ b/testsuites/unittest/sys/full/sys_test_027.cpp @@ -41,7 +41,7 @@ static UINT32 TestCase(VOID) int id1 = 1; int id2 = 2; char *str1 = "/storage/1.txt"; - char *str2 = "/storage/2.txt"; + char *str2 = "/etc/2.txt"; fd = open(str1, O_CREAT); if (fd < 0) { diff --git a/testsuites/unittest/sys/smoke/sys_test_028.cpp b/testsuites/unittest/sys/full/sys_test_028.cpp similarity index 100% rename from testsuites/unittest/sys/smoke/sys_test_028.cpp rename to testsuites/unittest/sys/full/sys_test_028.cpp diff --git a/testsuites/unittest/sys/sys_unit_test.cpp b/testsuites/unittest/sys/sys_unit_test.cpp index ce866c0a..fc126673 100644 --- a/testsuites/unittest/sys/sys_unit_test.cpp +++ b/testsuites/unittest/sys/sys_unit_test.cpp @@ -219,4 +219,138 @@ HWTEST_F(SysTest, IT_TEST_SYS_031, TestSize.Level0) IT_TEST_SYS_031(); } #endif + +#if defined(LOSCFG_USER_TEST_FULL) +/* * + * @tc.name: IT_TEST_SYS_001 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys001, TestSize.Level0) +{ + ItTestSys001(); +} + +/* * + * @tc.name: IT_TEST_SYS_018 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys018, TestSize.Level0) +{ + ItTestSys018(); +} + +/* * + * @tc.name: IT_TEST_SYS_019 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys019, TestSize.Level0) +{ + ItTestSys019(); +} + +/* * + * @tc.name: IT_TEST_SYS_020 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys020, TestSize.Level0) +{ + ItTestSys020(); +} + +/* * + * @tc.name: IT_TEST_SYS_021 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys021, TestSize.Level0) +{ + ItTestSys021(); +} + +/* * + * @tc.name: IT_TEST_SYS_022 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys022, TestSize.Level0) +{ + ItTestSys022(); +} + +/* * + * @tc.name: IT_TEST_SYS_023 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys023, TestSize.Level0) +{ + ItTestSys023(); +} + +/* * + * @tc.name: IT_TEST_SYS_024 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys024, TestSize.Level0) +{ + ItTestSys024(); +} + +/* * + * @tc.name: IT_TEST_SYS_025 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys025, TestSize.Level0) +{ + ItTestSys025(); +} + +/* * + * @tc.name: IT_TEST_SYS_025 + * @tc.desc: function for SysTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys026, TestSize.Level0) +{ + ItTestSys026(); +} + +/* * + * @tc.name: IT_TEST_SYS_027 + * @tc.desc: function for ftok normal test + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, ItTestSys027, TestSize.Level0) +{ + ItTestSys027(); +} + +/* * + * @tc.name: IT_TEST_SYS_028 + * @tc.desc: function for nice:set pthread priority + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SysTest, IT_TEST_SYS_028, TestSize.Level0) +{ + IT_TEST_SYS_028(); +} +#endif } // namespace OHOS -- GitLab