Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalczysko committed Nov 20, 2024
1 parent efd4d1f commit 30c8c7b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions molecule/ome-demoserver/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ scenario:
- destroy
verifier:
name: testinfra
directory: ../tests/
33 changes: 33 additions & 0 deletions molecule/tests/test_default.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os
import pytest
import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

OMERO = '/opt/omero/server/OMERO.server/bin/omero'
OMERO_LOGIN = '-C -s localhost -u root -w omero'


@pytest.mark.parametrize("name", [
'nginx',
'omero-server',
'omero-web',
'postgresql-16',
])
def test_service_running_and_enabled(host, name):
service = host.service(name)
assert service.is_running
assert service.is_enabled


def test_omero_login(host):
with host.sudo('omero-server'):
host.check_output(
'/opt/omero/server/OMERO.server/bin/omero '
'login -C -s localhost -u root -w omero')


def test_omero_nginx_ssl(host):
out = host.check_output('curl -fkI https://localhost/')
assert 'Location: /webclient/' in out

0 comments on commit 30c8c7b

Please sign in to comment.