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"))
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"))
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__)
def testRaisesWhenNeitherPythonHackNorExecutableURNIsPassed(self): with self.assertRaises(ValueError): signed_binary_utils.SignedBinaryIDFromURN( rdfvalue.RDFURN("aff4:/foo/bar"))