2017-08-15 18:41:54 +00:00
|
|
|
---
|
|
|
|
- hosts: localhost
|
2017-08-23 07:30:51 +00:00
|
|
|
gather_facts: yes
|
2017-08-22 19:20:00 +00:00
|
|
|
vars:
|
|
|
|
artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
|
|
|
|
subjects: "{{ lookup('env', 'TEST_SUBJECTS')}}"
|
2017-08-15 18:41:54 +00:00
|
|
|
tags:
|
|
|
|
- atomic
|
2017-08-23 07:30:51 +00:00
|
|
|
|
2017-08-15 18:41:54 +00:00
|
|
|
tasks:
|
2017-08-23 07:30:51 +00:00
|
|
|
- name: Prepare an SSH config
|
|
|
|
set_fact:
|
2017-08-24 19:31:05 +00:00
|
|
|
ssh_config: |
|
|
|
|
Host vmcheck
|
|
|
|
User {{ansible_ssh_user}}
|
|
|
|
Port {{ansible_ssh_port}}
|
|
|
|
HostName {{ansible_ssh_host}}
|
|
|
|
IdentityFile {{ansible_ssh_private_key_file}}
|
|
|
|
UserKnownHostsFile /dev/null
|
|
|
|
StrictHostKeyChecking no
|
2017-08-23 07:30:51 +00:00
|
|
|
|
|
|
|
- name: Add executor host
|
|
|
|
add_host:
|
|
|
|
name: executor
|
|
|
|
ansible_connection: local
|
|
|
|
ansible_ssh_host: 127.0.0.1
|
|
|
|
ansible_ssh_connection: local
|
2017-08-15 18:41:54 +00:00
|
|
|
|
|
|
|
# XXX: move to standard-test-roles, e.g. standard-test-get-source
|
2017-08-23 07:30:51 +00:00
|
|
|
- name: Extract and run tests
|
|
|
|
delegate_to: executor
|
|
|
|
block:
|
|
|
|
- name: Gather facts
|
|
|
|
setup:
|
|
|
|
delegate_facts: True
|
2017-08-22 19:09:19 +00:00
|
|
|
|
2017-08-23 07:30:51 +00:00
|
|
|
- name: Install requirements
|
2017-08-24 19:31:05 +00:00
|
|
|
package: name={{item}} state=present
|
2017-08-23 07:30:51 +00:00
|
|
|
with_items:
|
|
|
|
- fedpkg
|
2017-08-22 19:09:19 +00:00
|
|
|
|
2017-08-24 19:31:05 +00:00
|
|
|
# The dist doesn't actually matter here, it's just so we don't barf on
|
|
|
|
# private branches.
|
2017-08-23 07:30:51 +00:00
|
|
|
- name: Download and extract sources
|
|
|
|
command: fedpkg --dist=master prep
|
|
|
|
args:
|
|
|
|
chdir: "{{playbook_dir}}/.."
|
2017-08-15 18:41:54 +00:00
|
|
|
|
2017-08-23 07:30:51 +00:00
|
|
|
- name: Get source directory from environment
|
2017-08-24 19:31:05 +00:00
|
|
|
shell: rpm -q --specfile {{playbook_dir}}/../rpm-ostree.spec
|
|
|
|
--qf '{{playbook_dir}}/../%{NAME}-%{VERSION}\n' | head -n1
|
|
|
|
register: srcdir_query
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
srcdir: "{{srcdir_query.stdout}}"
|
2017-08-15 18:41:54 +00:00
|
|
|
|
2017-08-23 07:30:51 +00:00
|
|
|
- name: Write out SSH config
|
|
|
|
copy:
|
2017-08-24 19:31:05 +00:00
|
|
|
content: "{{ssh_config}}"
|
|
|
|
dest: "{{srcdir}}/ssh-config"
|
2017-08-15 18:41:54 +00:00
|
|
|
|
2017-08-23 07:30:51 +00:00
|
|
|
- set_fact:
|
2017-08-24 19:31:05 +00:00
|
|
|
vmssh: ssh -F {{srcdir}}/ssh-config vmcheck
|
2017-08-15 18:41:54 +00:00
|
|
|
|
2017-08-24 19:31:05 +00:00
|
|
|
- name: Get rpm-ostree status
|
2017-08-23 07:30:51 +00:00
|
|
|
command: "{{vmssh}} rpm-ostree status --json"
|
2017-08-15 18:41:54 +00:00
|
|
|
|
2017-08-24 19:31:05 +00:00
|
|
|
- name: Run vmcheck
|
2017-08-23 07:30:51 +00:00
|
|
|
block:
|
2017-08-24 19:31:05 +00:00
|
|
|
- name: Start test
|
2017-08-15 18:41:54 +00:00
|
|
|
command: tests/vmcheck/multitest.py vmcheck
|
|
|
|
# XXX: consider making vmcheck become an installed test
|
|
|
|
environment:
|
|
|
|
VMTESTS: 1
|
2017-08-24 19:31:05 +00:00
|
|
|
TESTS: basic
|
|
|
|
topsrcdir: "{{srcdir}}"
|
|
|
|
commondir: "{{srcdir}}/tests/common"
|
2017-08-15 18:41:54 +00:00
|
|
|
args:
|
2017-08-24 19:31:05 +00:00
|
|
|
chdir: "{{srcdir}}"
|
2017-08-15 18:41:54 +00:00
|
|
|
|
2017-08-23 07:30:51 +00:00
|
|
|
always:
|
2017-08-24 19:36:49 +00:00
|
|
|
- name: Fetch test results
|
|
|
|
command: rsync -a --delete {{srcdir}}/vmcheck/ {{artifacts}}/vmcheck
|