Added CI tests
Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
This commit is contained in:
parent
3767d9f58c
commit
824aa0598d
22
tests/test-simple
Normal file
22
tests/test-simple
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -d /tmp/test-ttmkfdir ];then
|
||||||
|
rm -rf /tmp/test-ttmkfdir
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir /tmp/test-ttmkfdir
|
||||||
|
cd /tmp/test-ttmkfdir
|
||||||
|
ttmkfdir -d /usr/share/fonts/sazanami/gothic .
|
||||||
|
if [ -f ./fonts.scale ]; then
|
||||||
|
diff -urN ./fonts.scale /usr/share/fonts/sazanami/gothic/fonts.scale
|
||||||
|
retval=$?
|
||||||
|
echo $retval
|
||||||
|
if [ $retval -ne 0 ]; then
|
||||||
|
echo "check if sazanami-gothic-fonts is installed or its packaging is changed"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "ttmkfdir sucessfully generated fonts.scale file for sazanami-gothic-fonts directory"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
34
tests/tests.yml
Normal file
34
tests/tests.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
vars:
|
||||||
|
- artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
remote_user: root
|
||||||
|
tasks:
|
||||||
|
- name: Install required packages
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- sazanami*fonts
|
||||||
|
- xorg-x11-fonts-misc
|
||||||
|
|
||||||
|
- name: Install the test files
|
||||||
|
copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }} mode=0755
|
||||||
|
with_items:
|
||||||
|
- {file: test-simple, dest: test-simple }
|
||||||
|
|
||||||
|
- name: Test block
|
||||||
|
block:
|
||||||
|
- name: Execute the tests
|
||||||
|
shell: |
|
||||||
|
/usr/local/bin/test-simple &> /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
|
Loading…
Reference in New Issue
Block a user