mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
tests for scp_download
This commit is contained in:
parent
0e94c25929
commit
44c96e5c15
1 changed files with 17 additions and 5 deletions
|
@ -44,17 +44,29 @@ Shindo.tests('compute examples', 'compute') do
|
|||
|
||||
# scp a file to a server
|
||||
lorem_path = File.join([File.dirname(__FILE__), '..', 'tests', 'lorem.txt'])
|
||||
tests("@server.scp('#{lorem_path}', 'lorem.txt')").succeeds do
|
||||
@server.scp(lorem_path, 'lorem.txt')
|
||||
tests("@server.scp_upload('#{lorem_path}', 'lorem.txt')").succeeds do
|
||||
@server.scp_upload(lorem_path, 'lorem.txt')
|
||||
end
|
||||
|
||||
# scp a file from a server
|
||||
tests("@server.scp_download('lorem.txt', '/tmp/lorem.txt)").succeeds do
|
||||
@server.scp_download('lorem.txt', '/tmp/lorem.txt')
|
||||
end
|
||||
File.delete('/tmp/lorem.txt')
|
||||
|
||||
# scp a directory to a server
|
||||
Dir.mkdir('/tmp/lorem')
|
||||
file = ::File.new('/tmp/lorem/lorem.txt', 'w')
|
||||
file.write(File.read(lorem_path))
|
||||
lorem_dir = File.join([File.dirname(__FILE__), '..', 'tests'])
|
||||
tests("@server.scp('#{lorem_dir}', '/tmp/lorem', :recursive => true)").succeeds do
|
||||
@server.scp(lorem_dir, '/tmp/lorem', :recursive => true)
|
||||
tests("@server.scp_upload('/tmp/lorem', '/tmp', :recursive => true)").succeeds do
|
||||
@server.scp_upload('/tmp/lorem', '/tmp', :recursive => true)
|
||||
end
|
||||
File.delete('/tmp/lorem/lorem.txt')
|
||||
Dir.rmdir('/tmp/lorem')
|
||||
|
||||
# scp a directory from a server
|
||||
tests("@server.scp_download('/tmp/lorem', '/tmp', :recursive => true)").succeeds do
|
||||
@server.scp_download('/tmp/lorem', '/tmp', :recursive => true)
|
||||
end
|
||||
File.delete('/tmp/lorem/lorem.txt')
|
||||
Dir.rmdir('/tmp/lorem')
|
||||
|
|
Loading…
Reference in a new issue