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

Submitted by Adrian Reber on March 23, 2017, 7:59 p.m.

Details

Message ID 1490299158-12933-5-git-send-email-adrian@lisas.de
State Accepted
Series "zdtm: also dump and restore tests with --check-only"
Commit bdfccc3b22aab16e980bd993bd4319cdba7b0f27
Headers show

Commit Message

Adrian Reber March 23, 2017, 7:59 p.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 8d38e05..7177347 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -493,6 +493,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):