Add simple sanity check for docker

This commit is contained in:
Paul Gauthier 2023-06-28 15:55:42 -07:00
parent 06656998e1
commit 03a5598c60

View file

@ -86,6 +86,8 @@ def main(
summarize_results(dirname)
return
check_docker()
if clean and dirname.exists():
print("Cleaning up and replacing", dirname)
dir_files = set(fn.name for fn in dirname.glob("*"))
@ -432,5 +434,19 @@ def cleanup_test_output(output):
return res
def check_docker():
command = [
"docker",
"run",
"-it",
"--rm",
"--interactive=false",
"python:3.8-slim",
"/bin/true",
]
result = subprocess.run(command, stdout=subprocess.PIPE, text=True)
assert not result.returncode, "Can't run: " + " ".join(command)
if __name__ == "__main__":
app()