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
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()
def clean_deployments_db(): yield r = docker.exec('mender-mongo-deployments', \ docker.BASE_COMPOSE_FILES, \ 'mongo', 'deployment_service', '--eval', 'db.dropDatabase()')
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()
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