]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request 3821 from davide125/fix-tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 1 Aug 2016 02:01:43 +0000 (22:01 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 1 Aug 2016 02:06:09 +0000 (22:06 -0400)
1  2 
src/test/test-condition.c
test/udev-test.pl

index 987862f1c62f08d68d4b99792ef75782a516a07f,4ef61ebfa514860bc82b06a31ae67ab5148196c5..66003aa6bd05cc8a866d23d0e9dd437310830fdd
@@@ -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) {
index da0a4e1f6b4c8dc5b78aa62ea20f0abc90e4ecfd,35a2668fb32305be44b7821a2cb31424289abd36..129af854f1feb7f1915aa5a43ff8eef7280bc4e1
@@@ -1535,11 -1535,18 +1535,18 @@@ if (!($<==0)) 
          exit($EXIT_TEST_SKIP);
  }
  
 -    print "Running in a chroot, skipping the test.\n";
 -    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);
+ }
  # 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();