Exemplo n.º 1
0
def container(request, salt_root):
    obj = ContainerFactory(
        config__image=request.config.getini('MINION_IMAGE') or request.config.getini('IMAGE'),
        config__salt_config=None,
        ssh_config={'user': '******', 'password': '******'})
    obj.run('zypper --non-interactive rm salt')  # Remove salt from the image!!
    request.addfinalizer(obj.remove)
    return obj
Exemplo n.º 2
0
def container(request, salt_root):
    obj = ContainerFactory(config__image=request.config.getini('MINION_IMAGE')
                           or request.config.getini('IMAGE'),
                           config__salt_config=None,
                           ssh_config={
                               'user': '******',
                               'password': '******'
                           })
    obj.run('zypper --non-interactive rm salt')  # Remove salt from the image!!
    request.addfinalizer(obj.remove)
    return obj
Exemplo n.º 3
0
def sshdcontainer(request, salt_root):
    fake = Faker()
    obj = ContainerFactory(
        config__name='ssdcontainer_{0}_{1}_{2}'.format(
            fake.word(), fake.word(), os.environ.get('ST_JOB_ID', '')),  # pylint: disable=no-member
        config__image=request.config.getini('MINION_IMAGE')
        or request.config.getini('IMAGE'),
        config__salt_config=None,
        ssh_config={
            'user': '******',
            'password': '******',
            'port': 22
        })
    obj.run('zypper --non-interactive rm salt')  # Remove salt from the image!!

    request.addfinalizer(obj.remove)
    return obj
Exemplo n.º 4
0
def sshdcontainer(request, salt_root, docker_client):
    obj = ContainerFactory(config__docker_client=docker_client,
                           config__image=request.config.getini('MINION_IMAGE')
                           or request.config.getini('IMAGE'),
                           config__salt_config=None)

    obj.run('ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -q -N ""')
    obj.run('ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -q -N ""')
    obj.run('ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -q -N ""')
    obj.run('./tests/scripts/chpasswd.sh {}:{}'.format(USER, PASSWORD))
    obj.run('/usr/sbin/sshd -p 2222')
    obj.run('zypper --non-interactive rm salt')  # Remove salt from the image!!

    request.addfinalizer(obj.remove)
    return obj