diff --git a/appveyor.yml b/appveyor.yml index 4a4f970a..de2fa7c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,7 +48,7 @@ install: test_script: # uncomment to allow remote login to windows ci vm via rdp -# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # lint the python code # - python -m flake8 jupyterfs setup.py diff --git a/jupyterfs/tests/test_pyfilesystem_manager.py b/jupyterfs/tests/test_pyfilesystem_manager.py index 838ac19e..72712933 100644 --- a/jupyterfs/tests/test_pyfilesystem_manager.py +++ b/jupyterfs/tests/test_pyfilesystem_manager.py @@ -25,8 +25,9 @@ test_hostname_smb_docker_share = 'TESTNET' test_name_port_smb_docker_share = 3669 +test_direct_tcp_smb_os_share = True test_host_smb_os_share = socket.gethostbyname_ex(socket.gethostname())[2][-1] -test_smb_port_smb_os_share = 139 +test_smb_port_smb_os_share = 445 _test_file_model = { 'content': test_content, @@ -209,6 +210,7 @@ def teardown_method(self, method): def _createContentsManager(self): kwargs = dict( + direct_tcp=test_direct_tcp_smb_os_share, host=test_host_smb_os_share, hostname=socket.getfqdn(), passwd=samba.smb_passwd, @@ -217,11 +219,11 @@ def _createContentsManager(self): ) if test_smb_port_smb_os_share is not None: - uri = 'smb://{username}:{passwd}@{host}:{port}/{share}?hostname={hostname}'.format(port=test_smb_port_smb_os_share, **kwargs) - cm = PyFilesystemContentsManager.open_fs(uri) + uri = 'smb://{username}:{passwd}@{host}:{port}/{share}?hostname={hostname}&direct-tcp={direct_tcp}'.format(port=test_smb_port_smb_os_share, **kwargs) else: - uri = 'smb://{username}:{passwd}@{host}/{share}?hostname={hostname}'.format(**kwargs) - cm = PyFilesystemContentsManager.open_fs(uri) + uri = 'smb://{username}:{passwd}@{host}/{share}?hostname={hostname}&direct-tcp={direct_tcp}'.format(**kwargs) + + cm = PyFilesystemContentsManager.open_fs(uri) assert cm.dir_exists('.') return cm diff --git a/jupyterfs/tests/utils/samba.py b/jupyterfs/tests/utils/samba.py index 19bb3924..8272124f 100755 --- a/jupyterfs/tests/utils/samba.py +++ b/jupyterfs/tests/utils/samba.py @@ -84,6 +84,7 @@ class RootDirUtil: def __init__( self, dir_name, + direct_tcp=False, host=None, hostname=None, my_name='local', @@ -94,6 +95,7 @@ def __init__( self.hostname = socket.getfqdn() if hostname is None else hostname self.dir_name = dir_name + self.direct_tcp = direct_tcp self.my_name = my_name self.name_port = name_port self.smb_port = smb_port @@ -133,6 +135,7 @@ def resource(self): password=smb_passwd, my_name=self.my_name, remote_name=self.hostname, + is_direct_tcp=self.direct_tcp, ) conn = SMBConnection(**kwargs)