コード例 #1
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def log_includes_count(server_type, count, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    count, line = test_define_value(count, line)
    other.log_contains_count(server_type, count, line)
コード例 #2
0
def log_includes_line(step, table_name, db_type, condition, line):
    """
    Check if in table X in database type Y include line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    table_name, db_type, line = test_define_value(table_name, db_type, line)
    other.db_table_contain(table_name, db_type, condition, line)
コード例 #3
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def file_includes_line(condition, line):
    """
    Check if downloaded file includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    line = test_define_value(line)[0]
    other.file_includes_line(condition, line)
コード例 #4
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def table_contains_line(table_name, db_type, condition, line):
    """
    Check if in table X in database type Y include line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    table_name, db_type, line = test_define_value(table_name, db_type, line)
    other.db_table_contain(table_name, db_type, condition, line)
コード例 #5
0
def file_includes_line(step, condition, line):
    """
    Check if downloaded file includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    line = test_define_value(line)[0]
    other.file_includes_line(step, condition, line)
コード例 #6
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def log_contains_line(server_type, condition, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    line = test_define_value(line)[0]
    other.log_contains(server_type, condition, line)
コード例 #7
0
def log_includes_line(step, server_type, condition, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    line = test_define_value(line)[0]
    other.log_contains(step, server_type, condition, line)
コード例 #8
0
def log_includes_line(step, file_path, condition, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    file_path, line = test_define_value(file_path, line)
    other.regular_file_contain(file_path, condition, line)
コード例 #9
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def copy_remote(remote_path):
    """
    Download file from remote server. It is stored in test directory.
    And named "downloaded_file"
    """
    remote_path = test_define_value(remote_path)[0]
    other.copy_file_from_server(remote_path)
コード例 #10
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def file_contains_line(file_path, condition, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    file_path, line = test_define_value(file_path, line)
    other.regular_file_contain(file_path, condition, line)
コード例 #11
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def remote_log_includes_line(destination, file_path, condition, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    destination, file_path, line = test_define_value(destination, file_path, line)
    other.regular_file_contain(file_path, condition, line, destination=destination)
コード例 #12
0
def copy_remote(step, remote_path):
    """
    Download file from remote server. It is stored in test directory.
    And named "downloaded_file"
    """
    remote_path = test_define_value(remote_path)[0]
    other.copy_file_from_server(step, remote_path)
コード例 #13
0
def log_includes_count(step, server_type, count, line):
    """
    Check if Log includes line.
    Be aware that tested line is every thing after "line: " until end of the line.
    """
    count, line = test_define_value(count, line)
    other.log_contains_count(step, server_type, count, line)
コード例 #14
0
ファイル: cb_model.py プロジェクト: isc-projects/forge
def _substitute_vars(cfg):
    for k, v in cfg.items():
        if isinstance(v, basestring):
            cfg[k] = srv_control.test_define_value(v)[0]
        elif isinstance(v, dict):
            _substitute_vars(v)
        elif isinstance(v, list):
            new_list = []
            for lv in v:
                if isinstance(lv, dict):
                    _substitute_vars(lv)
                    new_list.append(lv)
                elif isinstance(lv, basestring):
                    new_list.append(srv_control.test_define_value(lv)[0])
                else:
                    new_list.append(lv)
            cfg[k] = new_list
コード例 #15
0
ファイル: srv_msg.py プロジェクト: deviousops/forge
def client_sets_value(step, value_name, new_value):
    """
    User can set values like: address, T1 or DUID to make test scenario
    more accurate.
    """
    # that is also used for DNS messages
    value_name, new_value = test_define_value(value_name, new_value)
    dhcpmsg.client_sets_value(step, value_name, new_value)
コード例 #16
0
def client_sets_value(step, sender_type, value_name, new_value):
    """
    User can set values like: address, T1 or DUID to make test scenario
    more accurate.
    """
    # that is also used for DNS messages and RelayForward message but sender_type was
    # introduced just to keep tests cleaner - it's unused in the code.
    value_name, new_value = test_define_value(value_name, new_value)
    dhcpmsg.client_sets_value(step, value_name, new_value)
コード例 #17
0
def client_does_include_with_value(step, opt_type, value):
    """
    You can choose to include options to message with proposed value. Mostly used only with
    DHCPv4. Also reason why that step is called "Client adds to message" not
    "Client does (NOT )?include" as other step is that lettuce step parser is really... weak.
    What ever I'll do with that always takes wrong step.
    """
    opt_type, value = test_define_value(opt_type, value)
    dhcpmsg.client_does_include(step, opt_type, value)
コード例 #18
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def client_sets_value(sender_type, value_name, new_value):
    """
    User can set values like: address, T1 or DUID to make test scenario
    more accurate.
    """
    # that is also used for DNS messages and RelayForward message but sender_type was
    # introduced just to keep tests cleaner - it's unused in the code.
    value_name, new_value = test_define_value(value_name, new_value)
    dhcpmsg.client_sets_value(value_name, new_value)
コード例 #19
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def client_does_include_with_value(opt_type, value):
    """
    You can choose to include options to message with proposed value. Mostly used only with
    DHCPv4. Also reason why that step is called "Client adds to message" not
    "Client does (NOT )?include" as other step is that lettuce step parser is really... weak.
    What ever I'll do with that always takes wrong step.
    """
    opt_type, value = test_define_value(opt_type, value)
    dhcpmsg.client_does_include(None, opt_type, value)
コード例 #20
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def response_check_option_content(resp_rel, opt_code, expect, data_type, expected_value):
    """
    Detailed parsing of received option. For more details please read manual section "Parsing respond"
    """
    data_type, expected_value = test_define_value(data_type, expected_value)
    if data_type == "sub-option":
        dhcpmsg.response_check_include_suboption(opt_code, expect, expected_value)
    else:
        dhcpmsg.response_check_option_content(opt_code, expect, data_type, expected_value)
コード例 #21
0
def client_send_msg_via_interface(step, iface, addr, msgname):
    """
    This step actually build message (e.g. SOLICIT) with all details
    specified in steps like:
    Client sets (\w+) value to (\S+).
    Client does include (\S+).
    and others..
    Message builded here will be send in step: Server must response with...
    """
    msgname, iface, addr = test_define_value(msgname, iface, addr)
    dhcpmsg.client_send_msg(step, msgname, iface, addr)
コード例 #22
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def client_send_msg_via_interface(iface, addr, msgname):
    """
    This step actually build message (e.g. SOLICIT) with all details
    specified in steps like:
    Client sets (\w+) value to (\S+).
    Client does include (\S+).
    and others..
    Message builded here will be send in step: Server must response with...
    """
    msgname, iface, addr = test_define_value(msgname, iface, addr)
    dhcpmsg.client_send_msg(msgname, iface, addr)
コード例 #23
0
def response_check_option_content(step, resp_rel, opt_code, expect, data_type,
                                  expected_value):
    """
    Detailed parsing of received option. For more details please read manual section "Parsing respond"
    """
    data_type, expected_value = test_define_value(data_type, expected_value)
    if data_type == "sub-option":
        dhcpmsg.response_check_include_suboption(opt_code, expect,
                                                 expected_value)
    else:
        dhcpmsg.response_check_option_content(opt_code, expect, data_type,
                                              expected_value)
コード例 #24
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def remove_from_db_table(table_name, db_type):
    table_name, db_type = test_define_value(table_name, db_type)
    other.remove_from_db_table(table_name, db_type)
コード例 #25
0
def change_message_filed(step, message_filed, value, value_type):
    message_filed, value, value_type = test_define_value(
        message_filed, value, value_type)
    dhcpmsg.change_message_field(message_filed, value, value_type)
コード例 #26
0
def network_variable(step, value_name, value):
    value_name, value = test_define_value(value_name, value)
    other.change_network_variables(value_name, value)
コード例 #27
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def network_variable(value_name, value):
    value_name, value = test_define_value(value_name, value)
    other.change_network_variables(value_name, value)
コード例 #28
0
def remove_from_db_table(step, table_name, db_type):
    table_name, db_type = test_define_value(table_name, db_type)
    other.remove_from_db_table(table_name, db_type)
コード例 #29
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def change_message_filed(message_filed, value, value_type):
    message_filed, value, value_type = test_define_value(message_filed, value, value_type)
    dhcpmsg.change_message_field(message_filed, value, value_type)
コード例 #30
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def send_through_socket_given_server_site(destination_address, socket_path, command):
    destination_address, socket_path, command = test_define_value(destination_address, socket_path, command)
    return other.send_through_socket_server_site(socket_path, command, destination_address=destination_address)
コード例 #31
0
def send_file_to_server(step, local_path, remote_path):
    """
    If you need send some file to server, use that step.
    """
    local_path, remote_path = test_define_value(local_path, remote_path)
    other.send_file_to_server(step, local_path, remote_path)
コード例 #32
0
def compare_file(step, remote_path):
    """
    Compare two files, our local and "downloaded_file".
    """
    remote_path = test_define_value(remote_path)[0]
    other.compare_file(step, remote_path)
コード例 #33
0
def remove_file_from_server(step, remote_path):
    """
    If you need to remove file from a server, please do so.
    """
    remote_path = test_define_value(remote_path)[0]
    other.remove_file_from_server(step, remote_path)
コード例 #34
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def remove_file_from_server(remote_path):
    """
    If you need to remove file from a server, please do so.
    """
    remote_path = test_define_value(remote_path)[0]
    other.remove_file_from_server(remote_path)
コード例 #35
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def send_through_http(http_address, http_port, command):
    http_address, http_port, command = test_define_value(http_address, http_port, command)
    return other.send_through_http(http_address, int(http_port), command)
コード例 #36
0
ファイル: srv_msg.py プロジェクト: deviousops/forge
def execute_shell(step, path, arg):
    path, arg = test_define_value(path, arg)
    other.execute_shell_script(path, arg)
コード例 #37
0
def forge_sleep(step, time_val, time_units):
    """
    Pause the test for selected amount of time counted in seconds or milliseconds.
    """
    time_val, time_units = test_define_value(time_val, time_units)
    other.forge_sleep(int(time_val), str(time_units))
コード例 #38
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def forge_sleep(time_val, time_units):
    """
    Pause the test for selected amount of time counted in seconds or milliseconds.
    """
    time_val, time_units = test_define_value(time_val, time_units)
    other.forge_sleep(int(time_val), str(time_units))
コード例 #39
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def execute_shell(path):
    path = test_define_value(path)[0]
    other.execute_shell_script(path, '')
コード例 #40
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def compare_file(remote_path):
    """
    Compare two files, our local and "downloaded_file".
    """
    remote_path = test_define_value(remote_path)[0]
    other.compare_file(remote_path)
コード例 #41
0
def execute_shell(step, script_type, path, arg):
    path, arg = test_define_value(path, arg)
    other.execute_shell_script(path, arg)
コード例 #42
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def send_file_to_server(local_path, remote_path):
    """
    If you need send some file to server, use that step.
    """
    local_path, remote_path = test_define_value(local_path, remote_path)
    other.send_file_to_server(local_path, remote_path)
コード例 #43
0
def execute_shell(step, path):
    path = test_define_value(path)[0]
    other.execute_shell_script(path, '')
コード例 #44
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def execute_shell_with_args(script_type, path, arg):
    path, arg = test_define_value(path, arg)
    other.execute_shell_script(path, arg)
コード例 #45
0
def execute_shell_command(step, command):
    command = test_define_value(command)[0]
    other.execute_shell_command(command)
コード例 #46
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def execute_shell_command(command):
    command = test_define_value(command)[0]
    other.execute_shell_command(command)
コード例 #47
0
def send_through_socket_server_site(step, destination_address, socket_path,
                                    command):
    destination_address, socket_path, command = test_define_value(
        destination_address, socket_path, command)
    other.send_through_socket_server_site(
        socket_path, command, destination_address=destination_address)
コード例 #48
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def send_through_socket_server_site(socket_path, command):
    socket_path, command = test_define_value(socket_path, command)
    return other.send_through_socket_server_site(socket_path, command)
コード例 #49
0
def send_through_socket_server_site(step, socket_path, command):
    socket_path, command = test_define_value(socket_path, command)
    other.send_through_socket_server_site(socket_path, command)
コード例 #50
0
ファイル: srv_msg.py プロジェクト: isc-projects/forge
def json_response_parsing(parameter_name, condition, parameter_value):
    parameter_name, parameter_value = test_define_value(parameter_name, parameter_value)
    other.parse_json_file(condition, str(parameter_name), str(parameter_value))
コード例 #51
0
def send_through_http(step, http_address, http_port, command):
    http_address, http_port, command = test_define_value(
        http_address, http_port, command)
    other.send_through_http(http_address, int(http_port), command)
コード例 #52
0
def json_response_parsing(step, parameter_name, condition, parameter_value):
    parameter_name, parameter_value = test_define_value(
        parameter_name, parameter_value)
    other.parse_json_file(condition, str(parameter_name), str(parameter_value))
コード例 #53
0
ファイル: srv_msg.py プロジェクト: deviousops/forge
def response_check_option_content(step, opt_code, expect, data_type, expected):
    """
    Detailed parsing of received option. For more details please read manual section "Parsing respond"
    """
    data_type, expected = test_define_value(data_type, expected)
    dhcpmsg.response_check_option_content(step, 0, opt_code, expect, data_type, expected)