Run the newly created system tests in CI and collect artifacts.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
os: [alpine, debian, fedora]
steps:
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.11
+
- name: Checkout repository
uses: actions/checkout@v3
./share/ansible/build-out/config.h
./share/ansible/build-out/build.log
./share/ansible/build-out/test-suite.log
+ ./tests/system/pytest.log
+ ./tests/system/artifacts
if-no-files-found: ignore
gather_facts: false
roles:
- role: ci_run
+
+- name: Run system tests
+ hosts: localhost
+ roles:
+ - role: run_system_tests
- build-base
- byacc
- cmocka-dev
+ - coreutils
- expect
- gettext-dev
- git
- "/usr/local/src/shadow/config.h"
- "/usr/local/src/shadow/build.log"
- "/usr/local/src/shadow/tests/unit/test-suite.log"
+
+- name: Copy configuration file for testing
+ ansible.builtin.copy:
+ src: /usr/local/src/shadow/etc/login.defs
+ dest: /etc/login.defs
+ remote_src: yes
- "/usr/local/src/shadow/config.h"
- "/usr/local/src/shadow/build.log"
- "/usr/local/src/shadow/tests/unit/test-suite.log"
+
+- name: Copy configuration file for testing
+ ansible.builtin.copy:
+ src: /usr/local/src/shadow/etc/login.defs
+ dest: /etc/login.defs
+ remote_src: yes
- "/usr/local/src/shadow/config.h"
- "/usr/local/src/shadow/build.log"
- "/usr/local/src/shadow/tests/unit/test-suite.log"
+
+- name: Copy configuration file for testing
+ ansible.builtin.copy:
+ src: /usr/local/src/shadow/etc/login.defs
+ dest: /etc/login.defs
+ remote_src: yes
--- /dev/null
+Role Name
+=========
+
+Run system tests.
+
+Example Playbook
+----------------
+
+Usage example:
+
+ - hosts: localhost
+ roles:
+ - role: run_system_tests
+
+License
+-------
+
+BSD
+
+Author Information
+------------------
+
+Iker Pedrosa <ipedrosa@redhat.com>
--- /dev/null
+---
+# tasks file for run_system_tests
+- name: Prepare environment and run system tests
+ ansible.builtin.shell: |
+ set -ex
+ pushd ../../tests/system/
+ python3 -m venv .venv
+ source .venv/bin/activate
+ pip3 install -r ./requirements.txt
+ exec 3>&1 1> >(tee pytest.log) 2>&1
+ pytest --mh-config=mhc.yaml --mh-lazy-ssh -vvv
+ popd
+ args:
+ executable: /bin/bash