def setUp(self):
        test_common.setup_flexmock()

        api_server_ip = socket.gethostbyname(socket.gethostname())
        api_server_port = get_free_port()
        http_server_port = get_free_port()
        gevent.spawn(test_common.launch_api_server, api_server_ip, api_server_port, http_server_port)
        block_till_port_listened(api_server_ip, api_server_port)
        self._vnc_lib = VncApi("u", "p", api_server_host=api_server_ip, api_server_port=api_server_port)
    def setUp(self):
        test_common.setup_flexmock()

        api_server_ip = socket.gethostbyname(socket.gethostname())
        api_server_port = get_free_port()
        http_server_port = get_free_port()
        gevent.spawn(test_common.launch_api_server,
                     api_server_ip, api_server_port, http_server_port)
        block_till_port_listened(api_server_ip, api_server_port)
        self._vnc_lib = VncApi('u', 'p', api_server_host=api_server_ip,
                               api_server_port=api_server_port)
    def setUp(self):
        super(TestFixtures, self).setUp()
        test_common.setup_flexmock()

        api_server_ip = socket.gethostbyname(socket.gethostname())
        api_server_port = get_free_port()
        http_server_port = get_free_port()
        self._api_svr = gevent.spawn(test_common.launch_api_server, api_server_ip, api_server_port, http_server_port)
        block_till_port_listened(api_server_ip, api_server_port)
        self._vnc_lib = VncApi('u', 'p', api_server_host = api_server_ip,
                                         api_server_port = api_server_port)
def main(args_str = None):   
    if not args_str:
        args_str = ' '.join(sys.argv[1:])
    args = parse_args(args_str)

    test_common.setup_flexmock()
    if not args.listen_ip:
        api_server_ip = socket.gethostbyname(socket.gethostname())
    else:
        api_server_ip = args.listen_ip

    if not args.listen_port:
        api_server_port = get_free_port()
    else:
        api_server_port = args.listen_port
    http_server_port = get_free_port()

    api_srv = gevent.spawn(test_common.launch_api_server, api_server_ip, api_server_port, http_server_port)
    gevent.joinall([api_srv])
Esempio n. 5
0
def main(args_str=None):
    if not args_str:
        args_str = ' '.join(sys.argv[1:])
    args = parse_args(args_str)

    test_common.setup_flexmock()
    if not args.listen_ip:
        api_server_ip = socket.gethostbyname(socket.gethostname())
    else:
        api_server_ip = args.listen_ip

    if not args.listen_port:
        api_server_port = get_free_port()
    else:
        api_server_port = args.listen_port
    http_server_port = get_free_port()

    api_srv = gevent.spawn(test_common.launch_api_server, api_server_ip,
                           api_server_port, http_server_port)
    gevent.joinall([api_srv])