Skip to content
Snippets Groups Projects
Commit d0524029 authored by Luis Araujo's avatar Luis Araujo
Browse files

Add ported test cases for rhosydd and ribchester


This commit also adds a new macro 'macro_modules_preconditions'
to make convenient adding the preconditions for the library modules
test cases.

Signed-off-by: default avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent e0bb6041
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,10 @@ def get_template_values(testcase_data):
if packages_list:
template_values.update({ 'packages_list' : packages_list })
modules_preconditions = metadata.get('macro_modules_preconditions')
if modules_preconditions:
template_values.update({ 'libname' : modules_preconditions })
return template_values
def generate_test_case(tc_file, directory):
......
......@@ -34,14 +34,15 @@
<li>{{ resource|e }}</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% if pre_conditions or pkgname or packages_list %}
{% if pre_conditions or pkgname or packages_list or libname %}
<hr />
<h4>Pre Conditions</h4>
<ol>
{% if pkgname %}{{ macros.ostree_preconditions(pkgname) }}{% endif %}
{% if packages_list %}{{ macros.install_packages(packages_list) }}{% endif %}
{% if libname %}{{ macros.modules_preconditions(libname) }}{% endif %}
{% for comment, command, output in pre_conditions %}
{% if comment %}<li class="mb-sm-2">{{ comment|e }}</li>{% endif %}
{% if command %}<p><kbd>{{ command|e }}</kbd></p>{% endif %}
......
......@@ -20,3 +20,14 @@
<li class="mb-sm-2">Restart the system to restore the filesystem state to read-only before running the test.</li>
<p><kbd>$ sudo reboot</kbd></p>
{% endmacro %}
{% macro modules_preconditions(libname) %}
<li class="mb-sm-2">Download the ribchester binary inside the /tmp directory.</li>
<p><kbd>$ cd /tmp/</kbd></p>
<p><kbd>$ apt source {{ libname }}</kbd></p>
<p><kbd>$ chown user:user -R /tmp/{{ libname }}-*</kbd></p>
<li class="mb-sm-2">Clone the apertis-tests git repository:</li>
<p><kbd>$ git clone https://gitlab.apertis.org/infrastructure/apertis-tests.git</kbd></p>
<li class="mb-sm-2">Enter the tests directory and follow the execution steps.</li>
<p><kbd>$ cd apertis-tests/</kbd></p>
{% endmacro %}
metadata:
name: rhosydd
format: "Apertis Test Definition 1.0"
image-type: any
image-arch: any
type: unit
exec-type: automated
priority: medium
maintainer: "Apertis Project"
description: "Rhosydd module test."
macro_modules_preconditions: rhosydd
expected:
- "All tests should pass (ok). The output should be similar to:"
- |
>test.name0...ok
test.name1...ok
test.name2...ok
test.nameN...ok
install:
deps:
- build-essential
- devscripts
- dpkg-dev
- gnome-desktop-testing
- libcroesor-0-dev
- libcroesor-0-tests
- librhosydd-0-dev
- librhosydd-0-tests
- python3-debian
- rhosydd
- rhosydd-tests
- rhosydd-tools
- rhosydd-mock-backends
steps:
# Download in /tmp directory
- cd /tmp/
- apt source rhosydd
- chown user:user -R /tmp/rhosydd-*
run:
steps:
- "# Execute the following commands:"
- systemctl start rhosydd-mock-backend.service
- systemctl start rhosydd-speedo-backend.service
- common/run-test-in-systemd --timeout=900 --chdir /tmp/rhosydd-* --user=user --name=rhosydd -- sadt --verbose
parse:
pattern: '^(?P<test_case_id>[a-zA-Z0-9_\-\./]+)\s...\s(?P<result>ok|FAIL|SKIP)'
fixupdict:
ok: pass
FAIL: fail
SKIP: skip
metadata:
name: ribchester
format: "Apertis Test Definition 1.0"
image-type: any
image-arch: any
type: unit
exec-type: automated
priority: critical
maintainer: "Apertis Project"
description: "Ribchester library test."
macro_modules_preconditions: ribchester
expected:
- "All tests should pass (ok). The output should be similar to:"
- |
>test.name0...ok
test.name1...ok
test.name2...ok
test.nameN...ok
install:
deps:
- build-essential
- devscripts
- gnome-desktop-testing
- python3-debian
- ribchester-dev
- ribchester-tests
steps:
# Download in /tmp directory
- cd /tmp/
- apt source ribchester
- chown user:user -R /tmp/ribchester-*
run:
steps:
- "# Execute the following command:"
- common/run-test-in-systemd --timeout=900 --chdir /tmp/ribchester-* --user=user --name=ribchester -- sadt --verbose
parse:
pattern: '^(?P<test_case_id>[a-zA-Z0-9_\-\./]+)\s...\s(?P<result>ok|FAIL|SKIP)'
fixupdict:
ok: pass
FAIL: fail
SKIP: skip
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment