diff --git a/examples/compute_tests.rb b/examples/compute_tests.rb index ec649d25e..a7a72944e 100755 --- a/examples/compute_tests.rb +++ b/examples/compute_tests.rb @@ -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')