Merge branch '3.9.2_7.1.1_tests' into fix_tests

This commit is contained in:
rshad 2019-07-08 09:37:13 +00:00
commit d56aa627ae
9 changed files with 0 additions and 191 deletions

View File

@ -17,6 +17,5 @@ python_version = "2.7"
test ="molecule test"
agent ="molecule test -s wazuh-agent"
elasticsearch ="molecule test -s elasticsearch"
logstash ="molecule test -s logstash"
filebeat ="molecule test -s filebeat"
kibana ="molecule test -s kibana"

View File

@ -4,16 +4,3 @@ import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_logstash_is_installed(host):
"""Test if the filebeat package is installed."""
filebeat = host.package("filebeat")
assert filebeat.is_installed
def test_logstash_is_running(host):
"""Test if the services are enabled and running."""
filebeat = host.service("filebeat")
assert filebeat.is_enabled
assert filebeat.is_running

View File

@ -6,13 +6,6 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_logstash_is_running(host):
"""Test if the services are enabled and running."""
kibana = host.service("kibana")
assert kibana.is_enabled
assert kibana.is_running
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

View File

@ -1,14 +0,0 @@
# Molecule managed
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

View File

@ -1,22 +0,0 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -1,56 +0,0 @@
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: bionic
image: solita/ubuntu-systemd:bionic
command: /sbin/init
ulimits:
- nofile:262144:262144
privileged: true
memory_reservation: 1024m
- name: xenial
image: solita/ubuntu-systemd:xenial
privileged: true
memory_reservation: 1024m
command: /sbin/init
ulimits:
- nofile:262144:262144
- name: centos6
image: geerlingguy/docker-centos6-ansible
privileged: true
memory_reservation: 1024m
command: /sbin/init
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
ulimits:
- nofile:262144:262144
- name: centos7
image: milcom/centos7-systemd
memory_reservation: 1024m
privileged: true
ulimits:
- nofile:262144:262144
provisioner:
name: ansible
playbooks:
docker:
create: ../default/create.yml
destroy: ../default/destroy.yml
env:
ANSIBLE_ROLES_PATH: ../../roles
lint:
name: ansible-lint
enabled: true
inventory:
group_vars:
all:
elasticsearch_jvm_xms: 256
verifier:
name: testinfra
lint:
name: flake8

View File

@ -1,5 +0,0 @@
---
- name: Converge
hosts: all
roles:
- role: elastic-stack/ansible-logstash

View File

@ -1,41 +0,0 @@
---
- name: Prepare
hosts: all
gather_facts: true
pre_tasks:
- name: "Install Python packages for Trusty to solve trust issues"
package:
name:
- python-setuptools
- python-pip
state: latest
register: wazuh_manager_trusty_packages_installed
until: wazuh_manager_trusty_packages_installed is succeeded
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
- name: "Install dependencies"
package:
name:
- curl
- net-tools
state: latest
register: wazuh_manager_dependencies_packages_installed
until: wazuh_manager_dependencies_packages_installed is succeeded
- name: "Install (RedHat) dependencies"
package:
name:
- initscripts
state: latest
register: wazuh_manager_dependencies_packages_installed
until: wazuh_manager_dependencies_packages_installed is succeeded
when:
- ansible_os_family == 'RedHat'
roles:
- role: wazuh/ansible-wazuh-manager
- role: elastic-stack/ansible-elasticsearch
elasticsearch_network_host: 'localhost'

View File

@ -1,32 +0,0 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_logstash_is_installed(host):
"""Test if logstash is installed with correct version."""
logstash = host.package("logstash")
assert logstash.is_installed
distribution = host.system_info.distribution.lower()
if distribution == 'ubuntu':
assert logstash.version.startswith('1:6.7.1')
else:
assert logstash.version.startswith('6.7.1')
def test_logstash_is_running(host):
"""Test if the services are enabled and running."""
logstash = host.service("logstash")
assert logstash.is_enabled
assert logstash.is_running
def test_find_correct_logentry(host):
"""See if logstash is started and is connected to Elasticsearch."""
logfile = host.file("/var/log/logstash/logstash-plain.log")
assert logfile.contains("Successfully started Logstash API endpoint")
assert logfile.contains("Restored connection to ES instance")