コード例 #1
0
ファイル: srv_control.py プロジェクト: Streder/forge
def start_srv(name,
              type_of_action,
              config_set=None,
              dest=world.f_cfg.mgmt_address):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    dest = test_define_value(dest)[0]
    check_remote_address(dest)
    if name not in ["DHCP", "DNS"]:
        assert False, "I don't think there is support for something else than DNS or DHCP"
    if type_of_action == "started":
        if name == "DHCP":
            log.info(
                '-----------------  KEA START %s -------------------------------------------------------',
                dest)
            dhcp.start_srv(True, None, destination_address=dest)
        elif name == "DNS":
            log.info(
                '-----------------  BIND START %s -------------------------------------------------------',
                dest)
            if config_set is not None:
                use_dns_set_number(config_set)
            dns.start_srv(True, None, destination_address=dest)
    elif type_of_action == "stopped":
        if name == "DHCP":
            log.info(
                '-----------------  KEA STOP %s  -------------------------------------------------------',
                dest)
            dhcp.stop_srv(destination_address=dest)
        elif name == "DNS":
            log.info(
                '-----------------  BIND STOP %s  -------------------------------------------------------',
                dest)
            dns.stop_srv(destination_address=dest)
    elif type_of_action == "restarted":
        if name == "DHCP":
            log.info(
                '-----------------  KEA RESTART %s  -------------------------------------------------------',
                dest)
            dhcp.restart_srv(destination_address=dest)
        elif name == "DNS":
            log.info(
                '-----------------  BIND RESTART %s  -------------------------------------------------------',
                dest)
            dns.restart_srv(destination_address=dest)
    elif type_of_action == "reconfigured":
        if name == "DHCP":
            log.info(
                '-----------------  KEA RECONFIG %s  -------------------------------------------------------',
                dest)
            dhcp.reconfigure_srv(destination_address=dest)
        elif name == "DNS":
            log.info(
                '-----------------  BIND RECONFIG %s  -------------------------------------------------------',
                dest)
            dns.reconfigure_srv(destination_address=dest)
    else:
        assert False, "we don't support '%s' action." % str(type_of_action)
コード例 #2
0
ファイル: srv_control.py プロジェクト: Streder/forge
def remote_start_srv(name, type_of_action, destination_address):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    destination_address = test_define_value(destination_address)[0]
    check_remote_address(destination_address)
    if name not in ["DHCP", "DNS"]:
        assert False, "I don't think there is support for something else than DNS or DHCP"
    if type_of_action == "started":
        if name == "DHCP":
            dhcp.start_srv(True, None, destination_address)
        elif name == "DNS":
            dns.start_srv(True, None, destination_address)
    elif type_of_action == "stopped":
        if name == "DHCP":
            dhcp.stop_srv(destination_address=destination_address)
        elif name == "DNS":
            dns.stop_srv(destination_address=destination_address)
    elif type_of_action == "restarted":
        if name == "DHCP":
            dhcp.restart_srv(destination_address=destination_address)
        elif name == "DNS":
            dns.restart_srv(destination_address=destination_address)
    elif type_of_action == "reconfigured":
        if name == "DHCP":
            dhcp.reconfigure_srv(destination_address=destination_address)
        elif name == "DNS":
            dns.reconfigure_srv(destination_address=destination_address)
    else:
        assert False, "we don't support this action."
コード例 #3
0
ファイル: srv_control.py プロジェクト: shawnmullaney/forge
def start_srv(name, type_of_action):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    if name not in ["DHCP", "DNS"]:
        assert False, "I don't think there is support for something else than DNS or DHCP"
    if type_of_action == "started":
        if name == "DHCP":
            dhcp.start_srv(True, None)
        elif name == "DNS":
            dns.start_srv(True, None)
    elif type_of_action == "stopped":
        if name == "DHCP":
            dhcp.stop_srv()
        elif name == "DNS":
            dns.stop_srv()
    elif type_of_action == "restarted":
        if name == "DHCP":
            dhcp.restart_srv()
        elif name == "DNS":
            dns.restart_srv()
    elif type_of_action == "reconfigured":
        if name == "DHCP":
            dhcp.reconfigure_srv()
        elif name == "DNS":
            dns.reconfigure_srv()
    else:
        assert False, "we don't support this action."
