tests/str: Rework sysinstall-tests to be an entrypoint

Prep for creating more types of tests.

Move copying of `tests/` into the sysinstall-tests rather than `overlay-git`
as not all test types may need that.

Factored out of https://github.com/ostreedev/ostree/pull/1501

Closes: #1509
Approved by: jlebon
This commit is contained in:
Colin Walters 2018-03-22 10:37:07 -04:00 committed by Atomic Bot
parent e08b38072f
commit d48ccbcabf
4 changed files with 29 additions and 32 deletions

View File

@ -15,7 +15,7 @@ tests:
- ./tests/fedora-str/provision.sh
# TODO: enhance papr to have caching, a bit like https://docs.travis-ci.com/user/caching/
- curl -Lo fedora-atomic-host.qcow2 https://getfedora.org/atomic_qcow2_latest
- env "TEST_SUBJECTS=$(pwd)/fedora-atomic-host.qcow2" ./tests/fedora-str/playbook-run.sh tests/fedora-str/tests.yml
- env "TEST_SUBJECTS=$(pwd)/fedora-atomic-host.qcow2" ./tests/fedora-str/playbook-run.sh tests/fedora-str/sysinstall-tests.yml
artifacts:
- tests/fedora-str/artifacts/fedora-atomic-host.qcow2.log

View File

@ -21,7 +21,3 @@
when: ostree_orig_version_yaml['libostree']['Git'] == ostree_new_version_yaml['libostree']['Git']
fail:
msg: "Failed to change ostree version"
# Next copy all of the tests/ directory
- name: Copy test data
synchronize: src=../../ dest=/root/tests/ archive=yes

View File

@ -1,17 +1,28 @@
# Run the system installed tests
- import_tasks: overlay-git.yml
when: use_git_build
# Down the line perhaps do each log file separately?
- name: Run sysinstalled tests
shell: /root/tests/installed/run.sh &> /root/installed-tests.log
register: sysinstalled_result
failed_when: False
- name: Fetch sysinstalled results
fetch:
src: /root/installed-tests.log
dest: artifacts/installed-tests.log
flat: yes
- name: Assert that sysinstalled tests succeeded
when: sysinstalled_result.rc != 0
fail:
msg: "sysinstalled tests failed"
# This entrypoint right now just runs the sysinstalled-tests.
---
- hosts: localhost
tags:
- atomic
remote_user: root
vars:
use_git_build: True
tasks:
- import_tasks: overlay-git.yml
when: use_git_build
# Next copy all of the tests/ directory
- name: Copy test data
synchronize: src=../../ dest=/root/tests/ archive=yes
# Down the line perhaps do each log file separately?
- name: Run shell script sysinstalled tests
shell: /root/tests/installed/run.sh &> /root/installed-tests.log
register: sysinstalled_result
failed_when: False
- name: Fetch sysinstalled results
fetch:
src: /root/installed-tests.log
dest: artifacts/installed-tests.log
flat: yes
- name: Assert that sysinstalled tests succeeded
when: sysinstalled_result.rc != 0
fail:
msg: "sysinstalled tests failed"

View File

@ -1,10 +0,0 @@
# This entrypoint right now just runs the sysinstalled-tests.
---
- hosts: localhost
tags:
- atomic
remote_user: root
vars:
use_git_build: True
tasks:
- import_tasks: sysinstall-tests.yml