'Test that the client iterator works.'

def testIteratedDirectoryListing(self):

    with vfs_test_lib.VFSOverrider(rdf_paths.PathSpec.PathType.OS, MockVFSHandler):
        path = '/'
        client_mock = action_mocks.ActionMock(standard.IteratedListDirectory)
        for _ in flow_test_lib.TestFlowHelper(filesystem.IteratedListDirectory.__name__, client_mock, client_id=self.client_id, pathspec=rdf_paths.PathSpec(path='/', pathtype=rdf_paths.PathSpec.PathType.OS), token=self.token):
            pass
        fd = aff4.FACTORY.Open(self.client_id.Add('fs/os').Add(path), token=self.token)
        directory = [ch for ch in fd.OpenChildren()]
        pb = rdf_paths.PathSpec(path=path, pathtype=rdf_paths.PathSpec.PathType.OS)
        directory2 = list(vfs.VFSOpen(pb).ListFiles())
        directory.sort()
        result = [x.Get(x.Schema.STAT) for x in directory]
        for (x, y) in zip(result, directory2):
            self.assertEqual(x.st_mode, y.st_mode)
            self.assertRDFValuesEqual(x, y)
