From 1ff438fd186dae9d0a86405b7e92de1aa871dd27 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 25 Mar 2025 10:42:39 +0000 Subject: [PATCH] tests: execute: Check that we are not running for forever There was a bug once where the loop never terminated if the process actually could never be executed. Signed-off-by: Michael Tremer --- tests/python/execute.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/python/execute.py b/tests/python/execute.py index 97bf4b50..b8b4bcd5 100755 --- a/tests/python/execute.py +++ b/tests/python/execute.py @@ -118,6 +118,10 @@ class ExecuteTests(tests.TestCase): # Test a very long string test(b"A" * 8192 + b"\n") + # Ensure that we won't run forever in case the command cannot be found + with self.assertRaises(pakfire.CommandExecutionError): + self.pakfire.execute(["/does-not-exist"], input=b"1234") + def test_nice(self): self.pakfire.execute(["/command", "print-nice"], nice=5) -- 2.39.5