core: drop unused param, move taint calculation to separate file
Follow-up for 2b28dfe6e6.
I also considered moving the function to src/basic, but since it's only used by
the manager, it doesn't seem useful.
This commit is contained in:
@@ -535,7 +535,7 @@ executables += [
|
||||
'parallel' : false,
|
||||
},
|
||||
core_test_template + {
|
||||
'sources' : files('test-manager.c'),
|
||||
'sources' : files('test-taint.c'),
|
||||
},
|
||||
core_test_template + {
|
||||
'sources' : files('test-namespace.c'),
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "manager.h"
|
||||
#include "tests.h"
|
||||
|
||||
TEST(manager_taint_string) {
|
||||
Manager m = {};
|
||||
|
||||
_cleanup_free_ char *a = manager_taint_string(&m);
|
||||
assert_se(a);
|
||||
log_debug("taint string: '%s'", a);
|
||||
|
||||
if (cg_all_unified() == 0)
|
||||
assert_se(strstr(a, "cgroupsv1"));
|
||||
else
|
||||
assert_se(!strstr(a, "cgroupsv1"));
|
||||
}
|
||||
|
||||
DEFINE_TEST_MAIN(LOG_DEBUG);
|
||||
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "taint.h"
|
||||
#include "tests.h"
|
||||
|
||||
TEST(taint_string) {
|
||||
_cleanup_free_ char *a = taint_string();
|
||||
assert_se(a);
|
||||
log_debug("taint string: '%s'", a);
|
||||
|
||||
assert_se(!!strstr(a, "cgroupsv1") == (cg_all_unified() == 0));
|
||||
}
|
||||
|
||||
DEFINE_TEST_MAIN(LOG_DEBUG);
|
||||
Reference in New Issue
Block a user