示例#1
0
文件: yara_test.py 项目: syth3/grr
  def testBlobIsMarkedAsYaraSignature(self):
    args = api_yara.ApiUploadYaraSignatureArgs()
    args.signature = "rule foo { condition: false };"

    blob_id = self.handler.Handle(args, token=self.token).blob_id

    self.assertTrue(data_store.REL_DB.VerifyYaraSignatureReference(blob_id))
示例#2
0
    def testSignatureIsUploadedToBlobStore(self):
        signature = "rule foo { condition: true };"

        args = api_yara.ApiUploadYaraSignatureArgs()
        args.signature = signature

        blob_id = self.handler.Handle(args, context=self.context).blob_id
        blob = data_store.BLOBS.ReadBlob(blob_id)

        self.assertEqual(blob.decode("utf-8"), signature)