fixed some linting errors and removed the changes added to the tests
This commit is contained in:
parent
c59c0fd008
commit
37cd4893b3
1
Pipfile
1
Pipfile
@ -14,7 +14,6 @@ molecule = "*"
|
||||
python_version = "2.7"
|
||||
|
||||
[scripts]
|
||||
clean = "molecule destroy"
|
||||
test ="molecule test --destroy=never"
|
||||
verify_test ="molecule verify"
|
||||
agent ="molecule test -s wazuh-agent"
|
||||
|
||||
@ -14,13 +14,13 @@ platforms:
|
||||
- nofile:262144:262144
|
||||
privileged: true
|
||||
memory_reservation: 5120m
|
||||
- name: xenial
|
||||
image: solita/ubuntu-systemd:xenial
|
||||
privileged: true
|
||||
memory_reservation: 2048m
|
||||
command: /sbin/init
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
- name: xenial
|
||||
image: solita/ubuntu-systemd:xenial
|
||||
privileged: true
|
||||
memory_reservation: 2048m
|
||||
command: /sbin/init
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
# - name: trusty
|
||||
# image: ubuntu:trusty
|
||||
# privileged: true
|
||||
@ -33,12 +33,12 @@ platforms:
|
||||
# memory_reservation: 2048m
|
||||
# ulimits:
|
||||
# - nofile:262144:262144
|
||||
- name: centos7
|
||||
image: milcom/centos7-systemd
|
||||
memory_reservation: 2048m
|
||||
privileged: true
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
- name: centos7
|
||||
image: milcom/centos7-systemd
|
||||
memory_reservation: 2048m
|
||||
privileged: true
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
provisioner:
|
||||
name: ansible
|
||||
env:
|
||||
|
||||
@ -78,54 +78,3 @@ def test_open_ports(host):
|
||||
elif distribution == 'centos':
|
||||
assert host.socket("tcp://:::1515").is_listening
|
||||
assert not host.socket("tcp://:::1514").is_listening
|
||||
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_filebeat_is_installed(host):
|
||||
"""Test if the elasticsearch package is installed."""
|
||||
filebeat = host.package("filebeat")
|
||||
assert filebeat.is_installed
|
||||
assert filebeat.version.startswith('7.2.0')
|
||||
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_elasticsearch_is_installed(host):
|
||||
"""Test if the elasticsearch package is installed."""
|
||||
elasticsearch = host.package("elasticsearch")
|
||||
assert elasticsearch.is_installed
|
||||
assert elasticsearch.version.startswith('7.2.0')
|
||||
|
||||
|
||||
def test_elasticsearch_is_running(host):
|
||||
"""Test if the services are enabled and running."""
|
||||
elasticsearch = host.service("elasticsearch")
|
||||
assert elasticsearch.is_enabled
|
||||
assert elasticsearch.is_running
|
||||
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_port_kibana_is_open(host):
|
||||
"""Test if the port 5601 is open and listening to connections."""
|
||||
host.socket("tcp://0.0.0.0:5601").is_listening
|
||||
|
||||
|
||||
def test_find_correct_elasticsearch_version(host):
|
||||
"""Test if we find the kibana/elasticsearch version in package.json"""
|
||||
kibana = host.file("/usr/share/kibana/plugins/wazuh/package.json")
|
||||
assert kibana.contains("7.2.0")
|
||||
|
||||
|
||||
def test_wazuh_plugin_installed(host):
|
||||
"""Make sure there is a plugin wazuh directory."""
|
||||
kibana = host.file("/usr/share/kibana/plugins/wazuh/")
|
||||
|
||||
assert kibana.is_directory
|
||||
@ -25,9 +25,9 @@ platforms:
|
||||
# command: /sbin/init
|
||||
# volumes:
|
||||
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
- name: centos7
|
||||
image: milcom/centos7-systemd
|
||||
privileged: true
|
||||
- name: centos7
|
||||
image: milcom/centos7-systemd
|
||||
privileged: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user