resolving alpine+nginx issues

This commit is contained in:
diginc
2017-01-08 23:43:12 -06:00
parent dc83502ed1
commit cc1c7a745d
5 changed files with 19 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ def test_indecies_are_present(RunningPiHole):
def test_html_index_requests_load_as_expected(RunningPiHole, ip, url):
command = 'curl -s -o /tmp/curled_file -w "%{{http_code}}" http://{}{}'.format(ip, url)
http_rc = RunningPiHole.run(command)
assert RunningPiHole.run('md5sum /tmp/curled_file /var/www/html/pihole/index.html').rc == 0
assert RunningPiHole.run('grep -q "Access to the following site has been blocked" /tmp/curled_file ').rc == 0
assert int(http_rc.stdout) == 200
@pytest.mark.parametrize('ip', [ '127.0.0.1', '[::]' ] )
@@ -54,7 +54,8 @@ def test_javascript_requests_load_as_expected(RunningPiHole, ip, url):
assert RunningPiHole.run('md5sum /tmp/curled_file /var/www/html/pihole/index.js').rc == 0
assert int(http_rc.stdout) == 200
@pytest.mark.parametrize('ip', [ '127.0.0.1', '[::]' ] )
# 127.0.0.1 fails host check now :(
@pytest.mark.parametrize('ip', [ 'localhost', '[::]' ] )
@pytest.mark.parametrize('url', [ '/admin/', '/admin/index.php' ] )
def test_admin_requests_load_as_expected(RunningPiHole, ip, url):
command = 'curl -s -o /tmp/curled_file -w "%{{http_code}}" http://{}{}'.format(ip, url)
@@ -62,5 +63,5 @@ def test_admin_requests_load_as_expected(RunningPiHole, ip, url):
assert int(http_rc.stdout) == 200
assert RunningPiHole.run('wc -l /tmp/curled_file ') > 10
assert RunningPiHole.run('grep -q "Content-Security-Policy" /tmp/curled_file ').rc == 0
assert RunningPiHole.run('grep -q "js/pihole/footer.js" /tmp/curled_file ').rc == 0
assert RunningPiHole.run('grep -q "scripts/pi-hole/js/footer.js" /tmp/curled_file ').rc == 0