Esempio n. 1
0
def send_a_file_to_the_share_with_nas_ipwheelshare_and_administrator_and_abcd1234(
        driver, nas_ip, wheelshare, user, password):
    """Send a file to the share with nas_IP/"{wheelshare}" and "{user}" and "{password}"."""
    run_cmd('touch testfile.txt')
    results = run_cmd(
        f'smbclient //{nas_ip}/{wheelshare} -U {user}%{password} -c "put testfile.txt testfile.txt"'
    )
    assert results['result'], results['output']
    run_cmd('rm testfile.txt')
Esempio n. 2
0
def send_a_file_to_the_share_with_ipldapsmbshare_and_eturgeon_and_need_4_testing(
        ldapsmbshare, ldap_user, ldap_password, nas_ip):
    """send a file to the share with ip/ldapsmbshare and "eturgeon" and "Need_4_testing"."""
    run_cmd('touch testfile.txt')
    results = run_cmd(
        f'smbclient //{nas_ip}/{ldapsmbshare} -U {ldap_user}%{ldap_password} -c "put testfile.txt testfile.txt"'
    )
    assert results['result'], results['output']
    run_cmd('rm testfile.txt')
Esempio n. 3
0
def send_a_file_to_the_share_with_nas_url_smbname_and_user_password(
        driver, nas_url, smbname, user, password):
    """Send a file the share with "nas_url"/"smbname" and "user"%"password"."""
    run_cmd('touch testfile.txt')
    results = run_cmd(
        f'smbclient //{nas_url}/{smbname} -W AD01 -U {user}%{password} -c "put testfile.txt testfile.txt"'
    )
    time.sleep(1)
    run_cmd('rm testfile.txt')
    assert results['result'], results['output']
Esempio n. 4
0
def send_a_file_to_the_share_should_fail_with_nas_ipwheelshare_and_footesting(
        driver, nas_ip, wheelshare, user, password):
    """send a file to the share should fail with NAS IP/"{wheelshare}" and {user}%{password}."""
    run_cmd('touch testfile2.txt')
    results = run_cmd(
        f'smbclient //{nas_ip}/{wheelshare} -U {user}%{password} -c "put testfile2.txt testfile2.txt"'
    )
    time.sleep(1)
    run_cmd('rm testfile2.txt')
    assert not results['result'], results['output']
configxml = etree.parse(filezilla_config)

configroot = configxml.getroot()

configlog = configroot.find(".//*[@name='Logging file']")

if (configlog is None):
    notify("Filezilla", "Logging file location not set")
    sys.exit()

filezilla_log = configlog.text

remote_str = ""

exam_server = run_cmd("grep Connected %s | tail -1 | awk '{ print $8}'" %
                      (filezilla_log))

lastlog = run_cmd("grep local:%s %s | tail -1" % (exam, filezilla_log))

m = re.search("remote\:(.*?)=", lastlog)

remote_file = m.group(1)

tree = etree.parse(filezilla_sites)

root = tree.getroot()

for server in root.iter('Server'):
    host = server.find("Host").text

    if host != exam_server: