mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-697: Adds ansible and cfn logs to cloudwatch * DCD-697: Adds ansible and cfn logs to cloudwatch * DCD-697: Adds provisioning logs to a separarte log group. Adds a test to ensure provisioining logs exist * DCD-697: Refers to files, not directory, for provisioning log groups * DCD-697: Adds a comma between log groups * DCD-697: Removes redundant comma between the 2 log groups Approved-by: Steve Smith <ssmith@atlassian.com> Approved-by: Adam Brokes <abrokes@atlassian.com>
27 lines
798 B
Python
27 lines
798 B
Python
import os
|
|
import pytest
|
|
|
|
import testinfra.utils.ansible_runner
|
|
|
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
|
|
|
|
|
@pytest.mark.parametrize('exe', [
|
|
'/usr/bin/ec2-metadata',
|
|
'/usr/bin/amazon-ssm-agent',
|
|
'/sbin/mount.efs',
|
|
'/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent'
|
|
])
|
|
def test_package_exes(host, exe):
|
|
assert host.file(exe).exists
|
|
|
|
|
|
def test_service_file(host):
|
|
f = host.file('/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json')
|
|
assert f.contains('"log_group_name": "jira-software-MY_STACK"')
|
|
assert f.contains('"log_group_name": "jira-software-MY_STACK-provisioning"')
|
|
assert f.user == 'root'
|
|
assert f.group == 'root'
|
|
assert f.mode == 0o0644
|