Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
1510b72a
Commit
1510b72a
authored
Sep 21, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fakessh: Add integration test for inter-child rsync.
parent
b2f13f1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
tests/fakessh_test.py
tests/fakessh_test.py
+36
-0
No files found.
tests/fakessh_test.py
View file @
1510b72a
...
...
@@ -24,3 +24,39 @@ class RsyncTest(testlib.DockerMixin, unittest.TestCase):
assert
context
.
call
(
os
.
path
.
exists
,
'/tmp/data'
)
assert
context
.
call
(
os
.
path
.
exists
,
'/tmp/data/simple_pkg/a.py'
)
def
test_rsync_between_direct_children
(
self
):
# master -> SSH -> has-sudo-pubkey -> rsync(.ssh) -> master ->
# has-sudo -> rsync
pubkey_acct
=
self
.
docker_ssh
(
username
=
'has-sudo-pubkey'
,
identity_file
=
testlib
.
data_path
(
'docker/has-sudo-pubkey.key'
),
)
nopw_acct
=
self
.
docker_ssh
(
username
=
'has-sudo-nopw'
,
password
=
'y'
,
)
webapp_acct
=
self
.
router
.
sudo
(
via
=
nopw_acct
,
username
=
'webapp'
,
)
dest_path
=
webapp_acct
.
call
(
os
.
path
.
expanduser
,
'~/.ssh'
)
if
webapp_acct
.
call
(
os
.
path
.
exists
,
dest_path
):
webapp_acct
.
call
(
shutil
.
rmtree
,
dest_path
)
return_code
=
pubkey_acct
.
call
(
mitogen
.
fakessh
.
run
,
webapp_acct
,
args
=
[
'rsync'
,
'--progress'
,
'-vvva'
,
'.ssh/'
,
'target:'
+
dest_path
])
assert
return_code
==
0
assert
pubkey_acct
.
call
(
os
.
path
.
getsize
,
'.ssh/authorized_keys'
)
==
\
webapp_acct
.
call
(
os
.
path
.
getsize
,
dest_path
+
'/authorized_keys'
)
if
__name__
==
'__main__'
:
import
mitogen.utils
mitogen
.
utils
.
log_to_file
(
level
=
'DEBUG'
,
io
=
False
)
unittest
.
main
()
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