From: Tom Hromatka Date: Mon, 29 Mar 2021 17:54:09 +0000 (+0000) Subject: gunit: Ignore systemd hierarchies in test 007 X-Git-Tag: v2.0.3~11^2^2~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b89bcfd6e4b48d3cb8cb7a9e12a03896f02ee3ef;p=thirdparty%2Flibcgroup.git gunit: Ignore systemd hierarchies in test 007 Now that systemd hierarchies are being ignored via the OPAQUE_HIERARCHY setting, update unit test 007 to ensure that systemd hierachies are not added to the mount table. Signed-off-by: Tom Hromatka --- diff --git a/gunit/007-cgroup_process_v1_mount.cpp b/gunit/007-cgroup_process_v1_mount.cpp index 7a82f400..84a1f799 100644 --- a/gunit/007-cgroup_process_v1_mount.cpp +++ b/gunit/007-cgroup_process_v1_mount.cpp @@ -86,26 +86,9 @@ TEST_F(CgroupProcessV1MntTest, AddV1NamedMount) ret = cgroup_process_v1_mnt(controllers, &ent, &mnt_tbl_idx); ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 2); - ASSERT_STREQ(cg_mount_table[1].name, "name=systemd"); - ASSERT_STREQ(cg_mount_table[1].mount.path, ent.mnt_dir); -} - -TEST_F(CgroupProcessV1MntTest, AddV1NamedMount_Duplicate) -{ - char *controllers[] = {"cpu", "memory", "systemd", NULL}; - struct mntent ent = (struct mntent) { - .mnt_fsname = "cgroup", - .mnt_dir = "/cgroup2/systemd", - .mnt_type = "cgroup", - .mnt_opts = "rw,nosuid,nodev,noexec,relatime,seclabel,name=systemd", - }; - int ret; - - ret = cgroup_process_v1_mnt(controllers, &ent, &mnt_tbl_idx); - - ASSERT_EQ(ret, 0); - ASSERT_EQ(mnt_tbl_idx, 2); - ASSERT_STREQ(cg_mount_table[1].name, "name=systemd"); - ASSERT_STREQ(cg_mount_table[1].mount.next->path, ent.mnt_dir); + ASSERT_EQ(mnt_tbl_idx, 1); + ASSERT_STREQ(cg_mount_table[0].name, "memory"); + /* The systemd hierarchy should not be mounted due to it being + * excluded by the OPAQUE_HIERARCHY option + */ }