From 01fd6005d113b36cfcffcda9ae0c54c163fc7845 Mon Sep 17 00:00:00 2001 From: Manuel Franceschini <manuel.franceschini@gmail.com> Date: Mon, 28 Apr 2008 10:42:04 +0000 Subject: [PATCH] Make testSignal unittest not depend on default shell This patch changes the code executed when testing the signal handling of RunCmd. Since sh does not always point to bash (e.g. on Ubuntu, where it points to /bin/dash) this test might fail due to the returned exit code is different so the received signal is not correctly detected. Additionally fix the docstring of testSignal. Reviewed-by: iustinp --- test/ganeti.utils_unittest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ganeti.utils_unittest.py b/test/ganeti.utils_unittest.py index b9035e77d..abc4a7692 100755 --- a/test/ganeti.utils_unittest.py +++ b/test/ganeti.utils_unittest.py @@ -155,8 +155,8 @@ class TestRunCmd(unittest.TestCase): self.assertEqual(result.output, "A" + self.magic + "B" + self.magic) def testSignal(self): - """Test standard error""" - result = RunCmd("/bin/sh -c 'kill -15 $$'") + """Test signal""" + result = RunCmd(["python", "-c", "import os; os.kill(os.getpid(), 15)"]) self.assertEqual(result.signal, 15) def testListRun(self): -- GitLab