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 <tom.hroma...@oracle.com>
---
 gunit/007-cgroup_process_v1_mount.cpp | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/gunit/007-cgroup_process_v1_mount.cpp 
b/gunit/007-cgroup_process_v1_mount.cpp
index 7a82f4001eaf..84a1f79981b5 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
+        */
 }
-- 
2.26.2



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to