def run_drone_demo(command): plugins = list_plugins() base_image = 'tfoote/drone_demo' desired_plugins = ['nvidia', 'pulse', 'user', 'home', 'x11'] active_extensions = [e() for e in plugins.values() if e.get_name() in desired_plugins] pull_image(base_image) dig = DockerImageGenerator(active_extensions, {}, base_image) if dig.build() != 0: print ("Failed to build") sys.exit(1) if dig.run(command) != 0: print ("Failed to run") sys.exit(1)
def test_pull_image(self): TEST_IMAGE = 'alpine:latest' docker_client = get_docker_client() l = docker_client.images() tags = set( chain.from_iterable([i['RepoTags'] for i in l if i['RepoTags']])) print(tags) if TEST_IMAGE in tags: docker_client.remove_image(TEST_IMAGE) print('removed image %s' % TEST_IMAGE) self.assertTrue(pull_image(TEST_IMAGE))
def test_failed_pull_image(self): self.assertFalse(pull_image("osrf/ros:does_not_exist"))