Beispiel #1
0
def save_logs(destination_address=world.f_cfg.mgmt_address):
    fabric_download_file(world.f_cfg.log_join('kea.log*'),
                         check_local_path_for_downloaded_files(
                             world.cfg["test_result_dir"], '.',
                             destination_address),
                         destination_host=destination_address,
                         warn_only=True)
Beispiel #2
0
def save_logs(destination_address=world.f_cfg.mgmt_address):
    fabric_download_file('/tmp/dns.log',
                         check_local_path_for_downloaded_files(
                             world.cfg["test_result_dir"], 'dns/dns_log_file',
                             destination_address),
                         destination_host=destination_address,
                         ignore_errors=True)
def copy_file_from_server(remote_path):
    """
    Copy file from remote server via ssh. Address/login/password from init_all.py
    Path required.
    """
    fabric_download_file(remote_path,
                         world.cfg["test_result_dir"] + '/downloaded_file')
Beispiel #4
0
def save_leases(tmp_db_type=None, destination_address=world.f_cfg.mgmt_address):
    if world.f_cfg.db_type in ["mysql", "postgresql", "cql"]:
        # that is tmp solution - just clearing not saving.
        clear_leases(destination_address=world.f_cfg.mgmt_address)
    else:
        fabric_download_file(world.cfg['leases'],
                             check_local_path_for_downloaded_files(world.cfg["dir_name"],
                                                                   '/leases.csv',
                                                                   destination_address),
                             destination_host=destination_address)
Beispiel #5
0
def save_leases(tmp_db_type=None, destination_address=world.f_cfg.mgmt_address):
    if world.f_cfg.db_type in ["mysql", "postgresql", "cql"]:
        # TODO
        pass
    else:
        fabric_download_file(world.cfg['leases'],
                             check_local_path_for_downloaded_files(world.cfg["dir_name"],
                                                                   'leases.csv',
                                                                   destination_address),
                             destination_host=destination_address, warn_only=True)
Beispiel #6
0
def save_leases(tmp_db_type=None,
                destination_address=world.f_cfg.mgmt_address):
    if world.f_cfg.db_type in ["mysql", "postgresql", "cql"]:
        # TODO
        pass
    else:
        fabric_download_file(world.f_cfg.get_leases_path(),
                             check_local_path_for_downloaded_files(
                                 world.cfg["test_result_dir"], 'leases.csv',
                                 destination_address),
                             destination_host=destination_address,
                             warn_only=True)
Beispiel #7
0
def save_leases():
    db_name = DB_NAME
    db_user = DB_USER
    db_passwd = DB_PASSWD

    if DB_TYPE == "mysql":
        # that is tmp solution - just clearing not saving.
        command = '''mysql -u {db_user} -p{db_passwd} -Nse 'show tables' {db_name} | while read table; do mysql -u {db_user} -p{db_passwd} -e "truncate table $table" {db_name}; done'''.format(**locals())
        fabric_run_command(command)
    elif DB_TYPE == "postgresql":
        pointer_start = '{'
        pointer_end = '}'
        command = """psql -U {db_user} -d {db_name} -c "\\\\dtvs" -t  | awk '{pointer_start}print $3{pointer_end}' | while read table; do if [ ! -z "$table" -a "$table" != " " ]; then psql -U {db_user} -d {db_name} -c "truncate $table"; fi done""".format(**locals())
        fabric_run_command(command)
    else:
        fabric_download_file(world.cfg['leases'], world.cfg["dir_name"] + '/kea_leases.csv')
Beispiel #8
0
def save_leases(tmp_db_type=None):
    db_name = world.f_cfg.db_name
    db_user = world.f_cfg.db_user
    db_passwd = world.f_cfg.db_passwd

    if world.f_cfg.db_type == "mysql":
        # that is tmp solution - just clearing not saving.
        #command = '''mysql -u {db_user} -p{db_passwd} -Nse 'show tables' {db_name} | while read table; do mysql -u {db_user} -p{db_passwd} -e "truncate table $table" {db_name}; done'''.format(**locals())
        command = 'for table_name in dhcp4_options dhcp6_options ipv6_reservations hosts lease4 lease6; do mysql -u {db_user} -p{db_passwd} -e "delete from $table_name" {db_name}; done'.format(
            **locals())
        fabric_run_command(command)
    elif world.f_cfg.db_type == "postgresql":
        pointer_start = '{'
        pointer_end = '}'
        #command = """psql -U {db_user} -d {db_name} -c "\\\\dtvs" -t  | awk '{pointer_start}print $3{pointer_end}' | while read table; do if [ ! -z "$table" -a "$table" != " " ]; then psql -U {db_user} -d {db_name} -c "truncate $table"; fi done""".format(**locals())
        command = 'for table_name in dhcp4_options dhcp6_options ipv6_reservations hosts lease4 lease6; do psql -U {db_user} -d {db_name} -c "delete from $table_name" ; done'.format(
            **locals())
        fabric_run_command(command)
    else:
        fabric_download_file(world.cfg['leases'],
                             world.cfg["dir_name"] + '/kea_leases.csv')
