diff mbox series

[v1,08/13] tests/docker: search the tests/docker tree to inline parent dockerfile

Message ID 20200124204026.2107-9-alex.bennee@linaro.org
State New
Headers show
Series docker multiarch awareness | expand

Commit Message

Alex Bennée Jan. 24, 2020, 8:40 p.m. UTC
The changes to a multi-directory set of dockerfiles means we can't
rely on hardcoding any more. Just search down the tree until we find
the file we are looking for.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/docker.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 7dfca63fe4..892d70b568 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -189,9 +189,10 @@  def _read_qemu_dockerfile(img_name):
     if img_name.startswith("debian") and img_name.endswith("user"):
         img_name = "debian-bootstrap"
 
-    df = os.path.join(os.path.dirname(__file__), "dockerfiles",
-                      img_name + ".docker")
-    return _read_dockerfile(df)
+    dockerfile = img_name + ".docker"
+    for root, dirs, files in os.walk(os.path.dirname(__file__)):
+        if dockerfile in files:
+            return _read_dockerfile(os.path.join(root, dockerfile))
 
 
 def _dockerfile_preprocess(df):