You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by bf...@apache.org on 2011/06/09 20:54:37 UTC
svn commit: r1134038 - in /oodt/branches/protocol/protocol-sftp: ./
src/main/java/org/apache/oodt/cas/protocol/sftp/
src/main/java/org/apache/oodt/cas/protocol/sftp/auth/ src/test/
src/test/org/ src/test/org/apache/ src/test/org/apache/oodt/ src/test/o...
Author: bfoster
Date: Thu Jun 9 18:54:36 2011
New Revision: 1134038
URL: http://svn.apache.org/viewvc?rev=1134038&view=rev
Log:
- SFTP unit tests . . . real pain in the a$$!!!!
----------------
OODT-194
Added:
oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/
oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/HostKeyAuthentication.java (with props)
oodt/branches/protocol/protocol-sftp/src/test/
oodt/branches/protocol/protocol-sftp/src/test/org/
oodt/branches/protocol/protocol-sftp/src/test/org/apache/
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/DummyAuthenticationProvider.java (with props)
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java (with props)
oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java (with props)
oodt/branches/protocol/protocol-sftp/src/testdata/
oodt/branches/protocol/protocol-sftp/src/testdata/authorization.xml (with props)
oodt/branches/protocol/protocol-sftp/src/testdata/platform.xml (with props)
oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.key
oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.pub
oodt/branches/protocol/protocol-sftp/src/testdata/server.xml (with props)
oodt/branches/protocol/protocol-sftp/src/testdata/sshTestDir/
oodt/branches/protocol/protocol-sftp/src/testdata/sshTestDir/sshTestFile
Modified:
oodt/branches/protocol/protocol-sftp/pom.xml
oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java
Modified: oodt/branches/protocol/protocol-sftp/pom.xml
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/pom.xml?rev=1134038&r1=1134037&r2=1134038&view=diff
==============================================================================
--- oodt/branches/protocol/protocol-sftp/pom.xml (original)
+++ oodt/branches/protocol/protocol-sftp/pom.xml Thu Jun 9 18:54:36 2011
@@ -83,6 +83,18 @@
<artifactId>jsch</artifactId>
<version>0.1.42</version>
</dependency>
+ <dependency>
+ <groupId>sshtools</groupId>
+ <artifactId>j2ssh-core</artifactId>
+ <version>0.2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>sshtools</groupId>
+ <artifactId>j2ssh-daemon</artifactId>
+ <version>0.2.2</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Modified: oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java?rev=1134038&r1=1134037&r2=1134038&view=diff
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java (original)
+++ oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/JschSftpProtocol.java Thu Jun 9 18:54:36 2011
@@ -19,6 +19,7 @@ package org.apache.oodt.cas.protocol.sft
//OODT imports
import org.apache.oodt.cas.protocol.auth.Authentication;
import org.apache.oodt.cas.protocol.exceptions.ProtocolException;
+import org.apache.oodt.cas.protocol.sftp.auth.HostKeyAuthentication;
import org.apache.oodt.cas.protocol.Protocol;
import org.apache.oodt.cas.protocol.ProtocolFile;
@@ -26,7 +27,7 @@ import org.apache.oodt.cas.protocol.Prot
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
-import com.jcraft.jsch.SftpProgressMonitor;
+import com.jcraft.jsch.UserInfo;
//JDK imports
import java.io.File;
@@ -48,13 +49,22 @@ public class JschSftpProtocol implements
private ChannelSftp sftpChannel;
+ private ProtocolFile homeDir;
+
+ private int port;
+
private static final JSch jsch = new JSch();
public JschSftpProtocol() {
+ this(22);
+ }
+
+ public JschSftpProtocol(int port) {
session = null;
sftpChannel = null;
+ this.port = port;
}
-
+
public void cd(ProtocolFile file) throws ProtocolException {
try {
sftpChannel.cd(file.getPath());
@@ -63,19 +73,48 @@ public class JschSftpProtocol implements
+ e.getMessage());
}
}
+
+ public void cdRoot() throws ProtocolException {
+ cd(new ProtocolFile(ProtocolFile.SEPARATOR, true));
+ }
+
+ public void cdHome() throws ProtocolException {
+ cd(homeDir);
+ }
- public void connect(String host, Authentication auth) throws ProtocolException {
+ public void connect(String host, final Authentication auth) throws ProtocolException {
try {
- System.out.println(System.getProperty("user.home") + "/.ssh/known_hosts");
- jsch.setKnownHosts(System.getProperty("user.home") + "/.ssh/known_hosts");
- session = jsch.getSession(auth.getUser(), host, 22);
- session.setPassword(auth.getPass());
+ if (auth instanceof HostKeyAuthentication) {
+ jsch.setKnownHosts(((HostKeyAuthentication) auth).getHostKeyFile());
+ } else {
+ jsch.setKnownHosts(System.getProperty("user.home") + "/.ssh/known_hosts");
+ }
+ session = jsch.getSession(auth.getUser(), host, this.port);
+ session.setUserInfo(new UserInfo() {
+ public String getPassphrase() {
+ return "";
+ }
+ public String getPassword() {
+ return auth.getPass();
+ }
+ public boolean promptPassphrase(String arg0) {
+ return false;
+ }
+ public boolean promptPassword(String arg0) {
+ return true;
+ }
+ public boolean promptYesNo(String arg0) {
+ return false;
+ }
+ public void showMessage(String arg0) {}
+ });
session.connect();
sftpChannel = (ChannelSftp) session.openChannel("sftp");
sftpChannel.connect();
+ homeDir = pwd();
} catch (Exception e) {
throw new ProtocolException("Failed to connect to host " + host + " : "
- + e.getMessage());
+ + e.getMessage(), e);
}
}
Added: oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/HostKeyAuthentication.java
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/HostKeyAuthentication.java?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/HostKeyAuthentication.java (added)
+++ oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/HostKeyAuthentication.java Thu Jun 9 18:54:36 2011
@@ -0,0 +1,17 @@
+package org.apache.oodt.cas.protocol.sftp.auth;
+
+import org.apache.oodt.cas.protocol.auth.BasicAuthentication;
+
+public class HostKeyAuthentication extends BasicAuthentication {
+
+ private String hostKeyFile;
+
+ public HostKeyAuthentication(String user, String pass, String hostKeyFile) {
+ super(user, pass);
+ this.hostKeyFile = hostKeyFile;
+ }
+
+ public String getHostKeyFile() {
+ return hostKeyFile;
+ }
+}
Propchange: oodt/branches/protocol/protocol-sftp/src/main/java/org/apache/oodt/cas/protocol/sftp/auth/HostKeyAuthentication.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/DummyAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/DummyAuthenticationProvider.java?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/DummyAuthenticationProvider.java (added)
+++ oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/DummyAuthenticationProvider.java Thu Jun 9 18:54:36 2011
@@ -0,0 +1,53 @@
+package org.apache.oodt.cas.protocol.sftp;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.sshtools.daemon.platform.NativeAuthenticationProvider;
+import com.sshtools.daemon.platform.PasswordChangeException;
+
+/**
+ * This authentication provider provides no authentication at all, and just lets
+ * anybody in so you should never use it!
+ *
+ * It is really just for testing.
+ */
+public class DummyAuthenticationProvider extends NativeAuthenticationProvider {
+
+ Log log = LogFactory.getLog(DummyAuthenticationProvider.class);
+
+ public DummyAuthenticationProvider() {
+ log.error("DummyAuthenticationProvider is in use. This is only for testing.");
+ }
+
+ @Override
+ public boolean changePassword(String username, String oldpassword,
+ String newpassword) {
+ return false;
+ }
+
+ @Override
+ public String getHomeDirectory(String username) throws IOException {
+ return new File("src/testdata").getAbsolutePath();
+ }
+
+ @Override
+ public void logoffUser() throws IOException {
+
+ }
+
+ @Override
+ public boolean logonUser(String username, String password)
+ throws PasswordChangeException, IOException {
+ return true;
+ }
+
+ @Override
+ public boolean logonUser(String username) throws IOException {
+ return true;
+ }
+
+}
Propchange: oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/DummyAuthenticationProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java (added)
+++ oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java Thu Jun 9 18:54:36 2011
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.protocol.sftp;
+
+//JUnit imports
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executors;
+
+import org.apache.oodt.cas.protocol.ProtocolFile;
+import org.apache.oodt.cas.protocol.exceptions.ProtocolException;
+import org.apache.oodt.cas.protocol.sftp.auth.HostKeyAuthentication;
+
+import com.sshtools.daemon.SshDaemon;
+import com.sshtools.daemon.configuration.XmlServerConfigurationContext;
+import com.sshtools.j2ssh.configuration.ConfigurationException;
+import com.sshtools.j2ssh.configuration.ConfigurationLoader;
+
+import junit.framework.TestCase;
+
+/**
+ * Test class for {@link JschSftpProtocol}.
+ *
+ * @author bfoster
+ */
+public class TestJschSftpProtocol extends TestCase {
+
+ @Override
+ public void setUp() {
+ XmlServerConfigurationContext context = new XmlServerConfigurationContext();
+ context.setServerConfigurationResource("src/testdata/server.xml");
+ context.setPlatformConfigurationResource("src/testdata/platform.xml");
+ try {
+ ConfigurationLoader.initialize(false, context);
+ } catch (ConfigurationException e1) {
+ fail("Failed to initialize server configuration");
+ }
+
+ Executors.newSingleThreadExecutor().execute(new Runnable() {
+
+ public void run() {
+ try {
+ SshDaemon.start();
+ } catch (Exception e) {
+ try { SshDaemon.stop(); } catch (Exception ignore) {}
+ fail("Failed to start SSH daemon");
+ }
+ }
+
+ });
+ }
+
+ @Override
+ public void tearDown() {
+ try {
+ SshDaemon.stop();
+ } catch (IOException e) {
+ fail("Failed to stop SSH daemon");
+ }
+ }
+
+ public void testCDandPWDandLS() throws IOException, ProtocolException {
+ JschSftpProtocol sftpProtocol = new JschSftpProtocol(2022);
+ sftpProtocol.connect("localhost", new HostKeyAuthentication("bfoster", "", new File("src/testdata/sample-dsa.pub").getAbsoluteFile().getAbsolutePath()));
+ ProtocolFile homeDir = sftpProtocol.pwd();
+ ProtocolFile testDir = new ProtocolFile(homeDir, "sshTestDir", true);
+ sftpProtocol.cd(testDir);
+ assertEquals(testDir, sftpProtocol.pwd());
+ List<ProtocolFile> lsResults = new ArrayList<ProtocolFile>(sftpProtocol.ls());
+ assertEquals(1, lsResults.size());
+ ProtocolFile testFile = lsResults.get(0);
+ assertEquals(new ProtocolFile(testDir, "sshTestFile", false), testFile);
+ }
+
+}
Propchange: oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/TestJschSftpProtocol.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java (added)
+++ oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java Thu Jun 9 18:54:36 2011
@@ -0,0 +1,95 @@
+package org.apache.oodt.cas.protocol.sftp;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Map;
+
+import com.sshtools.daemon.platform.NativeProcessProvider;
+import com.sshtools.j2ssh.io.DynamicBuffer;
+
+/**
+ * This is a shell provider that prints a message saying that
+ * we don't support shell access, and then closes the connection.
+ */
+public final class UnsupportedShellProcessProvider extends NativeProcessProvider {
+
+ private static final String MESSAGE = "This server does not provide shell access, only SFTP. Goodbye.\n";
+
+ private DynamicBuffer stdin = new DynamicBuffer();
+ private DynamicBuffer stderr = new DynamicBuffer();
+ private DynamicBuffer stdout = new DynamicBuffer();
+
+ @Override
+ public boolean createProcess(final String command, final Map environment)
+ throws IOException {
+ return true;
+ }
+
+ @Override
+ public String getDefaultTerminalProvider() {
+ return "UnsupportedShell";
+ }
+
+ @Override
+ public void kill() {
+ try {
+ stdin.getInputStream().close();
+ stdin.getOutputStream().close();
+ } catch (Exception ex) {
+ }
+ try {
+ stdout.getInputStream().close();
+ stdout.getOutputStream().close();
+ } catch (Exception ex1) {
+ }
+ try {
+ stderr.getInputStream().close();
+ stderr.getOutputStream().close();
+ } catch (Exception ex2) {
+ }
+ }
+
+ @Override
+ public void start() throws IOException {
+ stdin.getOutputStream().write(MESSAGE.getBytes());
+ }
+
+ @Override
+ public boolean stillActive() {
+ try {
+ return stdin.getInputStream().available() > 0;
+ } catch (IOException ex) {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean supportsPseudoTerminal(final String term) {
+ return true;
+ }
+
+ @Override
+ public boolean allocatePseudoTerminal(final String term, final int cols, final int rows,
+ final int width, final int height, final String modes) {
+ return true;
+ }
+
+ @Override
+ public int waitForExitCode() {
+ return 0;
+ }
+
+ public InputStream getInputStream() throws IOException {
+ return stdin.getInputStream();
+ }
+
+ public OutputStream getOutputStream() throws IOException {
+ return stdout.getOutputStream();
+ }
+
+ public InputStream getStderrInputStream() {
+ return stderr.getInputStream();
+ }
+
+}
Propchange: oodt/branches/protocol/protocol-sftp/src/test/org/apache/oodt/cas/protocol/sftp/UnsupportedShellProcessProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/testdata/authorization.xml
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/testdata/authorization.xml?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/testdata/authorization.xml (added)
+++ oodt/branches/protocol/protocol-sftp/src/testdata/authorization.xml Thu Jun 9 18:54:36 2011
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Sshtools User Authorization File -->
+<AuthorizedKeys>
+ <!-- Enter authorized public key elements here -->
+ <Key>sample-dsa.pub</Key>
+
+</AuthorizedKeys>
Propchange: oodt/branches/protocol/protocol-sftp/src/testdata/authorization.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/testdata/platform.xml
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/testdata/platform.xml?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/testdata/platform.xml (added)
+++ oodt/branches/protocol/protocol-sftp/src/testdata/platform.xml Thu Jun 9 18:54:36 2011
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Platform configuration file - Determines the behaviour of platform specific services
+-->
+<PlatformConfiguration>
+ <!-- The process provider for executing and redirecting a process -->
+ <NativeProcessProvider>org.apache.oodt.cas.protocol.sftp.UnsupportedShellProcessProvider</NativeProcessProvider>
+ <!-- The authentication provider for authenticating users and obtaining user information -->
+ <!--
+ WARNING: the dummy provider here doesn't ask for any passwords so obviously it's
+ extremely insecure. You should only use it for testing.
+ -->
+ <NativeAuthenticationProvider>org.apache.oodt.cas.protocol.sftp.DummyAuthenticationProvider</NativeAuthenticationProvider>
+ <!-- The file system provider for SFTP -->
+ <NativeFileSystemProvider>com.sshtools.daemon.vfs.VirtualFileSystem</NativeFileSystemProvider>
+ <!-- Native settings which may be used by the process or authentication provider -->
+ <!-- Add native settings here -->
+ <!-- <NativeSetting Name="AuthenticateOnDomain" Value="."/> -->
+</PlatformConfiguration>
Propchange: oodt/branches/protocol/protocol-sftp/src/testdata/platform.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.key
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.key?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.key (added)
+++ oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.key Thu Jun 9 18:54:36 2011
@@ -0,0 +1,12 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBvAIBAAKBgQD/dvNwGfLUx8hRXmJRN/zEvlrUVgOPuYao0JQfcdwz4Zqi/kDq
++4I/GsGphw8v/pI0g0N5jHiiGQ+apVoSOXoYgrW6YNKHIpmBvM1zVQWA33bAqq/+
++k+9Bugp8xvAA5AXUrPdRKQiKYC5ECYX/lIDZCSgty6QrQSnhmAECdm6mQIVAO/1
+X4nkLhL4jwhOGMUmuTVOQxwJAoGBAMi/2mkZc1Aj7FQCJsv/j/Th9eYLYJ1JaeFm
+iYhfkggMfoKyfWlEEjll56UThZL+ZyC2WVUUWDuTrt77zVPUGxEFM2gwL9judLaq
+lV+rOFrwf5LcaQnSoNHWrkf2MUy+juinZFHN/2eI+mQXv0/07IQjbCDAH0U1rr97
+Qxw9Saa3AoGAVMOH1a6meQj4pzZZ9BEkFVVQAuC+DBqxZND2flxIMnO/Z9si1Znw
+0z0ClXXY5vpk1DQJ2FI60aufqYgg/2UhQNjTp37DKL6sk4aK25wwXLWbuaf6b9Ah
+IFwU+g5xSm0j12P40AqaNIhLoCv2FPXSHvnJDsZw3r703ITUB+hwlEwCFQCjIrDI
+YOzgRFkXJwfZCKVpo3L1JA==
+-----END DSA PRIVATE KEY-----
\ No newline at end of file
Added: oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.pub
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.pub?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.pub (added)
+++ oodt/branches/protocol/protocol-sftp/src/testdata/sample-dsa.pub Thu Jun 9 18:54:36 2011
@@ -0,0 +1 @@
+[localhost]:2022 ssh-dss AAAAB3NzaC1kc3MAAACBAP9283AZ8tTHyFFeYlE3/MS+WtRWA4+5hqjQlB9x3DPhmqL+QOr7gj8awamHDy/+kjSDQ3mMeKIZD5qlWhI5ehiCtbpg0ocimYG8zXNVBYDfdsCqr/76T70G6CnzG8ADkBdSs91EpCIpgLkQJhf+UgNkJKC3LpCtBKeGYAQJ2bqZAAAAFQDv9V+J5C4S+I8IThjFJrk1TkMcCQAAAIEAyL/aaRlzUCPsVAImy/+P9OH15gtgnUlp4WaJiF+SCAx+grJ9aUQSOWXnpROFkv5nILZZVRRYO5Ou3vvNU9QbEQUzaDAv2O50tqqVX6s4WvB/ktxpCdKg0dauR/YxTL6O6KdkUc3/Z4j6ZBe/T/TshCNsIMAfRTWuv3tDHD1JprcAAACAVMOH1a6meQj4pzZZ9BEkFVVQAuC+DBqxZND2flxIMnO/Z9si1Znw0z0ClXXY5vpk1DQJ2FI60aufqYgg/2UhQNjTp37DKL6sk4aK25wwXLWbuaf6b9AhIFwU+g5xSm0j12P40AqaNIhLoCv2FPXSHvnJDsZw3r703ITUB+hwlEw=
Added: oodt/branches/protocol/protocol-sftp/src/testdata/server.xml
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/testdata/server.xml?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/testdata/server.xml (added)
+++ oodt/branches/protocol/protocol-sftp/src/testdata/server.xml Thu Jun 9 18:54:36 2011
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<ServerConfiguration>
+ <!-- this key needs generating by the provided keygen tool -->
+ <ServerHostKey PrivateKeyFile="src/testdata/sample-dsa.key"/>
+ <Port>2022</Port>
+ <!-- UserConfigDirectory>src/testdata</UserConfigDirectory -->
+ <!-- add other authentication methods as desired -->
+ <AllowedAuthentication>password</AllowedAuthentication>
+ <AllowedAuthentication>keyboard-interactive</AllowedAuthentication>
+ <!-- You can specify more subsystems, or even a replacement SFTP subsystem -->
+ <Subsystem Name="sftp" Type="class" Provider="com.sshtools.daemon.sftp.SftpSubsystemServer" />
+</ServerConfiguration>
Propchange: oodt/branches/protocol/protocol-sftp/src/testdata/server.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: oodt/branches/protocol/protocol-sftp/src/testdata/sshTestDir/sshTestFile
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-sftp/src/testdata/sshTestDir/sshTestFile?rev=1134038&view=auto
==============================================================================
--- oodt/branches/protocol/protocol-sftp/src/testdata/sshTestDir/sshTestFile (added)
+++ oodt/branches/protocol/protocol-sftp/src/testdata/sshTestDir/sshTestFile Thu Jun 9 18:54:36 2011
@@ -0,0 +1,3 @@
+This is a
+test
+file to test SFTP GET
\ No newline at end of file
Re: svn commit: r1134038 - in /oodt/branches/protocol/protocol-sftp: ./ src/main/java/org/apache/oodt/cas/protocol/sftp/ src/main/java/org/apache/oodt/cas/protocol/sftp/auth/ src/test/ src/test/org/ src/test/org/apache/ src/test/org/apache/oodt/ src/test/o...
Posted by Sean Kelly <ke...@apache.org>.
> - SFTP unit tests
Oh wow, AWESOME! These are fantastic to have.
> . . . real pain in the a$$!!!!
Heh, I bet. (Python FTW!)
Thanks for developing them!
--Sean