Commit 6ddbb205 authored by Jérome Perrin's avatar Jérome Perrin

Update most SR tests to use slapos.testing

Update almost all tests to use nexedi/slapos.core!64 

Notable changes:
 * the testcase class is generated dynamically with `makeModuleSetUpAndTestCaseClass`
 * `self.slap` allow low level control of slapos
 * IP addresses are available as `_ipv6_address` and `_ipv4_address` class attributes
 * `getSupervisorRPCServer` no longer exist, instead use `self.slap.instance_supervisor_rpc` (as context manager)
 * now the framework takes care of running promises and instance step fail when instanciation fail or when promises are not satisfied (as a result, some tests checking promises are dropped)
 * test needs `slapos` and `supervisord` commands in PATH. It's important to have a recent enough `slapos` and not the `~/bin/slapos` from slaprunner which sets `$SLAPOS_CONFIGURATION` 

Following tests were not updated:
 * `caddy-frontend` as this will require more work, because this software uses shared partitions and maybe other things will need to be adapted in the tests. 
 * `slapos-master` as it is same as ERP5 and I thought maybe we can do better than duplicating code, so I left it as is for now.
 * `nextcloud` as this fail the `slapos node instance` step.

There are also a few style changes or small fixes to make pylint happy and some other fixes for problems with softwares and also a fix for seleniumrunner flaky test.

/reviewed-on nexedi/slapos!624
parents e35a7b9b 213d79a5
...@@ -28,7 +28,8 @@ from setuptools import setup, find_packages ...@@ -28,7 +28,8 @@ from setuptools import setup, find_packages
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.erp5' name = 'slapos.test.erp5'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -25,15 +25,24 @@ ...@@ -25,15 +25,24 @@
# #
############################################################################## ##############################################################################
import json
import os import os
import unittest
import logging
if os.environ.get('DEBUG'): from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
raise ValueError("Don't set DEBUG - it breaks postfix compilation - set SLAPOS_TEST_DEBUG instead.")
debug_mode = os.environ.get('SLAPOS_TEST_DEBUG') setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
# for development: debugging logs and install Ctrl+C handler os.path.abspath(
if debug_mode: os.path.join(os.path.dirname(__file__), '..', '..', 'software.cfg')))
logging.basicConfig(level=logging.DEBUG)
unittest.installHandler()
class ERP5InstanceTestCase(SlapOSInstanceTestCase):
"""ERP5 base test case
"""
# ERP5 instanciation needs to run several times before being ready, as
# the root instance request more instances.
instance_max_retry = 7 # XXX how many times ?
def getRootPartitionConnectionParameterDict(self):
"""Return the output paramters from the root partition"""
return json.loads(
self.computer_partition.getConnectionParameterDict()['_'])
...@@ -29,28 +29,15 @@ import os ...@@ -29,28 +29,15 @@ import os
import json import json
import glob import glob
import urlparse import urlparse
import logging
import socket import socket
import time import time
import psutil import psutil
import requests import requests
from utils import SlapOSInstanceTestCase from . import ERP5InstanceTestCase
from . import setUpModule
setUpModule # pyflakes
class ERP5TestCase(SlapOSInstanceTestCase):
"""Test the remote driver on a minimal web server.
"""
logger = logging.getLogger(__name__)
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'software.cfg')), )
def getRootPartitionConnectionParameterDict(self):
"""Return the output paramters from the root partition"""
return json.loads(
self.computer_partition.getConnectionParameterDict()['_'])
class TestPublishedURLIsReachableMixin(object): class TestPublishedURLIsReachableMixin(object):
...@@ -60,12 +47,14 @@ class TestPublishedURLIsReachableMixin(object): ...@@ -60,12 +47,14 @@ class TestPublishedURLIsReachableMixin(object):
# What happens is that instanciation just create the services, but does not # What happens is that instanciation just create the services, but does not
# wait for ERP5 to be initialized. When this test run ERP5 instance is # wait for ERP5 to be initialized. When this test run ERP5 instance is
# instanciated, but zope is still busy creating the site and haproxy replies # instanciated, but zope is still busy creating the site and haproxy replies
# with 503 Service Unavailable. # with 503 Service Unavailable, sometimes the first request is 404, so we
# retry in a loop.
# If we can move the "create site" in slapos node instance, then this retry loop # If we can move the "create site" in slapos node instance, then this retry loop
# would not be necessary. # would not be necessary.
for i in range(1, 20): for i in range(1, 60):
r = requests.get(url, verify=False) # XXX can we get CA from caucase already ? r = requests.get(url, verify=False) # XXX can we get CA from caucase already ?
if r.status_code == requests.codes.service_unavailable: if r.status_code in (requests.codes.service_unavailable,
requests.codes.not_found):
delay = i * 2 delay = i * 2
self.logger.warn("ERP5 was not available, sleeping for %ds and retrying", delay) self.logger.warn("ERP5 was not available, sleeping for %ds and retrying", delay)
time.sleep(delay) time.sleep(delay)
...@@ -91,13 +80,13 @@ class TestPublishedURLIsReachableMixin(object): ...@@ -91,13 +80,13 @@ class TestPublishedURLIsReachableMixin(object):
urlparse.urljoin(param_dict['family-default'], param_dict['site-id'])) urlparse.urljoin(param_dict['family-default'], param_dict['site-id']))
class TestDefaultParameters(ERP5TestCase, TestPublishedURLIsReachableMixin): class TestDefaultParameters(ERP5InstanceTestCase, TestPublishedURLIsReachableMixin):
"""Test ERP5 can be instanciated with no parameters """Test ERP5 can be instanciated with no parameters
""" """
__partition_reference__ = 'defp' __partition_reference__ = 'defp'
class TestMedusa(ERP5TestCase, TestPublishedURLIsReachableMixin): class TestMedusa(ERP5InstanceTestCase, TestPublishedURLIsReachableMixin):
"""Test ERP5 Medusa server """Test ERP5 Medusa server
""" """
__partition_reference__ = 'medusa' __partition_reference__ = 'medusa'
...@@ -107,7 +96,7 @@ class TestMedusa(ERP5TestCase, TestPublishedURLIsReachableMixin): ...@@ -107,7 +96,7 @@ class TestMedusa(ERP5TestCase, TestPublishedURLIsReachableMixin):
return {'_': json.dumps({'wsgi': False})} return {'_': json.dumps({'wsgi': False})}
class TestApacheBalancerPorts(ERP5TestCase): class TestApacheBalancerPorts(ERP5InstanceTestCase):
"""Instanciate with two zope families, this should create for each family: """Instanciate with two zope families, this should create for each family:
- a balancer entry point with corresponding haproxy - a balancer entry point with corresponding haproxy
- a balancer entry point for test runner - a balancer entry point for test runner
...@@ -159,8 +148,8 @@ class TestApacheBalancerPorts(ERP5TestCase): ...@@ -159,8 +148,8 @@ class TestApacheBalancerPorts(ERP5TestCase):
def test_zope_listen(self): def test_zope_listen(self):
# we requested 3 zope in family1 and 5 zopes in family2, we should have 8 zope running. # we requested 3 zope in family1 and 5 zopes in family2, we should have 8 zope running.
all_process_info = self.getSupervisorRPCServer( with self.slap.instance_supervisor_rpc as supervisor:
).supervisor.getAllProcessInfo() all_process_info = supervisor.getAllProcessInfo()
self.assertEqual( self.assertEqual(
3 + 5, 3 + 5,
len([p for p in all_process_info if p['name'].startswith('zope-')])) len([p for p in all_process_info if p['name'].startswith('zope-')]))
...@@ -168,8 +157,8 @@ class TestApacheBalancerPorts(ERP5TestCase): ...@@ -168,8 +157,8 @@ class TestApacheBalancerPorts(ERP5TestCase):
def test_apache_listen(self): def test_apache_listen(self):
# We have 2 families, apache should listen to a total of 3 ports per family # We have 2 families, apache should listen to a total of 3 ports per family
# normal access on ipv4 and ipv6 and test runner access on ipv4 only # normal access on ipv4 and ipv6 and test runner access on ipv4 only
all_process_info = self.getSupervisorRPCServer( with self.slap.instance_supervisor_rpc as supervisor:
).supervisor.getAllProcessInfo() all_process_info = supervisor.getAllProcessInfo()
process_info, = [p for p in all_process_info if p['name'] == 'apache'] process_info, = [p for p in all_process_info if p['name'] == 'apache']
apache_process = psutil.Process(process_info['pid']) apache_process = psutil.Process(process_info['pid'])
self.assertEqual( self.assertEqual(
...@@ -182,8 +171,8 @@ class TestApacheBalancerPorts(ERP5TestCase): ...@@ -182,8 +171,8 @@ class TestApacheBalancerPorts(ERP5TestCase):
def test_haproxy_listen(self): def test_haproxy_listen(self):
# There is one haproxy per family # There is one haproxy per family
all_process_info = self.getSupervisorRPCServer( with self.slap.instance_supervisor_rpc as supervisor:
).supervisor.getAllProcessInfo() all_process_info = supervisor.getAllProcessInfo()
process_info, = [ process_info, = [
p for p in all_process_info if p['name'].startswith('haproxy-') p for p in all_process_info if p['name'].startswith('haproxy-')
] ]
...@@ -193,7 +182,7 @@ class TestApacheBalancerPorts(ERP5TestCase): ...@@ -193,7 +182,7 @@ class TestApacheBalancerPorts(ERP5TestCase):
]) ])
class TestDisableTestRunner(ERP5TestCase, TestPublishedURLIsReachableMixin): class TestDisableTestRunner(ERP5InstanceTestCase, TestPublishedURLIsReachableMixin):
"""Test ERP5 can be instanciated without test runner. """Test ERP5 can be instanciated without test runner.
""" """
__partition_reference__ = 'distr' __partition_reference__ = 'distr'
...@@ -215,8 +204,8 @@ class TestDisableTestRunner(ERP5TestCase, TestPublishedURLIsReachableMixin): ...@@ -215,8 +204,8 @@ class TestDisableTestRunner(ERP5TestCase, TestPublishedURLIsReachableMixin):
def test_no_apache_testrunner_port(self): def test_no_apache_testrunner_port(self):
# Apache only listen on two ports, there is no apache ports allocated for test runner # Apache only listen on two ports, there is no apache ports allocated for test runner
all_process_info = self.getSupervisorRPCServer( with self.slap.instance_supervisor_rpc as supervisor:
).supervisor.getAllProcessInfo() all_process_info = supervisor.getAllProcessInfo()
process_info, = [p for p in all_process_info if p['name'] == 'apache'] process_info, = [p for p in all_process_info if p['name'] == 'apache']
apache_process = psutil.Process(process_info['pid']) apache_process = psutil.Process(process_info['pid'])
self.assertEqual( self.assertEqual(
......
This diff is collapsed.
...@@ -28,23 +28,25 @@ from setuptools import setup, find_packages ...@@ -28,23 +28,25 @@ from setuptools import setup, find_packages
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.helloworld' name = 'slapos.test.helloworld'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(
version=version, name=name,
description="Test for SlapOS' helloworld", version=version,
long_description=long_description, description="Test for SlapOS' helloworld",
long_description_content_type='text/markdown', long_description=long_description,
maintainer="Nexedi", long_description_content_type='text/markdown',
maintainer_email="info@nexedi.com", maintainer="Nexedi",
url="https://lab.nexedi.com/nexedi/slapos", maintainer_email="info@nexedi.com",
packages=find_packages(), url="https://lab.nexedi.com/nexedi/slapos",
install_requires=[ packages=find_packages(),
install_requires=[
'slapos.core', 'slapos.core',
'slapos.libnetworkcache', 'slapos.libnetworkcache',
'erp5.util', 'erp5.util',
'requests', 'requests',
], ],
zip_safe=True, zip_safe=True,
test_suite='test', test_suite='test',
) )
...@@ -27,26 +27,19 @@ ...@@ -27,26 +27,19 @@
import os import os
import requests import requests
import utils
# for development: debugging logs and install Ctrl+C handler from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class HelloWorldTestCase(utils.SlapOSInstanceTestCase):
class HelloWorldTestCase(SlapOSInstanceTestCase):
# to be defined by subclasses # to be defined by subclasses
name = None name = None
kind = None kind = None
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')),)
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
return {"name": cls.name} return {"name": cls.name}
......
This diff is collapsed.
...@@ -25,26 +25,20 @@ ...@@ -25,26 +25,20 @@
# #
############################################################################## ##############################################################################
import utils
import httplib import httplib
import json import json
import os import os
import requests import requests
# for development: debugging logs and install Ctrl+C handler from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class TestJupyter(utils.SlapOSInstanceTestCase):
@classmethod class TestJupyter(InstanceTestCase):
def getSoftwareURLList(cls):
return (os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')),)
def test(self): def test(self):
parameter_dict = self.computer_partition.getConnectionParameterDict() parameter_dict = self.computer_partition.getConnectionParameterDict()
...@@ -54,12 +48,11 @@ class TestJupyter(utils.SlapOSInstanceTestCase): ...@@ -54,12 +48,11 @@ class TestJupyter(utils.SlapOSInstanceTestCase):
except Exception as e: except Exception as e:
self.fail("Can't parse json in %s, error %s" % (parameter_dict['_'], e)) self.fail("Can't parse json in %s, error %s" % (parameter_dict['_'], e))
ip = os.environ['SLAPOS_TEST_IPV6']
self.assertEqual( self.assertEqual(
{ {
'jupyter-classic-url': 'https://[%s]:8888/tree' % (ip,), 'jupyter-classic-url': 'https://[%s]:8888/tree' % (self._ipv6_address, ),
'jupyterlab-url': 'https://[%s]:8888/lab' % (ip,), 'jupyterlab-url': 'https://[%s]:8888/lab' % (self._ipv6_address, ),
'url': 'https://[%s]:8888/tree' % (ip,) 'url': 'https://[%s]:8888/tree' % (self._ipv6_address, )
}, },
connection_dict connection_dict
) )
......
This diff is collapsed.
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.kvm' name = 'slapos.test.kvm'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -26,30 +26,15 @@ ...@@ -26,30 +26,15 @@
############################################################################## ##############################################################################
import os import os
import shutil
import urlparse
import tempfile
import requests
import socket
import StringIO
import subprocess
import json
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
# for development: debugging logs and install Ctrl+C handler
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class InstanceTestCase(utils.SlapOSInstanceTestCase):
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class ServicesTestCase(InstanceTestCase): class ServicesTestCase(InstanceTestCase):
...@@ -67,8 +52,8 @@ class ServicesTestCase(InstanceTestCase): ...@@ -67,8 +52,8 @@ class ServicesTestCase(InstanceTestCase):
'websockify-{hash}-on-watch', 'websockify-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [process['name']
for process in supervisor.getAllProcessInfo()] for process in supervisor.getAllProcessInfo()]
hash_files = [os.path.join(self.computer_partition_root_path, path) hash_files = [os.path.join(self.computer_partition_root_path, path)
......
This diff is collapsed.
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.monitor' name = 'slapos.test.monitor'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -26,33 +26,17 @@ ...@@ -26,33 +26,17 @@
############################################################################## ##############################################################################
import os import os
import shutil
import urlparse
import tempfile
import requests
import socket
import StringIO
import subprocess
import json
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
# for development: debugging logs and install Ctrl+C handler from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class InstanceTestCase(utils.SlapOSInstanceTestCase):
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class ServicesTestCase(SlapOSInstanceTestCase):
class ServicesTestCase(InstanceTestCase):
def test_hashes(self): def test_hashes(self):
hash_files = [ hash_files = [
...@@ -63,9 +47,9 @@ class ServicesTestCase(InstanceTestCase): ...@@ -63,9 +47,9 @@ class ServicesTestCase(InstanceTestCase):
'crond-{hash}-on-watch', 'crond-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [process['name']
for process in supervisor.getAllProcessInfo()] for process in supervisor.getAllProcessInfo()]
hash_files = [os.path.join(self.computer_partition_root_path, path) hash_files = [os.path.join(self.computer_partition_root_path, path)
for path in hash_files] for path in hash_files]
......
This diff is collapsed.
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.plantuml' name = 'slapos.test.plantuml'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -35,21 +35,13 @@ from PIL import Image ...@@ -35,21 +35,13 @@ from PIL import Image
import requests import requests
import plantuml import plantuml
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
# for development: debugging logs and install Ctrl+C handler
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, PlantUMLTestCase = makeModuleSetUpAndTestCaseClass(
class PlantUMLTestCase(utils.SlapOSInstanceTestCase): os.path.abspath(
@classmethod os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class TestSimpleDiagram(PlantUMLTestCase): class TestSimpleDiagram(PlantUMLTestCase):
...@@ -165,8 +157,8 @@ class ServicesTestCase(PlantUMLTestCase): ...@@ -165,8 +157,8 @@ class ServicesTestCase(PlantUMLTestCase):
'tomcat-instance-{hash}-on-watch', 'tomcat-instance-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [process['name']
for process in supervisor.getAllProcessInfo()] for process in supervisor.getAllProcessInfo()]
hash_files = [os.path.join(self.computer_partition_root_path, path) hash_files = [os.path.join(self.computer_partition_root_path, path)
......
This diff is collapsed.
...@@ -120,7 +120,7 @@ monitor-password = $${monitor-publish-parameters:monitor-password} ...@@ -120,7 +120,7 @@ monitor-password = $${monitor-publish-parameters:monitor-password}
##################### #####################
# Power DNS Slave configuration # Power DNS Slave configuration
# #
{% set slave_instance_list = json_module.loads(slapparameter_dict.get('extra_slave_instance_list', '')) %} {% set slave_instance_list = json_module.loads(slapparameter_dict.get('extra_slave_instance_list', '[]')) %}
# Iter through slave list to prepare configuration # Iter through slave list to prepare configuration
{% for slave in slave_instance_list %} {% for slave in slave_instance_list %}
......
...@@ -25,7 +25,7 @@ mode = 0644 ...@@ -25,7 +25,7 @@ mode = 0644
[template-powerdns] [template-powerdns]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-powerdns.cfg url = ${:_profile_base_location_}/instance-powerdns.cfg
md5sum = 5077ba344b641fa9703f9872a974d3d7 md5sum = f0d87be6df84f23c811638ce9d5f60ea
output = ${buildout:directory}/template-powerdns.cfg output = ${buildout:directory}/template-powerdns.cfg
mode = 0644 mode = 0644
......
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.powerdns' name = 'slapos.test.powerdns'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -26,33 +26,22 @@ ...@@ -26,33 +26,22 @@
############################################################################## ##############################################################################
import os import os
import shutil
import urlparse
import tempfile
import requests
import socket
import StringIO
import subprocess
import json
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
# for development: debugging logs and install Ctrl+C handler
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class InstanceTestCase(utils.SlapOSInstanceTestCase):
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class PowerDNSTestCase(SlapOSInstanceTestCase):
# power dns uses sockets and need shorter paths on test nodes.
__partition_reference__ = 'pdns'
class ServicesTestCase(InstanceTestCase):
class ServicesTestCase(PowerDNSTestCase):
def test_hashes(self): def test_hashes(self):
hash_files = [ hash_files = [
...@@ -62,9 +51,9 @@ class ServicesTestCase(InstanceTestCase): ...@@ -62,9 +51,9 @@ class ServicesTestCase(InstanceTestCase):
'pdns-{hash}-on-watch', 'pdns-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [process['name']
for process in supervisor.getAllProcessInfo()] for process in supervisor.getAllProcessInfo()]
hash_files = [os.path.join(self.computer_partition_root_path, path) hash_files = [os.path.join(self.computer_partition_root_path, path)
for path in hash_files] for path in hash_files]
......
This diff is collapsed.
...@@ -25,30 +25,30 @@ ...@@ -25,30 +25,30 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.proftpd' name = 'slapos.test.proftpd'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(
version=version, name=name,
description="Test for SlapOS' ProFTPd", version=version,
long_description=long_description, description="Test for SlapOS' ProFTPd",
long_description_content_type='text/markdown', long_description=long_description,
maintainer="Nexedi", long_description_content_type='text/markdown',
maintainer_email="info@nexedi.com", maintainer="Nexedi",
url="https://lab.nexedi.com/nexedi/slapos", maintainer_email="info@nexedi.com",
packages=find_packages(), url="https://lab.nexedi.com/nexedi/slapos",
install_requires=[ packages=find_packages(),
install_requires=[
'slapos.core', 'slapos.core',
'slapos.libnetworkcache', 'slapos.libnetworkcache',
'erp5.util', 'erp5.util',
'pysftp', 'pysftp',
'supervisor', 'supervisor',
'psutil', 'psutil',
], ],
zip_safe=True, zip_safe=True,
test_suite='test', test_suite='test',
) )
...@@ -37,22 +37,15 @@ import psutil ...@@ -37,22 +37,15 @@ import psutil
from paramiko.ssh_exception import SSHException from paramiko.ssh_exception import SSHException
from paramiko.ssh_exception import AuthenticationException from paramiko.ssh_exception import AuthenticationException
import utils from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
from slapos.testing.utils import findFreeTCPPort
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
# for development: debugging logs and install Ctrl+C handler
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
class ProFTPdTestCase(utils.SlapOSInstanceTestCase):
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class ProFTPdTestCase(SlapOSInstanceTestCase):
def _getConnection(self, username=None, password=None, hostname=None): def _getConnection(self, username=None, password=None, hostname=None):
"""Returns a pysftp connection connected to the SFTP """Returns a pysftp connection connected to the SFTP
...@@ -77,7 +70,7 @@ class ProFTPdTestCase(utils.SlapOSInstanceTestCase): ...@@ -77,7 +70,7 @@ class ProFTPdTestCase(utils.SlapOSInstanceTestCase):
class TestSFTPListen(ProFTPdTestCase): class TestSFTPListen(ProFTPdTestCase):
def test_listen_on_ipv4(self): def test_listen_on_ipv4(self):
self.assertTrue(self._getConnection(hostname=self.config['ipv4_address'])) self.assertTrue(self._getConnection(hostname=self._ipv4_address))
def test_does_not_listen_on_all_ip(self): def test_does_not_listen_on_all_ip(self):
with self.assertRaises(SSHException): with self.assertRaises(SSHException):
...@@ -115,20 +108,22 @@ class TestSFTPOperations(ProFTPdTestCase): ...@@ -115,20 +108,22 @@ class TestSFTPOperations(ProFTPdTestCase):
# download the file again, it should have same content # download the file again, it should have same content
tempdir = tempfile.mkdtemp() tempdir = tempfile.mkdtemp()
self.addCleanup(lambda : shutil.rmtree(tempdir)) self.addCleanup(lambda: shutil.rmtree(tempdir))
local_file = os.path.join(tempdir, 'testfile') local_file = os.path.join(tempdir, 'testfile')
retrieve_same_file = sftp.get('testfile', local_file) sftp.get('testfile', local_file)
with open(local_file) as f: with open(local_file) as f:
self.assertEqual(f.read(), "Hello FTP !") self.assertEqual(f.read(), "Hello FTP !")
def test_uploaded_file_not_visible_until_fully_uploaded(self): def test_uploaded_file_not_visible_until_fully_uploaded(self):
test_self = self test_self = self
class PartialFile(StringIO.StringIO): class PartialFile(StringIO.StringIO):
def read(self, *args): def read(self, *args):
# file is not visible yet # file is not visible yet
test_self.assertNotIn('destination', os.listdir(test_self.upload_dir)) test_self.assertNotIn('destination', os.listdir(test_self.upload_dir))
# it's just a hidden file # it's just a hidden file
test_self.assertEqual(['.in.destination.'], os.listdir(test_self.upload_dir)) test_self.assertEqual(
['.in.destination.'], os.listdir(test_self.upload_dir))
return StringIO.StringIO.read(self, *args) return StringIO.StringIO.read(self, *args)
with self._getConnection() as sftp: with self._getConnection() as sftp:
...@@ -140,13 +135,16 @@ class TestSFTPOperations(ProFTPdTestCase): ...@@ -140,13 +135,16 @@ class TestSFTPOperations(ProFTPdTestCase):
def test_partial_upload_are_deleted(self): def test_partial_upload_are_deleted(self):
test_self = self test_self = self
with self._getConnection() as sftp: with self._getConnection() as sftp:
class ErrorFile(StringIO.StringIO): class ErrorFile(StringIO.StringIO):
def read(self, *args): def read(self, *args):
# at this point, file is already created on server # at this point, file is already created on server
test_self.assertEqual(['.in.destination.'], os.listdir(test_self.upload_dir)) test_self.assertEqual(
['.in.destination.'], os.listdir(test_self.upload_dir))
# simulate a connection closed # simulate a connection closed
sftp.sftp_client.close() sftp.sftp_client.close()
return "something that will not be sent to server" return "something that will not be sent to server"
with self.assertRaises(IOError): with self.assertRaises(IOError):
sftp.sftp_client.putfo(ErrorFile(), "destination") sftp.sftp_client.putfo(ErrorFile(), "destination")
# no half uploaded file is kept # no half uploaded file is kept
...@@ -164,12 +162,14 @@ class TestSFTPOperations(ProFTPdTestCase): ...@@ -164,12 +162,14 @@ class TestSFTPOperations(ProFTPdTestCase):
class TestUserManagement(ProFTPdTestCase): class TestUserManagement(ProFTPdTestCase):
def test_user_can_be_added_from_script(self): def test_user_can_be_added_from_script(self):
with self.assertRaisesRegexp(AuthenticationException, 'Authentication failed'): with self.assertRaisesRegexp(AuthenticationException,
'Authentication failed'):
self._getConnection(username='bob', password='secret') self._getConnection(username='bob', password='secret')
subprocess.check_call( subprocess.check_call(
'echo secret | %s/bin/ftpasswd --name=bob --stdin' % self.computer_partition_root_path, 'echo secret | %s/bin/ftpasswd --name=bob --stdin' %
shell=True) self.computer_partition_root_path,
shell=True)
self.assertTrue(self._getConnection(username='bob', password='secret')) self.assertTrue(self._getConnection(username='bob', password='secret'))
...@@ -177,7 +177,8 @@ class TestBan(ProFTPdTestCase): ...@@ -177,7 +177,8 @@ class TestBan(ProFTPdTestCase):
def test_client_are_banned_after_5_wrong_passwords(self): def test_client_are_banned_after_5_wrong_passwords(self):
# Simulate failed 5 login attempts # Simulate failed 5 login attempts
for i in range(5): for i in range(5):
with self.assertRaisesRegexp(AuthenticationException, 'Authentication failed'): with self.assertRaisesRegexp(AuthenticationException,
'Authentication failed'):
self._getConnection(password='wrong') self._getConnection(password='wrong')
# after that, even with a valid password we cannot connect # after that, even with a valid password we cannot connect
...@@ -185,17 +186,19 @@ class TestBan(ProFTPdTestCase): ...@@ -185,17 +186,19 @@ class TestBan(ProFTPdTestCase):
self._getConnection() self._getConnection()
# ban event is logged # ban event is logged
with open(os.path.join( with open(os.path.join(self.computer_partition_root_path,
self.computer_partition_root_path, 'var', 'log', 'proftpd-ban.log')) as ban_log_file: 'var',
'log',
'proftpd-ban.log')) as ban_log_file:
self.assertRegexpMatches( self.assertRegexpMatches(
ban_log_file.readlines()[-1], ban_log_file.readlines()[-1],
'login from host .* denied due to host ban') 'login from host .* denied due to host ban')
class TestInstanceParameterPort(ProFTPdTestCase): class TestInstanceParameterPort(ProFTPdTestCase):
@classmethod @classmethod
def getInstanceParameterDict(cls): def getInstanceParameterDict(cls):
cls.free_port = utils.findFreeTCPPort(cls.config['ipv4_address']) cls.free_port = findFreeTCPPort(cls._ipv4_address)
return {'port': cls.free_port} return {'port': cls.free_port}
def test_instance_parameter_port(self): def test_instance_parameter_port(self):
...@@ -211,23 +214,26 @@ class TestFilesAndSocketsInInstanceDir(ProFTPdTestCase): ...@@ -211,23 +214,26 @@ class TestFilesAndSocketsInInstanceDir(ProFTPdTestCase):
def setUp(self): def setUp(self):
"""sets `self.proftpdProcess` to `psutil.Process` for the running proftpd in the instance. """sets `self.proftpdProcess` to `psutil.Process` for the running proftpd in the instance.
""" """
all_process_info = self.getSupervisorRPCServer().supervisor.getAllProcessInfo() with self.slap.instance_supervisor_rpc as supervisor:
all_process_info = supervisor.getAllProcessInfo()
# there is only one process in this instance # there is only one process in this instance
process_info, = [p for p in all_process_info if p['name'] != 'watchdog'] process_info, = [p for p in all_process_info if p['name'] != 'watchdog']
process = psutil.Process(process_info['pid']) process = psutil.Process(process_info['pid'])
self.assertEqual('proftpd', process.name()) # sanity check self.assertEqual('proftpd', process.name()) # sanity check
self.proftpdProcess = process self.proftpdProcess = process
def test_only_write_file_in_instance_dir(self): def test_only_write_file_in_instance_dir(self):
self.assertEqual( self.assertEqual(
[], [],
[f for f in self.proftpdProcess.open_files() [
if f.mode != 'r' f for f in self.proftpdProcess.open_files() if f.mode != 'r'
if not f.path.startswith(self.computer_partition_root_path)]) if not f.path.startswith(self.computer_partition_root_path)
])
def test_only_unix_socket_in_instance_dir(self): def test_only_unix_socket_in_instance_dir(self):
self.assertEqual( self.assertEqual(
[], [],
[s for s in self.proftpdProcess.connections('unix') [
if not s.laddr.startswith(self.computer_partition_root_path)]) s for s in self.proftpdProcess.connections('unix')
if not s.laddr.startswith(self.computer_partition_root_path)
])
This diff is collapsed.
...@@ -25,30 +25,30 @@ ...@@ -25,30 +25,30 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.re6stnet' name = 'slapos.test.re6stnet'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(
version=version, name=name,
description="Test for SlapOS' Re6stnet", version=version,
long_description=long_description, description="Test for SlapOS' Re6stnet",
long_description_content_type='text/markdown', long_description=long_description,
maintainer="Nexedi", long_description_content_type='text/markdown',
maintainer_email="info@nexedi.com", maintainer="Nexedi",
url="https://lab.nexedi.com/nexedi/slapos", maintainer_email="info@nexedi.com",
packages=find_packages(), url="https://lab.nexedi.com/nexedi/slapos",
install_requires=[ packages=find_packages(),
install_requires=[
'slapos.core', 'slapos.core',
'slapos.cookbook', 'slapos.cookbook',
'slapos.libnetworkcache', 'slapos.libnetworkcache',
'erp5.util', 'erp5.util',
'supervisor', 'supervisor',
'psutil', 'psutil',
], ],
zip_safe=True, zip_safe=True,
test_suite='test', test_suite='test',
) )
...@@ -26,60 +26,39 @@ ...@@ -26,60 +26,39 @@
############################################################################## ##############################################################################
import os import os
import shutil
import urlparse
import tempfile
import requests import requests
import socket
import StringIO
import subprocess
import json import json
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
SLAPOS_TEST_IPV4 = os.environ['SLAPOS_TEST_IPV4'] setUpModule, Re6stnetTestCase = makeModuleSetUpAndTestCaseClass(
SLAPOS_TEST_IPV6 = os.environ['SLAPOS_TEST_IPV6'] os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
# for development: debugging logs and install Ctrl+C handler
if os.environ.get('SLAPOS_TEST_DEBUG'):
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
class Re6stnetTestCase(utils.SlapOSInstanceTestCase):
def setUp(self):
import logging
utils.SlapOSInstanceTestCase.setUp(self)
self.logger = logging.getLogger(__name__)
@classmethod
def getSoftwareURLList(cls):
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class TestRe6stnetRegistry(Re6stnetTestCase): class TestRe6stnetRegistry(Re6stnetTestCase):
def test_listen(self): def test_listen(self):
connection_parameters = self.computer_partition.getConnectionParameterDict() connection_parameters = self.computer_partition.getConnectionParameterDict()
registry_url = connection_parameters['re6stry-local-url'] registry_url = connection_parameters['re6stry-local-url']
_ = requests.get(registry_url) _ = requests.get(registry_url)
class TestPortRedirection(Re6stnetTestCase):
class TestPortRedirection(Re6stnetTestCase):
def test_portredir_config(self): def test_portredir_config(self):
portredir_config_path = os.path.join(self.computer_partition_root_path, '.slapos-port-redirect') portredir_config_path = os.path.join(
self.computer_partition_root_path, '.slapos-port-redirect')
with open(portredir_config_path) as f: with open(portredir_config_path) as f:
portredir_config = json.load(f) portredir_config = json.load(f)
self.assertDictContainsSubset({ self.assertDictContainsSubset(
'srcPort': 9201, {
'destPort': 9201, 'srcPort': 9201,
}, portredir_config[0]) 'destPort': 9201,
}, portredir_config[0])
class ServicesTestCase(Re6stnetTestCase): class ServicesTestCase(Re6stnetTestCase):
...@@ -89,18 +68,21 @@ class ServicesTestCase(Re6stnetTestCase): ...@@ -89,18 +68,21 @@ class ServicesTestCase(Re6stnetTestCase):
def test_hashes(self): def test_hashes(self):
hash_files = [ hash_files = [
'software_release/buildout.cfg', 'software_release/buildout.cfg',
] ]
expected_process_names = [ expected_process_names = [
'httpd-{hash}-on-watch', 'httpd-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [
for process in supervisor.getAllProcessInfo()] process['name'] for process in supervisor.getAllProcessInfo()
]
hash_files = [os.path.join(self.computer_partition_root_path, path) hash_files = [
for path in hash_files] os.path.join(self.computer_partition_root_path, path)
for path in hash_files
]
for name in expected_process_names: for name in expected_process_names:
h = generateHashFromFiles(hash_files) h = generateHashFromFiles(hash_files)
......
This diff is collapsed.
...@@ -28,18 +28,20 @@ from setuptools import setup, find_packages ...@@ -28,18 +28,20 @@ from setuptools import setup, find_packages
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.seleniumserver' name = 'slapos.test.seleniumserver'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(
version=version, name=name,
description="Test for SlapOS' Selenium Server", version=version,
long_description=long_description, description="Test for SlapOS' Selenium Server",
long_description_content_type='text/markdown', long_description=long_description,
maintainer="Nexedi", long_description_content_type='text/markdown',
maintainer_email="info@nexedi.com", maintainer="Nexedi",
url="https://lab.nexedi.com/nexedi/slapos", maintainer_email="info@nexedi.com",
packages=find_packages(), url="https://lab.nexedi.com/nexedi/slapos",
install_requires=[ packages=find_packages(),
install_requires=[
'slapos.core', 'slapos.core',
'supervisor', 'supervisor',
'slapos.libnetworkcache', 'slapos.libnetworkcache',
...@@ -49,7 +51,7 @@ setup(name=name, ...@@ -49,7 +51,7 @@ setup(name=name,
'image', 'image',
'requests', 'requests',
'paramiko', 'paramiko',
], ],
zip_safe=True, zip_safe=True,
test_suite='test', test_suite='test',
) )
This diff is collapsed.
This diff is collapsed.
...@@ -112,6 +112,7 @@ eggs = ...@@ -112,6 +112,7 @@ eggs =
${bcrypt:egg} ${bcrypt:egg}
slapos.libnetworkcache slapos.libnetworkcache
slapos.core slapos.core
supervisor
${slapos.cookbook-setup:egg} ${slapos.cookbook-setup:egg}
${slapos.test.caddy-frontend-setup:egg} ${slapos.test.caddy-frontend-setup:egg}
${slapos.test.erp5-setup:egg} ${slapos.test.erp5-setup:egg}
...@@ -128,12 +129,13 @@ eggs = ...@@ -128,12 +129,13 @@ eggs =
${slapos.test.nextcloud-setup:egg} ${slapos.test.nextcloud-setup:egg}
${slapos.test.turnserver-setup:egg} ${slapos.test.turnserver-setup:egg}
${backports.lzma:egg} ${backports.lzma:egg}
entry-points = entry-points =
runTestSuite=erp5.util.testsuite:runTestSuite runTestSuite=erp5.util.testsuite:runTestSuite
scripts = scripts =
runTestSuite runTestSuite
slapos slapos
supervisorctl
supervisord
interpreter= interpreter=
python_for_test python_for_test
......
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
# #
############################################################################## ##############################################################################
from setuptools import setup, find_packages from setuptools import setup, find_packages
import glob
import os
version = '0.0.1.dev0' version = '0.0.1.dev0'
name = 'slapos.test.slaprunner' name = 'slapos.test.slaprunner'
long_description = open("README.md").read() with open("README.md") as f:
long_description = f.read()
setup(name=name, setup(name=name,
version=version, version=version,
......
...@@ -26,35 +26,21 @@ ...@@ -26,35 +26,21 @@
############################################################################## ##############################################################################
import os import os
import shutil
import urlparse
import tempfile
import requests
import socket
import StringIO
import subprocess
import json
import psutil
import utils
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
# for development: debugging logs and install Ctrl+C handler setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
if os.environ.get('SLAPOS_TEST_DEBUG'): os.path.abspath(
import logging os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
logging.basicConfig(level=logging.DEBUG)
import unittest
unittest.installHandler()
class InstanceTestCase(utils.SlapOSInstanceTestCase): class SlaprunnerTestCase(SlapOSInstanceTestCase):
@classmethod # Slaprunner uses unix sockets, so it needs short paths.
def getSoftwareURLList(cls): __partition_reference__ = 's'
return (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'software.cfg')), )
class ServicesTestCase(InstanceTestCase):
class ServicesTestCase(SlaprunnerTestCase):
def test_hashes(self): def test_hashes(self):
hash_files = [ hash_files = [
'software_release/buildout.cfg', 'software_release/buildout.cfg',
...@@ -71,9 +57,10 @@ class ServicesTestCase(InstanceTestCase): ...@@ -71,9 +57,10 @@ class ServicesTestCase(InstanceTestCase):
'supervisord-{hash}-on-watch', 'supervisord-{hash}-on-watch',
] ]
supervisor = self.getSupervisorRPCServer().supervisor with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name'] process_names = [
for process in supervisor.getAllProcessInfo()] process['name'] for process in supervisor.getAllProcessInfo()
]
hash_files = [os.path.join(self.computer_partition_root_path, path) hash_files = [os.path.join(self.computer_partition_root_path, path)
for path in hash_files] for path in hash_files]
......
This diff is collapsed.
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[instance-cfg]
filename = instance.cfg.in
md5sum = d027a2dccaf15ae6e7d3a28cc02d70c3
[template-turnserver]
filename = instance-turnserver.cfg.jinja2.in
md5sum = 6ba54fb299e1fd59617e5a6a9545e36e
...@@ -109,8 +109,12 @@ mode = 644 ...@@ -109,8 +109,12 @@ mode = 644
[turnserver-wrapper] [turnserver-wrapper]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = {{ parameter_dict['turnserver-location'] }}/bin/turnserver # XXX on first invocation of read-secret, the secret file is not yet generated
-c ${turnserver-config:output} # so on first buildout run turnserver-config has an empty secret.
# We don't want to start the server when config file is not complete.
command-line =
bash -c "egrep static-auth-secret=.+ ${turnserver-config:output} && \
{{ parameter_dict['turnserver-location'] }}/bin/turnserver -c ${turnserver-config:output}"
wrapper-path = ${directory:services}/turnserver wrapper-path = ${directory:services}/turnserver
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
......
...@@ -7,6 +7,7 @@ extends = ...@@ -7,6 +7,7 @@ extends =
../../component/socat/buildout.cfg ../../component/socat/buildout.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
buildout.hash.cfg
parts += parts +=
...@@ -22,14 +23,11 @@ mode = 644 ...@@ -22,14 +23,11 @@ mode = 644
[instance-cfg] [instance-cfg]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg output = ${buildout:directory}/instance.cfg
md5sum = d027a2dccaf15ae6e7d3a28cc02d70c3
[template-turnserver] [template-turnserver]
<= download-base <= download-base
filename = instance-turnserver.cfg.jinja2.in
md5sum = f275df4900a9db1d1a72b67b12ee8afe
[versions] [versions]
slapos.recipe.template = 4.3 slapos.recipe.template = 4.3
This diff is collapsed.
This diff is collapsed.
...@@ -137,7 +137,7 @@ pytz = 2016.10 ...@@ -137,7 +137,7 @@ pytz = 2016.10
requests = 2.13.0 requests = 2.13.0
six = 1.12.0 six = 1.12.0
slapos.cookbook = 1.0.123 slapos.cookbook = 1.0.123
slapos.core = 1.4.28 slapos.core = 1.5.0
slapos.extension.strip = 0.4 slapos.extension.strip = 0.4
slapos.extension.shared = 1.0 slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.19 slapos.libnetworkcache = 0.19
...@@ -154,7 +154,7 @@ CacheControl = 0.12.5 ...@@ -154,7 +154,7 @@ CacheControl = 0.12.5
msgpack = 0.6.1 msgpack = 0.6.1
# Required by: # Required by:
# slapos.core==1.4.26 # slapos.core==1.5.0
Flask = 0.12 Flask = 0.12
# Required by: # Required by:
...@@ -226,7 +226,7 @@ jsonschema = 3.0.2 ...@@ -226,7 +226,7 @@ jsonschema = 3.0.2
lockfile = 0.12.2 lockfile = 0.12.2
# Required by: # Required by:
# slapos.core==1.4.26 # slapos.core==1.5.0
# XXX 'slapos node format' raises an exception with netifaces 0.10.5. # XXX 'slapos node format' raises an exception with netifaces 0.10.5.
netifaces = 0.10.7 netifaces = 0.10.7
...@@ -259,7 +259,7 @@ python-dateutil = 2.7.3 ...@@ -259,7 +259,7 @@ python-dateutil = 2.7.3
rpdb = 0.1.5 rpdb = 0.1.5
# Required by: # Required by:
# slapos.core==1.4.26 # slapos.core==1.5.0
supervisor = 3.3.3 supervisor = 3.3.3
# Required by: # Required by:
...@@ -267,11 +267,11 @@ supervisor = 3.3.3 ...@@ -267,11 +267,11 @@ supervisor = 3.3.3
tzlocal = 1.5.1 tzlocal = 1.5.1
# Required by: # Required by:
# slapos.core==1.4.26 # slapos.core==1.5.0
uritemplate = 3.0.0 uritemplate = 3.0.0
# Required by: # Required by:
# slapos.core==1.4.26 # slapos.core==1.5.0
zope.interface = 4.3.3 zope.interface = 4.3.3
[networkcache] [networkcache]
......
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