def test_get_filtered_list_with_input_list_ALL(self, *args): pids = [ c.pid for c in get_containers(ignore_raw_containers=False, user_list='ALL')] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(DOCKER_IDS + ['4'])
def test_get_filtered_list(self, *args): pids = [c.pid for c in get_containers(ignore_raw_containers=False)] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(DOCKER_IDS + ['4']) assert '1' not in pids # init process assert '5' not in pids # crawler process
def test_get_filtered_list_with_input_list_ALL(self, *args): pids = [ c.pid for c in get_containers(ignore_raw_containers=False, user_list='ALL') ] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(DOCKER_IDS + ['4'])
def test_get_filtered_list_with_input_list(self, *args): pids = [ c.pid for c in get_containers(ignore_raw_containers=False, user_list='102')] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(['102']) assert '3' not in pids # filtered container assert '4' not in pids # filtered container assert '1' not in pids # init process assert '5' not in pids # crawler process
def crawl(self, ignore_plugin_exception=True): """ Crawls all containers. :param ignore_plugin_exception: just ignore exceptions in a plugin :return: a list generator of Frame objects """ containers_list = get_containers( user_list=self.user_list, host_namespace=self.host_namespace) for container in containers_list: yield self.crawl_container(container, ignore_plugin_exception)
def test_get_filtered_list_with_input_list(self, *args): pids = [ c.pid for c in get_containers(ignore_raw_containers=False, user_list='102') ] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(['102']) assert '3' not in pids # filtered container assert '4' not in pids # filtered container assert '1' not in pids # init process assert '5' not in pids # crawler process
def update_containers_list(self): """ Actually poll for new containers. This updates the list of new and deleted containers, in self.new and self.deleted. :return: None """ curr_containers = set( get_containers(environment=self.environment, user_list=self.user_list, host_namespace=self.host_namespace)) self.new = curr_containers - self.containers_list self.deleted = self.containers_list - curr_containers self.containers_list = curr_containers
def test_get_filtered_list_non_default_env(self, *args): opts = {'environment': 'alchemy', 'docker_containers_list': 'ALL', 'partition_strategy': {'name': 'equally_by_pid', 'args': {'process_id': 0, 'num_processes': 1}}} pids = [c.pid for c in get_containers(opts)] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(DOCKER_IDS) # only docker containers are returned in non-cloudsight environments # (see the 'alchemy' above) assert '4' not in pids
def update_containers_list(self): """ Actually poll for new containers. This updates the list of new and deleted containers, in self.new and self.deleted. :return: None """ curr_containers = set( get_containers( environment=self.environment, user_list=self.user_list, host_namespace=self.host_namespace)) self.new = curr_containers - self.containers_list self.deleted = self.containers_list - curr_containers self.containers_list = curr_containers
def test_get_filtered_list_non_default_env(self, *args): opts = { 'environment': 'alchemy', 'docker_containers_list': 'ALL', 'partition_strategy': { 'name': 'equally_by_pid', 'args': { 'process_id': 0, 'num_processes': 1 } } } pids = [c.pid for c in get_containers(opts)] # pid 1 is the init process, which is not a container # according to the definition in container.py assert set(pids) == set(DOCKER_IDS) # only docker containers are returned in non-cloudsight environments # (see the 'alchemy' above) assert '4' not in pids
def listino(csv_file, images_folder): containers = get_containers(csv_file, images_folder) return _html(containers)