Beispiel #1
0
def __local_install(app_archive_path, device_host):
    run_scp('{0} root@{1}:/app.tar.gz'.format(app_archive_path, device_host),
            password=DEVICE_PASSWORD)
    run_ssh(device_host,
            '/opt/app/sam/bin/sam --debug install /app.tar.gz',
            password=DEVICE_PASSWORD)
    time.sleep(3)
Beispiel #2
0
def __local_install(password, version, arch, release):
    run_scp('{0}/../platform-{1}-{2}.tar.gz root@localhost:/'.format(DIR, version, arch), password=password)
    run_ssh('/opt/app/sam/bin/sam --debug install /platform-{0}-{1}.tar.gz'.format(version, arch), password=password)
    run_ssh('/opt/app/sam/bin/sam update --release {0}'.format(release), password=password)
    set_docker_ssh_port(password)
    run_ssh('systemctl restart platform-uwsgi-public', password=password)
    time.sleep(3)
Beispiel #3
0
def local_install(password, app_archive_path, installer):
    _, app_archive = split(app_archive_path)
    run_scp('{0} root@localhost:/'.format(app_archive_path), password=password)
    cmd = SAM_INSTALL
    if installer == 'snapd':
        cmd = SNAP_INSTALL
    run_ssh('{0} /{1}'.format(cmd, app_archive), password=password)
Beispiel #4
0
def test_copy_logs():
    os.mkdir(LOG_DIR)
    run_scp('root@localhost:/opt/data/platform/log/* {0}'.format(LOG_DIR), password=DEVICE_PASSWORD)
    run_ssh('ls -la /opt/app/diaspora/diaspora/log', password=DEVICE_PASSWORD)
    run_scp('root@localhost:/opt/app/diaspora/diaspora/log/* {0}'.format(LOG_DIR), password=DEVICE_PASSWORD)

    print('-------------------------------------------------------')
    print('syncloud docker image is running')
    print('connect using: {0}'.format(ssh_command(DEVICE_PASSWORD, SSH)))
    print('-------------------------------------------------------')
Beispiel #5
0
def module_teardown():
    os.mkdir(LOG_DIR)
    run_scp('root@localhost:/opt/data/platform/log/* {0}'.format(LOG_DIR), password=LOGS_SSH_PASSWORD)

    print('systemd logs')
    run_ssh('journalctl | grep platform', password=LOGS_SSH_PASSWORD)

    print('-------------------------------------------------------')
    print('syncloud docker image is running')
    print('connect using: {0}'.format(ssh_command(DEVICE_PASSWORD, SSH)))
    print('-------------------------------------------------------')
Beispiel #6
0
def __local_install(auth):
    email, password, domain, release, version, arch = auth
    run_scp('{0}/../owncloud-{1}-{2}.tar.gz root@localhost:/'.format(
        DIR, version, arch),
            password=DEVICE_PASSWORD)
    run_ssh(
        '/opt/app/sam/bin/sam --debug install /owncloud-{0}-{1}.tar.gz'.format(
            version, arch),
        password=DEVICE_PASSWORD)
    set_docker_ssh_port(DEVICE_PASSWORD)
    time.sleep(3)
Beispiel #7
0
def module_teardown():
    os.mkdir(LOG_DIR)
    run_scp('root@localhost:/opt/data/platform/log/* {0}'.format(LOG_DIR),
            password=LOGS_SSH_PASSWORD)

    print('systemd logs')
    run_ssh('journalctl | grep platform', password=LOGS_SSH_PASSWORD)

    print('-------------------------------------------------------')
    print('syncloud docker image is running')
    print('connect using: {0}'.format(ssh_command(DEVICE_PASSWORD, SSH)))
    print('-------------------------------------------------------')
Beispiel #8
0
def __local_install(password, version, arch, release):
    run_scp('{0}/../platform-{1}-{2}.tar.gz root@localhost:/'.format(
        DIR, version, arch),
            password=password)
    run_ssh(
        '/opt/app/sam/bin/sam --debug install /platform-{0}-{1}.tar.gz'.format(
            version, arch),
        password=password)
    run_ssh('/opt/app/sam/bin/sam update --release {0}'.format(release),
            password=password)
    set_docker_ssh_port(password)
    run_ssh('systemctl restart platform-uwsgi-public', password=password)
    time.sleep(3)
Beispiel #9
0
def module_teardown():
    os.mkdir(LOG_DIR)
    platform_log_dir = join(LOG_DIR, 'platform_log')
    os.mkdir(platform_log_dir)
    run_scp('root@localhost:/opt/data/platform/log/* {0}'.format(platform_log_dir), password=LOGS_SSH_PASSWORD)
    owncloud_log_dir = join(LOG_DIR, 'owncloud_log')
    os.mkdir(owncloud_log_dir)
    run_scp('root@localhost:/opt/data/owncloud/log/*.log {0}'.format(owncloud_log_dir), password=LOGS_SSH_PASSWORD)

    print('-------------------------------------------------------')
    print('syncloud docker image is running')
    print('connect using: {0}'.format(ssh_command(DEVICE_PASSWORD, SSH)))
    print('-------------------------------------------------------')
Beispiel #10
0
def module_teardown():
    run_scp('root@localhost:{0}/log/* {1}'.format(DATA_DIR, LOG_DIR),
            password=LOGS_SSH_PASSWORD)
    run_scp('root@localhost:/var/log/sam.log {1}'.format(DATA_DIR, LOG_DIR),
            throw=False,
            password=LOGS_SSH_PASSWORD)

    print('systemd logs')
    run_ssh('journalctl | tail -200', password=LOGS_SSH_PASSWORD)

    print('-------------------------------------------------------')
    print('syncloud docker image is running')
    print('connect using: {0}'.format(ssh_command(DEVICE_PASSWORD, SSH)))
    print('-------------------------------------------------------')
