This commit is contained in:
16
molecule/default/tests/test_docker.py
Executable file
16
molecule/default/tests/test_docker.py
Executable file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('middleware')
|
||||
|
||||
|
||||
def test_docker_package(host):
|
||||
|
||||
assert host.package("docker-ce").is_installed
|
||||
|
||||
|
||||
def test_docker_service(host):
|
||||
assert host.service('docker').is_running
|
||||
assert host.service('docker').is_enabled
|
||||
23
molecule/default/tests/test_gitea.py
Normal file
23
molecule/default/tests/test_gitea.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('gitea')
|
||||
|
||||
|
||||
def test_gitea_service(host):
|
||||
assert host.service('gitea').is_running
|
||||
assert host.service('gitea').is_enabled
|
||||
|
||||
|
||||
def test_gitea_with_https(host):
|
||||
cmd = host.run("curl -I -k -H Host:git.localhost https://127.0.0.1")
|
||||
assert cmd.rc == 0
|
||||
assert "HTTP/2 200" in cmd.stdout
|
||||
|
||||
|
||||
def test_gitea_redirection_with_http(host):
|
||||
cmd = host.run("curl -I -H Host:git.localhost http://127.0.0.1")
|
||||
assert cmd.rc == 0
|
||||
assert "HTTP/1.1 307 Temporary Redirect" in cmd.stdout
|
||||
11
molecule/default/tests/test_traefik.py
Executable file
11
molecule/default/tests/test_traefik.py
Executable file
@@ -0,0 +1,11 @@
|
||||
import os
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('middleware')
|
||||
|
||||
|
||||
def test_traefik_service(host):
|
||||
assert host.service('traefik').is_running
|
||||
assert host.service('traefik').is_enabled
|
||||
Reference in New Issue
Block a user