validate/launcher: Ensure the HTTP server is started when a pipeline needs it

Pipelines declared in gst-integration-testsuites can rely on the validate HTTP
server, so when an URI pointing to it is detected, advertise the server as
needed before starting the test.

For this to work the test scenario should explicitely declare the pipeline uri,
as shown in this example:

    "some_playbin3":
    {
        "pipeline": "playbin3 uri=%(uri)s video-sink=%(videosink)s",
        "config": [
            "%(validateflow)s, pad=sink:sink"
        ],
        "scenarios": ["play_15s"],
        "uri": "http://127.0.0.1:%(http-server-port)s/defaults/html/foo.html"
    }
This commit is contained in:
Philippe Normand 2019-08-19 11:25:45 +01:00
parent 8e01e03364
commit 3351807107

View file

@ -1029,10 +1029,13 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
if self._is_test_wanted(test) and test.media_descriptor is not None:
protocol = test.media_descriptor.get_protocol()
uri = test.media_descriptor.get_uri()
if protocol in [Protocols.HTTP, Protocols.HLS, Protocols.DASH] and \
("127.0.0.1:%s" % (
self.options.http_server_port) in uri or "127.0.0.1:8079" in uri):
uri_requires_http_server = False
if uri:
expanded_uri = uri % {
'http-server-port': self.options.http_server_port}
uri_requires_http_server = expanded_uri.find(
"127.0.0.1:%s" % self.options.http_server_port) != -1
if protocol in [Protocols.HTTP, Protocols.HLS, Protocols.DASH] or uri_requires_http_server:
return True
return False