'This tests running the hunt on some clients.'

def testGenericHuntWithoutOutputPlugins(self):

    hunt_urn = self.StartHunt()
    self.AssignTasksToClients()
    self.RunHunt()
    self.StopHunt(hunt_urn)
    self.ProcessHuntOutputPlugins()
    with aff4.FACTORY.Open(hunt_urn, age=aff4.ALL_TIMES, token=self.token) as hunt_obj:
        (started, finished, errors) = hunt_obj.GetClientsCounts()
        self.assertEqual(started, 10)
        self.assertEqual(finished, 10)
        self.assertEqual(errors, 5)
        collection = implementation.GRRHunt.ResultCollectionForHID(hunt_urn, token=self.token)
        i = 0
        for (i, x) in enumerate(collection):
            self.assertEqual(x.payload.__class__, rdf_client.StatEntry)
            self.assertEqual(x.payload.AFF4Path(x.source).Split(2)[(-1)], 'fs/os/tmp/evil.txt')
        self.assertEqual(i, 4)
        per_type_collection = implementation.GRRHunt.TypedResultCollectionForHID(hunt_urn, token=self.token)
        for (i, x) in enumerate(per_type_collection):
            self.assertEqual(x.payload.__class__, rdf_client.StatEntry)
            self.assertEqual(x.payload.AFF4Path(x.source).Split(2)[(-1)], 'fs/os/tmp/evil.txt')
        self.assertListEqual(per_type_collection.ListStoredTypes(), [rdf_client.StatEntry.__name__])
