Commit fa972a7d authored by Boxiang Sun's avatar Boxiang Sun

peertube: Test and configuration improvement

parent 60421bad
...@@ -393,14 +393,14 @@ transcoding: ...@@ -393,14 +393,14 @@ transcoding:
resolutions: # Only created if the original video has a higher resolution, uses more storage! resolutions: # Only created if the original video has a higher resolution, uses more storage!
0p: false # audio-only (creates mp4 without video stream, always created when enabled) 0p: false # audio-only (creates mp4 without video stream, always created when enabled)
144p: false 144p: true
240p: false 240p: true
360p: false 360p: true
480p: false 480p: true
720p: false 720p: true
1080p: false 1080p: true
1440p: false 1440p: true
2160p: false 2160p: true
# Transcode and keep original resolution, even if it's above your maximum enabled resolution # Transcode and keep original resolution, even if it's above your maximum enabled resolution
always_transcode_original_resolution: true always_transcode_original_resolution: true
...@@ -688,7 +688,7 @@ search: ...@@ -688,7 +688,7 @@ search:
# If enabled, the associated group will be able to "escape" from the instance follows # If enabled, the associated group will be able to "escape" from the instance follows
# That means they will be able to follow channels, watch videos, list videos of non followed instances # That means they will be able to follow channels, watch videos, list videos of non followed instances
remote_uri: remote_uri:
users: true users: false
anonymous: false anonymous: false
# Use a third party index instead of your local index, only for search results # Use a third party index instead of your local index, only for search results
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
import os import os
import requests import requests
import re
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -35,6 +36,26 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( ...@@ -35,6 +36,26 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg'))) os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
ipv6_regexp = '''(?:(?x)(?:(?:[0-9a-f]{1,4}:){1,1}(?::[0-9a-f]{1,4}){1,6})|
(?:(?:[0-9a-f]{1,4}:){1,2}(?::[0-9a-f]{1,4}){1,5})|
(?:(?:[0-9a-f]{1,4}:){1,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)){3})|
(?:(?:(?:[0-9a-f]{1,4}:){1,5}|:):(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})|
(?::(?::[0-9a-f]{1,4}){1,5}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}))
'''
class TestPeerTube(SlapOSInstanceTestCase): class TestPeerTube(SlapOSInstanceTestCase):
def setUp(self): def setUp(self):
self.connection_parameters = self.computer_partition.getConnectionParameterDict() self.connection_parameters = self.computer_partition.getConnectionParameterDict()
...@@ -46,3 +67,8 @@ class TestPeerTube(SlapOSInstanceTestCase): ...@@ -46,3 +67,8 @@ class TestPeerTube(SlapOSInstanceTestCase):
response = requests.get(url, verify=False) response = requests.get(url, verify=False)
self.assertEqual(requests.codes['OK'], response.status_code) self.assertEqual(requests.codes['OK'], response.status_code)
self.assertIn('PeerTube', response.text) self.assertIn('PeerTube', response.text)
response =requests.get(url + "/feeds/videos.xml?sort=-trending", verify=False)
self.assertEqual(requests.codes['OK'], response.status_code)
self.assertIn('rss', response.text)
self.assertFalse(bool(re.search(ipv6_regexp, 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