validate: fix crash if timeout when media_descriptor is None
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>
Mon, 17 Dec 2018 09:34:43 +0000 (10:34 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>
Mon, 17 Dec 2018 09:34:43 +0000 (10:34 +0100)
Some tests may not have any media_descriptor. If those were failing to
shutdown after EOS we were calling get_protocol() on None.

validate/launcher/baseclasses.py

index 4eab026..d89f0f1 100644 (file)
@@ -737,7 +737,7 @@ class GstValidateTest(Test):
             if self._sent_eos_time is not None:
                 t = time.time()
                 if ((t - self._sent_eos_time)) > 30:
-                    if self.media_descriptor.get_protocol() == Protocols.HLS:
+                    if self.media_descriptor is not None and self.media_descriptor.get_protocol() == Protocols.HLS:
                         self.set_result(Result.PASSED,
                                         """Got no EOS 30 seconds after sending EOS,
                                         in HLS known and tolerated issue: