mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-05 14:09:53 +03:00
support/testing: factor out run_cmd_on_host
Currently many test cases call subprocess.check_output on their own. Factor out that code to an infra method so the call get standardized. This will be handful when switching the test infra to use Python 3. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
1b2928201f
commit
620c98a214
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import infra.basetest
|
||||
|
||||
@@ -15,10 +14,7 @@ CHECK_FS_TYPE_CMD = "mount | grep '/dev/root on / type {}'"
|
||||
|
||||
def dumpe2fs_run(builddir, image):
|
||||
cmd = ["host/sbin/dumpe2fs", os.path.join("images", image)]
|
||||
ret = subprocess.check_output(cmd,
|
||||
stderr=open(os.devnull, "w"),
|
||||
cwd=builddir,
|
||||
env={"LANG": "C"})
|
||||
ret = infra.run_cmd_on_host(builddir, cmd)
|
||||
return ret.strip().splitlines()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user