Skip to content
Snippets Groups Projects
Commit fa0b8c66 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

test: correct syntax for verify tasks, make them idempotent, run them only on...

test: correct syntax for verify tasks, make them idempotent, run them only on the Rosetta Molecule VM
parent 7a221390
No related branches found
No related tags found
1 merge request!4fix: install MediaArea packages only from official MediaArea repo
Pipeline #7511 passed
......@@ -3,25 +3,42 @@
- name: Verify
hosts: all
gather_facts: true
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true
- name: Run Rosetta-specific tests.
when: "{{ ansible_hostname }} = 'vm-rosapp-mol'"
block:
- name: Get list of installed MediaArea packages.
ansible.builtin.command:
cmd: "dnf list mediaconch mediainfo libmediainfo libzen"
register: mediaconch_repo
- name: Test if the MediaArea packages are installed from their own repository.
ansible.builtin.assert:
that: "'@MediaArea' in {{ mediaconch_repo.stdout }}"
- name: Call mediaconch to see if it runs without errors.
ansible.builtin.command:
cmd: "mediaconch -h"
register: mediaconch_output
- name: Parse mediaconch output.
ansible.builtin.assert:
that: "'MediaConch Command Line Interface' in {{ mediaconch_output.stdout }}"
- name: Run Rosetta-specific tests.
hosts: 'vm-rosapp-mol'
gather_facts: true
tasks:
- name: Get list of installed MediaArea packages.
ansible.builtin.command:
cmd: "dnf list mediaconch mediainfo libmediainfo libzen"
register: mediaconch_repo
changed_when: false
- name: >
Test if the MediaArea packages are installed from their own repository.
ansible.builtin.assert:
that: "'@MediaArea' in mediaconch_repo.stdout"
success_msg: >
The string '@MediaArea' was found in the list of installed MediaArea
packages, so we can assume that at least one of them was installed
from the official MediaArea repository.
fail_msg: >
The string '@MediaArea' was NOT found in the list of installed
MediaArea packages, so they are probably installed from another
source, quite possibly EPEL. These will probably not work without
RHEL 8.
- name: Call mediaconch to see if it runs without errors.
ansible.builtin.command:
cmd: "mediaconch -h"
register: mediaconch_output
changed_when: false
- name: Parse mediaconch output.
ansible.builtin.assert:
that: "'MediaConch Command Line Interface' in mediaconch_output.stdout"
success_msg: MediaConch runs as expected.
fail_msg: MediaConch couldn't be run without errors.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment