Commit 0812d6da authored by Cédric de Saint Martin's avatar Cédric de Saint Martin Committed by Rafael Monnerat

slapproxy test: use current running code to start external proxy.

parent 368d0da0
...@@ -34,6 +34,7 @@ import logging ...@@ -34,6 +34,7 @@ import logging
import shutil import shutil
import socket import socket
import subprocess import subprocess
import sys
import tempfile import tempfile
import time import time
import unittest import unittest
...@@ -903,8 +904,12 @@ database_uri = %(tempdir)s/lib/external_proxy.db ...@@ -903,8 +904,12 @@ database_uri = %(tempdir)s/lib/external_proxy.db
Start external slapproxy Start external slapproxy
""" """
logging.getLogger().info('Starting external proxy, listening to %s:%s' % (self.external_proxy_host, self.external_proxy_port)) logging.getLogger().info('Starting external proxy, listening to %s:%s' % (self.external_proxy_host, self.external_proxy_port))
# XXX use current dev version, not standard one installed through package # XXX This uses a hack to run current code of slapos.core
self.external_proxy_process = subprocess.Popen(['slapos', 'proxy', 'start', '--cfg', self.external_slapproxy_configuration_file_location ]) import slapos
self.external_proxy_process = subprocess.Popen([
sys.executable, '%s/cli/entry.py' % os.path.dirname(slapos.__file__),
'proxy', 'start', '--cfg', self.external_slapproxy_configuration_file_location
])
# Wait a bit for proxy to be started # Wait a bit for proxy to be started
attempts = 0 attempts = 0
while (attempts < 20): while (attempts < 20):
......
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