Esempio n. 1
0
def clean_devauth_db():
    yield
    r = docker.exec(
        "mender-mongo",
        docker.BASE_COMPOSE_FILES,
        "mongo",
        "deviceauth",
        "--eval",
        "db.dropDatabase()",
    )
    assert r.returncode == 0, r.stderr
Esempio n. 2
0
def single_user():
    r = docker.exec('mender-useradm', \
                    docker.BASE_COMPOSE_FILES, \
                    '/usr/bin/useradm', \
                    'create-user', \
                    '--username' , '*****@*****.**',\
                    '--password' , 'youcantguess')

    assert r.returncode == 0, r.stderr
    yield
    clean_useradm_db()
Esempio n. 3
0
def clean_deployments_db():
    yield
    r = docker.exec('mender-mongo-deployments', \
                    docker.BASE_COMPOSE_FILES, \
                    'mongo', 'deployment_service', '--eval', 'db.dropDatabase()')
Esempio n. 4
0
def clean_useradm_db():
    r = docker.exec('mender-mongo', \
                    docker.BASE_COMPOSE_FILES, \
                    'mongo', 'useradm', '--eval', 'db.dropDatabase()')

    assert r.returncode == 0, r.stderr
#!/usr/bin/env python
""" This is a testinfra for ansible program. """
import docker as obj

obj.before_exec()
obj.exec()
obj.after_exec()
Esempio n. 6
0
def clean_deployments_db():
    yield
    r = docker.exec('mender-mongo', \
                    docker.BASE_COMPOSE_FILES, \
                    'mongo', 'deployment_service', '--eval', 'db.dropDatabase()')
    assert r.returncode == 0, r.stderr