]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
gunit: Ignore systemd hierarchies in test 007
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 29 Mar 2021 17:54:09 +0000 (17:54 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 29 Mar 2021 18:01:03 +0000 (18:01 +0000)
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.hromatka@oracle.com>
gunit/007-cgroup_process_v1_mount.cpp

index 7a82f4001eaf0fb73a0ce105d2a158509ce16a06..84a1f79981b577a8e60d8dd3fc861d11194485e0 100644 (file)
@@ -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
+        */
 }