TestComplete and Paramiko (with gss_auth=True) - Steps
Hi,
I am able to connect TestComplete and Paramiko (with gss_auth=True)
So wanted to share the knowledge here with the community.
Hope it helps.
Note:
>> The understanding is that Test Complete is running Python 3.6
>> TestComplete x64 version is being executed.
>> The directory "paramiko_gssapi_py36" is the parent directory where the respective "paramiko-gssapi" installation was performed.
>> To achieve the "paramiko-gssapi" installation, we just need to trigger the "pip install" command as below :-
pip install paramiko[gssapi]
Files required to be moved from one folder to another folder :-
===========================================================
1) _win32sysloader.pyd (from win32 folder to parent paramiko_gssapi_py36 dir)
2) win32security.pyd (from win32 folder to parent paramiko_gssapi_py36 dir)
3) win32api.pyd (from win32 folder to parent paramiko_gssapi_py36 dir)
4) win32timezone.py (from win32/lib folder to parent paramiko_gssapi_py36 dir)
5) pywintypes.py (from win32/lib folder to parent paramiko_gssapi_py36 dir)
6) sspicon.py (from win32/lib folder to parent paramiko_gssapi_py36 dir)
7) sspi.py (from win32/lib folder to parent paramiko_gssapi_py36 dir)
8 ) pythoncom36.dll (from pywin32_system32 folder to parent paramiko_gssapi_py36 dir)
9) pywintypes36.dll (from pywin32_system32 folder to parent paramiko_gssapi_py36 dir)
Please find a sample python script below, which uses the Paramiko (gss_auth=True) code.
Note:- If you want to ignore using the "sys.path.insert(....)" function line, you can copy-paste the entire contents from "paramiko_gssapi_py36" to the below path :-
C:\Program Files (x86)\SmartBear\TestComplete 14\x64\Bin\Extensions\Python\Python36\Lib
######################### Paramiko and GSSAPI ######################
import sys
import os
sys.path.insert(0, "C:\\paramiko_gssapi_py36")
import paramiko
def test101():
execSSH("test_server", "user01", "pwd")
def execSSH(host, user, my_command):
#Establishes a SSH connection with the given details.
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=host, username=user, gss_auth=True)
stdin, stdout, stderr = ssh_client.exec_command(my_command, get_pty = True)
Log.message("O/P: "+str(stdout.read().decode('utf-8').strip('\n')))
######################### Paramiko and GSSAPI ######################