Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
bb0ca97b
Commit
bb0ca97b
authored
Sep 12, 2014
by
Cédric de Saint Martin
Committed by
Rafael Monnerat
Nov 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.proxy: tests: do not wait for fixed time for external proxy to be started.
Also remove trailing whitespaces.
parent
214db720
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
slapos/tests/slapproxy/__init__.py
slapos/tests/slapproxy/__init__.py
+24
-13
No files found.
slapos/tests/slapproxy/__init__.py
View file @
bb0ca97b
...
...
@@ -32,6 +32,7 @@ import ConfigParser
import
os
import
logging
import
shutil
import
socket
import
subprocess
import
tempfile
import
time
...
...
@@ -41,6 +42,7 @@ from xml_marshaller.xml_marshaller import loads, dumps
import
slapos.proxy
import
slapos.proxy.views
as
views
import
slapos.slap
import
slapos.slap.slap
import
sqlite3
...
...
@@ -867,6 +869,8 @@ class TestMultiMasterSupport(MasterMixin):
self
.
external_proxy_port
=
8281
self
.
external_master_url
=
'http://%s:%s'
%
(
self
.
external_proxy_host
,
self
.
external_proxy_port
)
self
.
external_computer_id
=
'external_computer'
self
.
external_proxy_slap
=
slapos
.
slap
.
slap
()
self
.
external_proxy_slap
.
initializeConnection
(
self
.
external_master_url
)
super
(
TestMultiMasterSupport
,
self
).
setUp
()
...
...
@@ -900,9 +904,16 @@ database_uri = %(tempdir)s/lib/external_proxy.db
# XXX use current dev version, not standard one installed through package
self
.
external_proxy_process
=
subprocess
.
Popen
([
'slapos'
,
'proxy'
,
'start'
,
'--cfg'
,
self
.
external_slapproxy_configuration_file_location
])
# Wait a bit for proxy to be started
time
.
sleep
(
0.5
)
self
.
external_proxy_slap
=
slapos
.
slap
.
slap
()
self
.
external_proxy_slap
.
initializeConnection
(
self
.
external_master_url
)
attempts
=
0
while
(
attempts
<
20
):
try
:
self
.
external_proxy_slap
.
_connection_helper
.
GET
(
'/'
)
except
slapos
.
slap
.
NotFoundError
:
break
except
socket
.
error
:
attempts
=
attempts
+
1
time
.
sleep
(
0.1
)
def
createSlapOSConfigurationFile
(
self
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment