MCPcopy Create free account
hub / github.com/apache/mesos / CgroupsFilter

Method CgroupsFilter

src/tests/environment.cpp:165–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163{
164public:
165 CgroupsFilter()
166 {
167#ifdef __linux__
168 Try<set<string>> hierarchies = cgroups::hierarchies();
169 if (hierarchies.isError()) {
170 std::cerr
171 << "-------------------------------------------------------------\n"
172 << "We cannot run any cgroups tests that require mounting\n"
173 << "hierarchies because reading cgroup heirarchies failed:\n"
174 << hierarchies.error() << "\n"
175 << "We'll disable the CgroupsNoHierarchyTest test fixture for now.\n"
176 << "-------------------------------------------------------------"
177 << std::endl;
178
179 error = hierarchies.error();
180 } else if (!hierarchies->empty()) {
181 std::cerr
182 << "-------------------------------------------------------------\n"
183 << "We cannot run any cgroups tests that require mounting\n"
184 << "hierarchies because you have the following hierarchies mounted:\n"
185 << strings::trim(stringify(hierarchies.get()), " {},") << "\n"
186 << "We'll disable the CgroupsNoHierarchyTest test fixture for now.\n"
187 << "-------------------------------------------------------------"
188 << std::endl;
189
190 error = Error("Hierarchies exist");
191 }
192#endif // __linux__
193 }
194
195 bool disable(const ::testing::TestInfo* test) const override
196 {

Callers

nothing calls this directly

Calls 8

hierarchiesFunction · 0.85
trimFunction · 0.85
errorMethod · 0.65
stringifyFunction · 0.50
ErrorFunction · 0.50
isErrorMethod · 0.45
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected