bmahler commented on code in PR #510:
URL: https://github.com/apache/mesos/pull/510#discussion_r1521824848
##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
}
}
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+ Try<set<string>> available =
+ cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+ ASSERT_SOME(available);
+ EXPECT_TRUE(available.get().count("cpu") == 1);
+ EXPECT_SOME(cgroups2::controllers::enable(cgroups2::ROOT_CGROUP, {"cpu"}));
+ Try<set<string>> enabled =
Review Comment:
nit: newline above this
##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
}
}
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+ Try<set<string>> available =
+ cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+ ASSERT_SOME(available);
+ EXPECT_TRUE(available.get().count("cpu") == 1);
+ EXPECT_SOME(cgroups2::controllers::enable(cgroups2::ROOT_CGROUP, {"cpu"}));
+ Try<set<string>> enabled =
+ cgroups2::controllers::enabled(cgroups2::ROOT_CGROUP);
+ ASSERT_SOME(enabled);
+ EXPECT_TRUE(enabled.get().find("cpu") != enabled.get().end());
Review Comment:
ditto here
##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
}
}
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+ Try<set<string>> available =
+ cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+ ASSERT_SOME(available);
+ EXPECT_TRUE(available.get().count("cpu") == 1);
Review Comment:
you can use s/.get()./->/, actually tidy will complain about this, but since
tidy is broken we're not gonna notice these
##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
}
}
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+ Try<set<string>> available =
+ cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+ ASSERT_SOME(available);
+ EXPECT_TRUE(available.get().count("cpu") == 1);
Review Comment:
maybe EXPECT_EQ here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]