Remove obsolete copy of standard-test-roles

This is available in the dist-git runner and as proper Fedora package.
This commit is contained in:
Martin Pitt 2018-11-14 09:39:12 +01:00
parent 207cf70ee3
commit 892f695e57
11 changed files with 0 additions and 147 deletions

View File

@ -1,12 +0,0 @@
# Ansible role for overlaying Atomic Host packages
Certain Atomic Host use cases require that packages are
overlaid onto the host. This role allows you to do that.
You should not use this role to indiscriminately overlay test
dependencies into the Atomic Host unless those dependencies are
part of a real end user story.
You should define the following variables:
* packages: A list of packages to overlay

View File

@ -1,17 +0,0 @@
---
- block:
- name: Overlaying end user packages onto Atomic Host
shell: rpm-ostree install {{ packages | join(" ") }}
- name: Reboot the Atomic Host
shell: sleep 2 && systemctl reboot
ignore_errors: true
async: 1
poll: 0
- name: Waiting for Atomic Host to restart
local_action: wait_for host={{ ansible_ssh_host }} search_regex=OpenSSH port={{ ansible_ssh_port }} timeout=300 delay=20 connect_timeout=20
become: false
# All these commands only apply to Atomic Host
tags: atomic

View File

@ -1,2 +0,0 @@
---
packages: []

View File

@ -1,17 +0,0 @@
# Ansible role for executing test scripts
Put this role in your tests.yml playbook and specify a
number of test scripts to execute as tests. The results
of each script will be piped into log file in the artifacts
directory. If any script exits with a non-zero exit code
the role will fail.
In the case of test subjects such a host or container, these
test scripts and related files will be copied to the target into
/var/tmp/tests before execution.
You should define the following variables:
* tests: An array of scripts to run
* files: A list of files or directories needed by the scripts

View File

@ -1,2 +0,0 @@
---
artifacts: "{{ lookup('env', 'TEST_ARTIFACTS') | default('./artifacts', true) }}"

View File

@ -1,48 +0,0 @@
---
- name: Install testing requirements
package: name={{ item }} state=present
with_items:
- rsync
when: ansible_pkg_mgr != 'unknown'
- name: Copy test scripts to target
synchronize:
src: "{{ item }}"
dest: /var/tmp/tests/
ssh_args: "-o UserKnownHostsFile=/dev/null"
with_items:
- "{{ tests }}"
- "{{ files }}"
- block:
- name: Execute test scripts
shell: |
set -e
mkdir -p /var/tmp/artifacts
logfile=/var/tmp/artifacts/test.$(echo {{ item }} | sed -e 's/\//-/g').log
exec 2>>$logfile 1>>$logfile
cd /var/tmp/tests
if [ -x {{ item }} ]; then
./$(basename {{ item }}) && result="PASS" || result="FAIL"
else
/bin/sh -e ./$(basename {{ item }}) && result="PASS" || result="FAIL"
fi
echo "$result {{ item }}" >> /var/tmp/artifacts/test.log
with_items:
- "{{ tests }}"
always:
- name: Pull out the logs
synchronize:
dest: "{{ artifacts }}"
src: "/var/tmp/artifacts/./"
mode: pull
ssh_args: "-o UserKnownHostsFile=/dev/null"
when: artifacts|default("") != ""
# Can't go in block. See
# https://github.com/ansible/ansible/issues/20736
- name: Check the results
shell: grep "^FAIL" /var/tmp/artifacts/test.log
register: test_fails
failed_when: test_fails.stdout or test_fails.stderr

View File

@ -1,3 +0,0 @@
---
tests: []
files: []

View File

@ -1,12 +0,0 @@
# Ansible role for Upstream source tarball tests
Put this role in your tests.yml playbook. The playbook
will extract the upstream source tarball as described in
the package spec file into a test/source/ directory. You
can then use or execute files (usually tests) from the
upstream sources in your playbook.
You can redefine the following variables:
* srcdir: A directory to extract sources into. This defaults
to {{ playbook_dir }}/source/

View File

@ -1,2 +0,0 @@
---
artifacts: "{{ lookup('env', 'TEST_ARTIFACTS') | default('./artifacts', true) }}"

View File

@ -1,30 +0,0 @@
---
- name: Add executor host
add_host:
name: executor
ansible_connection: local
ansible_ssh_host: 127.0.0.1
ansible_ssh_connection: local
- name: Extract package source code
delegate_to: executor
block:
- name: Gather facts
setup:
delegate_facts: True
- name: Install requirements
package: name={{item}} state=present
with_items:
- fedpkg
# The dist doesn't actually matter here
- name: Download sources, extract, and strip leading path
shell: |
shopt -s dotglob
set -e
rm -rf {{ srcdir }}
fedpkg --release=master prep --builddir={{ srcdir }}
mv {{ srcdir }}/*/* {{ srcdir }}
args:
chdir: "{{playbook_dir}}/.."

View File

@ -1,2 +0,0 @@
---
srcdir: "{{ playbook_dir }}/source"