diff --git a/.gitignore b/.gitignore index ba59cf7..aee8b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/fontpackages-1.44.tar.xz -/fontpackages-1.44.tar.xz +fontpackages-1.44.tar.xz diff --git a/tests/runtests.sh b/tests/runtests.sh new file mode 100644 index 0000000..602fc7c --- /dev/null +++ b/tests/runtests.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo "Test for fontpackages-filesystem" +rpm -qf `rpm -E %_fontbasedir`|grep fontpackages-filesystem +retval=$? +echo $retval +if [ $retval -ne 0 ]; then + echo "FAILED: %_fontbasedir is not owned by fontpackages-filesystem" +else + echo "PASSED: %_fontbasedir is owned by fontpackages-filesystem" +fi + + +echo "Test for fontpackages-devel" +rpm -E %_font_pkg +retval=$? +echo $retval +if [ $retval -ne 0 ]; then + echo "FAILED: %_font_pkg macro is not available by fontpackages-devel" +else + echo "PASSED: %_font_pkg macro is available by fontpackages-devel" +fi + +echo "Test dependencies of font packages" +rpm -q --requires lohit-devanagari-fonts|grep fontpackages-filesystem +retval=$? +echo $retval +if [ $retval -ne 0 ]; then + echo "FAILED: lohit-devanagari-fonts package does not require fontpackages-filesystem package" +else + echo "PASSED: lohit-devanagari-fonts package does require fontpackages-filesystem package" +fi + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..c7fd904 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,33 @@ +- hosts: localhost + vars: + - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}" + tags: + - classic + remote_user: root + tasks: + - name: Install required packages + dnf: + name: + - lohit-devanagari-fonts + + - name: Install the test files + copy: src={{ item.file }} dest=/tmp/{{ item.dest }} mode=0755 + with_items: + - {file: runtests.sh, dest: runtests.sh } + + - name: Test block + block: + - name: Execute the tests + shell: | + /tmp/runtests.sh &> /tmp/test.log && result=pass || result=fail + echo -e "results:\n- {result: $result, test: simple}" > /tmp/results.yml + + always: + - name: Pull out the logs + fetch: + dest: "{{ artifacts }}/" + src: "{{ item }}" + flat: yes + with_items: + - /tmp/test.log + - /tmp/results.yml