def clean_manager(self, label=None, clean_tag=False): docl.clean(label=[self.env_label] + list((label or []))) if clean_tag: tag = 'integration-tests/{0}'.format(self.env_id) try: logger.info('Removing container image {0}'.format(tag)) docl.remove_image(tag=tag) except sh.ErrorReturnCode: logger.warn( 'Failed removing container image {0}. This most likely ' 'means the image never got created in the first place'. format(tag))
def tearDown(self): self.logger.info('Removing leftover test containers') docl.clean(label=['marker=test', self.env.env_label]) super(BaseAgentTestCase, self).tearDown()
def destroy(self): logger.info('Destroying test environment...') os.environ.pop('CFY_WORKDIR', None) docl.clean(label=[self.env_label]) self.delete_working_directory()
def destroy(self): logger.info('Destroying test environment...') os.environ.pop('CFY_WORKDIR', None) docl.clean(label=[self.env_label]) self.delete_working_directory()