tests: minor syntax cleanups for legibility

Split ssh_config and long commands over multiple lines. Other minor
cleanups and syntax consistency fixes.
This commit is contained in:
Jonathan Lebon 2017-08-24 15:31:05 -04:00
parent 1459e66ac5
commit cae2408d4f

View File

@ -10,7 +10,14 @@
tasks:
- name: Prepare an SSH config
set_fact:
ssh_config: "Host vmcheck\n\tUser {{ ansible_ssh_user }}\n\tPort {{ ansible_ssh_port }}\n\tHostName {{ ansible_ssh_host }}\n\tIdentityFile {{ ansible_ssh_private_key_file }}\n\tUserKnownHostsFile /dev/null\n\tStrictHostKeyChecking no\n"
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
- name: Add executor host
add_host:
@ -28,30 +35,34 @@
delegate_facts: True
- name: Install requirements
package: name={{item}} state=present # XXX: state=latest
package: name={{item}} state=present
with_items:
- fedpkg
# The dist doesn't actually matter here
# The dist doesn't actually matter here, it's just so we don't barf on
# private branches.
- name: Download and extract sources
command: fedpkg --dist=master prep
args:
chdir: "{{playbook_dir}}/.."
- name: Get source directory from environment
shell: "rpm -q --specfile {{playbook_dir}}/../rpm-ostree.spec --qf '{{playbook_dir}}/../%{NAME}-%{VERSION}\n' | head -n1"
register: srcdir
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}}"
- name: Write out SSH config
copy:
content: "{{ssh_config}}"
dest: "{{srcdir.stdout}}/ssh-config"
dest: "{{srcdir}}/ssh-config"
- set_fact:
vmssh: ssh -F {{srcdir.stdout}}/ssh-config vmcheck
vmssh: ssh -F {{srcdir}}/ssh-config vmcheck
# XXX: need to upstream this
- name: create and rebase onto vmcheck
- name: Get rpm-ostree status
command: "{{vmssh}} rpm-ostree status --json"
register: status
- set_fact:
@ -62,24 +73,23 @@
- shell: "{{vmssh}} shutdown -r now"
ignore_errors: true
- name: Run Tests
block:
- name: Run vmcheck
block:
- name: Start test
command: tests/vmcheck/multitest.py vmcheck
# XXX: consider making vmcheck become an installed test
environment:
VMTESTS: 1
SKIP_VMOVERLAY: 1
TESTS: basic layering-basic
topsrcdir: "{{srcdir.stdout}}"
commondir: "{{srcdir.stdout}}/tests/common"
TESTS: basic
topsrcdir: "{{srcdir}}"
commondir: "{{srcdir}}/tests/common"
args:
chdir: "{{srcdir.stdout}}"
chdir: "{{srcdir}}"
always:
- name: fetch vmcheck results
synchronize:
src: "{{srcdir.stdout}}/vmcheck/"
src: "{{srcdir}}/vmcheck/"
dest: "{{artifacts}}/vmcheck"
mode: pull
delete: yes