コード例 #1
0
 def getOpenPort(self, ip):
     return DataReceiverThread.getOpenPort(category="avatar%s" % ip)
コード例 #2
0
    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: