]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
integration test runner: detecting podman startup failure
authorVasek Sraier <git@vakabus.cz>
Tue, 23 Mar 2021 16:07:48 +0000 (17:07 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:51 +0000 (16:17 +0200)
manager/integration/runner.py

index 9464e64390633a084cbc2e96c3e957fdc4da3feb..7be4fd547a903b2890349f6f6b53d38f01092f9a 100644 (file)
@@ -67,6 +67,11 @@ class PodmanService:
             "podman system service tcp:localhost:13579 --time=0", shell=True, env=env
         )
         time.sleep(0.5)  # required to prevent connection failures
+
+        # check that it is really running
+        if self._process.poll() is not None:
+            raise Exception(f"Failed to start the podman service, it exited early with exit code {self._process.returncode}")
+
         return PodmanServiceManager("http://localhost:13579")
 
     def __exit__(self, ex_type, ex_value, ex_traceback):
@@ -76,7 +81,7 @@ class PodmanService:
         time.sleep(0.5)  # fixes interleaved stacktraces with podman's output
 
         if failed_while_running:
-            raise Exception("Failed to properly start the podman service", ex_value)
+            raise Exception("Podman has probably unexpectedly stopped. Can't terminate it properly.", ex_value)
 
 
 class PodmanServiceManager: