def setup(request, topology):
    global cookie_header
    global SWITCH_IP
    global proxy
    global sw1
    sw1 = topology.get("sw1")
    assert sw1 is not None
    if SWITCH_IP is None:
        SWITCH_IP = get_switch_ip(sw1)
    proxy = environ["https_proxy"]
    environ["https_proxy"] = ""
    get_server_crt(sw1)
    if cookie_header is None:
        cookie_header = login(SWITCH_IP)
    def cleanup():
        global cookie_header
        environ["https_proxy"] = proxy
        remove_server_crt()
        cookie_header = None

    request.addfinalizer(cleanup)
Ejemplo n.º 2
0
def sanity_check(topology):
    sw1 = topology.get("sw1")
    assert sw1 is not None
    sleep(2)
    get_server_crt(sw1)
    rest_sanity_check(SWITCH_IP)
def sanity_check(topology):
    sw1 = topology.get("sw1")
    sleep(2)
    get_server_crt(sw1)
    rest_sanity_check(SWITCH_IP)