condition: add ConditionPathIsEncrypted=

It's easy to add, and should be pretty useful, in particular as in
AssertPathIsEncrypted= as it can be used for checking that
some path is encrypted before some service is invoked that might want to
place secure material there.
This commit is contained in:
Lennart Poettering
2020-05-15 15:50:09 +02:00
parent 89fe653544
commit 7f19247b5e
4 changed files with 27 additions and 0 deletions
+5
View File
@@ -112,6 +112,11 @@ static void test_condition_test_path(void) {
assert_se(condition_test(condition) > 0);
condition_free(condition);
condition = condition_new(CONDITION_PATH_IS_ENCRYPTED, "/sys", false, false);
assert_se(condition);
assert_se(condition_test(condition) == 0);
condition_free(condition);
condition = condition_new(CONDITION_PATH_IS_SYMBOLIC_LINK, "/dev/stdout", false, false);
assert_se(condition);
assert_se(condition_test(condition) > 0);