Add gating tests (for RHEL)

This commit is contained in:
Richard W.M. Jones 2021-06-23 10:55:23 +01:00
parent 1030ff3001
commit dfd02f7fb4
4 changed files with 93 additions and 0 deletions

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: xen-ci.brew-build.tier1.functional}

35
tests/augtool_test.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -eux
augtool -L > augtool_test.out 2> augtool_test.err <<EOF
# do not try to parse /etc/profile.d/*, and /etc/profile files,
# as the Shellvars lens cannot handle their advanced syntax
rm /augeas/load/Shellvars/*[. =~ regexp("/etc/profile.*")]
# exclude /etc/mke2fs.conf, as it has various issues:
# https://bugzilla.redhat.com/1807010
rm /augeas/load/Mke2fs/
# exclude 21-cloudinit.conf, which seems to have issues
ins excl before /augeas/load/Rsyslog/*[label() = 'excl'][position() = 1]
set /augeas/load/Rsyslog/*[label() = 'excl'][position() = 1] /etc/rsyslog.d/21-cloudinit.conf
# load, and print the errors
load
print /augeas//error
EOF
# remove output related to the removal of the /etc/profile.* 'incl'
# transforms
sed -i '/^rm /d' augtool_test.out
echo "BEGIN output ========"
cat augtool_test.out
echo "END output ========"
echo "BEGIN error ========"
cat augtool_test.err
echo "END error ========"
test ! -s augtool_test.out
test ! -s augtool_test.err

18
tests/devel.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -eux
pkg-config --cflags augeas
pkg-config --libs augeas
src_dump="$(realpath source/examples/dump.c)"
tmpdir="$(mktemp -d)"
pushd "$tmpdir"
gcc -o dump $(pkg-config --cflags --libs augeas) "$src_dump"
test -x dump
./dump > /dev/null
popd
rm -rf "$tmpdir"

33
tests/tests.yml Normal file
View File

@ -0,0 +1,33 @@
---
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic
tags:
- atomic
- classic
- container
required_packages:
- augeas
- augeas-devel
- libxml2-devel
- gcc
- pkg-config
- chrony # test its configs
- fuse # test its configs
- iscsi-initiator-utils # test its configs
- lvm2 # test its configs
- mdadm # test its configs
- openssh-server # test its configs
- rsync # test its configs
- rsyslog # test its configs
- sudo # test its configs
tests:
- augtool_test:
dir: .
run: ./augtool_test.sh
- devel:
dir: .
run: ./devel.sh