Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
BioHPC
clair-singularity
Commits
9733f723
Commit
9733f723
authored
Aug 24, 2017
by
David Trudgian
Browse files
daemonize httpd process
parent
6fec904d
Changes
2
Hide whitespace changes
Inline
Side-by-side
clair_singularity/cli.py
View file @
9733f723
...
@@ -41,6 +41,7 @@ def cli(image, clair_uri, text_output, json_output, bind_ip, bind_port, quiet):
...
@@ -41,6 +41,7 @@ def cli(image, clair_uri, text_output, json_output, bind_ip, bind_port, quiet):
# Start an HTTP server to serve the .tar.gz from our temporary directory
# Start an HTTP server to serve the .tar.gz from our temporary directory
# so that Clair can retrieve it
# so that Clair can retrieve it
httpd
=
Process
(
target
=
http_server
,
args
=
(
tar_dir
,
bind_ip
,
bind_port
,
quiet
))
httpd
=
Process
(
target
=
http_server
,
args
=
(
tar_dir
,
bind_ip
,
bind_port
,
quiet
))
httpd
.
daemon
=
True
httpd
.
start
()
httpd
.
start
()
# Allow up to 30 seconds for the httpd to start and be answering requests
# Allow up to 30 seconds for the httpd to start and be answering requests
httpd_ready
=
wait_net_service
(
bind_ip
,
bind_port
,
30
)
httpd_ready
=
wait_net_service
(
bind_ip
,
bind_port
,
30
)
...
...
tests/test_image.py
View file @
9733f723
...
@@ -46,6 +46,7 @@ def test_http_server(testimage, tmpdir):
...
@@ -46,6 +46,7 @@ def test_http_server(testimage, tmpdir):
"""Test we can retrieve the test image from in-built http server"""
"""Test we can retrieve the test image from in-built http server"""
httpd
=
multiprocessing
.
Process
(
target
=
http_server
,
httpd
=
multiprocessing
.
Process
(
target
=
http_server
,
args
=
(
os
.
path
.
dirname
(
testimage
),
'127.0.0.1'
,
8088
,
False
))
args
=
(
os
.
path
.
dirname
(
testimage
),
'127.0.0.1'
,
8088
,
False
))
httpd
.
daemon
=
True
httpd
.
start
()
httpd
.
start
()
# Allow up to 30 seconds for the httpd to start and be answering requests
# Allow up to 30 seconds for the httpd to start and be answering requests
httpd_ready
=
wait_net_service
(
'127.0.0.1'
,
8088
,
30
)
httpd_ready
=
wait_net_service
(
'127.0.0.1'
,
8088
,
30
)
...
...
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