Beispiel #1
0
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)
Beispiel #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)
Beispiel #3
0
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)
Beispiel #4
0
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)
Beispiel #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)
Beispiel #6
0
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)
Beispiel #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)
Beispiel #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)
Beispiel #9
0
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)
Beispiel #10
0
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)
Beispiel #11
0
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)
Beispiel #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)
Beispiel #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)
Beispiel #14
0
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
Beispiel #15
0
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)
Beispiel #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)
Beispiel #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)
Beispiel #18
0
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)
Beispiel #19
0
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)
Beispiel #20
0
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)
Beispiel #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)
Beispiel #22
0
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)
Beispiel #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)
Beispiel #24
0
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)
Beispiel #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)
Beispiel #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)
Beispiel #27
0
def network_variable(value_name, value):
    value_name, value = test_define_value(value_name, value)
    other.change_network_variables(value_name, value)
Beispiel #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)
Beispiel #29
0
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)
Beispiel #30
0
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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #34
0
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)
Beispiel #35
0
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)
Beispiel #36
0
def execute_shell(step, path, arg):
    path, arg = test_define_value(path, arg)
    other.execute_shell_script(path, arg)
Beispiel #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))
Beispiel #38
0
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))
Beispiel #39
0
def execute_shell(path):
    path = test_define_value(path)[0]
    other.execute_shell_script(path, '')
Beispiel #40
0
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)
Beispiel #41
0
def execute_shell(step, script_type, path, arg):
    path, arg = test_define_value(path, arg)
    other.execute_shell_script(path, arg)
Beispiel #42
0
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)
Beispiel #43
0
def execute_shell(step, path):
    path = test_define_value(path)[0]
    other.execute_shell_script(path, '')
Beispiel #44
0
def execute_shell_with_args(script_type, path, arg):
    path, arg = test_define_value(path, arg)
    other.execute_shell_script(path, arg)
Beispiel #45
0
def execute_shell_command(step, command):
    command = test_define_value(command)[0]
    other.execute_shell_command(command)
Beispiel #46
0
def execute_shell_command(command):
    command = test_define_value(command)[0]
    other.execute_shell_command(command)
Beispiel #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)
Beispiel #48
0
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)
Beispiel #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)
Beispiel #50
0
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))
Beispiel #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)
Beispiel #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))
Beispiel #53
0
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)