コード例 #4
0
ファイル: srv_control.py プロジェクト: isc-projects/forge
def remote_start_srv(name, type_of_action, destination_address):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    destination_address = test_define_value(destination_address)[0]
    check_remote_address(destination_address)
    if name not in ["DHCP", "DNS"]:
        assert False, "I don't think there is support for something else than DNS or DHCP"
    if type_of_action == "started":
        if name == "DHCP":
            dhcp.start_srv(True, None, destination_address)
        elif name == "DNS":
            dns.start_srv(True, None, destination_address)
    elif type_of_action == "stopped":
        if name == "DHCP":
            dhcp.stop_srv(destination_address=destination_address)
        elif name == "DNS":
            dns.stop_srv(destination_address=destination_address)
    elif type_of_action == "restarted":
        if name == "DHCP":
            dhcp.restart_srv(destination_address=destination_address)
        elif name == "DNS":
            dns.restart_srv(destination_address=destination_address)
    elif type_of_action == "reconfigured":
        if name == "DHCP":
            dhcp.reconfigure_srv(destination_address=destination_address)
        elif name == "DNS":
            dns.reconfigure_srv(destination_address=destination_address)
    else:
        assert False, "we don't support this action."
コード例 #5
0
ファイル: srv_control.py プロジェクト: isc-projects/forge
def start_srv(name, type_of_action):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    if name not in ["DHCP", "DNS"]:
        assert False, "I don't think there is support for something else than DNS or DHCP"
    if type_of_action == "started":
        if name == "DHCP":
            dhcp.start_srv(True, None)
        elif name == "DNS":
            dns.start_srv(True, None)
    elif type_of_action == "stopped":
        if name == "DHCP":
            dhcp.stop_srv()
        elif name == "DNS":
            dns.stop_srv()
    elif type_of_action == "restarted":
        if name == "DHCP":
            dhcp.restart_srv()
        elif name == "DNS":
            dns.restart_srv()
    elif type_of_action == "reconfigured":
        if name == "DHCP":
            dhcp.reconfigure_srv()
        elif name == "DNS":
            dns.reconfigure_srv()
    else:
        assert False, "we don't support this action."
コード例 #6
0
ファイル: srv_control.py プロジェクト: Streder/forge
def start_srv_during_process(name, process):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    if name == "DHCP":
        dhcp.start_srv(False, process)
    elif name == "DNS":
        dns.start_srv(False, process)
    else:
        assert False, "I don't think there is support for something else than DNS or DHCP"
コード例 #7
0
ファイル: srv_control.py プロジェクト: isc-projects/forge
def start_srv_during_process(name, process):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    if name == "DHCP":
        dhcp.start_srv(False, process)
    elif name == "DNS":
        dns.start_srv(False, process)
    else:
        assert False, "I don't think there is support for something else than DNS or DHCP"
コード例 #8
0
ファイル: srv_control.py プロジェクト: Streder/forge
def start_srv_during_remote_process(name, process, destination_address):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    destination_address[0] = test_define_value(destination_address)
    check_remote_address(destination_address)
    if name == "DHCP":
        dhcp.start_srv(False, process, destination_address)
    elif name == "DNS":
        dns.start_srv(False, process, destination_address)
    else:
        assert False, "I don't think there is support for something else than DNS or DHCP"
コード例 #9
0
ファイル: srv_control.py プロジェクト: isc-projects/forge
def start_srv_during_remote_process(name, process, destination_address):
    """
    Decide which you want, start server of failed start (testing incorrect configuration)
    Also decide in which part should it failed.
    """
    destination_address[0] = test_define_value(destination_address)
    check_remote_address(destination_address)
    if name == "DHCP":
        dhcp.start_srv(False, process, destination_address)
    elif name == "DNS":
        dns.start_srv(False, process, destination_address)
    else:
        assert False, "I don't think there is support for something else than DNS or DHCP"