def GetClientTestTargets(client_ids=None, hostnames=None, token=None, checkin_duration_threshold='20m'):
 if client_ids:
  client_ids = set(client_ids)
 else:
  client_ids = set(config_lib.CONFIG.Get('Test.end_to_end_client_ids'))
 if hostnames:
  hosts = set(hostnames)
 else:
  hosts = set(config_lib.CONFIG.Get('Test.end_to_end_client_hostnames'))
 if hosts:
  client_id_dict = client_index.GetClientURNsForHostnames(hosts, token=token)
  for client_list in client_id_dict.values():
   client_ids.update(client_list)
 client_id_set = set([rdf_client.ClientURN(x) for x in client_ids])
 duration_threshold = rdfvalue.Duration(checkin_duration_threshold)
 for client in aff4.FACTORY.MultiOpen(client_id_set, token=token):
  if ((rdfvalue.RDFDatetime.Now() - client.Get(client.Schema.LAST)) > duration_threshold):
   client_id_set.remove(client.urn)
 return client_id_set

def GetClientTestTargets ( client_ids = None , hostnames = None , token = None , checkin_duration_threshold = '20m' ) : if client_ids : client_ids = set ( client_ids ) else : client_ids = set ( config_lib . CONFIG . Get ( 'Test.end_to_end_client_ids' ) ) if hostnames : hosts = set ( hostnames ) else : hosts = set ( config_lib . CONFIG . Get ( 'Test.end_to_end_client_hostnames' ) ) if hosts : client_id_dict = client_index . GetClientURNsForHostnames ( hosts , token = token ) for client_list in client_id_dict . values ( ) : client_ids . update ( client_list ) client_id_set = set ( [ rdf_client . ClientURN ( x ) for x in client_ids ] ) duration_threshold = rdfvalue . Duration ( checkin_duration_threshold ) for client in aff4 . FACTORY . MultiOpen ( client_id_set , token = token ) : if ( ( rdfvalue . RDFDatetime . Now ( ) - client . Get ( client . Schema . LAST ) ) > duration_threshold ) : client_id_set . remove ( client . urn ) return client_id_set
get client urns for end-to-end tests .