~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ssh_transport.py

  • Committer: John Arbash Meinel
  • Date: 2010-11-05 20:54:32 UTC
  • mfrom: (5526 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5527.
  • Revision ID: john@arbash-meinel.com-20101105205432-rmyozu8sthyhmri8
Merge bzr.dev to resolve bzr-2.3.txt (aka NEWS)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    OpenSSHSubprocessVendor,
21
21
    PLinkSubprocessVendor,
22
22
    SSHCorpSubprocessVendor,
 
23
    LSHSubprocessVendor,
23
24
    SSHVendorManager,
24
25
    )
25
26
 
72
73
        manager.set_ssh_version_string("SSH Secure Shell")
73
74
        self.assertIsInstance(manager.get_vendor({}), SSHCorpSubprocessVendor)
74
75
 
 
76
    def test_get_vendor_by_inspection_lsh(self):
 
77
        manager = TestSSHVendorManager()
 
78
        self.assertRaises(SSHVendorNotFound, manager.get_vendor, {})
 
79
        manager.set_ssh_version_string("lsh")
 
80
        self.assertIsInstance(manager.get_vendor({}), LSHSubprocessVendor)
 
81
 
75
82
    def test_get_vendor_by_inspection_plink(self):
76
83
        manager = TestSSHVendorManager()
77
84
        self.assertRaises(SSHVendorNotFound, manager.get_vendor, {})
160
167
            vendor._get_vendor_specific_argv(
161
168
                "user", "host", 100, command=["bzr"]),
162
169
            ["ssh", "-oForwardX11=no", "-oForwardAgent=no",
163
 
                "-oClearAllForwardings=yes", "-oProtocol=2",
 
170
                "-oClearAllForwardings=yes",
164
171
                "-oNoHostAuthenticationForLocalhost=yes",
165
172
                "-p", "100",
166
173
                "-l", "user",
173
180
            vendor._get_vendor_specific_argv(
174
181
                "user", "host", 100, subsystem="sftp"),
175
182
            ["ssh", "-oForwardX11=no", "-oForwardAgent=no",
176
 
                "-oClearAllForwardings=yes", "-oProtocol=2",
 
183
                "-oClearAllForwardings=yes",
177
184
                "-oNoHostAuthenticationForLocalhost=yes",
178
185
                "-p", "100",
179
186
                "-l", "user",
202
209
                "-s", "sftp", "host"]
203
210
            )
204
211
 
 
212
    def test_lsh_command_arguments(self):
 
213
        vendor = LSHSubprocessVendor()
 
214
        self.assertEqual(
 
215
            vendor._get_vendor_specific_argv(
 
216
                "user", "host", 100, command=["bzr"]),
 
217
            ["lsh",
 
218
                "-p", "100",
 
219
                "-l", "user",
 
220
                "host", "bzr"]
 
221
            )
 
222
 
 
223
    def test_lsh_subsystem_arguments(self):
 
224
        vendor = LSHSubprocessVendor()
 
225
        self.assertEqual(
 
226
            vendor._get_vendor_specific_argv(
 
227
                "user", "host", 100, subsystem="sftp"),
 
228
            ["lsh",
 
229
                "-p", "100",
 
230
                "-l", "user",
 
231
                "--subsystem", "sftp", "host"]
 
232
            )
 
233
 
205
234
    def test_plink_command_arguments(self):
206
235
        vendor = PLinkSubprocessVendor()
207
236
        self.assertEqual(