Molecule is broken
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Converge
|
|
||||||
hosts: all
|
|
||||||
vars:
|
|
||||||
podman_packages:
|
|
||||||
- podman
|
|
||||||
podman_configure_registries: true
|
|
||||||
podman_configure_storage: true
|
|
||||||
podman_configure_policy: true
|
|
||||||
podman_enable_socket: false
|
|
||||||
podman_enable_api_service: false
|
|
||||||
podman_policy_default_type: "insecureAcceptAnything"
|
|
||||||
podman_policy_trusted_registries: []
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
dependency:
|
|
||||||
name: galaxy
|
|
||||||
driver:
|
|
||||||
name: podman
|
|
||||||
platform_defaults: &platform_defaults
|
|
||||||
tmpfs:
|
|
||||||
- /tmp
|
|
||||||
- /run/lock
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /lib/systemd/systemd
|
|
||||||
platforms:
|
|
||||||
- name: debian-bullseye
|
|
||||||
image: docker.io/jrei/systemd-debian:12
|
|
||||||
<<: *platform_defaults
|
|
||||||
- name: debian-trixie
|
|
||||||
image: docker.io/jrei/systemd-debian:13
|
|
||||||
<<: *platform_defaults
|
|
||||||
|
|
||||||
provisioner:
|
|
||||||
name: ansible
|
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
verifier:
|
|
||||||
name: ansible
|
|
||||||
lint: |
|
|
||||||
set -e
|
|
||||||
ansible-lint .
|
|
||||||
yamllint .
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Prepare instance for podman role testing
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
tasks:
|
|
||||||
- name: Ensure apt cache is up-to-date
|
|
||||||
ansible.builtin.apt:
|
|
||||||
update_cache: true
|
|
||||||
cache_valid_time: 3600
|
|
||||||
|
|
||||||
- name: Install prerequisites used by the role/tests
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name:
|
|
||||||
- apt-transport-https
|
|
||||||
- ca-certificates
|
|
||||||
- gnupg
|
|
||||||
- lsb-release
|
|
||||||
- curl
|
|
||||||
state: present
|
|
||||||
update_cache: false
|
|
||||||
|
|
||||||
- name: Install python3-venv and python3-pip for testinfra
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name:
|
|
||||||
- python3-pip
|
|
||||||
- python3-venv
|
|
||||||
state: present
|
|
||||||
update_cache: false
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
collections:
|
|
||||||
- name: containers.podman
|
|
||||||
Binary file not shown.
@@ -1,34 +0,0 @@
|
|||||||
import os
|
|
||||||
import testinfra.utils.ansible_runner
|
|
||||||
|
|
||||||
# Get hosts from Testinfra inventory created by Molecule
|
|
||||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|
||||||
os.environ.get('MOLECULE_INVENTORY_FILE')
|
|
||||||
).get_hosts('all')
|
|
||||||
|
|
||||||
|
|
||||||
def test_podman_package_installed(host):
|
|
||||||
pkg = host.package("podman")
|
|
||||||
assert pkg.is_installed, "podman package should be installed"
|
|
||||||
|
|
||||||
|
|
||||||
def test_podman_binary_executes(host):
|
|
||||||
cmd = host.run("podman --version")
|
|
||||||
assert cmd.rc == 0, f"podman not runnable: {cmd.stderr or cmd.stdout}"
|
|
||||||
|
|
||||||
|
|
||||||
def test_containers_conf_exists(host):
|
|
||||||
f = host.file("/etc/containers/registries.conf")
|
|
||||||
assert f.exists, "/etc/containers/registries.conf should exist"
|
|
||||||
|
|
||||||
|
|
||||||
def test_policy_json_exists(host):
|
|
||||||
f = host.file("/etc/containers/policy.json")
|
|
||||||
assert f.exists, "/etc/containers/policy.json should exist"
|
|
||||||
|
|
||||||
|
|
||||||
def test_podman_config_file_valid_json(host):
|
|
||||||
f = host.file("/etc/containers/policy.json")
|
|
||||||
assert f.exists and f.size > 0
|
|
||||||
cmd = host.run("python3 -c 'import json,sys;json.load(open(\"/etc/containers/policy.json\"))'")
|
|
||||||
assert cmd.rc == 0, "policy.json should be valid JSON"
|
|
||||||
Reference in New Issue
Block a user