def vc_vcp_platforms(request): vc = PlatformWrapper() vcp = PlatformWrapper() # VC is setup to allow all connections vc.allow_all_connections() start_wrapper_platform(vc, with_http=True) if request.param == 'use-http': start_wrapper_platform(vcp, volttron_central_address=vc.bind_web_address) else: start_wrapper_platform(vcp, volttron_central_address=vc.vip_address, volttron_central_serverkey=vc.serverkey) vcp_uuid = add_volttron_central_platform(vcp) vc_uuid = add_volttron_central(vc) # Give the agents a chance to do stuff. Can take up to 10 seconds to # reconnect with vc. gevent.sleep(10) yield vc, vcp vc.shutdown_platform() vcp.shutdown_platform()
def vc_vcp_platforms(): """ This method returns two distinct platforms one vc and one vcp. When they are returned they should be registered together. This method will yield the two platforms as a tuple and then after the module is finished executing the cleanup of both will happen. """ vc = PlatformWrapper() vcp = PlatformWrapper() # VC is setup to allow all connections vc.allow_all_connections() start_wrapper_platform(vc, with_http=True) start_wrapper_platform(vcp, volttron_central_address=vc.vip_address, volttron_central_serverkey=vc.serverkey) vc_uuid = add_volttron_central(vc) vcp_uuid = add_volttron_central_platform(vcp) # Sleep so we know we are registered gevent.sleep(15) yield vc, vcp vc.shutdown_platform() vcp.shutdown_platform()
def vc_vcp_platforms(request): vc = PlatformWrapper() vcp = PlatformWrapper() # VC is setup to allow all connections vc.allow_all_connections() start_wrapper_platform(vc, with_http=True) if request.param == 'use-http': start_wrapper_platform(vcp, volttron_central_address=vc.bind_web_address) else: start_wrapper_platform(vcp, volttron_central_address=vc.vip_address, volttron_central_serverkey=vc.serverkey) vcp_uuid = add_volttron_central_platform(vcp) vc_uuid = add_volttron_central(vc) # Give the agents a chance to do stuff. Can take up to 10 seconds to # reconnect with vc. gevent.sleep(10) yield vc, vcp vc.shutdown_platform() vcp.shutdown_platform()