Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Lu Xu
slapos.toolbox
Commits
41107678
Commit
41107678
authored
Sep 11, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_check_url_available: wait for our test HTTP server to be available
parent
56b5df0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
slapos/test/promise/plugin/test_check_url_available.py
slapos/test/promise/plugin/test_check_url_available.py
+8
-0
No files found.
slapos/test/promise/plugin/test_check_url_available.py
View file @
41107678
...
@@ -29,6 +29,7 @@ from slapos.grid.promise import PromiseError
...
@@ -29,6 +29,7 @@ from slapos.grid.promise import PromiseError
from
slapos.test.promise.plugin
import
TestPromisePluginMixin
from
slapos.test.promise.plugin
import
TestPromisePluginMixin
from
slapos.util
import
str2bytes
from
slapos.util
import
str2bytes
import
contextlib
from
cryptography
import
x509
from
cryptography
import
x509
from
cryptography.hazmat.backends
import
default_backend
from
cryptography.hazmat.backends
import
default_backend
from
cryptography.hazmat.primitives
import
hashes
from
cryptography.hazmat.primitives
import
hashes
...
@@ -42,6 +43,7 @@ import json
...
@@ -42,6 +43,7 @@ import json
import
multiprocessing
import
multiprocessing
import
os
import
os
import
six
import
six
import
socket
import
ssl
import
ssl
import
tempfile
import
tempfile
import
time
import
time
...
@@ -192,6 +194,12 @@ class CheckUrlAvailableMixin(TestPromisePluginMixin):
...
@@ -192,6 +194,12 @@ class CheckUrlAvailableMixin(TestPromisePluginMixin):
cls
.
server_process
=
multiprocessing
.
Process
(
target
=
server
)
cls
.
server_process
=
multiprocessing
.
Process
(
target
=
server
)
cls
.
server_process
.
start
()
cls
.
server_process
.
start
()
for
_
in
range
(
20
):
try
:
with
contextlib
.
closing
(
socket
.
create_connection
((
SLAPOS_TEST_IPV4
,
SLAPOS_TEST_IPV4_PORT
))):
break
except
Exception
:
time
.
sleep
(.
1
)
@
classmethod
@
classmethod
def
tearDownClass
(
cls
):
def
tearDownClass
(
cls
):
...
...
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