Commit c3a9002a authored by Boxiang Sun's avatar Boxiang Sun

peertube: add test

parent 47275893
......@@ -24,8 +24,8 @@ md5sum = 458870b70c33a1621b68961ae2372ad5
filename = template-peertube-service.sh.in
# md5sum = 458870b70c33a1621b68961ae2372ad5
[template-peertube-production]
filename = template-peertube-production.yaml.in
[template-peertube]
filename = template-peertube.yaml.in
# md5sum = 458870b70c33a1621b68961ae2372ad5
[template-nginx-configuration]
......
......@@ -8,8 +8,9 @@ parts =
postgresql
nginx-service
nginx-listen-promise
peertube-production-yaml
peertube-yaml
peertube-service
publish-connection-parameter
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
......@@ -33,9 +34,9 @@ storage = $${:peertube_directory}/storage
versions = $${:peertube_directory}/versions
ssl = $${:etc}/ssl
[peertube-production-yaml]
[peertube-yaml]
recipe = slapos.recipe.template
url = ${template-peertube-production:output}
url = ${template-peertube:output}
output = $${directory:config}/peertube.yaml
[peertube-service]
......@@ -103,7 +104,6 @@ recipe = slapos.cookbook:mkdirectory
srv = $${directory:srv}/redis
log = $${directory:log}/redis
[service-redis]
recipe = slapos.cookbook:redis.server
wrapper = $${directory:services}/redis
......@@ -148,6 +148,16 @@ key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
configuration._ = {}
[frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = PeerTube Server Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config-url = $${nginx-listen-promise:config-url}
return = domain secure_access
[publish-connection-parameter]
recipe = slapos.cookbook:publish
# url = $${peertube-instance:url}
frontend-url = $${frontend:connection-domain}
......@@ -89,7 +89,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
[template-peertube-production]
[template-peertube]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename}
......
......@@ -5,7 +5,7 @@ listen:
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
webserver:
https: true
hostname: '[$${nginx-configuration:ip}]'
hostname: '$${frontend:connection-domain}'
port: $${nginx-configuration:port}
# Secrets you need to generate the first time you run PeerTube
......
......@@ -45,17 +45,14 @@ class PeertubeTestCase(SlapOSInstanceTestCase):
return {"name": cls.name}
class HTTPRequestTestMixin(object):
class TestPeerTube(PeertubeTestCase):
def setUp(self):
self.connection_parameters = self.computer_partition.getConnectionParameterDict()
"""Test that the service url.${kind} responds Hello ${name}
"""
def test_get(self):
#url = self.computer_partition.getConnectionParameterDict()['url.{}'.format(
# self.kind)]
#response = requests.get(url)
self.assertEqual("Hello", "World")
class TestPython(PeertubeTestCase, HTTPRequestTestMixin):
name = "Python"
kind = "python"
backend_url = self.connection_parameters['frontend-url']
response = requests.get(url)
self.assertEqual(requests.codes['OK'], response.status_code)
self.assertIn('PeerTube', response.text)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment