Add gating.yaml to enable gating for sssd

Resolves: rhbz#1954686
Recipient is set to sssd-team to include dev and qe
Add tier0 tests to execute for gating
bump release from 4 to 5
This commit is contained in:
Steeve Goveas 2021-05-03 15:08:16 +05:30
parent b14fdeab20
commit a5f1b2a632
5 changed files with 139 additions and 1 deletions

8
gating.yaml Normal file
View File

@ -0,0 +1,8 @@
# recipients: sssd-team, ftrivino
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: idm-ci.brew-build.tier1.functional}

View File

@ -27,7 +27,7 @@
Name: sssd
Version: 2.4.2
Release: 4%{?dist}
Release: 5%{?dist}
Summary: System Security Services Daemon
License: GPLv3+
URL: https://github.com/SSSD/sssd/
@ -1015,6 +1015,9 @@ fi
%systemd_postun_with_restart sssd.service
%changelog
* Tue Jun 01 2021 Steeve Goveas <sgoveas@redhat.com> - 2.4.2-5
- Rebuilt for RHEL 9 BETA to add gating tests (rhbz#1954686)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.2-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937

112
tests/sssd-tasks.yml Normal file
View File

@ -0,0 +1,112 @@
---
- name: Set ansible_python_interpreter to /usr/libexec/platform-python
set_fact:
ansible_python_interpreter: '/usr/libexec/platform-python'
- name: Define remote_artificats
set_fact:
remote_artifacts: /tmp/artifacts
when: remote_artifacts is not defined
- name: Install testing requirements
package: name={{ item }} state=present
with_items:
- rsync
when: ansible_pkg_mgr != 'unknown'
- name: Install required packages
dnf:
name: >
git, gcc, redhat-rpm-config.noarch, openldap-devel,
openldap-clients, dbus-tools, python3-virtualenv, make,
python3-pip, krb5-devel, sssd, sssd-kcm, libsss_sudo,
ldb-tools, sssd-tools, nss-tools, sssd-dbus, python3-devel
- name: Install 389-ds-base krb5 server and workstation
dnf:
name: >
389-ds-base, krb5-server, krb5-workstation
- name: clone upstream sssd git to run tests
git:
repo: "{{ upstream_sssd_git }}"
dest: "{{ upstream_src_dir }}"
version: "{{ upstream_git_branch }}"
- name: Update /etc/hosts file with current hostname
lineinfile:
path: /etc/hosts
line: "{{ ansible_default_ipv4.address }} {{ ansible_hostname }}"
- name: Create Multihost configuration files
blockinfile:
dest: /tmp/mhc.yaml
block: |
windows_test_dir: '/home/Administrator'
root_password: 'foobar'
domains:
- name: testrealm.test
type: sssd
hosts:
- name: {{ ansible_hostname }}
external_hostname: {{ ansible_hostname }}
role: master
create: yes
marker: ""
- name: Install pytest-multihost and other test dependencies
pip:
name: "{{ item }}"
virtualenv: "{{ venv_dir }}"
virtualenv_command: /usr/bin/virtualenv
with_items:
- setuptools
- pytz
- paramiko
- pep8
- pylint
- pytest-multihost
- python-ldap
- pytest
- pyyaml
- name: Find directory python searches for path
shell: python3 -m site --user-site
register: pypath
- name: Create Python path dir
file:
path: "{{ pypath.stdout }}"
state: directory
- name: Create file with sssd testlib path
copy:
dest: "{{ pypath.stdout }}/sssdlib.pth"
content: "{{ upstream_src_dir }}/src/tests/multihost"
- name: create artifacts directory
file:
path: "{{ remote_artifacts }}"
state: directory
mode: 0755
- name: Test block
block:
- name: Execute pytest
shell: |
"{{ venv_dir }}/bin/pytest" -v \
--junit-xml="{{ remote_artifacts }}/junit.xml" \
--multihost-config=/tmp/mhc.yaml \
"{{ test_dir }}" 1> "{{ remote_artifacts }}/test.log"
always:
- name: copy sssd logs to "{{ remote_artifacts }}"
command: cp -a /var/log/sssd {{ remote_artifacts }}
- name: Pull out logs
synchronize:
dest: "{{ artifacts }}"
src: "{{ remote_artifacts }}/"
mode: pull
ssh_args: "-o UserKnownHostsFile=/dev/null"
when: artifacts|default("") != ""

7
tests/sssd-vars.yml Normal file
View File

@ -0,0 +1,7 @@
---
upstream_sssd_git: 'https://github.com/SSSD/sssd.git'
upstream_git_branch: 'master'
artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
venv_dir: /opt/sssd_venv
upstream_src_dir: /opt/sssd
test_dir: "{{ upstream_src_dir }}/src/tests/multihost/basic"

8
tests/tests.yml Normal file
View File

@ -0,0 +1,8 @@
---
- hosts: localhost
gather_facts: "True"
tags:
- classic
tasks:
- include_vars: sssd-vars.yml
- include_tasks: sssd-tasks.yml