Class SshTestBase


  • public abstract class SshTestBase
    extends SshTestHarness
    The ssh tests. Concrete subclasses can re-use these tests by implementing the abstract operations from SshTestHarness. This gives a way to test different ssh clients against a unified test suite.
    • Field Detail

      • KEY_RESOURCES

        public static java.lang.String[] KEY_RESOURCES
      • defaultCloneDir

        protected java.io.File defaultCloneDir
    • Constructor Detail

      • SshTestBase

        public SshTestBase()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Description copied from class: RepositoryTestCase
        Setup test
        Overrides:
        setUp in class SshTestHarness
        Throws:
        java.lang.Exception
      • testSshWithoutConfig

        public void testSshWithoutConfig()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSingleCommand

        public void testSingleCommand()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSingleCommandWithTimeoutExpired

        public void testSingleCommandWithTimeoutExpired()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithGlobalIdentity

        public void testSshWithGlobalIdentity()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithDefaultIdentity

        public void testSshWithDefaultIdentity()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithConfig

        public void testSshWithConfig()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithConfigEncryptedUnusedKey

        public void testSshWithConfigEncryptedUnusedKey()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithConfigEncryptedUnusedKeyInConfigLast

        public void testSshWithConfigEncryptedUnusedKeyInConfigLast()
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isJsch

        private boolean isJsch()
      • testSshWithConfigEncryptedUnusedKeyInConfigFirst

        public void testSshWithConfigEncryptedUnusedKeyInConfigFirst()
                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshEncryptedUsedKeyCached

        public void testSshEncryptedUsedKeyCached()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshEncryptedUsedKeyWrongPassword

        public void testSshEncryptedUsedKeyWrongPassword()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshEncryptedUsedKeySeveralPassword

        public void testSshEncryptedUsedKeySeveralPassword()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithoutKnownHosts

        public void testSshWithoutKnownHosts()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithoutKnownHostsWithProviderAsk

        public void testSshWithoutKnownHostsWithProviderAsk()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithoutKnownHostsWithProviderAcceptNew

        public void testSshWithoutKnownHostsWithProviderAcceptNew()
                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithoutKnownHostsDeny

        public void testSshWithoutKnownHostsDeny()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshModifiedHostKeyDeny

        public void testSshModifiedHostKeyDeny()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshModifiedHostKeyWithProviderDeny

        public void testSshModifiedHostKeyWithProviderDeny()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkKnownHostsModifiedHostKey

        private void checkKnownHostsModifiedHostKey​(java.io.File backup,
                                                    java.io.File newFile,
                                                    java.lang.String wrongKey)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • testSshModifiedHostKeyAllow

        public void testSshModifiedHostKeyAllow()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshModifiedHostKeyAsk

        public void testSshModifiedHostKeyAsk()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshCloneWithConfigAndPush

        public void testSshCloneWithConfigAndPush()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSftpWithConfig

        public void testSftpWithConfig()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSftpCloneWithConfigAndPush

        public void testSftpCloneWithConfigAndPush()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithConfigWrongKey

        public void testSshWithConfigWrongKey()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithWrongUserNameInConfig

        public void testSshWithWrongUserNameInConfig()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithWrongPortInConfig

        public void testSshWithWrongPortInConfig()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithAliasInConfig

        public void testSshWithAliasInConfig()
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithUnknownCiphersInConfig

        public void testSshWithUnknownCiphersInConfig()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithUnknownHostKeyAlgorithmsInConfig

        public void testSshWithUnknownHostKeyAlgorithmsInConfig()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithUnknownKexAlgorithmsInConfig

        public void testSshWithUnknownKexAlgorithmsInConfig()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithMinimalHostKeyAlgorithmsInConfig

        public void testSshWithMinimalHostKeyAlgorithmsInConfig()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithUnknownAuthInConfig

        public void testSshWithUnknownAuthInConfig()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshWithNoMatchingAuthInConfig

        public void testSshWithNoMatchingAuthInConfig()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testRsaHostKeySecond

        public void testRsaHostKeySecond()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testEcDsaHostKey

        public void testEcDsaHostKey()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPasswordAuth

        public void testPasswordAuth()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPasswordAuthSeveralTimes

        public void testPasswordAuthSeveralTimes()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPasswordAuthWrongPassword

        public void testPasswordAuthWrongPassword()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPasswordAuthNoPassword

        public void testPasswordAuthNoPassword()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testPasswordAuthCorrectPasswordTooLate

        public void testPasswordAuthCorrectPasswordTooLate()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testKeyboardInteractiveAuth

        public void testKeyboardInteractiveAuth()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testKeyboardInteractiveAuthSeveralTimes

        public void testKeyboardInteractiveAuthSeveralTimes()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testKeyboardInteractiveAuthWrongPassword

        public void testKeyboardInteractiveAuthWrongPassword()
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testKeyboardInteractiveAuthNoPassword

        public void testKeyboardInteractiveAuthNoPassword()
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testKeyboardInteractiveAuthCorrectPasswordTooLate

        public void testKeyboardInteractiveAuthCorrectPasswordTooLate()
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testSshKeys

        public void testSshKeys​(java.lang.String keyName)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception