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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
d7227ac8
Commit
d7227ac8
authored
Sep 12, 2014
by
Cédric de Saint Martin
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
91852bd7
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 @
d7227ac8
...
@@ -32,6 +32,7 @@ import ConfigParser
...
@@ -32,6 +32,7 @@ import ConfigParser
import
os
import
os
import
logging
import
logging
import
shutil
import
shutil
import
socket
import
subprocess
import
subprocess
import
tempfile
import
tempfile
import
time
import
time
...
@@ -41,6 +42,7 @@ from xml_marshaller.xml_marshaller import loads, dumps
...
@@ -41,6 +42,7 @@ from xml_marshaller.xml_marshaller import loads, dumps
import
slapos.proxy
import
slapos.proxy
import
slapos.proxy.views
as
views
import
slapos.proxy.views
as
views
import
slapos.slap
import
slapos.slap.slap
import
slapos.slap.slap
import
sqlite3
import
sqlite3
...
@@ -867,6 +869,8 @@ class TestMultiMasterSupport(MasterMixin):
...
@@ -867,6 +869,8 @@ class TestMultiMasterSupport(MasterMixin):
self
.
external_proxy_port
=
8281
self
.
external_proxy_port
=
8281
self
.
external_master_url
=
'http://%s:%s'
%
(
self
.
external_proxy_host
,
self
.
external_proxy_port
)
self
.
external_master_url
=
'http://%s:%s'
%
(
self
.
external_proxy_host
,
self
.
external_proxy_port
)
self
.
external_computer_id
=
'external_computer'
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
()
super
(
TestMultiMasterSupport
,
self
).
setUp
()
...
@@ -900,9 +904,16 @@ database_uri = %(tempdir)s/lib/external_proxy.db
...
@@ -900,9 +904,16 @@ database_uri = %(tempdir)s/lib/external_proxy.db
# XXX use current dev version, not standard one installed through package
# 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
])
self
.
external_proxy_process
=
subprocess
.
Popen
([
'slapos'
,
'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
time
.
sleep
(
0.5
)
attempts
=
0
self
.
external_proxy_slap
=
slapos
.
slap
.
slap
()
while
(
attempts
<
20
):
self
.
external_proxy_slap
.
initializeConnection
(
self
.
external_master_url
)
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
):
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