'Test the basic ExecuteBinaryCommand action.'

def testExecuteBinary(self):

    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))
