[RESEND,v2,4/5] zdtm: call getpid() during gone if pid is zero

Submitted by Adrian Reber on May 23, 2017, 9:42 a.m.

Details

Message ID 1495532535-22405-4-git-send-email-adrian@lisas.de
State New
Series "Series without cover letter"
Headers show

Commit Message

Adrian Reber May 23, 2017, 9:42 a.m.
From: Adrian Reber <areber@redhat.com>

If calling gone() without ever calling getpid() before leads to
backtrace. Just call getpid() to avoid that.

Signed-off-by: Adrian Reber <areber@redhat.com>
---
 test/zdtm.py | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index 19fbec2..b5062ea 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -500,6 +500,8 @@  class zdtm_test:
 		return self.__getcropts() + self.__freezer.getropts() + self.__desc.get('ropts', '').split()
 
 	def gone(self, force = True):
+		if self.__pid == 0:
+			self.getpid()
 		if not self.auto_reap:
 			pid, status = os.waitpid(int(self.__pid), 0)
 			if pid != int(self.__pid):