Add molecule test for bootstrap-os (#5845)

This commit is contained in:
Maxime Guyot
2020-04-01 16:25:28 +02:00
committed by GitHub
parent be9414fabe
commit ded58d3b66
8 changed files with 94 additions and 0 deletions

View File

@@ -23,3 +23,5 @@ fedora_coreos_packages:
## General
# Set the hostname to inventory_hostname
override_system_hostname: true
is_fedora_coreos: false

View File

@@ -0,0 +1,44 @@
---
scenario:
name: default
test_sequence:
- lint
- destroy
- dependency
- syntax
- create
- prepare
- converge
# - idempotence # skip
- side_effect
- verify
- destroy
dependency:
name: galaxy
lint:
name: yamllint
options:
config-file: ../../.yamllint
driver:
name: vagrant
provider:
name: libvirt
platforms:
- name: ubuntu18
box: generic/ubuntu1804
cpus: 2
memory: 2048
provisioner:
name: ansible
lint:
name: ansible-lint
inventory:
group_vars:
all:
user:
name: foo
comment: My test comment
verifier:
name: testinfra
lint:
name: flake8

View File

@@ -0,0 +1,6 @@
---
- name: Converge
hosts: all
gather_facts: no
roles:
- role: bootstrap-os

View File

@@ -0,0 +1,11 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_python(host):
assert host.exists('python3') or host.exists('python')