def getOpenPort(self, ip): return DataReceiverThread.getOpenPort(category="avatar%s" % ip)
sendDict = DataThreadBase.prepareSending(filesOrData, targetName, "gz") sendAndReceive(filesOrData, totalSize, targetDir, sendDict) if not testResult(filesOrData, targetDir, targetName, useTarstream=True): errors = True return not errors if __name__ == '__main__': initializeLogger() get_settings().set_verbose(True) errors = False # test opening ports p1 = DataReceiverThread.getOpenPort() p2 = DataReceiverThread.getOpenPort() assert p1 != p2 if p1 != get_settings().get_tcp_port(): getCoreLogger().error("Did not obtain default TCP port") errors = True DataReceiverThread.cleanup() sys.exit(0) sourceDir = mkdtemp() targetDir = mkdtemp() FILE_SIZE = 1024 * 1024 try: