summaryrefslogtreecommitdiff
path: root/src/test/test-condition.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-07-31 22:01:43 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-07-31 22:06:09 -0400
commitce5fcc695e3c74599c6b8ab0d6160edf7dc41ebc (patch)
tree21b3d1751b3f7175b969e96153913c7322816425 /src/test/test-condition.c
parent6d1e2ddd59f929ce98e400cb14fba7a873e2b409 (diff)
parent4dd4cb8fe40baea007336a346ec2aa645890eec3 (diff)
Merge pull request 3821 from davide125/fix-tests
Diffstat (limited to 'src/test/test-condition.c')
-rw-r--r--src/test/test-condition.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index 987862f1c6..66003aa6bd 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -25,6 +25,7 @@
#include "audit-util.h"
#include "condition.h"
#include "hostname-util.h"
+#include "id128-util.h"
#include "ima-util.h"
#include "log.h"
#include "macro.h"
@@ -142,9 +143,14 @@ static void test_condition_test_host(void) {
hostname = gethostname_malloc();
assert_se(hostname);
- condition = condition_new(CONDITION_HOST, hostname, false, false);
- assert_se(condition_test(condition));
- condition_free(condition);
+ /* if hostname looks like an id128 then skip testing it */
+ if (id128_is_valid(hostname))
+ log_notice("hostname is an id128, skipping test");
+ else {
+ condition = condition_new(CONDITION_HOST, hostname, false, false);
+ assert_se(condition_test(condition));
+ condition_free(condition);
+ }
}
static void test_condition_test_architecture(void) {