Exemplo n.º 1
0
 def testCorrectlyConvertsExecutableURN(self):
     self.assertEqual(
         signed_binary_utils.SignedBinaryIDFromURN(
             rdfvalue.RDFURN("aff4:/config/executables/foo")),
         rdf_objects.SignedBinaryID(
             binary_type=rdf_objects.SignedBinaryID.BinaryType.EXECUTABLE,
             path="foo"))
Exemplo n.º 2
0
 def testCorrectlyConvertsPythonHackURN(self):
     self.assertEqual(
         signed_binary_utils.SignedBinaryIDFromURN(
             rdfvalue.RDFURN("aff4:/config/python_hacks/foo")),
         rdf_objects.SignedBinaryID(
             binary_type=rdf_objects.SignedBinaryID.BinaryType.PYTHON_HACK,
             path="foo"))
Exemplo n.º 3
0
    def Start(self):
        """The start method."""
        if not self.args.binary:
            raise flow_base.FlowError("Please specify a binary.")

        binary_urn = rdfvalue.RDFURN(self.args.binary)
        self.state.write_path = "%d_%s" % (time.time(), binary_urn.Basename())

        self.StartBlobsUpload(
            signed_binary_utils.SignedBinaryIDFromURN(binary_urn),
            self.End.__name__)
Exemplo n.º 4
0
 def testRaisesWhenNeitherPythonHackNorExecutableURNIsPassed(self):
     with self.assertRaises(ValueError):
         signed_binary_utils.SignedBinaryIDFromURN(
             rdfvalue.RDFURN("aff4:/foo/bar"))