s4-selftest: silence warnings about bind chown
authorAndrew Tridgell <tridge@samba.org>
Sat, 2 Oct 2010 21:21:52 +0000 (14:21 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sun, 3 Oct 2010 04:11:52 +0000 (21:11 -0700)
source4/scripting/python/samba/provision.py
source4/selftest/wscript

index 79f180dfcbb2179fe3d38e5a82c94a72a090c0f8..96e7aa502fee9aba4aca47eafe6c57702cc7e30d 100644 (file)
@@ -1672,7 +1672,7 @@ def provision(setup_dir, logger, session_info,
             os.chmod(dns_keytab_path, 0640)
             os.chown(dns_keytab_path, -1, paths.bind_gid)
         except OSError:
             os.chmod(dns_keytab_path, 0640)
             os.chown(dns_keytab_path, -1, paths.bind_gid)
         except OSError:
-            if os.environ.get('UID_WRAPPER'):
+            if not os.environ.has_key('SAMBA_SELFTEST'):
                 logger.info("Failed to chown %s to bind gid %u", dns_keytab_path,
                             paths.bind_gid)
 
                 logger.info("Failed to chown %s to bind gid %u", dns_keytab_path,
                             paths.bind_gid)
 
@@ -1827,7 +1827,7 @@ def create_zone_file(lp, logger, paths, targetdir, setup_path, dnsdomain,
             os.chmod(dns_dir, 0775)
             os.chmod(paths.dns, 0664)
         except OSError:
             os.chmod(dns_dir, 0775)
             os.chmod(paths.dns, 0664)
         except OSError:
-            if os.environ.get('UID_WRAPPER'):
+            if not os.environ.has_key('SAMBA_SELFTEST'):
                 logger.error("Failed to chown %s to bind gid %u" % (dns_dir, paths.bind_gid))
 
     if targetdir is None:
                 logger.error("Failed to chown %s to bind gid %u" % (dns_dir, paths.bind_gid))
 
     if targetdir is None:
index 0d662c6456b6e768acab5606cce07288183f43c8..4606c6681adc680da302c5ca46c95f03b5812d26 100644 (file)
@@ -78,6 +78,8 @@ def cmd_testonly(opt):
         print("ERROR: You must use --enable-selftest to enable selftest")
         sys.exit(1)
 
         print("ERROR: You must use --enable-selftest to enable selftest")
         sys.exit(1)
 
+    os.environ['SAMBA_SELFTEST'] = '1'
+
     env.TESTS  = Options.options.TESTS
 
     env.SUBUNIT_FORMATTER = '${PYTHON} -u ../selftest/format-subunit --prefix=${SELFTEST_PREFIX} --immediate'
     env.TESTS  = Options.options.TESTS
 
     env.SUBUNIT_FORMATTER = '${PYTHON} -u ../selftest/format-subunit --prefix=${SELFTEST_PREFIX} --immediate'