Exemple #1
0
 def _RunQuery(self, plist_file="test.plist", query="", context=""):
     path = os.path.join(self.base_path, plist_file)
     pathspec = rdf_paths.PathSpec(path=path,
                                   pathtype=rdf_paths.PathSpec.PathType.OS)
     plistrequest = rdf_plist.PlistRequest()
     plistrequest.query = query
     plistrequest.context = context
     plistrequest.pathspec = pathspec
     return self.RunAction(plist.PlistQuery, plistrequest)
Exemple #2
0
    def _RunFlow(self, flow, context=None, query=None, output=None):
        client_mock = action_mocks.ActionMock("PlistQuery")
        request = rdf_plist.PlistRequest(context=context, query=query)
        request.pathspec.path = os.path.join(self.base_path, "test.plist")
        request.pathspec.pathtype = rdf_paths.PathSpec.PathType.OS

        for _ in test_lib.TestFlowHelper(flow,
                                         client_mock,
                                         client_id=self.client_id,
                                         token=self.token,
                                         request=request,
                                         output=output):
            pass
Exemple #3
0
    def _RunFlow(self, flow_name, context=None, query=None):
        client_mock = action_mocks.ActionMock(plist.PlistQuery)
        request = rdf_plist.PlistRequest(context=context, query=query)
        request.pathspec.path = os.path.join(self.base_path, "test.plist")
        request.pathspec.pathtype = rdf_paths.PathSpec.PathType.OS

        for s in flow_test_lib.TestFlowHelper(flow_name,
                                              client_mock,
                                              client_id=self.client_id,
                                              token=self.token,
                                              request=request):
            session_id = s

        return session_id