validate/launcher: Ensure the HTTP server is started when a pipeline needs it
authorPhilippe Normand <philn@igalia.com>
Mon, 19 Aug 2019 10:25:45 +0000 (11:25 +0100)
committerPhilippe Normand <philn@igalia.com>
Wed, 21 Aug 2019 07:37:38 +0000 (08:37 +0100)
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"
    }

validate/launcher/apps/gstvalidate.py

index adfd5d3..a5fb862 100644 (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