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
92ae8662
Commit
92ae8662
authored
Sep 16, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import random old test scripts into tests/ dir.
parent
996d8477
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
0 deletions
+74
-0
tests/fakessh_test.py
tests/fakessh_test.py
+42
-0
tests/nested_test.py
tests/nested_test.py
+14
-0
tests/proxy_test.py
tests/proxy_test.py
+18
-0
No files found.
tests/fakessh_test.py
0 → 100644
View file @
92ae8662
import
mitogen.utils
import
mitogen.fakessh
@
mitogen
.
utils
.
run_with_router
def
main
(
router
):
import
logging
mitogen
.
utils
.
log_to_file
(
level
=
logging
.
INFO
)
router
.
enable_debug
()
#mitogen.fakessh.run_with_fake_ssh(router, ['bash', '-c', 'echo $PATH'])
#mitogen.fakessh.run_with_fake_ssh(router, ['bash', '-c', 'ls -Gl $SSH_PATH'])
# k3 = router.ssh(hostname='k3')
k3
=
router
.
local
()
print
'GOT HERE'
import
os
k3
.
call
(
os
.
system
,
'hostname'
)
return
#sud = router.sudo(via=k3, username='root')
sud
=
k3
mitogen
.
fakessh
.
run_with_fake_ssh
(
sud
,
router
,
[
'rsync'
,
'--progress'
,
'-vvvr'
,
'h:/var/lib/docker'
])
#mitogen.fakessh.run_with_fake_ssh(router, ['bash', '-c', 'ssh h rsync --server . foo'])
# mitogen.fakessh.run_with_fake_ssh(router, ['bash', '-c', 'ssh k3.botanicus.net -t screen -dr'])
print
'end of t.py'
import
logging
import
mitogen.utils
import
mitogen.fakessh
@
mitogen
.
utils
.
run_with_router
def
main
(
router
):
mitogen
.
utils
.
log_to_file
(
level
=
logging
.
DEBUG
)
#router.enable_debug()
#router.enable_debug()
k3
=
router
.
ssh
(
hostname
=
'k3'
)
sudo
=
router
.
sudo
(
via
=
k3
,
username
=
'root'
)
mitogen
.
fakessh
.
run
(
sudo
,
router
,
[
'rsync'
,
'--progress'
,
'-r'
,
'h:/var/lib/docker'
])
tests/nested_test.py
0 → 100644
View file @
92ae8662
import
os
import
mitogen.utils
@
mitogen
.
utils
.
run_with_router
def
main
(
router
):
mitogen
.
utils
.
log_to_file
()
context
=
None
for
x
in
range
(
1
,
11
):
print
'Connect local%d via %s'
%
(
x
,
context
)
context
=
router
.
local
(
via
=
context
,
name
=
'local%d'
%
x
)
context
.
call
(
os
.
system
,
'pstree -s python -s mitogen'
)
tests/proxy_test.py
0 → 100644
View file @
92ae8662
import
logging
import
os
import
mitogen.ssh
import
mitogen.sudo
import
mitogen.utils
@
mitogen
.
utils
.
run_with_router
def
main
(
router
):
mitogen
.
utils
.
log_to_file
(
io
=
False
,
level
=
logging
.
INFO
)
child1
=
router
.
ssh
(
name
=
'u'
,
hostname
=
'u'
)
child2
=
router
.
sudo
(
username
=
'sudo_pw_test'
,
password
=
'x'
,
name
=
'sudo_pw_test'
,
via
=
child1
,
)
child2
.
call
(
os
.
system
,
'id'
)
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