From: Zbigniew Jędrzejewski-Szmek Date: Mon, 1 Aug 2016 02:01:43 +0000 (-0400) Subject: Merge pull request 3821 from davide125/fix-tests X-Git-Tag: upstream/v231~158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce5fcc695e3c74599c6b8ab0d6160edf7dc41ebc;p=platform%2Fupstream%2Fsystemd.git Merge pull request 3821 from davide125/fix-tests --- ce5fcc695e3c74599c6b8ab0d6160edf7dc41ebc diff --cc src/test/test-condition.c index 987862f,4ef61eb..66003aa --- a/src/test/test-condition.c +++ b/src/test/test-condition.c @@@ -142,9 -143,14 +143,14 @@@ static void test_condition_test_host(vo 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)) { ++ if (id128_is_valid(hostname)) + log_notice("hostname is an id128, skipping test"); - } else { ++ else { + condition = condition_new(CONDITION_HOST, hostname, false, false); + assert_se(condition_test(condition)); + condition_free(condition); + } } static void test_condition_test_architecture(void) { diff --cc test/udev-test.pl index da0a4e1,35a2668..129af85 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@@ -1535,11 -1535,18 +1535,18 @@@ if (!($<==0)) exit($EXIT_TEST_SKIP); } + # skip the test when running in a chroot + system("systemd-detect-virt", "-r", "-q"); + if ($? >> 8 == 0) { - print "Running in a chroot, skipping the test.\n"; - exit($EXIT_TEST_SKIP); ++ print "Running in a chroot, skipping the test.\n"; ++ exit($EXIT_TEST_SKIP); + } + # skip the test when running in a container system("systemd-detect-virt", "-c", "-q"); if ($? >> 8 == 0) { -- print "Running in a container, skipping the test.\n"; -- exit($EXIT_TEST_SKIP); ++ print "Running in a container, skipping the test.\n"; ++ exit($EXIT_TEST_SKIP); } udev_setup();