validate:launcher: Avoid running useless tests

For example we should not check if duration are equal when transcoding
with scenario set.

Also checking if position is in the seeked segment should be done at
a lower level
This commit is contained in:
Thibault Saunier 2014-02-14 16:07:51 +01:00
parent d377158b42
commit 1189c48ff8
3 changed files with 30 additions and 26 deletions

View file

@ -132,7 +132,7 @@ class GESRenderTest(GESTest):
self.add_arguments("-f", profile, "-o", self.dest_file)
def check_results(self):
if self.process.returncode == 0:
if self.result is Result.PASSED and self.scenario is None:
res, msg = utils.compare_rendered_with_original(self.duration, self.dest_file)
self.set_result(res, msg)
else:

View file

@ -152,6 +152,19 @@ class GstValidateLaunchTest(GstValidateTest):
self.add_arguments(self.pipeline_desc)
def get_current_value(self):
if self.scenario:
sent_eos = self.sent_eos_position()
if sent_eos is not None:
if ((time.time() - sent_eos)) > 30:
if self.file_infos.get("file-info", "protocol") == Protocols.HLS:
self.set_result(Result.PASSED,
"""Got no EOS 30 seconds after sending EOS,
in HLS known and tolerated issue:
https://bugzilla.gnome.org/show_bug.cgi?id=723868""")
return Result.KNOWN_ERROR
return Result.FAILED
return self.get_current_position()
@ -225,22 +238,23 @@ class GstValidateTranscodingTest(GstValidateTest):
self.add_arguments(self.uri, self.dest_file)
def get_current_value(self):
sent_eos = self.sent_eos_position()
if sent_eos is not None:
if ((time.time() - sent_eos)) > 30:
if self.file_infos.get("file-info", "protocol") == Protocols.HLS:
self.set_result(Result.PASSED,
"""Got no EOS 30 seconds after sending EOS,
in HLS known and tolerated issue:
https://bugzilla.gnome.org/show_bug.cgi?id=723868""")
return Result.KNOWN_ERROR
if self.scenario:
sent_eos = self.sent_eos_position()
if sent_eos is not None:
if ((time.time() - sent_eos)) > 30:
if self.file_infos.get("file-info", "protocol") == Protocols.HLS:
self.set_result(Result.PASSED,
"""Got no EOS 30 seconds after sending EOS,
in HLS known and tolerated issue:
https://bugzilla.gnome.org/show_bug.cgi?id=723868""")
return Result.KNOWN_ERROR
return Result.FAILED
return Result.FAILED
return self.get_current_size()
def check_results(self):
if self.result is Result.PASSED:
if self.result is Result.PASSED and not self.scenario:
orig_duration = long(self.file_infos.get("media-info", "file-duration"))
res, msg = compare_rendered_with_original(orig_duration, self.dest_file)
self.set_result(res, msg)

View file

@ -208,14 +208,13 @@ class GstValidateTest(Test):
def __init__(self, application_name, classname,
options, reporter, timeout=DEFAULT_TIMEOUT,
scenario=None, hard_timeout=None, max_outside_segment=5):
scenario=None, hard_timeout=None):
super(GstValidateTest, self).__init__(application_name, classname, options,
reporter, timeout=timeout, hard_timeout=hard_timeout)
# defines how much the process can be outside of the configured
# segment / seek
self.max_outside_segment = max_outside_segment
self._sent_eos_pos = None
if scenario is None or scenario.name.lower() == "none":
@ -262,7 +261,7 @@ class GstValidateTest(Test):
"segfault")
else:
self.set_result(Result.FAILED,
"Application returned %d (issues: %s)" % (
"Application returned %s (issues: %s)" % (
self.process.returncode,
self.get_validate_criticals_errors()
))
@ -351,17 +350,8 @@ class GstValidateTest(Test):
def get_current_position(self):
position, duration = self._get_position()
start, stop, rate = self._get_last_seek_values()
if start and not (start - self.max_outside_segment * GST_SECOND < position < stop +
self.max_outside_segment):
self.set_result(Result.FAILED,
"Position not in expected 'segment' (with %d second tolerance)"
"seek.start %d < position %d < seek.stop %d is FALSE"
% (self.max_outside_segment,
start - self.max_outside_segment, position,
stop + self.max_outside_segment)
)
if position == -1:
return position
return position