Exemplo n.º 1
0
 def test_adds_missing_host_key(self, mock_LOG):
     client = ssh.connect("123.456.789.0",
                          options={'StrictHostKeyChecking': 'no'})
     client._connect()
     pkey = ssh.make_pkey(self.rsakey)
     client._policy.missing_host_key(client, "123.456.789.0", pkey)
     expected = {'123.456.789.0': {'ssh-rsa': pkey}}
     self.assertEqual(expected, client._host_keys)
Exemplo n.º 2
0
 def test_adds_missing_host_key(self, mock_LOG):
     client = ssh.connect(
         "123.456.789.0", options={'StrictHostKeyChecking': 'no'})
     client._connect()
     pkey = ssh.make_pkey(self.rsakey)
     client._policy.missing_host_key(
         client,
         "123.456.789.0",
         pkey)
     expected = {'123.456.789.0': {
                 'ssh-rsa': pkey}}
     self.assertEqual(expected, client._host_keys)
Exemplo n.º 3
0
 def test_valid_dsa_logs_key_class(self, mock_LOG):
     ssh.make_pkey(self.dsakey)
     mock_LOG.info.assert_called_with('Valid SSH Key provided (%s)',
                                      'DSSKey')
Exemplo n.º 4
0
 def test_valid_ds_returns_pkey_obj(self):
     self.assertIsInstance(ssh.make_pkey(self.dsakey), paramiko.PKey)
Exemplo n.º 5
0
 def test_valid_dsa_logs_key_class(self, mock_LOG):
     ssh.make_pkey(self.dsakey)
     mock_LOG.info.assert_called_with(
         'Valid SSH Key provided (%s)', 'DSSKey')
Exemplo n.º 6
0
 def test_valid_ds_returns_pkey_obj(self):
     self.assertIsInstance(ssh.make_pkey(self.dsakey), paramiko.PKey)