'Test ** expressions with root_path.'

def testGlobWithStarStarRootPath(self):

    client = aff4.FACTORY.Open(self.client_id, mode='rw', token=self.token)
    kb = client.Get(client.Schema.KNOWLEDGE_BASE)
    kb.MergeOrAddUser(rdf_client.User(username='test'))
    kb.MergeOrAddUser(rdf_client.User(username='syslog'))
    client.Set(kb)
    client.Close()
    client_mock = action_mocks.GlobClientMock()
    path = os.path.join('foo**4')
    root_path = rdf_paths.PathSpec(path=os.path.join(self.base_path, 'test_img.dd'), pathtype=rdf_paths.PathSpec.PathType.OS)
    root_path.Append(path='/', pathtype=rdf_paths.PathSpec.PathType.TSK)
    for _ in flow_test_lib.TestFlowHelper(filesystem.Glob.__name__, client_mock, client_id=self.client_id, paths=[path], root_path=root_path, pathtype=rdf_paths.PathSpec.PathType.OS, token=self.token):
        pass
    output_path = self.client_id.Add('fs/tsk').Add(self.base_path.replace('\\', '/')).Add('test_img.dd/glob_test/a/b')
    children = []
    fd = aff4.FACTORY.Open(output_path, token=self.token)
    for child in fd.ListChildren():
        children.append(child.Basename())
    self.assertEqual(children, ['foo'])
