oomd: add unit test to repro #18926
authorAnita Zhang <the.anitazha@gmail.com>
Mon, 8 Mar 2021 18:51:12 +0000 (10:51 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Mar 2021 16:35:57 +0000 (17:35 +0100)
(cherry picked from commit 399d80ba8c604d57e7df6c5118ea3258cce026d9)

src/oom/test-oomd-util.c

index 5df57107f9cdde9167d2d7ccfef616547d9c784a..5abad11fbad53317fd999a255c555d179f80d802 100644 (file)
@@ -122,6 +122,7 @@ static void test_oomd_cgroup_context_acquire_and_insert(void) {
         assert_se(oomd_insert_cgroup_context(NULL, h1, cgroup) == 0);
         c1 = hashmap_get(h1, cgroup);
         assert_se(c1);
+        assert_se(oomd_insert_cgroup_context(NULL, h1, cgroup) == -EEXIST);
 
          /* make sure certain values from h1 get updated in h2 */
         c1->pgscan = 5555;