run tests using standard-test-basic role

attempt to run the test also as rootless
This commit is contained in:
Bruno Goncalves 2019-07-19 10:33:28 +02:00
parent 44918635e2
commit 096afbce0b
2 changed files with 21 additions and 40 deletions

View File

@ -1,13 +1,9 @@
#!/bin/bash #!/bin/bash -e
# #
# Simple podman tests # Simple podman tests
# #
rm -f /tmp/test.log /tmp/test.debug.log
# Log program versions # Log program versions
rpm -q podman podman-tests >/tmp/test.debug.log rpm -q podman podman-tests
bats /usr/share/podman/test/system &> /tmp/test.log bats /usr/share/podman/test/system
echo "bats completed with status $?" >>/tmp/test.debug.log

View File

@ -1,35 +1,20 @@
--- ---
- hosts: localhost - hosts: localhost
vars: roles:
- artifacts: ./artifacts - role: standard-test-basic
# FIXME! It would be cleaner to include 'podman' in this list; but the
# dnf module is broken in ansible <= 2.8, it doesn't report failures
# to install as long as _one_ package installs! So if podman installs
# but podman-tests doesn't, the `dnf` stanza succeeds, then the test
# one fails with a less-than-helpful error.
#
# See https://github.com/ansible/ansible/pull/49760
- required_packages:
- podman-tests
tags: tags:
- classic - classic
- container - container
required_packages:
tasks: - bats
- name: install packages - podman
dnf: name="{{ required_packages }}" state=installed - podman-tests
enablerepo=updates-testing tests:
- root-test:
- block: dir: ./
# FIXME: how to make two passes, one as root and one rootless? run: ./test_podman.sh
- name: Run test - rootless-test:
script: ./test_podman.sh # running the test with su doesn't create the directory for fedora user on /run/user/
always: # so create it manually
- name: Pull out logs dir: ./
fetch: run: mkdir /run/user/$(id -u fedora); su -c ${PWD}/test_podman.sh - fedora
src: "/tmp/{{ item }}"
dest: "{{ artifacts }}/{{ item }}"
flat: yes
with_items:
- test.log
- test.debug.log