adding gating tests and configuration
This commit is contained in:
parent
ad33f2f898
commit
9ec6ef9c3f
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-10
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
4
tests/scripts/data.txt
Normal file
4
tests/scripts/data.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Cloud
|
||||||
|
Linux
|
||||||
|
Fedora
|
||||||
|
Fedoraaa
|
58
tests/scripts/run_tests.sh
Normal file
58
tests/scripts/run_tests.sh
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#!/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
12
tests/tests.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user