SlideShare a Scribd company logo
Introduction to gst-validateflow
Alicia Boya García
Igalia
2019
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 1 / 16
About me
I work at Igalia, an open source consultancy.
Most of my work revolves around improving and maintaining
MediaSource Extensions for the GStreamer-based ports of
WebKit (WPE and WebKitGTK).
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 2 / 16
Verification tooling GStreamer
Unit tests (meson test):
They are written in C. Lots of control, relatively
straightforward to understand.
Depending on what is being tested they can require high
effort and there is limited framework (GstHarness).
gst-validate:
A C binary for running tests on pipelines and a complex
Python launcher that uses it.
At best, adding a test can feel more like editing config
files.
Complex or non supported use cases can still require C or
Python coding (e.g. to enable new actions in tests).
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 3 / 16
Components of a validate test
For every test found, an invocation to gst-validate-1.0 is
made with this information:
A pipeline
Validate config file(s)
Directories providing the available scenarios
Name of the scenario to use (if any)
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 4 / 16
Invoking gst-validate
$ gst-validate-launcher ’validate.launch_pipeline.*’
validate is the name of the testsuite.
validate.launch_pipeline.* is a regexp that selects
which tests to run from the set provided by the
testsuite.
Pitfall: It’s a regexp, not a glob!
. means any character.
* means any number of repetitions of the preceding item.
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 5 / 16
Invoking gst-validate, under the hood
The testsuites are defined in
gst-integration-testsuites/testsuites/*.py.
If no filter has been specified, the ‘validate‘ testsuite is
run by default.
The testsuite code adds a series of generators, which in
turn emitting a number of tests.
GstValidatePlaybinTestsGenerator
GstValidatePipelineTestsGenerator
...
The testsuite always adds all the tests, but only those
matching the command line arguments are run.
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 6 / 16
Playbin tests (file playback tests)
Many validate tests are generated automatically by
combining many of the parameters of the previous slide.
Namely, every file inside medias/defaults with a
matching .media_info gets played in playbin (2 or 3)
with a number of scenarios testing seeks, fast forward
and other use cases.
Monitors watch for error and warning conditions, like
no playback, missing or unordered events.
This allows for lots of useful smoke tests: if someone
breaks playback of a certain kind of file, there is a good
chance gst-validate will flag it!
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 7 / 16
Scenarios
Scenarios enumerate actions that will occur during a
validate test.
There are a number of predefined scenarios in
gst-devtools/validate/data/scenarios/.
Most actions are defined in gst-validate-scenario.c.
Validate plugins can define additional actions.
description, seek=true, duration=20, need-clock-sync=true, ignore-eos=true
include,location=includes/default-seek-flags.scenario
seek, name=First-forward-seek, playback-time="5.0",
start="10.0", flags="$(default_flags)"
seek, name=Second-backward-seek, playback-time="15.0",
start="10.0", flags="$(default_flags)"
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 8 / 16
Pipeline tests
They can be found in testsuites/pipelines.json:
"flvdemux.audio_only":
{
"pipeline": "uridecodebin
uri=’file://%(config_path)s/../medias/defaults/flv/819290236.flv’
caps=audio/x-raw expose-all-streams=FALSE ! queue !
audioconvert ! audioresample ! %(audiosink)s",
"scenarios": ["play_15s"]
}
These tests are more flexible in that we can run arbitrary
pipelines with arbitrary scenarios.
But validation is still a smoke test in the example above.
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 9 / 16
Finally, validateflow
validateflow is a gst-validate plugin that validates the
flow in a certain pad matches a previous execution
known to be good.
All buffers and events flowing are recorded to a text file.
On the first test run it generates an -expected file inside
the Git repo.
Further executions create an -actual temporary file
(inside the build directory) that is compared to the
former.
Any mismatch is marked as a test failure.
When authoring tests it’s important to check that the log
is correct and reproducible.
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 10 / 16
A simple validateflow test
"flow_simple_test_custom":
{
"pipeline": "videotestsrc num-buffers=3 ! fakesink",
"config": [
"%(validateflow)s, pad=fakesink0:sink, record-buffers=true,
caps-properties={ width, height };"
]
},
$ gst-validate-launcher 
validate.launch_pipeline.pipelines.flow_simple_test_custom
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
event caps: video/x-raw, width=(int)320, height=(int)240;
event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.0
buffer: pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
buffer: pts=0:00:00.033333333, dur=0:00:00.033333333
buffer: pts=0:00:00.066666666, dur=0:00:00.033333334
event eos: (no structure)
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 11 / 16
Useful scenario actions for validateflow
appsrc-push: Allows to use appsrc elements inside the
pipeline. Instructs it to push a chunk of data from a file
with a given offset and size and waits for the push to
succeed.
appsrc-eos: Marks the appsrc as EOS.
checkpoint: (validateflow-specific) Writes some text in
the actual/expected log. This allows you to know what
buffers and events are recorded before/after what
actions.
stop: Ends the test (otherwise the test ends when there
are no remaining actions and the pipeline is EOS).
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 12 / 16
Embedded scenarios
"matroskademux_flush_within_cluster":
{
"pipeline": "appsrc ! matroskademux ! fakesink async=false",
"config": [
"%(validateflow)s, pad=fakesink0:sink, record-buffers=true"
],
"scenarios": [{
"name": "default",
"actions": [
"description, handles-states=false",
"appsrc-push, target-element-name=appsrc0,
file-name="%(medias)s/fragments/feelings_vp9-20130806-242.webm/init.webm"",
"appsrc-push, target-element-name=appsrc0,
file-name="%(medias)s/fragments/feelings_vp9-20130806-242.webm/media1.webm", size=5000",
"flush, target-element-name=appsrc0",
"checkpoint, text="A different cluster is pushed"",
"appsrc-push, target-element-name=appsrc0,
file-name="%(medias)s/fragments/feelings_vp9-20130806-242.webm/media2.webm", size=10000",
"stop"
]
}]
},
By default no actions are run until the pipeline has prerolled
For this reason in pipelines using appsrc you need to either ensure the sink does not wait for pre-roll with
async=false or allow actions to run without waiting for it with handles-state=false.
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 13 / 16
Running tests with scenarios
A test can define multiple scenarios, each with a different
name. Or it may use no scenario at all.
The full name of the test is:
validate.launch_pipeline.<test name>.<scenario>
for tests with scenarios.
validate.launch_pipeline.pipelines.<test name>
for tests without scenarios.
Future work
The current naming scheme for pipeline tests is quite
unintuitive. We may consider to change it in the future to
something less surprising.
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 14 / 16
Documentation
The GStreamer documentation contains more in-detail
information about validateflow.
https://gstreamer.freedesktop.org/documentation/
gst-devtools/plugins/validateflow.html
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 15 / 16
Future work
Turn pipelines.json into pipelines.py, because
authoring JSON is uncomfortable for humans.
Adding support for recording messages with certain filters
(e.g. STREAM_COLLECTION messages from playbin3).
Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 16 / 16

More Related Content

Similar to Introduction to Validateflow (GStreamer Conference 2019)

Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
Mike Hugo
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
Robert Munteanu
 
Test Infected Presentation
Test Infected PresentationTest Infected Presentation
Test Infected Presentation
willmation
 
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf 2009: Industrial Strength Groovy by Paul KingGR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf
 
Testing in go
Testing in goTesting in go
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
Robert Munteanu
 
Git as version control for Analytics project
Git as version control for Analytics projectGit as version control for Analytics project
Git as version control for Analytics project
Nag Arvind Gudiseva
 
Phone gap 12 things you should know
Phone gap 12 things you should knowPhone gap 12 things you should know
Phone gap 12 things you should know
ISOCHK
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3g
vasya10
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
Tsuyoshi Yamamoto
 
Sprint 18
Sprint 18Sprint 18
Sprint 18
ManageIQ
 
GTLAB Overview
GTLAB OverviewGTLAB Overview
GTLAB Overview
marpierc
 
Istio By Example (extended version)
Istio By Example (extended version)Istio By Example (extended version)
Istio By Example (extended version)
Josef Adersberger
 
Istio by Example (extended version)
Istio by Example (extended version)Istio by Example (extended version)
Istio by Example (extended version)
QAware GmbH
 
Grails Advanced
Grails Advanced Grails Advanced
Grails Advanced
Saurabh Dixit
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
KAI CHU CHUNG
 
Capistrano
CapistranoCapistrano
Capistrano
Jason Noble
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
Fastly
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
KAI CHU CHUNG
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOps
Andrey Karpov
 

Similar to Introduction to Validateflow (GStreamer Conference 2019) (20)

Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
 
Test Infected Presentation
Test Infected PresentationTest Infected Presentation
Test Infected Presentation
 
GR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf 2009: Industrial Strength Groovy by Paul KingGR8Conf 2009: Industrial Strength Groovy by Paul King
GR8Conf 2009: Industrial Strength Groovy by Paul King
 
Testing in go
Testing in goTesting in go
Testing in go
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
 
Git as version control for Analytics project
Git as version control for Analytics projectGit as version control for Analytics project
Git as version control for Analytics project
 
Phone gap 12 things you should know
Phone gap 12 things you should knowPhone gap 12 things you should know
Phone gap 12 things you should know
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3g
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
 
Sprint 18
Sprint 18Sprint 18
Sprint 18
 
GTLAB Overview
GTLAB OverviewGTLAB Overview
GTLAB Overview
 
Istio By Example (extended version)
Istio By Example (extended version)Istio By Example (extended version)
Istio By Example (extended version)
 
Istio by Example (extended version)
Istio by Example (extended version)Istio by Example (extended version)
Istio by Example (extended version)
 
Grails Advanced
Grails Advanced Grails Advanced
Grails Advanced
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
 
Capistrano
CapistranoCapistrano
Capistrano
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOps
 

More from Igalia

The journey towards stabilizing Chromium’s Wayland support
The journey towards stabilizing Chromium’s Wayland supportThe journey towards stabilizing Chromium’s Wayland support
The journey towards stabilizing Chromium’s Wayland support
Igalia
 
Sustainable Futures: Funding the Web Ecosystem
Sustainable Futures: Funding the Web EcosystemSustainable Futures: Funding the Web Ecosystem
Sustainable Futures: Funding the Web Ecosystem
Igalia
 
Status of the Layer-Based SVG Engine in WebKit
Status of the Layer-Based SVG Engine in WebKitStatus of the Layer-Based SVG Engine in WebKit
Status of the Layer-Based SVG Engine in WebKit
Igalia
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
Igalia
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
Igalia
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
Igalia
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
Igalia
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
Igalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
Igalia
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Igalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
Igalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
Igalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
Igalia
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
Igalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
Igalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Igalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
Igalia
 

More from Igalia (20)

The journey towards stabilizing Chromium’s Wayland support
The journey towards stabilizing Chromium’s Wayland supportThe journey towards stabilizing Chromium’s Wayland support
The journey towards stabilizing Chromium’s Wayland support
 
Sustainable Futures: Funding the Web Ecosystem
Sustainable Futures: Funding the Web EcosystemSustainable Futures: Funding the Web Ecosystem
Sustainable Futures: Funding the Web Ecosystem
 
Status of the Layer-Based SVG Engine in WebKit
Status of the Layer-Based SVG Engine in WebKitStatus of the Layer-Based SVG Engine in WebKit
Status of the Layer-Based SVG Engine in WebKit
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 

Recently uploaded

What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 

Recently uploaded (20)

What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 

Introduction to Validateflow (GStreamer Conference 2019)

  • 1. Introduction to gst-validateflow Alicia Boya García Igalia 2019 Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 1 / 16
  • 2. About me I work at Igalia, an open source consultancy. Most of my work revolves around improving and maintaining MediaSource Extensions for the GStreamer-based ports of WebKit (WPE and WebKitGTK). Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 2 / 16
  • 3. Verification tooling GStreamer Unit tests (meson test): They are written in C. Lots of control, relatively straightforward to understand. Depending on what is being tested they can require high effort and there is limited framework (GstHarness). gst-validate: A C binary for running tests on pipelines and a complex Python launcher that uses it. At best, adding a test can feel more like editing config files. Complex or non supported use cases can still require C or Python coding (e.g. to enable new actions in tests). Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 3 / 16
  • 4. Components of a validate test For every test found, an invocation to gst-validate-1.0 is made with this information: A pipeline Validate config file(s) Directories providing the available scenarios Name of the scenario to use (if any) Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 4 / 16
  • 5. Invoking gst-validate $ gst-validate-launcher ’validate.launch_pipeline.*’ validate is the name of the testsuite. validate.launch_pipeline.* is a regexp that selects which tests to run from the set provided by the testsuite. Pitfall: It’s a regexp, not a glob! . means any character. * means any number of repetitions of the preceding item. Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 5 / 16
  • 6. Invoking gst-validate, under the hood The testsuites are defined in gst-integration-testsuites/testsuites/*.py. If no filter has been specified, the ‘validate‘ testsuite is run by default. The testsuite code adds a series of generators, which in turn emitting a number of tests. GstValidatePlaybinTestsGenerator GstValidatePipelineTestsGenerator ... The testsuite always adds all the tests, but only those matching the command line arguments are run. Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 6 / 16
  • 7. Playbin tests (file playback tests) Many validate tests are generated automatically by combining many of the parameters of the previous slide. Namely, every file inside medias/defaults with a matching .media_info gets played in playbin (2 or 3) with a number of scenarios testing seeks, fast forward and other use cases. Monitors watch for error and warning conditions, like no playback, missing or unordered events. This allows for lots of useful smoke tests: if someone breaks playback of a certain kind of file, there is a good chance gst-validate will flag it! Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 7 / 16
  • 8. Scenarios Scenarios enumerate actions that will occur during a validate test. There are a number of predefined scenarios in gst-devtools/validate/data/scenarios/. Most actions are defined in gst-validate-scenario.c. Validate plugins can define additional actions. description, seek=true, duration=20, need-clock-sync=true, ignore-eos=true include,location=includes/default-seek-flags.scenario seek, name=First-forward-seek, playback-time="5.0", start="10.0", flags="$(default_flags)" seek, name=Second-backward-seek, playback-time="15.0", start="10.0", flags="$(default_flags)" Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 8 / 16
  • 9. Pipeline tests They can be found in testsuites/pipelines.json: "flvdemux.audio_only": { "pipeline": "uridecodebin uri=’file://%(config_path)s/../medias/defaults/flv/819290236.flv’ caps=audio/x-raw expose-all-streams=FALSE ! queue ! audioconvert ! audioresample ! %(audiosink)s", "scenarios": ["play_15s"] } These tests are more flexible in that we can run arbitrary pipelines with arbitrary scenarios. But validation is still a smoke test in the example above. Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 9 / 16
  • 10. Finally, validateflow validateflow is a gst-validate plugin that validates the flow in a certain pad matches a previous execution known to be good. All buffers and events flowing are recorded to a text file. On the first test run it generates an -expected file inside the Git repo. Further executions create an -actual temporary file (inside the build directory) that is compared to the former. Any mismatch is marked as a test failure. When authoring tests it’s important to check that the log is correct and reproducible. Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 10 / 16
  • 11. A simple validateflow test "flow_simple_test_custom": { "pipeline": "videotestsrc num-buffers=3 ! fakesink", "config": [ "%(validateflow)s, pad=fakesink0:sink, record-buffers=true, caps-properties={ width, height };" ] }, $ gst-validate-launcher validate.launch_pipeline.pipelines.flow_simple_test_custom event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1; event caps: video/x-raw, width=(int)320, height=(int)240; event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.0 buffer: pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont buffer: pts=0:00:00.033333333, dur=0:00:00.033333333 buffer: pts=0:00:00.066666666, dur=0:00:00.033333334 event eos: (no structure) Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 11 / 16
  • 12. Useful scenario actions for validateflow appsrc-push: Allows to use appsrc elements inside the pipeline. Instructs it to push a chunk of data from a file with a given offset and size and waits for the push to succeed. appsrc-eos: Marks the appsrc as EOS. checkpoint: (validateflow-specific) Writes some text in the actual/expected log. This allows you to know what buffers and events are recorded before/after what actions. stop: Ends the test (otherwise the test ends when there are no remaining actions and the pipeline is EOS). Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 12 / 16
  • 13. Embedded scenarios "matroskademux_flush_within_cluster": { "pipeline": "appsrc ! matroskademux ! fakesink async=false", "config": [ "%(validateflow)s, pad=fakesink0:sink, record-buffers=true" ], "scenarios": [{ "name": "default", "actions": [ "description, handles-states=false", "appsrc-push, target-element-name=appsrc0, file-name="%(medias)s/fragments/feelings_vp9-20130806-242.webm/init.webm"", "appsrc-push, target-element-name=appsrc0, file-name="%(medias)s/fragments/feelings_vp9-20130806-242.webm/media1.webm", size=5000", "flush, target-element-name=appsrc0", "checkpoint, text="A different cluster is pushed"", "appsrc-push, target-element-name=appsrc0, file-name="%(medias)s/fragments/feelings_vp9-20130806-242.webm/media2.webm", size=10000", "stop" ] }] }, By default no actions are run until the pipeline has prerolled For this reason in pipelines using appsrc you need to either ensure the sink does not wait for pre-roll with async=false or allow actions to run without waiting for it with handles-state=false. Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 13 / 16
  • 14. Running tests with scenarios A test can define multiple scenarios, each with a different name. Or it may use no scenario at all. The full name of the test is: validate.launch_pipeline.<test name>.<scenario> for tests with scenarios. validate.launch_pipeline.pipelines.<test name> for tests without scenarios. Future work The current naming scheme for pipeline tests is quite unintuitive. We may consider to change it in the future to something less surprising. Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 14 / 16
  • 15. Documentation The GStreamer documentation contains more in-detail information about validateflow. https://gstreamer.freedesktop.org/documentation/ gst-devtools/plugins/validateflow.html Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 15 / 16
  • 16. Future work Turn pipelines.json into pipelines.py, because authoring JSON is uncomfortable for humans. Adding support for recording messages with certain filters (e.g. STREAM_COLLECTION messages from playbin3). Alicia Boya García (Igalia) Introduction to gst-validateflow 2019 16 / 16