make test: detect early vpp crash
[vpp.git] / test / hook.py
index 3ae1473..90e9bbf 100644 (file)
@@ -57,7 +57,6 @@ class PollHook(Hook):
     """ Hook which checks if the vpp subprocess is alive """
 
     def __init__(self, testcase):
-        self.vpp_dead = False
         self.testcase = testcase
         self.logger = testcase.logger
 
@@ -73,7 +72,7 @@ class PollHook(Hook):
             raise Exception("GDB refused to die...")
 
     def on_crash(self, core_path):
-        if self.testcase.interactive:
+        if self.testcase.debug_core:
             gdb_path = '/usr/bin/gdb'
             if os.path.isfile(gdb_path) and os.access(gdb_path, os.X_OK):
                 # automatically attach gdb
@@ -92,7 +91,7 @@ class PollHook(Hook):
         Poll the vpp status and throw an exception if it's not running
         :raises VppDiedError: exception if VPP is not running anymore
         """
-        if self.vpp_dead:
+        if self.testcase.vpp_dead:
             # already dead, nothing to do
             return