Skip to content
Juan A. Rubio edited this page May 14, 2017 · 18 revisions

Home | Tizonia OpenMAX IL | Skema

Skema test execution framework - An introduction

Skema is a test execution framework that lets you define and run OpenMAX IL test suites using an easy-to-program XML syntax like this:

<Suite>

  <Case name="Mp3Playback101">

    <OMX_Init />

    <OMX_GetHandle name="OMX.Aratelia.file_reader.binary" alias="fr" />
    <OMX_GetHandle name="OMX.Aratelia.audio_renderer.pcm" alias="ar" />
    <OMX_GetHandle name="OMX.Aratelia.audio_decoder.mp3" alias="ad" />

    <!-- Some more stuff... -->

    <OMX_FreeHandle alias="ar" />
    <OMX_FreeHandle alias="ad" />
    <OMX_FreeHandle alias="fr" />

    <OMX_Deinit />

  </Case>

</Suite>

In Skema, a suite is a python module (e.g. Vp8Playback.py) that has an associated XML script (Vp8Playback.xml). The python module simply contains a small amount of Python code needed by Skema to locate and execute the XML-based script. The associated XML script is the really important bit. It is used to describe tests cases and the OpenMAX IL operations that will be executed in each test case. For instance, in order to define a new test suite with a number of mp3 playback test cases, a Mp3Playback.xml and a Mp3Playback.py files would be produced.

Skema suites are placed under the skema/skema/suites folder in Skema's repository. Whenever a XML suite is loaded and parsed, Skema sequentially executes each of the XML tags found in the XML script.

The execution of the XML tags is possible because each tag is automatically associated to a special Python module of the same name. Skema tries and loads these special 'XML tag' python modules from the skema/skema/tags folder in Skema's repository. An example of Skema XML tag is OMX_SendCommand. This is defined in OMX_SendCommand.py. When the

<OMX_SetupTunnel outcomp="fr" outport="0" incomp="ad" inport="0" expect="OMX_ErrorNone"/>

tag is parsed, the corresponding Python module OMX_SendCommand.py is loaded and interpreted. Tag modules use the Ctypes-based omxil12.py module, to load the IL Core and access the IL API from the convenience of Python. This enables Skema to act as an IL Client that loads and drives any of the OpenMAX IL components accessible to the IL Core.

How to install Skema

Simply clone the repository, and run skema from the bin folder..

How to run Skema

The following sections explain the typical workflow

Set the LD_LIBRARY_PATH variable

Skema needs to load the Tizonia OpenMAX IL Core shared library. If Tizonia has been installed in a non-standard location, we need to make sure that LD_LIBRARY_PATH is set before running Skema. E.g.:

[juanrubio@gobo] [15:02] [~/work/skema/bin]: export LD_LIBRARY_PATH=/home/juanrubio/temp/lib

Available Skema commands

Run skema help for the available commands:

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema help

Available commands:

  list_installed_suites
  list_installed_tags
  help
  list_suites
  uninstall_tag
  version
  install_suite
  run_suite
  list_tags
  uninstall_suite
  install_tag

To access extended help on a command use 'skema help [command]'

List all available XML tags and Skema suites

Firstly, you will need to install all the available tags and suites found under Skema's source tree. The available suites and tags can be listed like this:

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema list_tags
OMX_BaseProfileAllocateBuffers
OMX_BaseProfileFreeBuffers
OMX_BaseProfilePort
OMX_BaseProfileStartBufferExchange
OMX_ComponentNameEnum
OMX_ComponentOfRoleEnum
OMX_Deinit
OMX_ExpectEvent
OMX_FreeHandle
OMX_GetComponentVersion
OMX_GetContentURI
OMX_GetHandle
OMX_GetParameter
OMX_Init
OMX_RoleOfComponentEnum
OMX_SendCommand
OMX_SetComponentRole
OMX_SetContentURI
OMX_SetParameter
OMX_SetupTunnel
OMX_TeardownTunnel
OMX_Wait

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema list_suites
PcmPlayback
PcmPlaybackBaseProfile
Mp3Playback
Vp8Playback
ComponentNameEnum
ComponentOfRoleEnum
RoleOfComponentEnum
StateMachine

Install all available tags and suites

As a prerequisite, you need to install both tags and suites. To install a tag or suite, simply use the corresponding command. For example:

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema install_tag OMX_ComponentNameEnum
...

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema install_suite ComponentNameEnum
...

The bin directory contains a convenience script to re-install all suites and tags in one go.

./skema-reinstall-all

Run a suite

This is the description of the run_suite command

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema help run_suite
Usage: skema run_suite SUITENAME

Options:
  -h, --help            show this help message and exit
  -q, --quiet
  -o DIR, --output=DIR  Store processed suite output to DIR

Description:
Run suites

Once all the tags and suites have been installed, you can run any of the installed suites for example like this:

[juanrubio@gobo] [15:02] [~/work/skema/bin]: ./skema run_suite Mp3Playback --quiet

Suite execution results

If you didn't use the -o flag, Skema's output logs will be placed in a directory under $HOME/.local/share/skema/results/

An example of Skema log file can be found here: Skema-log-files.md

Tips

skema's Bash completion file

There is a Bash completion file for skema. This comes handy when working skema on the command-line.

Enabling Tizonia's OpenMAX IL components log output

If you need to see the debug output produced by the Tizonia OpenMAX IL plugins during the execution of the test, make sure you have a .log4crc file appropriately configured and located in your $HOME directory. Then you just need to export the following environment variable in the shell where the Skema suite is being run:

export TIZONIA_CORE_STARTS_LOG=1