diff mbox series

[v1,5/8] docker: docker.py use "ps" to probe usage

Message ID 20180618130709.19730-6-alex.bennee@linaro.org
State New
Headers show
Series Docker tweaks for TCG testing | expand

Commit Message

Alex Bennée June 18, 2018, 1:07 p.m. UTC
The "images" command is a fairly heavyweight command to run as it
involves searching the whole docker file-system inventory. On a
machine with a lot of images this makes start-up fairly expensive.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/docker/docker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

Comments

Philippe Mathieu-Daudé June 18, 2018, 3 p.m. UTC | #1
On 06/18/2018 10:07 AM, Alex Bennée wrote:
> The "images" command is a fairly heavyweight command to run as it

> involves searching the whole docker file-system inventory. On a

> machine with a lot of images this makes start-up fairly expensive.


"version" would be even quicker.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> ---

>  tests/docker/docker.py | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/tests/docker/docker.py b/tests/docker/docker.py

> index c83fd89985..3072bf4a31 100755

> --- a/tests/docker/docker.py

> +++ b/tests/docker/docker.py

> @@ -49,7 +49,7 @@ def _guess_docker_command():

>      commands = [["docker"], ["sudo", "-n", "docker"]]

>      for cmd in commands:

>          try:

> -            if subprocess.call(cmd + ["images"],

> +            if subprocess.call(cmd + ["ps"],

>                                 stdout=DEVNULL, stderr=DEVNULL) == 0:

>                  return cmd

>          except OSError:

>
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index c83fd89985..3072bf4a31 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -49,7 +49,7 @@  def _guess_docker_command():
     commands = [["docker"], ["sudo", "-n", "docker"]]
     for cmd in commands:
         try:
-            if subprocess.call(cmd + ["images"],
+            if subprocess.call(cmd + ["ps"],
                                stdout=DEVNULL, stderr=DEVNULL) == 0:
                 return cmd
         except OSError: