def testOSXLaunchdPlistParser(self): parser = osx_file_parser.OSXLaunchdPlistParser() plists = ["com.google.code.grr.plist", "com.google.code.grr.bplist"] results = [] for plist in plists: path = os.path.join(self.base_path, "parser_test", plist) plist_file = open(path, "rb") pathspec = rdf_paths.PathSpec.OS(path=path) results.extend(list(parser.ParseFile(None, pathspec, plist_file))) for result in results: self.assertEqual(result.Label, "com.google.code.grr") self.assertCountEqual(result.ProgramArguments, [ "/usr/lib/grr/grr_3.0.0.5_amd64/grr", "--config=/usr/lib/grr/grr_3.0.0.5_amd64/grr.yaml" ])
def testOSXLaunchdPlistParser(self): parser = osx_file_parser.OSXLaunchdPlistParser() plists = ["com.google.code.grr.plist", "com.google.code.grr.bplist"] results = [] for plist in plists: path = os.path.join(self.base_path, "parser_test", plist) plist_file = open(path, "rb") stat = rdf_client_fs.StatEntry(pathspec=rdf_paths.PathSpec( path=path, pathtype=rdf_paths.PathSpec.PathType.OS), st_mode=16877) results.extend(list(parser.Parse(stat, plist_file, None))) for result in results: self.assertEqual(result.Label, "com.google.code.grr") self.assertCountEqual(result.ProgramArguments, [ "/usr/lib/grr/grr_3.0.0.5_amd64/grr", "--config=/usr/lib/grr/grr_3.0.0.5_amd64/grr.yaml" ])