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