feat: initial commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-01-15 21:32:00 +01:00
commit e53a7da36c
40 changed files with 516 additions and 0 deletions

View 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