DCD-224: Tweaks to product_base and add molecule tests.

This commit is contained in:
Steve Smith
2019-04-09 11:41:32 +10:00
parent 7984d87d29
commit 643a44a26e
7 changed files with 88 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_user_created(host):
user = host.user('testuser')
assert user.exists
@pytest.mark.parametrize('target', [
'/opt/atlassian/product',
'/opt/atlassian/temp'
])
def test_dirs_created(host, target):
d = host.file(target)
assert d.exists
assert d.is_directory
assert d.user == 'testuser'