diff --git a/renderer/make_page.py b/renderer/make_page.py index 69cddbf40744827d5bacbb126ac133f1967ebb1b..936dea8421e202e4d2fbbafdafcd5c1e3d18d1bf 100755 --- a/renderer/make_page.py +++ b/renderer/make_page.py @@ -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): diff --git a/renderer/templates/index.html b/renderer/templates/index.html index 3207e398d42662acd3d9bda97cd1d9d1dcd61a77..6c15088a4b725b774474947c0f0bb73cc0e1ee5e 100644 --- a/renderer/templates/index.html +++ b/renderer/templates/index.html @@ -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 %} diff --git a/renderer/templates/macros.html b/renderer/templates/macros.html index 4c72012b6fc5e06ec713dcc346f3e22045531454..c52198d3849ec915997504d2bf481f187a0b66df 100644 --- a/renderer/templates/macros.html +++ b/renderer/templates/macros.html @@ -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 %} diff --git a/tc/rhosydd.yaml b/tc/rhosydd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a066060c636df625ff295bc28203e000eec185e2 --- /dev/null +++ b/tc/rhosydd.yaml @@ -0,0 +1,55 @@ +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 diff --git a/tc/ribchester.yaml b/tc/ribchester.yaml new file mode 100644 index 0000000000000000000000000000000000000000..63a05e02edb7f78a9be276a1951e7de5ab7b7681 --- /dev/null +++ b/tc/ribchester.yaml @@ -0,0 +1,46 @@ +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