提交 4665fb5e 编写于 作者: H hu-jixiang1

fix fail testcase

Change-Id: If1c64b4c03e54a6c4af01d0d7f7c314e52c8cffe
上级 844302b2
......@@ -31,12 +31,12 @@ static void CreateDevDir()
int ret;
// Initialize the process and set the uid and gid of the process to zero
SetUidGid(UID0, GID0);
// Create a directory 'DACDIR0' in the directory '/dev'
ret = mkdir("/dev/" DACDIR0, CHMOD777);
ASSERT_EQ(ret, 0) << "ErrInfo: Failed to create the directory '/dev/DACDIR0'";
// Create a directory 'DACDIR0_DACDIR0' in the directory '/dev/DACDIR0'
ret = mkdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD777);
ASSERT_EQ(ret, 0) << "ErrInfo: Failed to create the directory '/dev/DACDIR0/DACDIR0_DACDIR0'";
// Create a directory 'DACDIR0' in the directory '/storage'
ret = mkdir("/storage/" DACDIR0, CHMOD777);
ASSERT_EQ(ret, 0) << "ErrInfo: Failed to create the directory '/storage/DACDIR0'";
// Create a directory 'DACDIR0_DACDIR0' in the directory '/storage/DACDIR0'
ret = mkdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD777);
ASSERT_EQ(ret, 0) << "ErrInfo: Failed to create the directory '/storage/DACDIR0/DACDIR0_DACDIR0'";
}
static void CreateDevTxt()
......@@ -45,20 +45,14 @@ static void CreateDevTxt()
int fd = 0;
// Initialize the process and set the uid and gid of the process to zero
SetUidGid(UID0, GID0);
// Create a directory 'DACDIR0' in the directory '/dev'
ret = mkdir("/dev/" DACDIR0, CHMOD777);
ASSERT_EQ(ret, 0) << "ErrInfo: Failed to create the directory '/dev/DACDIR0'";
// Failed to create a file 'DACDIR0_DACFILE0' in the directory '/dev/DACDIR0'
fd = open("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY | O_CREAT | O_TRUNC, CHMOD777);
if (fd >= 0) {
EXPECT_EQ(fd, FALSE) << "ErrInfo: Create a file 'DACDIR0_DACFILE0' in the directory '/dev/DACDIR0'";
close(fd);
}
// Create a directory 'DACDIR0' in the directory '/storage'
ret = mkdir("/storage/" DACDIR0, CHMOD777);
ASSERT_EQ(ret, 0) << "ErrInfo: Failed to create the directory '/storage/DACDIR0'";
}
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0290
* @tc.name : DAC control mechanism-File system dev-System call rmdir-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call rmdir-UID0-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 333
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -68,7 +62,7 @@ HWTEST_F(DacTestSuite, DACTest0290, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD333);
ret = chmod("/storage/" DACDIR0, CHMOD333);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 333";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -81,7 +75,7 @@ HWTEST_F(DacTestSuite, DACTest0290, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = rmdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = rmdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -99,7 +93,7 @@ HWTEST_F(DacTestSuite, DACTest0290, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0300
* @tc.name : DAC control mechanism-File system dev-System call rmdir-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call rmdir-UID1-GID0-Capability
CAPDACOVERRIDE-Permission 611
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -109,7 +103,7 @@ HWTEST_F(DacTestSuite, DACTest0300, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD611);
ret = chmod("/storage/" DACDIR0, CHMOD611);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 611";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -122,7 +116,7 @@ HWTEST_F(DacTestSuite, DACTest0300, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
ret = rmdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = rmdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -140,7 +134,7 @@ HWTEST_F(DacTestSuite, DACTest0300, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0310
* @tc.name : DAC control mechanism-File system dev-System call rmdir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call rmdir-UID1-GID1-Capability
CAPDACOVERRIDE-Permission 105
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -150,7 +144,7 @@ HWTEST_F(DacTestSuite, DACTest0310, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD105);
ret = chmod("/storage/" DACDIR0, CHMOD105);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 105";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -163,7 +157,7 @@ HWTEST_F(DacTestSuite, DACTest0310, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = rmdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = rmdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -181,7 +175,7 @@ HWTEST_F(DacTestSuite, DACTest0310, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0320
* @tc.name : DAC control mechanism-File system dev-System call rmdir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call rmdir-UID1-GID1-Capability
CAPDACOVERRIDE-Permission 555
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -191,7 +185,7 @@ HWTEST_F(DacTestSuite, DACTest0320, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD555);
ret = chmod("/storage/" DACDIR0, CHMOD555);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 555";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -204,7 +198,7 @@ HWTEST_F(DacTestSuite, DACTest0320, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = rmdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = rmdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -222,7 +216,7 @@ HWTEST_F(DacTestSuite, DACTest0320, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0330
* @tc.name : DAC control mechanism-File system dev-System call rmdir-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call rmdir-UID1-GID1-Groups contain-Capability
CAPDACREADSEARCH-Permission 666
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -233,7 +227,7 @@ HWTEST_F(DacTestSuite, DACTest0330, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD666);
ret = chmod("/storage/" DACDIR0, CHMOD666);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 666";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -247,7 +241,7 @@ HWTEST_F(DacTestSuite, DACTest0330, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = rmdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = rmdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -265,7 +259,7 @@ HWTEST_F(DacTestSuite, DACTest0330, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0340
* @tc.name : DAC control mechanism-File system dev-System call stat-UID0-GID1-Capability NULL-Permission 777
* @tc.name : DAC control mechanism-File system storage-System call stat-UID0-GID1-Capability NULL-Permission 777
* @tc.desc : [C- SECURITY -0200]
*/
HWTEST_F(DacTestSuite, DACTest0340, Function | MediumTest | Level2)
......@@ -274,7 +268,7 @@ HWTEST_F(DacTestSuite, DACTest0340, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD777);
ret = chmod("/storage/" DACDIR0, CHMOD777);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 777";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -287,7 +281,7 @@ HWTEST_F(DacTestSuite, DACTest0340, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = rmdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = rmdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -305,7 +299,7 @@ HWTEST_F(DacTestSuite, DACTest0340, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0350
* @tc.name : DAC control mechanism-File system dev-System call stat-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call stat-UID1-GID0-Capability
CAPDACOVERRIDE-Permission 166
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -316,7 +310,7 @@ HWTEST_F(DacTestSuite, DACTest0350, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD166);
ret = chmod("/storage/" DACDIR0, CHMOD166);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 166";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -329,7 +323,7 @@ HWTEST_F(DacTestSuite, DACTest0350, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
ret = stat("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
ret = stat("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -347,7 +341,7 @@ HWTEST_F(DacTestSuite, DACTest0350, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0360
* @tc.name : DAC control mechanism-File system dev-System call stat-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call stat-UID0-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 111
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -358,7 +352,7 @@ HWTEST_F(DacTestSuite, DACTest0360, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD111);
ret = chmod("/storage/" DACDIR0, CHMOD111);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 111";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -371,7 +365,7 @@ HWTEST_F(DacTestSuite, DACTest0360, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = stat("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
ret = stat("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -389,7 +383,7 @@ HWTEST_F(DacTestSuite, DACTest0360, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0370
* @tc.name : DAC control mechanism-File system dev-System call stat-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call stat-UID0-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 210
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -400,7 +394,7 @@ HWTEST_F(DacTestSuite, DACTest0370, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD210);
ret = chmod("/storage/" DACDIR0, CHMOD210);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 210";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -413,7 +407,7 @@ HWTEST_F(DacTestSuite, DACTest0370, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = stat("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
ret = stat("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -431,7 +425,7 @@ HWTEST_F(DacTestSuite, DACTest0370, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0380
* @tc.name : DAC control mechanism-File system dev-System call stat-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call stat-UID1-GID1-Groups contain-Capability
CAPDACOVERRIDE-Permission 655
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -443,7 +437,7 @@ HWTEST_F(DacTestSuite, DACTest0380, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD655);
ret = chmod("/storage/" DACDIR0, CHMOD655);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 655";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -457,7 +451,7 @@ HWTEST_F(DacTestSuite, DACTest0380, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = stat("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
ret = stat("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, &buf);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -475,7 +469,7 @@ HWTEST_F(DacTestSuite, DACTest0380, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0390
* @tc.name : DAC control mechanism-File system dev-System call rename-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call rename-UID1-GID0-Capability
CAPDACREADSEARCH-Permission 570
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -485,7 +479,7 @@ HWTEST_F(DacTestSuite, DACTest0390, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD570);
ret = chmod("/storage/" DACDIR0, CHMOD570);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 570";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -498,7 +492,7 @@ HWTEST_F(DacTestSuite, DACTest0390, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
ret = rename("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, "/dev/" DACDIR0 "/" DACDIR0_DACDIR1);
ret = rename("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, "/storage/" DACDIR0 "/" DACDIR0_DACDIR1);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -516,7 +510,7 @@ HWTEST_F(DacTestSuite, DACTest0390, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0400
* @tc.name : DAC control mechanism-File system dev-System call rename-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call rename-UID1-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 306
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -526,7 +520,7 @@ HWTEST_F(DacTestSuite, DACTest0400, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD306);
ret = chmod("/storage/" DACDIR0, CHMOD306);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 306";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -539,7 +533,7 @@ HWTEST_F(DacTestSuite, DACTest0400, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
ret = rename("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, "/dev/" DACDIR0 "/" DACDIR0_DACDIR1);
ret = rename("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, "/storage/" DACDIR0 "/" DACDIR0_DACDIR1);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -557,7 +551,7 @@ HWTEST_F(DacTestSuite, DACTest0400, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0410
* @tc.name : DAC control mechanism-File system dev-System call rename-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call rename-UID1-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 027
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -567,7 +561,7 @@ HWTEST_F(DacTestSuite, DACTest0410, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD027);
ret = chmod("/storage/" DACDIR0, CHMOD027);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 027";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -580,7 +574,7 @@ HWTEST_F(DacTestSuite, DACTest0410, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = rename("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, "/dev/" DACDIR0 "/" DACDIR0_DACDIR1);
ret = rename("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, "/storage/" DACDIR0 "/" DACDIR0_DACDIR1);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -598,7 +592,7 @@ HWTEST_F(DacTestSuite, DACTest0410, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0420
* @tc.name : DAC control mechanism-File system dev-System call chdir-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call chdir-UID0-GID1-Capability
CAPDACREADSEARCH-Permission 401
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -608,7 +602,7 @@ HWTEST_F(DacTestSuite, DACTest0420, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD401);
ret = chmod("/storage/" DACDIR0, CHMOD401);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 401";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -621,7 +615,7 @@ HWTEST_F(DacTestSuite, DACTest0420, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -639,7 +633,7 @@ HWTEST_F(DacTestSuite, DACTest0420, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0430
* @tc.name : DAC control mechanism-File system dev-System call chdir-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call chdir-UID0-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 507
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -649,7 +643,7 @@ HWTEST_F(DacTestSuite, DACTest0430, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD507);
ret = chmod("/storage/" DACDIR0, CHMOD507);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 507";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -662,7 +656,7 @@ HWTEST_F(DacTestSuite, DACTest0430, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -680,7 +674,7 @@ HWTEST_F(DacTestSuite, DACTest0430, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0440
* @tc.name : DAC control mechanism-File system dev-System call chdir-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call chdir-UID0-GID0-Capability
CAPDACOVERRIDE-Permission 347
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -690,7 +684,7 @@ HWTEST_F(DacTestSuite, DACTest0440, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD347);
ret = chmod("/storage/" DACDIR0, CHMOD347);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 347";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -703,7 +697,7 @@ HWTEST_F(DacTestSuite, DACTest0440, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -721,7 +715,7 @@ HWTEST_F(DacTestSuite, DACTest0440, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0450
* @tc.name : DAC control mechanism-File system dev-System call chdir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call chdir-UID1-GID1-Capability
CAPDACOVERRIDE-Permission 063
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -731,7 +725,7 @@ HWTEST_F(DacTestSuite, DACTest0450, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD063);
ret = chmod("/storage/" DACDIR0, CHMOD063);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 063";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -744,7 +738,7 @@ HWTEST_F(DacTestSuite, DACTest0450, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -762,7 +756,7 @@ HWTEST_F(DacTestSuite, DACTest0450, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0460
* @tc.name : DAC control mechanism-File system dev-System call chdir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call chdir-UID1-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 230
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -772,7 +766,7 @@ HWTEST_F(DacTestSuite, DACTest0460, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD230);
ret = chmod("/storage/" DACDIR0, CHMOD230);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 230";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -785,7 +779,7 @@ HWTEST_F(DacTestSuite, DACTest0460, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -803,7 +797,7 @@ HWTEST_F(DacTestSuite, DACTest0460, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0470
* @tc.name : DAC control mechanism-File system dev-System call chdir-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call chdir-UID1-GID1-Groups contain-Capability
CAPDACOVERRIDE-Permission 724
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -814,7 +808,7 @@ HWTEST_F(DacTestSuite, DACTest0470, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD724);
ret = chmod("/storage/" DACDIR0, CHMOD724);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 724";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -828,7 +822,7 @@ HWTEST_F(DacTestSuite, DACTest0470, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -846,7 +840,7 @@ HWTEST_F(DacTestSuite, DACTest0470, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0480
* @tc.name : DAC control mechanism-File system dev-System call execute-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call execute-UID1-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 702
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -858,8 +852,8 @@ HWTEST_F(DacTestSuite, DACTest0480, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD702);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD702);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -872,7 +866,7 @@ HWTEST_F(DacTestSuite, DACTest0480, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
ret = execve("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, argv, envp);
ret = execve("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, argv, envp);
// the file is not elf , can not exec
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
......@@ -891,7 +885,7 @@ HWTEST_F(DacTestSuite, DACTest0480, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0490
* @tc.name : DAC control mechanism-File system dev-System call execute-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call execute-UID0-GID0-Capability
CAPDACOVERRIDE-Permission 473
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -903,8 +897,8 @@ HWTEST_F(DacTestSuite, DACTest0490, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD473);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD473);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -917,7 +911,7 @@ HWTEST_F(DacTestSuite, DACTest0490, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = execve("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, argv, envp);
ret = execve("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, argv, envp);
// the file is not elf , can not exec
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
......@@ -936,7 +930,7 @@ HWTEST_F(DacTestSuite, DACTest0490, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0500
* @tc.name : DAC control mechanism-File system dev-System call execute-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call execute-UID1-GID1-Capability
CAPDACOVERRIDE-Permission 261
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -948,8 +942,8 @@ HWTEST_F(DacTestSuite, DACTest0500, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD261);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD261);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -962,7 +956,7 @@ HWTEST_F(DacTestSuite, DACTest0500, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = execve("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, argv, envp);
ret = execve("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, argv, envp);
// the file is not elf , can not exec
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
......@@ -981,7 +975,7 @@ HWTEST_F(DacTestSuite, DACTest0500, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0510
* @tc.name : DAC control mechanism-File system dev-System call access-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call access-UID0-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 460
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -991,8 +985,8 @@ HWTEST_F(DacTestSuite, DACTest0510, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD460);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD460);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1005,7 +999,7 @@ HWTEST_F(DacTestSuite, DACTest0510, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = access("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
ret = access("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1023,7 +1017,7 @@ HWTEST_F(DacTestSuite, DACTest0510, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0520
* @tc.name : DAC control mechanism-File system dev-System call access-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call access-UID1-GID0-Capability
CAPDACOVERRIDE-Permission 562
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1033,8 +1027,8 @@ HWTEST_F(DacTestSuite, DACTest0520, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD562);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD562);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1047,7 +1041,7 @@ HWTEST_F(DacTestSuite, DACTest0520, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = access("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
ret = access("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1066,7 +1060,7 @@ HWTEST_F(DacTestSuite, DACTest0520, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0530
* @tc.name : DAC control mechanism-File system dev-System call access-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call access-UID0-GID0-Capability
CAPDACOVERRIDE-Permission 076
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1076,8 +1070,8 @@ HWTEST_F(DacTestSuite, DACTest0530, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD076);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD076);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1090,7 +1084,7 @@ HWTEST_F(DacTestSuite, DACTest0530, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = access("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
ret = access("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1108,7 +1102,7 @@ HWTEST_F(DacTestSuite, DACTest0530, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0540
* @tc.name : DAC control mechanism-File system dev-System call access-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call access-UID1-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 305
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1119,8 +1113,8 @@ HWTEST_F(DacTestSuite, DACTest0540, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD076);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD076);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1134,7 +1128,7 @@ HWTEST_F(DacTestSuite, DACTest0540, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = access("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
ret = access("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1152,7 +1146,7 @@ HWTEST_F(DacTestSuite, DACTest0540, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0550
* @tc.name : DAC control mechanism-File system dev-System call access-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call access-UID1-GID1-Groups contain-Capability
CAPDACOVERRIDE-Permission 132
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1163,8 +1157,8 @@ HWTEST_F(DacTestSuite, DACTest0550, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD132);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD132);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1178,7 +1172,7 @@ HWTEST_F(DacTestSuite, DACTest0550, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = access("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
ret = access("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1196,7 +1190,7 @@ HWTEST_F(DacTestSuite, DACTest0550, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0560
* @tc.name : DAC control mechanism-File system dev-System call access-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call access-UID1-GID1-Groups contain-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 241
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1207,8 +1201,8 @@ HWTEST_F(DacTestSuite, DACTest0560, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD241);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD241);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1222,7 +1216,7 @@ HWTEST_F(DacTestSuite, DACTest0560, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = access("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
ret = access("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, F_OK);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1240,7 +1234,7 @@ HWTEST_F(DacTestSuite, DACTest0560, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0570
* @tc.name : DAC control mechanism-File system dev-System call mkdir-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call mkdir-UID0-GID1-Capability
CAPDACOVERRIDE-Permission 456
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1250,7 +1244,7 @@ HWTEST_F(DacTestSuite, DACTest0570, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD456);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD456);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 456";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1263,7 +1257,7 @@ HWTEST_F(DacTestSuite, DACTest0570, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = mkdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
ret = mkdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1281,7 +1275,7 @@ HWTEST_F(DacTestSuite, DACTest0570, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0580
* @tc.name : DAC control mechanism-File system dev-System call mkdir-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call mkdir-UID1-GID0-Capability
CAPDACOVERRIDE-Permission 167
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1291,7 +1285,7 @@ HWTEST_F(DacTestSuite, DACTest0580, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD167);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD167);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 167";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1304,7 +1298,7 @@ HWTEST_F(DacTestSuite, DACTest0580, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
ret = mkdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
ret = mkdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1322,7 +1316,7 @@ HWTEST_F(DacTestSuite, DACTest0580, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0590
* @tc.name : DAC control mechanism-File system dev-System call mkdir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call mkdir-UID1-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 511
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1332,7 +1326,7 @@ HWTEST_F(DacTestSuite, DACTest0590, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD511);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD511);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 511";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1345,7 +1339,7 @@ HWTEST_F(DacTestSuite, DACTest0590, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = mkdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
ret = mkdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1363,7 +1357,7 @@ HWTEST_F(DacTestSuite, DACTest0590, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0600
* @tc.name : DAC control mechanism-File system dev-System call mkdir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call mkdir-UID1-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 640
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1373,7 +1367,7 @@ HWTEST_F(DacTestSuite, DACTest0600, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD640);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD640);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 640";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1386,7 +1380,7 @@ HWTEST_F(DacTestSuite, DACTest0600, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = mkdir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
ret = mkdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1404,7 +1398,7 @@ HWTEST_F(DacTestSuite, DACTest0600, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0610
* @tc.name : DAC control mechanism-File system dev-System call unlink-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call unlink-UID0-GID1-Capability
CAPDACOVERRIDE-Permission 362
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1414,8 +1408,8 @@ HWTEST_F(DacTestSuite, DACTest0610, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD362);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD362);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1428,7 +1422,7 @@ HWTEST_F(DacTestSuite, DACTest0610, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = unlink("/dev/" DACDIR0 "/" DACDIR0_DACFILE0);
ret = unlink("/storage/" DACDIR0 "/" DACDIR0_DACFILE0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1446,7 +1440,7 @@ HWTEST_F(DacTestSuite, DACTest0610, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0620
* @tc.name : DAC control mechanism-File system dev-System call unlink-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call unlink-UID0-GID1-Capability
CAPDACOVERRIDE-Permission 526
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1456,8 +1450,8 @@ HWTEST_F(DacTestSuite, DACTest0620, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD526);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD526);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1470,7 +1464,7 @@ HWTEST_F(DacTestSuite, DACTest0620, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = unlink("/dev/" DACDIR0 "/" DACDIR0_DACFILE0);
ret = unlink("/storage/" DACDIR0 "/" DACDIR0_DACFILE0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1488,7 +1482,7 @@ HWTEST_F(DacTestSuite, DACTest0620, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0630
* @tc.name : DAC control mechanism-File system dev-System call unlink-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call unlink-UID0-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 604
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1498,8 +1492,8 @@ HWTEST_F(DacTestSuite, DACTest0630, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD604);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD604);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1512,7 +1506,7 @@ HWTEST_F(DacTestSuite, DACTest0630, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = unlink("/dev/" DACDIR0 "/" DACDIR0_DACFILE0);
ret = unlink("/storage/" DACDIR0 "/" DACDIR0_DACFILE0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1530,7 +1524,7 @@ HWTEST_F(DacTestSuite, DACTest0630, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0640
* @tc.name : DAC control mechanism-File system dev-System call unlink-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call unlink-UID0-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 671
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1540,8 +1534,8 @@ HWTEST_F(DacTestSuite, DACTest0640, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD671);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD671);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1554,7 +1548,7 @@ HWTEST_F(DacTestSuite, DACTest0640, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = unlink("/dev/" DACDIR0 "/" DACDIR0_DACFILE0);
ret = unlink("/storage/" DACDIR0 "/" DACDIR0_DACFILE0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1572,7 +1566,7 @@ HWTEST_F(DacTestSuite, DACTest0640, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0650
* @tc.name : DAC control mechanism-File system dev-System call unlink-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call unlink-UID0-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 743
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1582,8 +1576,8 @@ HWTEST_F(DacTestSuite, DACTest0650, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD743);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD743);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1596,7 +1590,7 @@ HWTEST_F(DacTestSuite, DACTest0650, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
ret = unlink("/dev/" DACDIR0 "/" DACDIR0_DACFILE0);
ret = unlink("/storage/" DACDIR0 "/" DACDIR0_DACFILE0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1614,7 +1608,7 @@ HWTEST_F(DacTestSuite, DACTest0650, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0660
* @tc.name : DAC control mechanism-File system dev-System call unlink-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call unlink-UID1-GID1-Groups contain-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 235
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1625,8 +1619,8 @@ HWTEST_F(DacTestSuite, DACTest0660, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD235);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD235);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1640,7 +1634,7 @@ HWTEST_F(DacTestSuite, DACTest0660, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
ret = unlink("/dev/" DACDIR0 "/" DACDIR0_DACFILE0);
ret = unlink("/storage/" DACDIR0 "/" DACDIR0_DACFILE0);
if (ret != FALSE) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1658,7 +1652,7 @@ HWTEST_F(DacTestSuite, DACTest0660, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0670
* @tc.name : DAC control mechanism-File system dev-System call open-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call open-UID1-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 371
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1669,8 +1663,8 @@ HWTEST_F(DacTestSuite, DACTest0670, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD371);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD371);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1683,7 +1677,7 @@ HWTEST_F(DacTestSuite, DACTest0670, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
fd = open("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
fd = open("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
if (fd >= 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
close(fd);
......@@ -1702,7 +1696,7 @@ HWTEST_F(DacTestSuite, DACTest0670, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0680
* @tc.name : DAC control mechanism-File system dev-System call open-UID1-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call open-UID1-GID0-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 702
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1713,8 +1707,8 @@ HWTEST_F(DacTestSuite, DACTest0680, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD702);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD702);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1727,7 +1721,7 @@ HWTEST_F(DacTestSuite, DACTest0680, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID0);
// Step 3: Invoke the interface to operate the file system
fd = open("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
fd = open("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
if (fd >= 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
close(fd);
......@@ -1746,7 +1740,7 @@ HWTEST_F(DacTestSuite, DACTest0680, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0690
* @tc.name : DAC control mechanism-File system dev-System call open-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call open-UID1-GID1-Capability
CAPDACOVERRIDE-Permission 406
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1757,8 +1751,8 @@ HWTEST_F(DacTestSuite, DACTest0690, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD406);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD406);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1771,7 +1765,7 @@ HWTEST_F(DacTestSuite, DACTest0690, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
fd = open("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
fd = open("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
if (fd >= 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
close(fd);
......@@ -1790,7 +1784,7 @@ HWTEST_F(DacTestSuite, DACTest0690, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0700
* @tc.name : DAC control mechanism-File system dev-System call open-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call open-UID1-GID1-Groups contain-Capability
CAPDACOVERRIDE-Permission 257
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1802,8 +1796,8 @@ HWTEST_F(DacTestSuite, DACTest0700, Function | MediumTest | Level2)
// Preset action: Create a file
CreateDevTxt();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0, CHMOD257);
// dev/shm can not change chmod
ret = chmod("/storage/" DACDIR0, CHMOD257);
// storage/shm can not change chmod
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod ";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1817,7 +1811,7 @@ HWTEST_F(DacTestSuite, DACTest0700, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
fd = open("/dev/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
fd = open("/storage/" DACDIR0 "/" DACDIR0_DACFILE0, O_WRONLY);
if (fd >= 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
close(fd);
......@@ -1836,7 +1830,7 @@ HWTEST_F(DacTestSuite, DACTest0700, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0710
* @tc.name : DAC control mechanism-File system dev-System call opendir-UID0-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call opendir-UID0-GID1-Capability
CAPDACREADSEARCH_CAPDACOVERRIDE-Permission 750
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1847,7 +1841,7 @@ HWTEST_F(DacTestSuite, DACTest0710, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD750);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD750);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 750";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1860,7 +1854,7 @@ HWTEST_F(DacTestSuite, DACTest0710, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
dir = opendir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
dir = opendir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (dir == nullptr) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1880,7 +1874,7 @@ HWTEST_F(DacTestSuite, DACTest0710, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0720
* @tc.name : DAC control mechanism-File system dev-System call opendir-UID0-GID0-Capability
* @tc.name : DAC control mechanism-File system storage-System call opendir-UID0-GID0-Capability
CAPDACOVERRIDE-Permission 143
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1891,7 +1885,7 @@ HWTEST_F(DacTestSuite, DACTest0720, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD143);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD143);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 143";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1904,7 +1898,7 @@ HWTEST_F(DacTestSuite, DACTest0720, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID0, GID0);
// Step 3: Invoke the interface to operate the file system
dir = opendir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
dir = opendir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (dir == nullptr) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1924,7 +1918,7 @@ HWTEST_F(DacTestSuite, DACTest0720, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0730
* @tc.name : DAC control mechanism-File system dev-System call opendir-UID1-GID1-Capability
* @tc.name : DAC control mechanism-File system storage-System call opendir-UID1-GID1-Capability
CAPDACOVERRIDE-Permission 521
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1935,7 +1929,7 @@ HWTEST_F(DacTestSuite, DACTest0730, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD521);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD521);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 521";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1948,7 +1942,7 @@ HWTEST_F(DacTestSuite, DACTest0730, Function | MediumTest | Level2)
// Step 2: Change the sub process uid, gid and groups according to the test procedure
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
dir = opendir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
dir = opendir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (dir == nullptr) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -1968,7 +1962,7 @@ HWTEST_F(DacTestSuite, DACTest0730, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0740
* @tc.name : DAC control mechanism-File system dev-System call opendir-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call opendir-UID1-GID1-Groups contain-Capability
CAPDACOVERRIDE-Permission 016
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -1980,7 +1974,7 @@ HWTEST_F(DacTestSuite, DACTest0740, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD016);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD016);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 016";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -1994,7 +1988,7 @@ HWTEST_F(DacTestSuite, DACTest0740, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
dir = opendir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
dir = opendir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (dir == nullptr) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......@@ -2014,7 +2008,7 @@ HWTEST_F(DacTestSuite, DACTest0740, Function | MediumTest | Level2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_DAC_0750
* @tc.name : DAC control mechanism-File system dev-System call opendir-UID1-GID1-Groups contain-Capability
* @tc.name : DAC control mechanism-File system storage-System call opendir-UID1-GID1-Groups contain-Capability
CAPDACOVERRIDE-Permission 407
* @tc.desc : [C- SECURITY -0200]
*/
......@@ -2026,7 +2020,7 @@ HWTEST_F(DacTestSuite, DACTest0750, Function | MediumTest | Level2)
// Preset action: Create a directory
CreateDevDir();
// Preset action: Change the file permission according to the test procedure
ret = chmod("/dev/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD407);
ret = chmod("/storage/" DACDIR0 "/" DACDIR0_DACDIR0, CHMOD407);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to chmod 407";
// Preset action: Fork a sub process
pid_t pid = fork();
......@@ -2040,7 +2034,7 @@ HWTEST_F(DacTestSuite, DACTest0750, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
setgroups(SINGLESIZE, list);
// Step 3: Invoke the interface to operate the file system
dir = opendir("/dev/" DACDIR0 "/" DACDIR0_DACDIR0);
dir = opendir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (dir == nullptr) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
......
......@@ -31,7 +31,7 @@ void DacTestSuite::SetUp()
// Delete the the directory if exists
RemoveDir(TOP_DIR "/" DACDIR0);
RemoveDir(TOP_DIR "/" DACDIR1);
RemoveDir("/dev/" DACDIR0);
RemoveDir("/storage/" DACDIR0);
// Obtain the current working directory of the test code
mCurPath = GetCurrentPath();
// Modify the current working directory of the test code
......@@ -47,7 +47,7 @@ void DacTestSuite::TearDown()
// Delete the the directory if exists
RemoveDir(TOP_DIR "/" DACDIR0);
RemoveDir(TOP_DIR "/" DACDIR1);
RemoveDir("/dev/" DACDIR0);
RemoveDir("/storage/" DACDIR0);
// Initialize the process and set the uid and gid of the process to zero
SetUidGid(UID0, GID0);
// Restore the working directory of the test code
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册