import testinfra.utils.ansible_runner def test_packages(host): package = host.package('default-jre') assert package.is_installed def test_config_file(host): path = host.file('/etc/cerebro/cerebro.conf') assert path.exists assert path.is_file assert path.user == 'root' assert path.group == 'cerebro' assert path.mode == 0o640 assert path.contains('http.port = 9000') def test_service(host): service = host.service('cerebro') assert service.is_running assert service.is_enabled def test_socket(host): socket = host.socket('tcp://0.0.0.0:9000') assert socket.is_listening