test: replace kitchen to molecule
This commit is contained in:
parent
033627595d
commit
5dbdb524d7
11 changed files with 66 additions and 226 deletions
molecule/default/tests
32
molecule/default/tests/test_default.py
Normal file
32
molecule/default/tests/test_default.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
import os
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
def test_packages(host):
|
||||
package = host.package('elasticsearch')
|
||||
assert package.is_installed
|
||||
|
||||
def test_config_file(host):
|
||||
config = host.file('/etc/elasticsearch/elasticsearch.yml')
|
||||
assert config.user == 'root'
|
||||
assert config.group == 'elasticsearch'
|
||||
assert config.mode == 0o640
|
||||
assert config.contains('path.data: /var/lib/elasticsearch')
|
||||
|
||||
def test_service(host):
|
||||
service = host.service('elasticsearch')
|
||||
assert service.is_running
|
||||
assert service.is_enabled
|
||||
|
||||
def test_socket(host):
|
||||
for port in [9200, 9300]:
|
||||
socket = host.socket('tcp://127.0.0.1:%d' % (port))
|
||||
assert socket.is_listening
|
||||
|
||||
def test_java_memory(host):
|
||||
process = host.process.get(user='elasticsearch', comm='java')
|
||||
assert '-Xms512m' in process.args
|
||||
assert '-Xmx512m' in process.args
|
||||
|
||||
def test_elasticsearch_template(host):
|
||||
result = host.check_output('curl -v http://127.0.0.1:9200/_template/test')
|
||||
assert '"number_of_replicas":"1"' in result
|
Loading…
Add table
Add a link
Reference in a new issue