]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
testing/infra/builder: call make with empty env
authorRicardo Martincoski <ricardo.martincoski@gmail.com>
Sun, 29 Oct 2017 14:06:00 +0000 (12:06 -0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 1 Apr 2018 17:59:36 +0000 (19:59 +0200)
Use an empty environment when calling make, but import PATH so the
buildroot tree under test can find binaries from the host machine.

Since environment variables are now ignored, move the handling of
BR2_DL_DIR to the defconfig to keep the current precedence of -d:

    BR2_DL_DIR  | -d DIR   | test downloads   | BR downloads
    ------------+----------+------------------+--------------
    unset       | unset    | [error]          | [error]
    unset       | set      | in $(DIR)        | in $(DIR)
    set         | unset    | in $(BR2_DL_DIR) | in $(BR2_DL_DIR)
    set         | set      | in $(DIR)        | in $(DIR)

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/testing/infra/basetest.py
support/testing/infra/builder.py
support/testing/run-tests

index 754922692cc2a9627fbd13d0b24ab0330fe12848..b85e8627fdaef2d855fcb1988890108b6145281b 100644 (file)
@@ -42,6 +42,7 @@ class BRTest(unittest.TestCase):
         self.testname = self.__class__.__name__
         self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname)
         self.emulator = None
+        self.config += '\nBR2_DL_DIR="{}"\n'.format(self.downloaddir)
         self.config += "\nBR2_JLEVEL={}\n".format(self.jlevel)
 
     def show_msg(self, msg):
index 7512339ae14e184121803201e157a22df90fac84..36f4801a2db2924837c6f60adf1194709f4f7795 100644 (file)
@@ -24,15 +24,18 @@ class Builder(object):
                            "> end defconfig\n")
         self.logfile.flush()
 
+        env = {"PATH": os.environ["PATH"]}
         cmd = ["make",
                "O={}".format(self.builddir),
                "olddefconfig"]
-        ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile)
+        ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
+                              env=env)
         if ret != 0:
             raise SystemError("Cannot olddefconfig")
 
         cmd = ["make", "-C", self.builddir]
-        ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile)
+        ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
+                              env=env)
         if ret != 0:
             raise SystemError("Build failed")
 
index f8cee09ed145921ab4732eac321d0db7d2c14d1e..270e78cff7cf5f708a7d448c0cbd5e51d1a796d3 100755 (executable)
@@ -58,7 +58,6 @@ def main():
             return 1
 
     BRTest.downloaddir = os.path.abspath(args.download)
-    os.putenv("BR2_DL_DIR", BRTest.downloaddir)
 
     if args.output is None:
         print "Missing output directory, please use -o/--output"