Resolves: rhbz#1995957 Add gating tests

This commit is contained in:
Pooja Yadav 2021-08-24 17:16:05 +05:30
parent 206a32f95f
commit 958d817a9b
3 changed files with 75 additions and 0 deletions

4
tests/scripts/data.txt Normal file
View File

@ -0,0 +1,4 @@
Cloud
Linux
Fedora
Fedoraaa

59
tests/scripts/run_tests.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
check_pkg() {
local pkg=$1
if rpm -q $pkg
then
echo "PASS"
else
echo "FAIL"
fi
}
check_dict() {
if [ -f "/usr/share/myspell/de_DE.dic" ]
then
echo "PASS"
else
echo "FAIL"
fi
}
check_misspelled_word() {
VAR1="Fedoraaa"
VAR2=$(hunspell -l data.txt)
if [ "$VAR1" = "$VAR2" ]; then
echo "PASS"
else
echo "FAIL"
fi
}
check_misspelled_line() {
VAR1="Fedoraaa"
VAR2=$(hunspell -L data.txt)
if [ "$VAR1" = "$VAR2" ]; then
echo "PASS"
else
echo "FAIL"
fi
}
check_correct_word() {
VAR1="Cloud\nLinux\nFedora"
VAR1=$(echo -e "$VAR1")
VAR2=$(hunspell -G data.txt)
if [ "$VAR1" = "$VAR2" ]; then
echo "PASS"
else
echo "FAIL"
fi
}
check_pkg "hunspell"
check_pkg "hunspell-de"
check_dict
check_misspelled_word
check_misspelled_line
check_correct_word

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
required_packages:
- hunspell
- hunspell-de
tests:
- simple:
dir: scripts
run: ./run_tests.sh