redcar 0.3.8.3 → 0.3.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/Rakefile +1 -1
- data/lib/redcar.rb +1 -1
- data/lib/redcar/installer.rb +14 -4
- metadata +1 -168
- data/lib/openssl/Manifest.txt +0 -99
- data/lib/openssl/build.properties +0 -7
- data/lib/plugin_manager/plugin_manager.gemspec +0 -33
- data/plugins/project/vendor/net-sftp/Manifest +0 -55
- data/plugins/project/vendor/net-sftp/Rakefile +0 -30
- data/plugins/project/vendor/net-sftp/lib/net/sftp.rb +0 -70
- data/plugins/project/vendor/net-sftp/lib/net/sftp/constants.rb +0 -187
- data/plugins/project/vendor/net-sftp/lib/net/sftp/errors.rb +0 -39
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/dir.rb +0 -93
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/download.rb +0 -364
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/file.rb +0 -176
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/file_factory.rb +0 -60
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/upload.rb +0 -387
- data/plugins/project/vendor/net-sftp/lib/net/sftp/packet.rb +0 -21
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol.rb +0 -32
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/attributes.rb +0 -315
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/base.rb +0 -268
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/name.rb +0 -43
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/02/base.rb +0 -31
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/03/base.rb +0 -35
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/attributes.rb +0 -152
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/base.rb +0 -94
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/name.rb +0 -67
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/05/base.rb +0 -66
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/06/attributes.rb +0 -107
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/06/base.rb +0 -63
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/base.rb +0 -50
- data/plugins/project/vendor/net-sftp/lib/net/sftp/request.rb +0 -91
- data/plugins/project/vendor/net-sftp/lib/net/sftp/response.rb +0 -76
- data/plugins/project/vendor/net-sftp/lib/net/sftp/session.rb +0 -951
- data/plugins/project/vendor/net-sftp/lib/net/sftp/version.rb +0 -18
- data/plugins/project/vendor/net-sftp/setup.rb +0 -1331
- data/plugins/project/vendor/net-sftp/test/common.rb +0 -171
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_attributes.rb +0 -97
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_base.rb +0 -210
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_name.rb +0 -27
- data/plugins/project/vendor/net-sftp/test/protocol/02/test_base.rb +0 -26
- data/plugins/project/vendor/net-sftp/test/protocol/03/test_base.rb +0 -27
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_attributes.rb +0 -148
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_base.rb +0 -74
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_name.rb +0 -53
- data/plugins/project/vendor/net-sftp/test/protocol/05/test_base.rb +0 -62
- data/plugins/project/vendor/net-sftp/test/protocol/06/test_attributes.rb +0 -124
- data/plugins/project/vendor/net-sftp/test/protocol/06/test_base.rb +0 -51
- data/plugins/project/vendor/net-sftp/test/protocol/test_base.rb +0 -42
- data/plugins/project/vendor/net-sftp/test/test_all.rb +0 -7
- data/plugins/project/vendor/net-sftp/test/test_dir.rb +0 -47
- data/plugins/project/vendor/net-sftp/test/test_download.rb +0 -252
- data/plugins/project/vendor/net-sftp/test/test_file.rb +0 -159
- data/plugins/project/vendor/net-sftp/test/test_file_factory.rb +0 -48
- data/plugins/project/vendor/net-sftp/test/test_packet.rb +0 -9
- data/plugins/project/vendor/net-sftp/test/test_protocol.rb +0 -17
- data/plugins/project/vendor/net-sftp/test/test_request.rb +0 -71
- data/plugins/project/vendor/net-sftp/test/test_response.rb +0 -53
- data/plugins/project/vendor/net-sftp/test/test_session.rb +0 -741
- data/plugins/project/vendor/net-sftp/test/test_upload.rb +0 -219
- data/plugins/project/vendor/net-ssh/Manifest +0 -110
- data/plugins/project/vendor/net-ssh/Rakefile +0 -85
- data/plugins/project/vendor/net-ssh/Rudyfile +0 -96
- data/plugins/project/vendor/net-ssh/lib/net/ssh.rb +0 -215
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/agent.rb +0 -179
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/constants.rb +0 -18
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/key_manager.rb +0 -193
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/abstract.rb +0 -60
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/hostbased.rb +0 -71
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/keyboard_interactive.rb +0 -66
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/password.rb +0 -39
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/publickey.rb +0 -92
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/pageant.rb +0 -183
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/session.rb +0 -134
- data/plugins/project/vendor/net-ssh/lib/net/ssh/buffer.rb +0 -340
- data/plugins/project/vendor/net-ssh/lib/net/ssh/buffered_io.rb +0 -198
- data/plugins/project/vendor/net-ssh/lib/net/ssh/config.rb +0 -202
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/channel.rb +0 -630
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/constants.rb +0 -33
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/session.rb +0 -597
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/term.rb +0 -178
- data/plugins/project/vendor/net-ssh/lib/net/ssh/errors.rb +0 -85
- data/plugins/project/vendor/net-ssh/lib/net/ssh/key_factory.rb +0 -102
- data/plugins/project/vendor/net-ssh/lib/net/ssh/known_hosts.rb +0 -129
- data/plugins/project/vendor/net-ssh/lib/net/ssh/loggable.rb +0 -61
- data/plugins/project/vendor/net-ssh/lib/net/ssh/packet.rb +0 -102
- data/plugins/project/vendor/net-ssh/lib/net/ssh/prompt.rb +0 -93
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/command.rb +0 -75
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/errors.rb +0 -14
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/http.rb +0 -94
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/socks4.rb +0 -70
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/socks5.rb +0 -142
- data/plugins/project/vendor/net-ssh/lib/net/ssh/ruby_compat.rb +0 -43
- data/plugins/project/vendor/net-ssh/lib/net/ssh/service/forward.rb +0 -288
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test.rb +0 -89
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/channel.rb +0 -129
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/extensions.rb +0 -152
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/kex.rb +0 -44
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/local_packet.rb +0 -51
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/packet.rb +0 -81
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/remote_packet.rb +0 -38
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/script.rb +0 -157
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/socket.rb +0 -64
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/algorithms.rb +0 -384
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/cipher_factory.rb +0 -97
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/constants.rb +0 -30
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac.rb +0 -31
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/abstract.rb +0 -79
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/md5.rb +0 -12
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/md5_96.rb +0 -11
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/none.rb +0 -15
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/sha1.rb +0 -13
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/sha1_96.rb +0 -11
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/identity_cipher.rb +0 -55
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex.rb +0 -13
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +0 -208
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +0 -77
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/openssl.rb +0 -128
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/packet_stream.rb +0 -235
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/server_version.rb +0 -71
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/session.rb +0 -276
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/state.rb +0 -206
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/lenient.rb +0 -30
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/null.rb +0 -12
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/strict.rb +0 -53
- data/plugins/project/vendor/net-ssh/lib/net/ssh/version.rb +0 -62
- data/plugins/project/vendor/net-ssh/net-ssh.gemspec +0 -138
- data/plugins/project/vendor/net-ssh/setup.rb +0 -1585
- data/plugins/project/vendor/net-ssh/support/arcfour_check.rb +0 -20
- data/plugins/project/vendor/net-ssh/support/ssh_tunnel_bug.rb +0 -65
- data/plugins/project/vendor/net-ssh/test/README.txt +0 -42
- data/plugins/project/vendor/net-ssh/test/authentication/methods/common.rb +0 -28
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_abstract.rb +0 -51
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_hostbased.rb +0 -114
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_keyboard_interactive.rb +0 -98
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_password.rb +0 -50
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_publickey.rb +0 -127
- data/plugins/project/vendor/net-ssh/test/authentication/test_agent.rb +0 -205
- data/plugins/project/vendor/net-ssh/test/authentication/test_key_manager.rb +0 -105
- data/plugins/project/vendor/net-ssh/test/authentication/test_session.rb +0 -93
- data/plugins/project/vendor/net-ssh/test/common.rb +0 -107
- data/plugins/project/vendor/net-ssh/test/configs/eqsign +0 -3
- data/plugins/project/vendor/net-ssh/test/configs/exact_match +0 -8
- data/plugins/project/vendor/net-ssh/test/configs/host_plus +0 -10
- data/plugins/project/vendor/net-ssh/test/configs/multihost +0 -4
- data/plugins/project/vendor/net-ssh/test/configs/nohost +0 -19
- data/plugins/project/vendor/net-ssh/test/configs/numeric_host +0 -4
- data/plugins/project/vendor/net-ssh/test/configs/wild_cards +0 -14
- data/plugins/project/vendor/net-ssh/test/connection/test_channel.rb +0 -467
- data/plugins/project/vendor/net-ssh/test/connection/test_session.rb +0 -488
- data/plugins/project/vendor/net-ssh/test/manual/test_forward.rb +0 -185
- data/plugins/project/vendor/net-ssh/test/test_all.rb +0 -9
- data/plugins/project/vendor/net-ssh/test/test_buffer.rb +0 -336
- data/plugins/project/vendor/net-ssh/test/test_buffered_io.rb +0 -63
- data/plugins/project/vendor/net-ssh/test/test_config.rb +0 -117
- data/plugins/project/vendor/net-ssh/test/test_key_factory.rb +0 -67
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_md5.rb +0 -39
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_md5_96.rb +0 -25
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_none.rb +0 -34
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_sha1.rb +0 -34
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_sha1_96.rb +0 -25
- data/plugins/project/vendor/net-ssh/test/transport/kex/test_diffie_hellman_group1_sha1.rb +0 -146
- data/plugins/project/vendor/net-ssh/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +0 -92
- data/plugins/project/vendor/net-ssh/test/transport/test_algorithms.rb +0 -302
- data/plugins/project/vendor/net-ssh/test/transport/test_cipher_factory.rb +0 -213
- data/plugins/project/vendor/net-ssh/test/transport/test_hmac.rb +0 -34
- data/plugins/project/vendor/net-ssh/test/transport/test_identity_cipher.rb +0 -40
- data/plugins/project/vendor/net-ssh/test/transport/test_packet_stream.rb +0 -441
- data/plugins/project/vendor/net-ssh/test/transport/test_server_version.rb +0 -78
- data/plugins/project/vendor/net-ssh/test/transport/test_session.rb +0 -315
- data/plugins/project/vendor/net-ssh/test/transport/test_state.rb +0 -173
@@ -1,219 +0,0 @@
|
|
1
|
-
require "common"
|
2
|
-
|
3
|
-
class UploadTest < Net::SFTP::TestCase
|
4
|
-
def setup
|
5
|
-
prepare_progress!
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_upload_file_should_send_file_contents
|
9
|
-
expect_file_transfer("/path/to/local", "/path/to/remote", "here are the contents")
|
10
|
-
assert_scripted_command { sftp.upload("/path/to/local", "/path/to/remote") }
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_upload_file_with_progress_should_report_progress
|
14
|
-
expect_file_transfer("/path/to/local", "/path/to/remote", "here are the contents")
|
15
|
-
|
16
|
-
assert_scripted_command do
|
17
|
-
sftp.upload("/path/to/local", "/path/to/remote") { |*args| record_progress(args) }
|
18
|
-
end
|
19
|
-
|
20
|
-
assert_progress_reported_open(:remote => "/path/to/remote")
|
21
|
-
assert_progress_reported_put(0, "here are the contents", :remote => "/path/to/remote")
|
22
|
-
assert_progress_reported_close(:remote => "/path/to/remote")
|
23
|
-
assert_progress_reported_finish
|
24
|
-
assert_no_more_reported_events
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_upload_file_with_progress_handler_should_report_progress
|
28
|
-
expect_file_transfer("/path/to/local", "/path/to/remote", "here are the contents")
|
29
|
-
|
30
|
-
assert_scripted_command do
|
31
|
-
sftp.upload("/path/to/local", "/path/to/remote", :progress => ProgressHandler.new(@progress))
|
32
|
-
end
|
33
|
-
|
34
|
-
assert_progress_reported_open(:remote => "/path/to/remote")
|
35
|
-
assert_progress_reported_put(0, "here are the contents", :remote => "/path/to/remote")
|
36
|
-
assert_progress_reported_close(:remote => "/path/to/remote")
|
37
|
-
assert_progress_reported_finish
|
38
|
-
assert_no_more_reported_events
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_upload_file_should_read_chunks_of_size(requested_size=nil)
|
42
|
-
size = requested_size || Net::SFTP::Operations::Upload::DEFAULT_READ_SIZE
|
43
|
-
expect_sftp_session :server_version => 3 do |channel|
|
44
|
-
channel.sends_packet(FXP_OPEN, :long, 0, :string, "/path/to/remote", :long, 0x1A, :long, 0)
|
45
|
-
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
46
|
-
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, "a" * size)
|
47
|
-
channel.sends_packet(FXP_WRITE, :long, 2, :string, "handle", :int64, size, :string, "b" * size)
|
48
|
-
channel.sends_packet(FXP_WRITE, :long, 3, :string, "handle", :int64, size*2, :string, "c" * size)
|
49
|
-
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
50
|
-
channel.sends_packet(FXP_WRITE, :long, 4, :string, "handle", :int64, size*3, :string, "d" * size)
|
51
|
-
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
52
|
-
channel.sends_packet(FXP_CLOSE, :long, 5, :string, "handle")
|
53
|
-
channel.gets_packet(FXP_STATUS, :long, 3, :long, 0)
|
54
|
-
channel.gets_packet(FXP_STATUS, :long, 4, :long, 0)
|
55
|
-
channel.gets_packet(FXP_STATUS, :long, 5, :long, 0)
|
56
|
-
end
|
57
|
-
|
58
|
-
expect_file("/path/to/local", "a" * size + "b" * size + "c" * size + "d" * size)
|
59
|
-
|
60
|
-
assert_scripted_command do
|
61
|
-
opts = {}
|
62
|
-
opts[:read_size] = size if requested_size
|
63
|
-
sftp.upload("/path/to/local", "/path/to/remote", opts)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_upload_file_with_custom_read_size_should_read_chunks_of_that_size
|
68
|
-
test_upload_file_should_read_chunks_of_size(100)
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_upload_file_with_custom_requests_should_start_that_many_writes
|
72
|
-
size = Net::SFTP::Operations::Upload::DEFAULT_READ_SIZE
|
73
|
-
expect_sftp_session :server_version => 3 do |channel|
|
74
|
-
channel.sends_packet(FXP_OPEN, :long, 0, :string, "/path/to/remote", :long, 0x1A, :long, 0)
|
75
|
-
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
76
|
-
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, "a" * size)
|
77
|
-
channel.sends_packet(FXP_WRITE, :long, 2, :string, "handle", :int64, size, :string, "b" * size)
|
78
|
-
channel.sends_packet(FXP_WRITE, :long, 3, :string, "handle", :int64, size*2, :string, "c" * size)
|
79
|
-
channel.sends_packet(FXP_WRITE, :long, 4, :string, "handle", :int64, size*3, :string, "d" * size)
|
80
|
-
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
81
|
-
channel.sends_packet(FXP_CLOSE, :long, 5, :string, "handle")
|
82
|
-
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
83
|
-
channel.gets_packet(FXP_STATUS, :long, 3, :long, 0)
|
84
|
-
channel.gets_packet(FXP_STATUS, :long, 4, :long, 0)
|
85
|
-
channel.gets_packet(FXP_STATUS, :long, 5, :long, 0)
|
86
|
-
end
|
87
|
-
|
88
|
-
expect_file("/path/to/local", "a" * size + "b" * size + "c" * size + "d" * size)
|
89
|
-
|
90
|
-
assert_scripted_command do
|
91
|
-
sftp.upload("/path/to/local", "/path/to/remote", :requests => 3)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_upload_directory_should_mirror_directory_structure_remotely
|
96
|
-
prepare_directory
|
97
|
-
|
98
|
-
assert_scripted_command do
|
99
|
-
sftp.upload("/path/to/local", "/path/to/remote")
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
def test_upload_directory_with_handler_should_report_progress
|
104
|
-
prepare_directory
|
105
|
-
|
106
|
-
assert_scripted_command do
|
107
|
-
sftp.upload("/path/to/local", "/path/to/remote") { |*args| record_progress(args) }
|
108
|
-
end
|
109
|
-
|
110
|
-
assert_progress_reported_open(:remote => "/path/to/remote/file1")
|
111
|
-
assert_progress_reported_open(:remote => "/path/to/remote/file2")
|
112
|
-
assert_progress_reported_open(:remote => "/path/to/remote/file3")
|
113
|
-
assert_progress_reported_mkdir("/path/to/remote/subdir")
|
114
|
-
assert_progress_reported_open(:remote => "/path/to/remote/subdir/other1")
|
115
|
-
assert_progress_reported_open(:remote => "/path/to/remote/subdir/other2")
|
116
|
-
assert_progress_reported_put(0, "contents of file1", :remote => "/path/to/remote/file1")
|
117
|
-
assert_progress_reported_put(0, "contents of file2", :remote => "/path/to/remote/file2")
|
118
|
-
assert_progress_reported_put(0, "contents of file3", :remote => "/path/to/remote/file3")
|
119
|
-
assert_progress_reported_close(:remote => "/path/to/remote/file1")
|
120
|
-
assert_progress_reported_put(0, "contents of other1", :remote => "/path/to/remote/subdir/other1")
|
121
|
-
assert_progress_reported_put(0, "contents of other2", :remote => "/path/to/remote/subdir/other2")
|
122
|
-
assert_progress_reported_close(:remote => "/path/to/remote/file2")
|
123
|
-
assert_progress_reported_close(:remote => "/path/to/remote/file3")
|
124
|
-
assert_progress_reported_close(:remote => "/path/to/remote/subdir/other1")
|
125
|
-
assert_progress_reported_close(:remote => "/path/to/remote/subdir/other2")
|
126
|
-
assert_progress_reported_finish
|
127
|
-
assert_no_more_reported_events
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_upload_io_should_send_io_as_file
|
131
|
-
expect_sftp_session :server_version => 3 do |channel|
|
132
|
-
channel.sends_packet(FXP_OPEN, :long, 0, :string, "/path/to/remote", :long, 0x1A, :long, 0)
|
133
|
-
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
134
|
-
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, "this is some text")
|
135
|
-
channel.sends_packet(FXP_CLOSE, :long, 2, :string, "handle")
|
136
|
-
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
137
|
-
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
138
|
-
end
|
139
|
-
|
140
|
-
assert_scripted_command do
|
141
|
-
sftp.upload(StringIO.new("this is some text"), "/path/to/remote")
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
private
|
146
|
-
|
147
|
-
def prepare_directory
|
148
|
-
expect_directory("/path/to/local", %w(. .. file1 file2 file3 subdir))
|
149
|
-
expect_directory("/path/to/local/subdir", %w(. .. other1 other2))
|
150
|
-
expect_file("/path/to/local/file1", "contents of file1")
|
151
|
-
expect_file("/path/to/local/file2", "contents of file2")
|
152
|
-
expect_file("/path/to/local/file3", "contents of file3")
|
153
|
-
expect_file("/path/to/local/subdir/other1", "contents of other1")
|
154
|
-
expect_file("/path/to/local/subdir/other2", "contents of other2")
|
155
|
-
|
156
|
-
expect_sftp_session :server_version => 3 do |ch|
|
157
|
-
ch.sends_packet(FXP_MKDIR, :long, 0, :string, "/path/to/remote", :long, 0)
|
158
|
-
ch.gets_packet(FXP_STATUS, :long, 0, :long, 0)
|
159
|
-
ch.sends_packet(FXP_OPEN, :long, 1, :string, "/path/to/remote/file1", :long, 0x1A, :long, 0)
|
160
|
-
ch.sends_packet(FXP_OPEN, :long, 2, :string, "/path/to/remote/file2", :long, 0x1A, :long, 0)
|
161
|
-
ch.sends_packet(FXP_OPEN, :long, 3, :string, "/path/to/remote/file3", :long, 0x1A, :long, 0)
|
162
|
-
ch.sends_packet(FXP_MKDIR, :long, 4, :string, "/path/to/remote/subdir", :long, 0)
|
163
|
-
ch.sends_packet(FXP_OPEN, :long, 5, :string, "/path/to/remote/subdir/other1", :long, 0x1A, :long, 0)
|
164
|
-
ch.sends_packet(FXP_OPEN, :long, 6, :string, "/path/to/remote/subdir/other2", :long, 0x1A, :long, 0)
|
165
|
-
ch.gets_packet(FXP_HANDLE, :long, 1, :string, "hfile1")
|
166
|
-
ch.sends_packet(FXP_WRITE, :long, 7, :string, "hfile1", :int64, 0, :string, "contents of file1")
|
167
|
-
ch.gets_packet(FXP_HANDLE, :long, 2, :string, "hfile2")
|
168
|
-
ch.sends_packet(FXP_WRITE, :long, 8, :string, "hfile2", :int64, 0, :string, "contents of file2")
|
169
|
-
ch.gets_packet(FXP_HANDLE, :long, 3, :string, "hfile3")
|
170
|
-
ch.sends_packet(FXP_WRITE, :long, 9, :string, "hfile3", :int64, 0, :string, "contents of file3")
|
171
|
-
ch.gets_packet(FXP_STATUS, :long, 4, :long, 0)
|
172
|
-
ch.gets_packet(FXP_HANDLE, :long, 5, :string, "hother1")
|
173
|
-
ch.sends_packet(FXP_CLOSE, :long, 10, :string, "hfile1")
|
174
|
-
ch.sends_packet(FXP_WRITE, :long, 11, :string, "hother1", :int64, 0, :string, "contents of other1")
|
175
|
-
ch.gets_packet(FXP_HANDLE, :long, 6, :string, "hother2")
|
176
|
-
ch.sends_packet(FXP_WRITE, :long, 12, :string, "hother2", :int64, 0, :string, "contents of other2")
|
177
|
-
ch.gets_packet(FXP_STATUS, :long, 7, :long, 0)
|
178
|
-
ch.sends_packet(FXP_CLOSE, :long, 13, :string, "hfile2")
|
179
|
-
ch.gets_packet(FXP_STATUS, :long, 8, :long, 0)
|
180
|
-
ch.sends_packet(FXP_CLOSE, :long, 14, :string, "hfile3")
|
181
|
-
ch.gets_packet(FXP_STATUS, :long, 9, :long, 0)
|
182
|
-
ch.sends_packet(FXP_CLOSE, :long, 15, :string, "hother1")
|
183
|
-
ch.gets_packet(FXP_STATUS, :long, 10, :long, 0)
|
184
|
-
ch.sends_packet(FXP_CLOSE, :long, 16, :string, "hother2")
|
185
|
-
ch.gets_packet(FXP_STATUS, :long, 11, :long, 0)
|
186
|
-
ch.gets_packet(FXP_STATUS, :long, 12, :long, 0)
|
187
|
-
ch.gets_packet(FXP_STATUS, :long, 13, :long, 0)
|
188
|
-
ch.gets_packet(FXP_STATUS, :long, 14, :long, 0)
|
189
|
-
ch.gets_packet(FXP_STATUS, :long, 15, :long, 0)
|
190
|
-
ch.gets_packet(FXP_STATUS, :long, 16, :long, 0)
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
def expect_file(path, data)
|
195
|
-
File.stubs(:directory?).with(path).returns(false)
|
196
|
-
File.stubs(:exists?).with(path).returns(true)
|
197
|
-
file = StringIO.new(data)
|
198
|
-
file.stubs(:stat).returns(stub("stat", :size => data.length))
|
199
|
-
File.stubs(:open).with(path, "rb").returns(file)
|
200
|
-
end
|
201
|
-
|
202
|
-
def expect_directory(path, entries)
|
203
|
-
Dir.stubs(:entries).with(path).returns(entries)
|
204
|
-
File.stubs(:directory?).with(path).returns(true)
|
205
|
-
end
|
206
|
-
|
207
|
-
def expect_file_transfer(local, remote, data)
|
208
|
-
expect_sftp_session :server_version => 3 do |channel|
|
209
|
-
channel.sends_packet(FXP_OPEN, :long, 0, :string, remote, :long, 0x1A, :long, 0)
|
210
|
-
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
211
|
-
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, data)
|
212
|
-
channel.sends_packet(FXP_CLOSE, :long, 2, :string, "handle")
|
213
|
-
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
214
|
-
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
215
|
-
end
|
216
|
-
|
217
|
-
expect_file(local, data)
|
218
|
-
end
|
219
|
-
end
|
@@ -1,110 +0,0 @@
|
|
1
|
-
CHANGELOG.rdoc
|
2
|
-
Manifest
|
3
|
-
README.rdoc
|
4
|
-
Rakefile
|
5
|
-
Rudyfile
|
6
|
-
THANKS.rdoc
|
7
|
-
lib/net/ssh.rb
|
8
|
-
lib/net/ssh/authentication/agent.rb
|
9
|
-
lib/net/ssh/authentication/constants.rb
|
10
|
-
lib/net/ssh/authentication/key_manager.rb
|
11
|
-
lib/net/ssh/authentication/methods/abstract.rb
|
12
|
-
lib/net/ssh/authentication/methods/hostbased.rb
|
13
|
-
lib/net/ssh/authentication/methods/keyboard_interactive.rb
|
14
|
-
lib/net/ssh/authentication/methods/password.rb
|
15
|
-
lib/net/ssh/authentication/methods/publickey.rb
|
16
|
-
lib/net/ssh/authentication/pageant.rb
|
17
|
-
lib/net/ssh/authentication/session.rb
|
18
|
-
lib/net/ssh/buffer.rb
|
19
|
-
lib/net/ssh/buffered_io.rb
|
20
|
-
lib/net/ssh/config.rb
|
21
|
-
lib/net/ssh/connection/channel.rb
|
22
|
-
lib/net/ssh/connection/constants.rb
|
23
|
-
lib/net/ssh/connection/session.rb
|
24
|
-
lib/net/ssh/connection/term.rb
|
25
|
-
lib/net/ssh/errors.rb
|
26
|
-
lib/net/ssh/key_factory.rb
|
27
|
-
lib/net/ssh/known_hosts.rb
|
28
|
-
lib/net/ssh/loggable.rb
|
29
|
-
lib/net/ssh/packet.rb
|
30
|
-
lib/net/ssh/prompt.rb
|
31
|
-
lib/net/ssh/proxy/command.rb
|
32
|
-
lib/net/ssh/proxy/errors.rb
|
33
|
-
lib/net/ssh/proxy/http.rb
|
34
|
-
lib/net/ssh/proxy/socks4.rb
|
35
|
-
lib/net/ssh/proxy/socks5.rb
|
36
|
-
lib/net/ssh/ruby_compat.rb
|
37
|
-
lib/net/ssh/service/forward.rb
|
38
|
-
lib/net/ssh/test.rb
|
39
|
-
lib/net/ssh/test/channel.rb
|
40
|
-
lib/net/ssh/test/extensions.rb
|
41
|
-
lib/net/ssh/test/kex.rb
|
42
|
-
lib/net/ssh/test/local_packet.rb
|
43
|
-
lib/net/ssh/test/packet.rb
|
44
|
-
lib/net/ssh/test/remote_packet.rb
|
45
|
-
lib/net/ssh/test/script.rb
|
46
|
-
lib/net/ssh/test/socket.rb
|
47
|
-
lib/net/ssh/transport/algorithms.rb
|
48
|
-
lib/net/ssh/transport/cipher_factory.rb
|
49
|
-
lib/net/ssh/transport/constants.rb
|
50
|
-
lib/net/ssh/transport/hmac.rb
|
51
|
-
lib/net/ssh/transport/hmac/abstract.rb
|
52
|
-
lib/net/ssh/transport/hmac/md5.rb
|
53
|
-
lib/net/ssh/transport/hmac/md5_96.rb
|
54
|
-
lib/net/ssh/transport/hmac/none.rb
|
55
|
-
lib/net/ssh/transport/hmac/sha1.rb
|
56
|
-
lib/net/ssh/transport/hmac/sha1_96.rb
|
57
|
-
lib/net/ssh/transport/identity_cipher.rb
|
58
|
-
lib/net/ssh/transport/kex.rb
|
59
|
-
lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
60
|
-
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
61
|
-
lib/net/ssh/transport/openssl.rb
|
62
|
-
lib/net/ssh/transport/packet_stream.rb
|
63
|
-
lib/net/ssh/transport/server_version.rb
|
64
|
-
lib/net/ssh/transport/session.rb
|
65
|
-
lib/net/ssh/transport/state.rb
|
66
|
-
lib/net/ssh/verifiers/lenient.rb
|
67
|
-
lib/net/ssh/verifiers/null.rb
|
68
|
-
lib/net/ssh/verifiers/strict.rb
|
69
|
-
lib/net/ssh/version.rb
|
70
|
-
net-ssh.gemspec
|
71
|
-
setup.rb
|
72
|
-
support/arcfour_check.rb
|
73
|
-
support/ssh_tunnel_bug.rb
|
74
|
-
test/authentication/methods/common.rb
|
75
|
-
test/authentication/methods/test_abstract.rb
|
76
|
-
test/authentication/methods/test_hostbased.rb
|
77
|
-
test/authentication/methods/test_keyboard_interactive.rb
|
78
|
-
test/authentication/methods/test_password.rb
|
79
|
-
test/authentication/methods/test_publickey.rb
|
80
|
-
test/authentication/test_agent.rb
|
81
|
-
test/authentication/test_key_manager.rb
|
82
|
-
test/authentication/test_session.rb
|
83
|
-
test/common.rb
|
84
|
-
test/configs/eqsign
|
85
|
-
test/configs/exact_match
|
86
|
-
test/configs/host_plus
|
87
|
-
test/configs/multihost
|
88
|
-
test/configs/wild_cards
|
89
|
-
test/connection/test_channel.rb
|
90
|
-
test/connection/test_session.rb
|
91
|
-
test/test_all.rb
|
92
|
-
test/test_buffer.rb
|
93
|
-
test/test_buffered_io.rb
|
94
|
-
test/test_config.rb
|
95
|
-
test/test_key_factory.rb
|
96
|
-
test/transport/hmac/test_md5.rb
|
97
|
-
test/transport/hmac/test_md5_96.rb
|
98
|
-
test/transport/hmac/test_none.rb
|
99
|
-
test/transport/hmac/test_sha1.rb
|
100
|
-
test/transport/hmac/test_sha1_96.rb
|
101
|
-
test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
102
|
-
test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
103
|
-
test/transport/test_algorithms.rb
|
104
|
-
test/transport/test_cipher_factory.rb
|
105
|
-
test/transport/test_hmac.rb
|
106
|
-
test/transport/test_identity_cipher.rb
|
107
|
-
test/transport/test_packet_stream.rb
|
108
|
-
test/transport/test_server_version.rb
|
109
|
-
test/transport/test_session.rb
|
110
|
-
test/transport/test_state.rb
|
@@ -1,85 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rake/gempackagetask'
|
4
|
-
require 'fileutils'
|
5
|
-
include FileUtils
|
6
|
-
|
7
|
-
begin
|
8
|
-
require 'hanna/rdoctask'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rake/rdoctask'
|
11
|
-
end
|
12
|
-
|
13
|
-
|
14
|
-
task :default => :package
|
15
|
-
|
16
|
-
# CONFIG =============================================================
|
17
|
-
|
18
|
-
# Change the following according to your needs
|
19
|
-
README = "README.rdoc"
|
20
|
-
CHANGES = "CHANGELOG.rdoc"
|
21
|
-
THANKS = 'THANKS.rdoc'
|
22
|
-
|
23
|
-
# Files and directories to be deleted when you run "rake clean"
|
24
|
-
CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
|
25
|
-
|
26
|
-
# Virginia assumes your project and gemspec have the same name
|
27
|
-
name = 'net-ssh'
|
28
|
-
load "#{name}.gemspec"
|
29
|
-
version = @spec.version
|
30
|
-
|
31
|
-
# That's it! The following defaults should allow you to get started
|
32
|
-
# on other things.
|
33
|
-
|
34
|
-
|
35
|
-
# TESTS/SPECS =========================================================
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
# INSTALL =============================================================
|
40
|
-
|
41
|
-
Rake::GemPackageTask.new(@spec) do |p|
|
42
|
-
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
43
|
-
end
|
44
|
-
|
45
|
-
task :release => [ :rdoc, :package ]
|
46
|
-
task :install => [ :rdoc, :package ] do
|
47
|
-
sh %{sudo gem install pkg/#{name}-#{version}.gem}
|
48
|
-
end
|
49
|
-
task :uninstall => [ :clean ] do
|
50
|
-
sh %{sudo gem uninstall #{name}}
|
51
|
-
end
|
52
|
-
|
53
|
-
|
54
|
-
# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
|
55
|
-
|
56
|
-
if @spec.rubyforge_project
|
57
|
-
desc 'Publish website to rubyforge'
|
58
|
-
task 'publish:rdoc' => 'doc/index.html' do
|
59
|
-
sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/ssh/v2/api/"
|
60
|
-
end
|
61
|
-
|
62
|
-
desc 'Public release to rubyforge'
|
63
|
-
task 'publish:gem' => [:package] do |t|
|
64
|
-
sh <<-end
|
65
|
-
rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
|
66
|
-
rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
# RUBY DOCS TASK ==================================
|
74
|
-
|
75
|
-
Rake::RDocTask.new do |t|
|
76
|
-
t.rdoc_dir = 'doc'
|
77
|
-
t.title = @spec.summary
|
78
|
-
t.options << '--line-numbers' << '-A cattr_accessor=object'
|
79
|
-
t.options << '--charset' << 'utf-8'
|
80
|
-
t.rdoc_files.include(README)
|
81
|
-
t.rdoc_files.include(CHANGES)
|
82
|
-
t.rdoc_files.include(THANKS)
|
83
|
-
t.rdoc_files.include('lib/**/*.rb')
|
84
|
-
end
|
85
|
-
|
@@ -1,96 +0,0 @@
|
|
1
|
-
# Rudyfile
|
2
|
-
#
|
3
|
-
# This configuration is used to test installing
|
4
|
-
# and running net-ssh on a clean machine.
|
5
|
-
#
|
6
|
-
# Usage:
|
7
|
-
#
|
8
|
-
# $ rudy -vv startup
|
9
|
-
# $ rudy -vv testsuite
|
10
|
-
# $ rudy -vv shutdown
|
11
|
-
#
|
12
|
-
# Requires: Rudy 0.9 (http://code.google.com/p/rudy/)
|
13
|
-
#
|
14
|
-
|
15
|
-
defaults do
|
16
|
-
color true
|
17
|
-
environment :test
|
18
|
-
role :netssh
|
19
|
-
end
|
20
|
-
|
21
|
-
machines do
|
22
|
-
region :'us-east-1' do
|
23
|
-
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
24
|
-
end
|
25
|
-
env :test do
|
26
|
-
role :netssh do
|
27
|
-
user :root
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
commands do
|
33
|
-
allow :apt_get, "apt-get", :y, :q
|
34
|
-
allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
|
35
|
-
allow :gem_sources, "/usr/bin/gem", "sources"
|
36
|
-
allow :gem_uninstall, "/usr/bin/gem", "uninstall", :V
|
37
|
-
allow :update_rubygems
|
38
|
-
allow :rm
|
39
|
-
end
|
40
|
-
|
41
|
-
routines do
|
42
|
-
|
43
|
-
testsuite do
|
44
|
-
before :sysupdate, :installdeps, :install_gem
|
45
|
-
|
46
|
-
remote :root do
|
47
|
-
directory_upload 'test', '/tmp/'
|
48
|
-
cd '/tmp'
|
49
|
-
ruby :I, 'lib/', :I, 'test/', :r, 'rubygems', 'test/test_all.rb'
|
50
|
-
end
|
51
|
-
|
52
|
-
after :install_rubyforge, :install_github
|
53
|
-
end
|
54
|
-
|
55
|
-
install_gem do
|
56
|
-
before :package_gem
|
57
|
-
remote :root do
|
58
|
-
disable_safe_mode
|
59
|
-
file_upload "pkg/net-ssh-*.gem", "/tmp/"
|
60
|
-
gem_install "/tmp/net-ssh-*.gem"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
package_gem do
|
65
|
-
local do
|
66
|
-
rm :r, :f, 'pkg'
|
67
|
-
rake 'package'
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
remove do
|
72
|
-
remote :root do
|
73
|
-
gem_uninstall 'net-ssh'
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
installdeps do
|
78
|
-
remote :root do
|
79
|
-
gem_install "rye", "test-unit", "mocha"
|
80
|
-
rye 'authorize-local'
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
sysupdate do
|
85
|
-
remote :root do
|
86
|
-
apt_get "update"
|
87
|
-
apt_get "install", "build-essential", "git-core"
|
88
|
-
apt_get "install", "ruby1.8-dev", "rdoc", "libzlib-ruby", "rubygems"
|
89
|
-
mkdir :p, "/var/lib/gems/1.8/bin" # Doesn't get created, but causes Rubygems to fail
|
90
|
-
gem_install "builder", "session"
|
91
|
-
gem_install 'rubygems-update', "-v=1.3.4" # circular issue with 1.3.5 and hoe
|
92
|
-
update_rubygems
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|