'Test our ability to walk over a registry tree.'

def testRecursiveRegistryListing(self):

    pathspec = rdf_paths.PathSpec(pathtype=rdf_paths.PathSpec.PathType.REGISTRY)
    walk_tups_0 = list(vfs.VFSOpen(pathspec).RecursiveListNames())
    walk_tups_1 = list(vfs.VFSOpen(pathspec).RecursiveListNames(depth=1))
    walk_tups_2 = list(vfs.VFSOpen(pathspec).RecursiveListNames(depth=2))
    walk_tups_inf = list(vfs.VFSOpen(pathspec).RecursiveListNames(depth=float('inf')))
    self.assertEqual(walk_tups_0, [('', ['HKEY_LOCAL_MACHINE', 'HKEY_USERS'], [])])
    self.assertEqual(walk_tups_1, [('', ['HKEY_LOCAL_MACHINE', 'HKEY_USERS'], []), ('HKEY_LOCAL_MACHINE', ['SOFTWARE', 'SYSTEM'], []), ('HKEY_USERS', ['S-1-5-20', 'S-1-5-21-702227000-2140022111-3110739999-1990'], [])])
    self.assertEqual(walk_tups_2, [('', ['HKEY_LOCAL_MACHINE', 'HKEY_USERS'], []), ('HKEY_LOCAL_MACHINE', ['SOFTWARE', 'SYSTEM'], []), ('HKEY_LOCAL_MACHINE\\SOFTWARE', ['ListingTest', 'Microsoft'], []), ('HKEY_LOCAL_MACHINE\\SYSTEM', ['CurrentControlSet', 'Select'], []), ('HKEY_USERS', ['S-1-5-20', 'S-1-5-21-702227000-2140022111-3110739999-1990'], []), ('HKEY_USERS\\S-1-5-20', ['Software'], []), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990', ['Software'], [])])
    self.assertEqual(walk_tups_inf, [('', ['HKEY_LOCAL_MACHINE', 'HKEY_USERS'], []), ('HKEY_LOCAL_MACHINE', ['SOFTWARE', 'SYSTEM'], []), ('HKEY_LOCAL_MACHINE\\SOFTWARE', ['ListingTest', 'Microsoft'], []), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\ListingTest', [], ['Value1', 'Value2']), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft', ['Windows', 'Windows    NT'], []), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows', ['CurrentVersion'], []), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion', [], ['ProgramFilesDir', 'ProgramFilesDir    (x86)']), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows    NT', ['CurrentVersion'], []), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows    NT\\CurrentVersion', ['ProfileList'], ['SystemRoot']), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows    NT\\CurrentVersion\\ProfileList', ['S-1-5-21-702227000-2140022111-3110739999-1990', 'S-1-5-21-702227068-2140022151-3110739409-1000'], ['ProfilesDirectory', 'ProgramData']), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows    NT\\CurrentVersion\\ProfileList\\S-1-5-21-702227000-2140022111-3110739999-1990', [], ['ProfileImagePath']), ('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows    NT\\CurrentVersion\\ProfileList\\S-1-5-21-702227068-2140022151-3110739409-1000', [], ['ProfileImagePath']), ('HKEY_LOCAL_MACHINE\\SYSTEM', ['CurrentControlSet', 'Select'], []), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet', ['Control'], []), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control', ['Nls', 'Session    Manager', 'TimeZoneInformation'], []), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls', ['CodePage'], []), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage', [], ['ACP']), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session    Manager', ['Environment'], []), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session    Manager\\Environment', [], ['Path', 'TEMP', 'windir']), ('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation', [], ['StandardName']), ('HKEY_LOCAL_MACHINE\\SYSTEM\\Select', [], ['Current']), ('HKEY_USERS', ['S-1-5-20', 'S-1-5-21-702227000-2140022111-3110739999-1990'], []), ('HKEY_USERS\\S-1-5-20', ['Software'], []), ('HKEY_USERS\\S-1-5-20\\Software', ['Microsoft'], []), ('HKEY_USERS\\S-1-5-20\\Software\\Microsoft', ['Windows'], []), ('HKEY_USERS\\S-1-5-20\\Software\\Microsoft\\Windows', ['CurrentVersion'], []), ('HKEY_USERS\\S-1-5-20\\Software\\Microsoft\\Windows\\CurrentVersion', ['Run'], []), ('HKEY_USERS\\S-1-5-20\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', [], ['MctAdmin', 'Sidebar']), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990', ['Software'], []), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990\\Software', ['Microsoft'], []), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990\\Software\\Microsoft', ['Windows'], []), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990\\Software\\Microsoft\\Windows', ['CurrentVersion'], []), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990\\Software\\Microsoft\\Windows\\CurrentVersion', ['Run'], []), ('HKEY_USERS\\S-1-5-21-702227000-2140022111-3110739999-1990\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', [], ['NothingToSeeHere'])])