Beispiel #9
0
def save_logs(destination_address=world.f_cfg.mgmt_address):
    fabric_download_file(
        world.f_cfg.software_install_path + 'var/kea/kea.log*',
        check_local_path_for_downloaded_files(world.cfg["dir_name"], '/.',
                                              destination_address),
        destination_host=destination_address)
Beispiel #10
0
def save_logs():
    fabric_download_file('/tmp/dns.log', world.cfg["dir_name"] + '/dns/dns_log_file')
Beispiel #11
0
def save_logs():
    fabric_download_file(SOFTWARE_INSTALL_DIR + 'var/kea/kea.log', world.cfg["dir_name"] + '/log_file')
    if world.ddns_enable:
        fabric_download_file(SOFTWARE_INSTALL_DIR + 'var/kea/kea.log_ddns', world.cfg["dir_name"] + '/log_file_ddns')
Beispiel #12
0
def clear_leases():
    fabric_download_file(world.cfg['leases'],
                         world.cfg["test_result_dir"] + '/dhcpd6.leases')
    fabric_remove_file_command(world.cfg["leases"])
    fabric_run_command('echo y |rm ' + world.cfg['leases'])
Beispiel #13
0
def save_leases():
    fabric_download_file(world.cfg['leases'], world.cfg["dir_name"] + '/kea_leases.csv')
Beispiel #14
0
def save_leases():
    fabric_download_file(world.cfg['leases'], world.cfg["dir_name"] + '/dhcpd.leases')
Beispiel #15
0
def save_logs():
    fabric_download_file(world.cfg["dhcp_log_file"],
                         world.cfg["dir_name"] + '/forge_dhcpd.log')
Beispiel #16
0
def save_leases():
    fabric_download_file(world.cfg['leases'], world.cfg["dir_name"] + '/kea_leases.csv')
Beispiel #17
0
def save_logs():
    fabric_download_file('log_file', world.cfg["dir_name"]+'/log_file')
Beispiel #18
0
def save_logs(destination_address=world.f_cfg.mgmt_address):
    fabric_download_file('/tmp/dns.log',
                         check_local_path_for_downloaded_files(world.cfg["dir_name"],
                                                               '/dns/dns_log_file', destination_address),
                         destination_host=destination_address)
Beispiel #19
0
def save_logs():
    fabric_download_file(
        world.f_cfg.software_install_path + 'var/kea/kea.log*',
        world.cfg["dir_name"] + '/.')
Beispiel #20
0
def save_logs(destination_address=world.f_cfg.mgmt_address):
    fabric_download_file(os.path.join(world.f_cfg.software_install_path, 'var/kea/kea.log*'),
                         check_local_path_for_downloaded_files(world.cfg["dir_name"],
                                                               '.',
                                                               destination_address),
                         destination_host=destination_address, warn_only=True)
Beispiel #21
0
def save_logs():
    fabric_download_file('log_file', world.cfg["dir_name"]+'/log_file')
def copy_file_from_server(remote_path):
    """
    Copy file from remote server via ssh. Address/login/password from init_all.py
    Path required.
    """
    fabric_download_file(remote_path, world.cfg["dir_name"] + '/downloaded_file')
Beispiel #23
0
def clear_leases():
    fabric_download_file(world.cfg['leases'], world.cfg["dir_name"] + '/dhcpd6.leases')
    fabric_remove_file_command(world.cfg["leases"])
    fabric_run_command('echo y |rm ' + world.cfg['leases'])
Beispiel #24
0
def save_leases():
    fabric_download_file(world.cfg['leases'],
                         world.cfg["test_result_dir"] + '/dhcpd6.leases')
Beispiel #25
0
def save_logs(destination_address=world.f_cfg.mgmt_address):
    fabric_download_file('/tmp/dns.log',
                         check_local_path_for_downloaded_files(world.cfg["dir_name"],
                                                               'dns/dns_log_file',
                                                               destination_address),
                         destination_host=destination_address, warn_only=True)
Beispiel #26
0
def save_logs():
    fabric_download_file(world.cfg["dhcp_log_file"],
                         world.cfg["test_result_dir"] + '/forge_dhcpd.log')
Beispiel #27
0
def save_logs():
    fabric_download_file(world.cfg["dhcp_log_file"], world.cfg["dir_name"] + '/forge_dhcpd.log')
Beispiel #28
0
def save_leases():
    fabric_download_file(world.cfg['leases'],
                         world.cfg["dir_name"] + '/dhcpd.leases')