Beispiel #11
0
def module_teardown():
    os.mkdir(LOG_DIR)
    platform_log_dir = join(LOG_DIR, 'platform_log')
    os.mkdir(platform_log_dir)
    run_scp(
        'root@localhost:/opt/data/platform/log/* {0}'.format(platform_log_dir),
        password=LOGS_SSH_PASSWORD)
    owncloud_log_dir = join(LOG_DIR, 'owncloud_log')
    os.mkdir(owncloud_log_dir)
    run_scp('root@localhost:/opt/data/owncloud/log/*.log {0}'.format(
        owncloud_log_dir),
            password=LOGS_SSH_PASSWORD)

    print('-------------------------------------------------------')
    print('syncloud docker image is running')
    print('connect using: {0}'.format(ssh_command(DEVICE_PASSWORD, SSH)))
    print('-------------------------------------------------------')
Beispiel #12
0
def test_external_https_mode_with_certbot(public_web_session):

    response = public_web_session.get(
        'http://localhost/rest/settings/regenerate_certificate')
    assert '"success": true' in response.text
    assert response.status_code == 200

    os.mkdir(CERTIFICATE_DIR)

    run_scp(
        'root@localhost:/opt/data/platform/certbot/live/*/fullchain.pem {0}/syncloud.crt'
        .format(CERTIFICATE_DIR),
        password=LOGS_SSH_PASSWORD)

    run_scp(
        'root@localhost:/opt/data/platform/certbot/keys/0000_key-certbot.pem {0}/syncloud.key'
        .format(CERTIFICATE_DIR),
        password=LOGS_SSH_PASSWORD)
Beispiel #13
0
def module_teardown(device_host, data_dir, platform_data_dir):
    platform_log_dir = join(LOG_DIR, 'platform_log')
    os.mkdir(platform_log_dir)
    run_ssh(device_host,
            'ls -la {0}'.format(data_dir),
            password=LOGS_SSH_PASSWORD,
            throw=False)

    run_scp('root@{0}:{1}/log/* {2}'.format(device_host, platform_data_dir,
                                            platform_log_dir),
            password=LOGS_SSH_PASSWORD,
            throw=False)
    run_scp('root@{0}:/var/log/sam.log {1}'.format(device_host,
                                                   platform_log_dir),
            password=LOGS_SSH_PASSWORD,
            throw=False)

    app_log_dir = join(LOG_DIR, 'diaspora_log')
    os.mkdir(app_log_dir)
    run_scp('root@{0}:{1}/log/*.log {2}'.format(device_host, data_dir,
                                                app_log_dir),
            password=LOGS_SSH_PASSWORD,
            throw=False)
    #run_scp('root@{0}:/opt/app/diaspora/diaspora/log/*.log {1}'.format(device_host, app_log_dir),
    #        password=LOGS_SSH_PASSWORD, throw=False)

    print('systemd logs')
    run_ssh(device_host, 'journalctl | tail -200', password=LOGS_SSH_PASSWORD)
Beispiel #14
0
def module_teardown(device_host):
    platform_log_dir = join(LOG_DIR, 'platform_log')
    os.mkdir(platform_log_dir)
    run_scp('root@{0}:/opt/data/platform/log/* {1}'.format(device_host, platform_log_dir), password=LOGS_SSH_PASSWORD, throw=False)

    run_scp('root@{0}:/var/log/sam.log {1}'.format(device_host, platform_log_dir), password=LOGS_SSH_PASSWORD, throw=False)

    print('systemd logs')
    run_ssh(device_host, 'journalctl | tail -200', password=LOGS_SSH_PASSWORD, throw=False)

    app_log_dir = join(LOG_DIR, 'owncloud_log')
    os.mkdir(app_log_dir)
    run_scp('root@{0}:/opt/data/owncloud/log/*.log {1}'.format(device_host, app_log_dir), password=LOGS_SSH_PASSWORD, throw=False)
Beispiel #15
0
def module_teardown(device_host):
    platform_log_dir = join(LOG_DIR, 'platform_log')
    os.mkdir(platform_log_dir)
    run_scp('root@{0}:/opt/data/platform/log/* {1}'.format(
        device_host, platform_log_dir),
            password=LOGS_SSH_PASSWORD)

    run_scp('root@{0}:/var/log/sam.log {1}'.format(device_host,
                                                   platform_log_dir),
            password=LOGS_SSH_PASSWORD)

    print('systemd logs')
    run_ssh(device_host, 'journalctl | tail -200', password=LOGS_SSH_PASSWORD)

    app_log_dir = join(LOG_DIR, 'owncloud_log')
    os.mkdir(app_log_dir)
    run_scp('root@{0}:/opt/data/owncloud/log/*.log {1}'.format(
        device_host, app_log_dir),
            password=LOGS_SSH_PASSWORD)
Beispiel #16
0
def __local_install(app_archive_path, device_host):
    run_scp('{0} root@{1}:/app.tar.gz'.format(app_archive_path, device_host), password=DEVICE_PASSWORD)
    run_ssh(device_host, '/opt/app/sam/bin/sam --debug install /app.tar.gz', password=DEVICE_PASSWORD)
    time.sleep(3)
Beispiel #17
0
def __local_install(auth):
    email, password, domain, release, version, arch = auth
    run_scp('{0}/../owncloud-{1}-{2}.tar.gz root@localhost:/'.format(DIR, version, arch), password=DEVICE_PASSWORD)
    run_ssh('/opt/app/sam/bin/sam --debug install /owncloud-{0}-{1}.tar.gz'.format(version, arch), password=DEVICE_PASSWORD)
    set_docker_ssh_port(DEVICE_PASSWORD)
    time.sleep(3)