From 368b7ebe8433e8ebf65ba933c578919c2b67858f Mon Sep 17 00:00:00 2001
From: pwalczysko
Date: Wed, 13 Nov 2024 18:10:48 +0000
Subject: [PATCH] Remove other tests, only leave demo
---
molecule/omero-training-server/Dockerfile.j2 | 22 ----
molecule/omero-training-server/molecule.yml | 59 ---------
.../tests/test_default.py | 63 ----------
molecule/resources/prepare-iproute.yml | 15 ---
molecule/web-proxy/molecule.yml | 30 -----
molecule/www/Dockerfile.j2 | 1 -
molecule/www/molecule.yml | 27 ----
molecule/www/tests/test_default.py | 25 ----
molecule/www/tests/test_redirects.py | 116 ------------------
9 files changed, 358 deletions(-)
delete mode 100644 molecule/omero-training-server/Dockerfile.j2
delete mode 100644 molecule/omero-training-server/molecule.yml
delete mode 100644 molecule/omero-training-server/tests/test_default.py
delete mode 100644 molecule/resources/prepare-iproute.yml
delete mode 100644 molecule/web-proxy/molecule.yml
delete mode 120000 molecule/www/Dockerfile.j2
delete mode 100644 molecule/www/molecule.yml
delete mode 100644 molecule/www/tests/test_default.py
delete mode 100644 molecule/www/tests/test_redirects.py
diff --git a/molecule/omero-training-server/Dockerfile.j2 b/molecule/omero-training-server/Dockerfile.j2
deleted file mode 100644
index 00b7fd61..00000000
--- a/molecule/omero-training-server/Dockerfile.j2
+++ /dev/null
@@ -1,22 +0,0 @@
-# Molecule managed
-
-{% if item.registry is defined %}
-FROM {{ item.registry.url }}/{{ item.image }}
-{% else %}
-FROM {{ item.image }}
-{% endif %}
-
-{% if item.env is defined %}
-{% for var, value in item.env.items() %}
-{% if value %}
-ENV {{ var }} {{ value }}
-{% endif %}
-{% endfor %}
-{% endif %}
-
-RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \
- elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \
- elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute ca-certificates && 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 iproute2 && 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 iproute2 && xbps-remove -O; fi
diff --git a/molecule/omero-training-server/molecule.yml b/molecule/omero-training-server/molecule.yml
deleted file mode 100644
index af145c55..00000000
--- a/molecule/omero-training-server/molecule.yml
+++ /dev/null
@@ -1,59 +0,0 @@
----
-dependency:
- name: galaxy
- options:
- role-file: requirements.yml
-driver:
- name: docker
-lint: |
- yamllint .
- ansible-lint
- flake8
-platforms:
- - name: ome-outreach
- image: centos/systemd
- command: /sbin/init
- privileged: true
- groups:
- - docker-hosts
- - omero-server
- - omero-web
- - monitored
-provisioner:
- name: ansible
- inventory:
- group_vars:
- all:
- molecule_test: true
- postgresql_version: "13"
- docker-hosts:
- # This should allow docker-in-docker to work
- docker_storage_driver: vfs
- # Latest version 17.12.1.ce-1.el7.centos has a bug that prevents
- # testing on travis: https://github.com/docker/for-linux/issues/219
- docker_version: 17.09.1.ce-1.el7.centos
- # firewalld isn't installed, don't attempt to disable
- iptables_raw_disable_firewalld: false
- playbooks:
- prepare: ../resources/prepare-iproute.yml
- converge: ../../site.yml
- lint:
- name: ansible-lint
-scenario:
- name: omero-training-server
- test_sequence:
- - destroy
- # dependency must come first so that ansible-lint will see a custom module
- # This might be fixed by https://github.com/ansible/molecule/pull/1739
- - dependency
- - lint
- - syntax
- - create
- - prepare
- - converge
- # FIXME: Some tasks are not idempotent
- # - idempotence
- - verify
- - destroy
-verifier:
- name: testinfra
diff --git a/molecule/omero-training-server/tests/test_default.py b/molecule/omero-training-server/tests/test_default.py
deleted file mode 100644
index 1660aff8..00000000
--- a/molecule/omero-training-server/tests/test_default.py
+++ /dev/null
@@ -1,63 +0,0 @@
-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-13',
- 'prometheus-node-exporter',
- 'prometheus-omero-exporter',
- 'prometheus-postgres-exporter',
-])
-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('importer1'):
- host.check_output(
- '/opt/omero/server/OMERO.server/bin/omero '
- 'login -C -s localhost -u root -w omero')
-
-
-@pytest.mark.parametrize("curl", [
- 'localhost:9449/metrics',
- '-u monitoring:monitoring -k https://localhost/metrics/9449',
-])
-def test_omero_metrics(host, curl):
- out = host.check_output('curl -f %s' % curl)
- assert 'omero_sessions_active' in out
-
-
-def test_omero_metrics_auth_fail(host):
- out = host.run(
- 'curl -f -u monitoring:incorrect -k https://localhost/metrics/9449')
- assert out.rc == 22
- assert '401' in out.stderr
-
-
-def test_omero_nginx_ssl(host):
- out = host.check_output('curl -fkI https://localhost/')
- assert 'Location: /webclient/' in out
-
-
-def test_local_ldap(host):
- initialised = host.check_output(
- '/home/ldap/ldapmanager get dc=openmicroscopy,dc=org')
- if len(initialised.strip()) == 0:
- host.check_output('/home/ldap/ldapmanager init')
-
- out = host.check_output(
- '/home/ldap/ldapmanager get dc=openmicroscopy,dc=org')
- assert 'dn: dc=openmicroscopy,dc=org' in out
diff --git a/molecule/resources/prepare-iproute.yml b/molecule/resources/prepare-iproute.yml
deleted file mode 100644
index 1730ad08..00000000
--- a/molecule/resources/prepare-iproute.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-# Install iproute for ansible network vars
-- name: Prepare iproute in resources
- hosts: all
- tasks:
- - name: Install iproute
- become: true
- ansible.builtin.yum:
- name: iproute
- state: present
-
- - name: Install cron
- become: true
- ansible.builtin.yum:
- name: cronie
- state: present
diff --git a/molecule/web-proxy/molecule.yml b/molecule/web-proxy/molecule.yml
deleted file mode 100644
index 8bdf86d9..00000000
--- a/molecule/web-proxy/molecule.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-dependency:
- name: galaxy
- options:
- role-file: requirements.yml
-driver:
- name: docker
-lint: |
- yamllint .
- ansible-lint
- flake8
-platforms:
- - name: web-proxy
- image: centos:7
- groups:
- - web-proxies
-provisioner:
- name: ansible
- playbooks:
- converge: ../../web-proxy/playbook.yml
- lint:
- name: ansible-lint
-scenario:
- name: web-proxy
- test_sequence:
- - lint
- - dependency
- - syntax
-verifier:
- name: testinfra
diff --git a/molecule/www/Dockerfile.j2 b/molecule/www/Dockerfile.j2
deleted file mode 120000
index 0e9184b4..00000000
--- a/molecule/www/Dockerfile.j2
+++ /dev/null
@@ -1 +0,0 @@
-../resources/Dockerfile.j2
\ No newline at end of file
diff --git a/molecule/www/molecule.yml b/molecule/www/molecule.yml
deleted file mode 100644
index e6b232df..00000000
--- a/molecule/www/molecule.yml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-dependency:
- name: galaxy
- options:
- role-file: requirements.yml
-driver:
- name: docker
-lint: |
- yamllint .
- ansible-lint
- flake8
-platforms:
- - name: www
- image: centos/systemd
- image_version: latest
- command: /sbin/init
- privileged: true
-provisioner:
- name: ansible
- playbooks:
- converge: ../../www/www-deploy.yml
- lint:
- name: ansible-lint
-scenario:
- name: www
-verifier:
- name: testinfra
diff --git a/molecule/www/tests/test_default.py b/molecule/www/tests/test_default.py
deleted file mode 100644
index d61e82f1..00000000
--- a/molecule/www/tests/test_default.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import os
-import pytest
-import testinfra.utils.ansible_runner
-
-testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
- os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
-
-
-@pytest.mark.skip(reason="Causes Travis CI to exceed 10min timeout")
-@pytest.mark.parametrize("address", [
- "http://localhost/",
- "https://localhost/",
-])
-def test_web(host, address):
- out = host.check_output('curl -k %s' % address)
- assert 'Home | Open Microscopy Environment (OME)' in out
-
-
-@pytest.mark.skip(reason="Causes Travis CI to exceed 10min timeout")
-def test_archived_community(host):
- out = host.check_output('curl -kL https://localhost/community')
- assert 'Powered by phpBB' in out
-
- out = host.check_output('curl -kIL https://localhost/community')
- assert 'Set-Cookie: phpbb' not in out
diff --git a/molecule/www/tests/test_redirects.py b/molecule/www/tests/test_redirects.py
deleted file mode 100644
index 3dfa70ac..00000000
--- a/molecule/www/tests/test_redirects.py
+++ /dev/null
@@ -1,116 +0,0 @@
-import os
-import testinfra.utils.ansible_runner
-import pytest
-
-testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
- os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
-
-external_uris = [
- ('/forums', 'https://forum.image.sc/c/data-management'),
- ('/omero-blog', 'http://blog.openmicroscopy.org'),
- ('/site/about/development-teams/glencoe-software',
- 'https://www.glencoesoftware.com/team.html'),
- ('/site/community/scripts',
- 'https://docs.openmicroscopy.org/latest/omero/developers/'
- 'scripts/index.html'),
- ('/site/support/bio-formats',
- 'https://docs.openmicroscopy.org/latest/bio-formats/'),
- ('/site/support/omero',
- 'https://docs.openmicroscopy.org/latest/omero/'),
- ('/site/support/ome-model',
- 'https://docs.openmicroscopy.org/latest/ome-model/'),
- ('/site/support/file-formats',
- 'https://docs.openmicroscopy.org/latest/ome-model/'),
- ('/site/support/file-formats/schemas/specifications/'
- 'compliant-file-specification',
- 'https://docs.openmicroscopy.org/latest/ome-model/specifications/'),
- ('/site/support/ome-tiff',
- 'https://docs.openmicroscopy.org/latest/ome-model/ome-tiff/'),
- ('/site/support/ome-files-cpp',
- 'https://docs.openmicroscopy.org/latest/ome-files-cpp/'),
- ('/site/support/contributing',
- 'https://docs.openmicroscopy.org/contributing/'),
- ('/info/flimfit', 'http://flimfit.org'),
- ('/info/scripts',
- 'https://docs.openmicroscopy.org/latest/omero/developers/'
- 'scripts/index.html'),
- ('/info/bio-formats',
- 'https://docs.openmicroscopy.org/latest/bio-formats/'),
- ('/info/slidebook',
- 'https://www.intelligent-imaging.com/technical-answers'),
-]
-
-redirect_uris = [
- ('/site', '/'),
- ('/site/about', '/about'),
- ('/site/about/licensing', '/licensing'),
- ('/site/about/licensing-attribution', '/licensing'),
- ('/site/about/licensing-attribution/licensing', '/licensing'),
- ('/site/about/ome-contributors', '/contributors'),
- ('/site/about/partners', '/commercial-partners'),
- ('/site/about/development-teams', '/teams'),
- ('/site/about/publications', '/citing-ome'),
- ('/site/about/who-ome', '/teams'),
- ('/site/about/what-omero/overview', '/omero'),
- ('/site/about/roadmap', '/about'),
- ('/site/about/project-history', '/about'),
-
- ('/site/community', '/support'),
- ('/site/community/mailing-lists', '/support'),
- ('/site/events', '/events'),
- ('/site/community/minutes/conference-calls', '/on-the-web'),
- ('/site/community/minutes/meetings/12th-annual-users-meeting-2017',
- '/events/12th-annual-users-meeting-2017.html'),
- ('/site/community/minutes/meetings/11th-annual-users-meeting-2016',
- '/events/11th-annual-users-meeting-2016.html'),
- ('/site/community/minutes/meetings/10th-annual-users-meeting-june-2015',
- '/events/10th-annual-users-meeting-june-2015.html'),
- ('/site/community/minutes/meetings/9th-annual-users-meeting-june-2014',
- '/events/9th-annual-users-meeting-june-2014.html'),
- ('/site/community/jobs', '/careers'),
-
- ('/site/products', '/products'),
- ('/site/products/bio-formats', '/bio-formats'),
- ('/site/products/bio-formats/downloads', '/bio-formats/downloads/'),
- ('/site/products/omero', '/omero'),
- ('/site/products/omero/downloads', '/omero/downloads/'),
- ('/site/products/omero/feature-list', '/omero/features/'),
- ('/site/products/omero/secvuln', '/security/advisories/'),
- ('/site/products/ome5/secvuln', '/security/advisories/'),
- ('/site/products/omero/secvuln/2014-SV3-csrf',
- '/security/advisories/2014-SV3-csrf/'),
-
- ('/site/support', '/docs'),
- ('/site/support/ome-artwork', '/artwork'),
- ('/site/support/ome-artwork/artwork-usage', '/artwork'),
- ('/site/news', '/announcements'),
-
- ('/info/vulnerabilities', '/security/advisories/'),
- ('/info/vulnerabilities/2014-SV3-csrf',
- '/security/advisories/2014-SV3-csrf/'),
- ('/info/omero', '/omero'),
- ('/info/cls', '/omero/downloads/'),
- ('/info/download', '/omero/downloads/'),
- ('/info/downloads', '/omero/downloads/'),
- ('/info/attribution', '/licensing/'),
-]
-
-
-@pytest.mark.skip(reason="Causes Travis CI to exceed 10min timeout")
-@pytest.mark.parametrize('path,redirect', redirect_uris)
-def test_internal_redirects(host, path, redirect):
- out = host.check_output('curl -I http://localhost%s' % path)
- assert 'HTTP/1.1 302' in out
- assert 'Location: http://localhost%s' % redirect in out
-
-
-@pytest.mark.skip(reason="Causes Travis CI to exceed 10min timeout")
-@pytest.mark.parametrize('path,redirect', external_uris)
-def test_external_redirects(host, path, redirect):
- out = host.check_output('curl -I http://localhost%s' % path)
- assert 'HTTP/1.1 302' in out
- assert 'Location: %s' % redirect in out
-
- out = host.check_output('curl -I http://localhost%s/' % path)
- assert 'HTTP/1.1 302' in out
- assert 'Location: %s' % redirect in out