diff --git a/tests/SMB_RPC/test_smb.py b/tests/SMB_RPC/test_smb.py index 52b2b380b8..b73f195445 100644 --- a/tests/SMB_RPC/test_smb.py +++ b/tests/SMB_RPC/test_smb.py @@ -87,7 +87,7 @@ def test_connection(self): self.assertEqual(credentials, (self.username, self.password, self.domain, '', '', '', None, None)) smb.logoff() del(smb) - + def test_close_connection(self): smb = self.create_connection() smb.login(self.username, self.password, self.domain) @@ -156,7 +156,7 @@ def test_createFile(self): smb.deleteFile(self.share, self.file + '.bak') smb.disconnectTree(tid) smb.logoff() - + def test_readwriteFile(self): smb = self.create_connection() smb.login(self.username, self.password, self.domain) @@ -176,9 +176,8 @@ def test_readwriteFile(self): smb.closeFile(tid, fid) smb.deleteFile(self.share, self.file) smb.disconnectTree(tid) - smb.logoff() - + def test_createdeleteDirectory(self): smb = self.create_connection() smb.login(self.username, self.password, self.domain) @@ -194,7 +193,7 @@ def test_createdeleteDirectory(self): smb.deleteDirectory(self.share, nested_dir) smb.deleteDirectory(self.share, self.directory) smb.logoff() - + def test_getData(self): smb = self.create_connection() smb.login(self.username, self.password, self.domain) @@ -205,6 +204,8 @@ def test_getData(self): smb.getServerOS() smb.doesSupportNTLMv2() smb.isLoginRequired() + smb.isSigningRequired() + smb.getIOCapabilities() smb.logoff() def test_getServerName(self): @@ -266,7 +267,21 @@ def test_getSessionKey(self): smb.login(self.username, self.password, self.domain) smb.getSessionKey() smb.logoff() - + + def test_queryInfo(self): + smb = self.create_connection() + smb.login(self.username, self.password, self.domain) + tid = smb.connectTree(self.share) + fid = smb.createFile(tid, self.file) + file_info = smb.queryInfo(tid, fid) + self.assertEqual(file_info["AllocationSize"], 0) + self.assertEqual(file_info["EndOfFile"], 0) + self.assertEqual(file_info["Directory"], 0) + smb.closeFile(tid,fid) + smb.deleteFile(self.share, self.file) + smb.disconnectTree(tid) + smb.logoff() + def __is_socket_opened(self, s): # We assume that if socket is selectable, it's open; and if it were not, it's closed. # Note: this method is accurate as long as the file descriptor used for the socket is not re-used