1 /* 2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, 6 * are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, this list of 9 * conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 * of conditions and the following disclaimer in the documentation and/or other materials 13 * provided with the distribution. 14 * 15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 16 * to endorse or promote products derived from this software without specific prior written 17 * permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 #include "stdio.h" 32 #include <climits> 33 #include <gtest/gtest.h> 34 35 #include "It_test_sys.h" 36 37 CHAR *g_groupFileStream = "root:x:0:\ndaemon:x:1:\nbin:x:2:\n"; 38 CHAR *g_passwdFileStream = "root:x:0:0:root:/root:/bin/bash\n" \ 39 "daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\nbin:x:2:2:bin:/bin:/usr/sbin/nologin\n"; 40 41 using namespace testing::ext; 42 namespace OHOS { 43 class SysTest : public testing::Test { 44 public: SetUpTestCase(void)45 static void SetUpTestCase(void) {} TearDownTestCase(void)46 static void TearDownTestCase(void) {} 47 }; 48 49 #if defined(LOSCFG_USER_TEST_SMOKE) 50 /* * 51 * @tc.name: IT_TEST_SYS_004 52 * @tc.desc: function for SysTest 53 * @tc.type: FUNC 54 */ 55 HWTEST_F(SysTest, ItTestSys004, TestSize.Level0) 56 { 57 ItTestSys004(); 58 } 59 60 /* * 61 * @tc.name: IT_TEST_SYS_005 62 * @tc.desc: function for SysTest 63 * @tc.type: FUNC 64 */ 65 HWTEST_F(SysTest, ItTestSys005, TestSize.Level0) 66 { 67 ItTestSys005(); 68 } 69 70 /* * 71 * @tc.name: IT_TEST_SYS_006 72 * @tc.desc: function for SysTest 73 * @tc.type: FUNC 74 */ 75 HWTEST_F(SysTest, ItTestSys006, TestSize.Level0) 76 { 77 ItTestSys006(); 78 } 79 80 /* * 81 * @tc.name: IT_TEST_SYS_007 82 * @tc.desc: function for SysTest 83 * @tc.type: FUNC 84 */ 85 HWTEST_F(SysTest, ItTestSys007, TestSize.Level0) 86 { 87 ItTestSys007(); 88 } 89 90 /* * 91 * @tc.name: IT_TEST_SYS_008 92 * @tc.desc: function for SysTest 93 * @tc.type: FUNC 94 */ 95 HWTEST_F(SysTest, ItTestSys008, TestSize.Level0) 96 { 97 ItTestSys008(); 98 } 99 100 /* * 101 * @tc.name: IT_TEST_SYS_009 102 * @tc.desc: function for SysTest 103 * @tc.type: FUNC 104 */ 105 HWTEST_F(SysTest, ItTestSys009, TestSize.Level0) 106 { 107 ItTestSys009(); 108 } 109 110 /* * 111 * @tc.name: IT_TEST_SYS_010 112 * @tc.desc: function for SysTest 113 * @tc.type: FUNC 114 */ 115 HWTEST_F(SysTest, ItTestSys010, TestSize.Level0) 116 { 117 ItTestSys010(); 118 } 119 120 /* * 121 * @tc.name: IT_TEST_SYS_012 122 * @tc.desc: function for SysTest 123 * @tc.type: FUNC 124 */ 125 HWTEST_F(SysTest, ItTestSys012, TestSize.Level0) 126 { 127 ItTestSys012(); 128 } 129 130 /* * 131 * @tc.name: IT_TEST_SYS_013 132 * @tc.desc: function for SysTest 133 * @tc.type: FUNC 134 */ 135 HWTEST_F(SysTest, ItTestSys013, TestSize.Level0) 136 { 137 ItTestSys013(); 138 } 139 140 /* * 141 * @tc.name: IT_TEST_SYS_014 142 * @tc.desc: function for SysTest 143 * @tc.type: FUNC 144 */ 145 HWTEST_F(SysTest, ItTestSys014, TestSize.Level0) 146 { 147 ItTestSys014(); 148 } 149 150 /* * 151 * @tc.name: IT_TEST_SYS_015 152 * @tc.desc: function for SysTest 153 * @tc.type: FUNC 154 */ 155 HWTEST_F(SysTest, ItTestSys015, TestSize.Level0) 156 { 157 ItTestSys015(); 158 } 159 160 /* * 161 * @tc.name: IT_TEST_SYS_016 162 * @tc.desc: function for SysTest 163 * @tc.type: FUNC 164 */ 165 HWTEST_F(SysTest, ItTestSys016, TestSize.Level0) 166 { 167 ItTestSys016(); 168 } 169 170 /* * 171 * @tc.name: IT_TEST_SYS_017 172 * @tc.desc: function for SysTest 173 * @tc.type: FUNC 174 */ 175 HWTEST_F(SysTest, ItTestSys017, TestSize.Level0) 176 { 177 ItTestSys017(); 178 } 179 180 /* * 181 * @tc.name: IT_TEST_SYS_029 182 * @tc.desc: function for ftok exception test 183 * @tc.type: FUNC 184 */ 185 HWTEST_F(SysTest, ItTestSys029, TestSize.Level0) 186 { 187 ItTestSys029(); 188 } 189 190 /* * 191 * @tc.name: IT_TEST_SYS_030 192 * @tc.desc: function for sigsetjmp siglongjmp test 193 * @tc.type: FUNC 194 */ 195 HWTEST_F(SysTest, IT_TEST_SYS_030, TestSize.Level0) 196 { 197 IT_TEST_SYS_030(); 198 } 199 200 /* * 201 * @tc.name: IT_TEST_SYS_031 202 * @tc.desc: function for ctermid test 203 * @tc.type: FUNC 204 */ 205 HWTEST_F(SysTest, IT_TEST_SYS_031, TestSize.Level0) 206 { 207 IT_TEST_SYS_031(); 208 } 209 #endif 210 211 #if defined(LOSCFG_USER_TEST_FULL) 212 /* * 213 * @tc.name: IT_TEST_SYS_001 214 * @tc.desc: function for SysTest 215 * @tc.type: FUNC 216 */ 217 HWTEST_F(SysTest, ItTestSys001, TestSize.Level0) 218 { 219 ItTestSys001(); 220 } 221 222 /* * 223 * @tc.name: IT_TEST_SYS_018 224 * @tc.desc: function for SysTest 225 * @tc.type: FUNC 226 */ 227 HWTEST_F(SysTest, ItTestSys018, TestSize.Level0) 228 { 229 ItTestSys018(); 230 } 231 232 /* * 233 * @tc.name: IT_TEST_SYS_019 234 * @tc.desc: function for SysTest 235 * @tc.type: FUNC 236 */ 237 HWTEST_F(SysTest, ItTestSys019, TestSize.Level0) 238 { 239 ItTestSys019(); 240 } 241 242 /* * 243 * @tc.name: IT_TEST_SYS_020 244 * @tc.desc: function for SysTest 245 * @tc.type: FUNC 246 */ 247 HWTEST_F(SysTest, ItTestSys020, TestSize.Level0) 248 { 249 ItTestSys020(); 250 } 251 252 /* * 253 * @tc.name: IT_TEST_SYS_021 254 * @tc.desc: function for SysTest 255 * @tc.type: FUNC 256 */ 257 HWTEST_F(SysTest, ItTestSys021, TestSize.Level0) 258 { 259 ItTestSys021(); 260 } 261 262 /* * 263 * @tc.name: IT_TEST_SYS_022 264 * @tc.desc: function for SysTest 265 * @tc.type: FUNC 266 */ 267 HWTEST_F(SysTest, ItTestSys022, TestSize.Level0) 268 { 269 ItTestSys022(); 270 } 271 272 /* * 273 * @tc.name: IT_TEST_SYS_023 274 * @tc.desc: function for SysTest 275 * @tc.type: FUNC 276 */ 277 HWTEST_F(SysTest, ItTestSys023, TestSize.Level0) 278 { 279 ItTestSys023(); 280 } 281 282 /* * 283 * @tc.name: IT_TEST_SYS_024 284 * @tc.desc: function for SysTest 285 * @tc.type: FUNC 286 */ 287 HWTEST_F(SysTest, ItTestSys024, TestSize.Level0) 288 { 289 ItTestSys024(); 290 } 291 292 /* * 293 * @tc.name: IT_TEST_SYS_025 294 * @tc.desc: function for SysTest 295 * @tc.type: FUNC 296 */ 297 HWTEST_F(SysTest, ItTestSys025, TestSize.Level0) 298 { 299 ItTestSys025(); 300 } 301 302 /* * 303 * @tc.name: IT_TEST_SYS_025 304 * @tc.desc: function for SysTest 305 * @tc.type: FUNC 306 */ 307 HWTEST_F(SysTest, ItTestSys026, TestSize.Level0) 308 { 309 ItTestSys026(); 310 } 311 312 /* * 313 * @tc.name: IT_TEST_SYS_027 314 * @tc.desc: function for ftok normal test 315 * @tc.type: FUNC 316 */ 317 HWTEST_F(SysTest, ItTestSys027, TestSize.Level0) 318 { 319 ItTestSys027(); 320 } 321 322 /* * 323 * @tc.name: ItTestSys028 324 * @tc.desc: function for nice:set pthread priority 325 * @tc.type: FUNC 326 */ 327 HWTEST_F(SysTest, ItTestSys028, TestSize.Level0) 328 { 329 ItTestSys028(); 330 } 331 #endif 332 } // namespace OHOS 333