|
|
|
@ -16,7 +16,7 @@ import requests
|
|
|
|
|
|
|
|
|
|
from util import take_screenshots
|
|
|
|
|
|
|
|
|
|
testinfra_hosts = ['paste01.opendev.org']
|
|
|
|
|
testinfra_hosts = ['paste99.opendev.org']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_lodgeit_container_web_listening(host):
|
|
|
|
@ -27,9 +27,7 @@ def test_lodgeit_container_web_listening(host):
|
|
|
|
|
assert paste_https.is_listening
|
|
|
|
|
|
|
|
|
|
def test_paste(host):
|
|
|
|
|
cmd = host.run('curl --insecure '
|
|
|
|
|
'--resolve paste.opendev.org:443:127.0.0.1 '
|
|
|
|
|
'https://paste.opendev.org')
|
|
|
|
|
cmd = host.run('curl https://paste99.opendev.org')
|
|
|
|
|
assert 'New Paste' in cmd.stdout
|
|
|
|
|
# ensure we paste private by default
|
|
|
|
|
assert '<input type="checkbox" name="private" id="private" checked>' \
|
|
|
|
@ -37,27 +35,22 @@ def test_paste(host):
|
|
|
|
|
|
|
|
|
|
def test_paste_redirects(host):
|
|
|
|
|
# http site should redirect all agents but Pastebinit
|
|
|
|
|
r = requests.get(
|
|
|
|
|
'http://%s' % host.backend.get_hostname(), allow_redirects=False)
|
|
|
|
|
r = requests.get('http://paste99.opendev.org', allow_redirects=False)
|
|
|
|
|
assert r.status_code == 301
|
|
|
|
|
assert r.headers['Location'] == 'https://paste.opendev.org/'
|
|
|
|
|
|
|
|
|
|
headers = {
|
|
|
|
|
'User-Agent': 'Pastebinit v1.2.3'
|
|
|
|
|
}
|
|
|
|
|
r = requests.get('http://%s' % (host.backend.get_hostname()))
|
|
|
|
|
r = requests.get('http://paste99.opendev.org')
|
|
|
|
|
assert r.status_code == 200
|
|
|
|
|
|
|
|
|
|
def test_paste_logo(host):
|
|
|
|
|
cmd = host.run('curl --insecure '
|
|
|
|
|
'--resolve paste.opendev.org:443:127.0.0.1 '
|
|
|
|
|
'https://paste.opendev.org/assets/opendev.svg')
|
|
|
|
|
cmd = host.run('curl https://paste99.opendev.org/assets/opendev.svg')
|
|
|
|
|
assert 'image/svg+xml' in cmd.stdout
|
|
|
|
|
|
|
|
|
|
def test_paste_robots(host):
|
|
|
|
|
cmd = host.run('curl --insecure '
|
|
|
|
|
'--resolve paste.opendev.org:443:127.0.0.1 '
|
|
|
|
|
'https://paste.opendev.org/robots.txt')
|
|
|
|
|
cmd = host.run('curl https://paste99.opendev.org/robots.txt')
|
|
|
|
|
assert 'Disallow: /' in cmd.stdout
|
|
|
|
|
|
|
|
|
|
def test_paste_screenshots(host):
|
|
|
|
|