Commit c3a9002a authored by Boxiang Sun's avatar Boxiang Sun

peertube: add test

parent 47275893
...@@ -24,8 +24,8 @@ md5sum = 458870b70c33a1621b68961ae2372ad5 ...@@ -24,8 +24,8 @@ md5sum = 458870b70c33a1621b68961ae2372ad5
filename = template-peertube-service.sh.in filename = template-peertube-service.sh.in
# md5sum = 458870b70c33a1621b68961ae2372ad5 # md5sum = 458870b70c33a1621b68961ae2372ad5
[template-peertube-production] [template-peertube]
filename = template-peertube-production.yaml.in filename = template-peertube.yaml.in
# md5sum = 458870b70c33a1621b68961ae2372ad5 # md5sum = 458870b70c33a1621b68961ae2372ad5
[template-nginx-configuration] [template-nginx-configuration]
......
...@@ -8,8 +8,9 @@ parts = ...@@ -8,8 +8,9 @@ parts =
postgresql postgresql
nginx-service nginx-service
nginx-listen-promise nginx-listen-promise
peertube-production-yaml peertube-yaml
peertube-service peertube-service
publish-connection-parameter
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -33,9 +34,9 @@ storage = $${:peertube_directory}/storage ...@@ -33,9 +34,9 @@ storage = $${:peertube_directory}/storage
versions = $${:peertube_directory}/versions versions = $${:peertube_directory}/versions
ssl = $${:etc}/ssl ssl = $${:etc}/ssl
[peertube-production-yaml] [peertube-yaml]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${template-peertube-production:output} url = ${template-peertube:output}
output = $${directory:config}/peertube.yaml output = $${directory:config}/peertube.yaml
[peertube-service] [peertube-service]
...@@ -103,7 +104,6 @@ recipe = slapos.cookbook:mkdirectory ...@@ -103,7 +104,6 @@ recipe = slapos.cookbook:mkdirectory
srv = $${directory:srv}/redis srv = $${directory:srv}/redis
log = $${directory:log}/redis log = $${directory:log}/redis
[service-redis] [service-redis]
recipe = slapos.cookbook:redis.server recipe = slapos.cookbook:redis.server
wrapper = $${directory:services}/redis wrapper = $${directory:services}/redis
...@@ -148,6 +148,16 @@ key = $${slap-connection:key-file} ...@@ -148,6 +148,16 @@ key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file} cert = $${slap-connection:cert-file}
configuration._ = {} 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] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
# url = $${peertube-instance:url} frontend-url = $${frontend:connection-domain}
...@@ -89,7 +89,7 @@ recipe = slapos.recipe.template ...@@ -89,7 +89,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename} output = ${buildout:directory}/${:filename}
[template-peertube-production] [template-peertube]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/${:filename} output = ${buildout:directory}/${:filename}
......
...@@ -5,7 +5,7 @@ listen: ...@@ -5,7 +5,7 @@ listen:
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL) # Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
webserver: webserver:
https: true https: true
hostname: '[$${nginx-configuration:ip}]' hostname: '$${frontend:connection-domain}'
port: $${nginx-configuration:port} port: $${nginx-configuration:port}
# Secrets you need to generate the first time you run PeerTube # Secrets you need to generate the first time you run PeerTube
......
...@@ -45,17 +45,14 @@ class PeertubeTestCase(SlapOSInstanceTestCase): ...@@ -45,17 +45,14 @@ class PeertubeTestCase(SlapOSInstanceTestCase):
return {"name": cls.name} 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} """Test that the service url.${kind} responds Hello ${name}
""" """
def test_get(self): def test_get(self):
#url = self.computer_partition.getConnectionParameterDict()['url.{}'.format( backend_url = self.connection_parameters['frontend-url']
# self.kind)] response = requests.get(url)
#response = requests.get(url) self.assertEqual(requests.codes['OK'], response.status_code)
self.assertEqual("Hello", "World") self.assertIn('PeerTube', response.text)
class TestPython(PeertubeTestCase, HTTPRequestTestMixin):
name = "Python"
kind = "python"
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