def testServerDownloadWithDynamicPort(self, output='/tmp/out'):
    log.debug('===> Running testcase testServerDownloadWithDynamicPort')
    root = os.path.dirname(os.path.abspath(__file__))
    server = tftpy.TftpServer(root)
    server_thread = threading.Thread(target=server.listen, kwargs={'listenip': 'localhost', 'listenport': 0})
    server_thread.start()
    try:
        server.is_running.wait()
        client = tftpy.TftpClient('localhost', server.listenport, {})
        time.sleep(1)
        client.download('640KBFILE', output)
    finally:
        server.stop(now=False)
        server_thread.join()
def testServerDownloadWithDynamicPort(self, output='/tmp/out'):
    log.debug('===> Running testcase testServerDownloadWithDynamicPort')
    root = os.path.dirname(os.path.abspath(__file__))
    server = tftpy.TftpServer(root)
    server_thread = threading.Thread(target=server.listen, kwargs={'listenip': 'localhost', 'listenport': 0})
    server_thread.start()
    try:
        server.is_running.wait()
        client = tftpy.TftpClient('localhost', server.listenport, {})
        time.sleep(1)
        client.download('640KBFILE', output)
    finally:
        server.stop(now=False)
        server_thread.join()