Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
c71afe35
Commit
c71afe35
authored
Apr 04, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Async tests complete. Fixed bug in async_wrapper
parent
fae3a718
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
library/async_wrapper
+0
-2
test/TestRunner.py
+5
-6
No files found.
library/async_wrapper
View file @
c71afe35
...
...
@@ -38,8 +38,6 @@ if len(sys.argv) < 3:
})
sys
.
exit
(
1
)
print
sys
.
argv
jid
=
sys
.
argv
[
1
]
time_limit
=
sys
.
argv
[
2
]
wrapped_module
=
sys
.
argv
[
3
]
...
...
test/TestRunner.py
View file @
c71afe35
...
...
@@ -57,6 +57,8 @@ class TestRunner(unittest.TestCase):
self
.
runner
.
module_args
=
module_args
self
.
runner
.
background
=
background
results
=
self
.
runner
.
run
()
# when using nosetests this will only show up on failure
# which is pretty useful
print
"RESULTS=
%
s"
%
results
assert
"127.0.0.1"
in
results
[
'contacted'
]
return
results
[
'contacted'
][
'127.0.0.1'
]
...
...
@@ -139,17 +141,14 @@ class TestRunner(unittest.TestCase):
def
test_async
(
self
):
# test async launch and job status
# of any particular module
result
=
self
.
_run
(
'command'
,
[
"/bin/sleep"
,
"10"
],
background
=
20
)
print
"RESULT1=
%
s"
%
result
result
=
self
.
_run
(
'command'
,
[
"/bin/sleep"
,
"3"
],
background
=
20
)
assert
'ansible_job_id'
in
result
assert
'started'
in
result
jid
=
result
[
'ansible_job_id'
]
# no real chance of this op taking a while, but whatever
time
.
sleep
(
1
)
# TODO: verify we are still running
time
.
sleep
(
12
)
time
.
sleep
(
5
)
# CLI will abstract this, but this is how it works internally
result
=
self
.
_run
(
'async_status'
,
[
"jid=
%
s"
%
ansible_job_
id
])
result
=
self
.
_run
(
'async_status'
,
[
"jid=
%
s"
%
j
id
])
# TODO: would be nice to have tests for supervisory process
# killing job after X seconds
assert
'finished'
in
result
...
...
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