diff --git a/tests/check-default-locale-installed.sh b/tests/check-default-locale-installed.sh new file mode 100644 index 0000000..f0844a6 --- /dev/null +++ b/tests/check-default-locale-installed.sh @@ -0,0 +1,34 @@ +#!/bin/bash + + +for pkg in `cat /tmp/langpacks-packages-list.txt`; do +sudo dnf install $pkg -y --quiet +retval=$? +echo $retval +if [ $retval -ne 0 ]; then + echo "$pkg is not installed" +else + echo "$pkg is successfully installed" +fi +done + +# Check hi language +sudo dnf list installed|grep glibc-langpack-hi +retval=$? +echo $retval +if [ $retval -ne 0 ]; then + echo "langpacks-hi failed to install locale package glibc-langpack-hi" +else + echo "langpacks-hi installed with locale package glibc-langpack-hi" +fi + +# Check zh_CN language +sudo dnf list installed|grep glibc-langpack-zh +retval=$? +echo $retval +if [ $retval -ne 0 ]; then + echo "langpacks-zh_CN failed to install locale package glibc-langpack-zh" +else + echo "langpacks-zh_CN installed with locale package glibc-langpack-zh" +fi + diff --git a/tests/langpacks-packages-list.txt b/tests/langpacks-packages-list.txt new file mode 100644 index 0000000..4db97c6 --- /dev/null +++ b/tests/langpacks-packages-list.txt @@ -0,0 +1,78 @@ +langpacks-af +langpacks-am +langpacks-ar +langpacks-as +langpacks-be +langpacks-bg +langpacks-bn +langpacks-br +langpacks-bs +langpacks-ca +langpacks-cs +langpacks-cy +langpacks-da +langpacks-de +langpacks-el +langpacks-en +langpacks-es +langpacks-et +langpacks-eu +langpacks-fa +langpacks-fi +langpacks-fr +langpacks-ga +langpacks-gl +langpacks-gu +langpacks-he +langpacks-hi +langpacks-hr +langpacks-hu +langpacks-ia +langpacks-id +langpacks-is +langpacks-it +langpacks-ja +langpacks-kk +langpacks-kn +langpacks-ko +langpacks-lt +langpacks-lv +langpacks-mk +langpacks-ml +langpacks-mr +langpacks-ms +langpacks-nb +langpacks-ne +langpacks-nl +langpacks-nn +langpacks-nr +langpacks-or +langpacks-pa +langpacks-pl +langpacks-pt +langpacks-ro +langpacks-ru +langpacks-si +langpacks-sk +langpacks-sl +langpacks-sq +langpacks-sr +langpacks-ss +langpacks-sv +langpacks-ta +langpacks-te +langpacks-th +langpacks-tn +langpacks-tr +langpacks-ts +langpacks-uk +langpacks-ur +langpacks-ve +langpacks-vi +langpacks-xh +langpacks-zu +langpacks-ast +langpacks-mai +langpacks-nso +langpacks-zh_CN +langpacks-zh_TW diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..51f3baa --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,39 @@ +- hosts: localhost + vars: + - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}" + tags: + - classic + remote_user: root + tasks: + - name: Install required packages + dnf: + name: + - langpacks-hi + - langpacks-zh_CN + + - name: Install the test files + copy: src={{ item.file }} dest=/tmp/{{ item.dest }} mode=0755 + with_items: + - {file: check-default-locale-installed.sh, dest: check-default-locale-installed.sh } + + - name: Install the test data files + copy: src={{ item.file }} dest=/tmp/{{ item.dest }} mode=0644 + with_items: + - {file: langpacks-packages-list.txt, dest: langpacks-packages-list.txt } + + - name: Test block + block: + - name: Execute the tests + shell: | + /tmp/check-default-locale-installed.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