Esempio n. 1
0
    def testExecuteBinary(self):
        """Test the basic ExecuteBinaryCommand action."""
        signed_blob = rdf_crypto.SignedBlob()
        signed_blob.Sign(open("/bin/ls", "rb").read(), self.signing_key)

        request = rdf_client.ExecuteBinaryRequest(executable=signed_blob,
                                                  args=[__file__],
                                                  write_path="ablob")

        result = self.RunAction(standard.ExecuteBinaryCommand, request)[0]

        self.assertTrue(result.time_used > 0)
        self.assertTrue(__file__ in result.stdout)
Esempio n. 2
0
  def testExecuteBinary(self):
    """Test the basic ExecuteBinaryCommand action."""
    signed_blob = rdf_crypto.SignedBlob()
    signed_blob.Sign(open("/bin/ls", "rb").read(), self.signing_key)

    writefile = utils.Join(self.temp_dir, "binexecute", "ablob")
    os.makedirs(os.path.dirname(writefile))
    request = rdf_client.ExecuteBinaryRequest(
        executable=signed_blob, args=[__file__], write_path=writefile)

    result = self.RunAction(standard.ExecuteBinaryCommand, request)[0]

    self.assertTrue(result.time_used > 0)
    self.assertTrue(__file__ in result.stdout)