public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/8] test/py: add various utility code
Date: Fri, 22 Jan 2016 09:49:23 -0700	[thread overview]
Message-ID: <56A25D93.70500@wwwdotorg.org> (raw)
In-Reply-To: <CAPnjgZ1pm_durLqBkYtQoY_iXmC94wAq=fpjukVOp=DpYc3HwQ@mail.gmail.com>

On 01/21/2016 08:36 PM, Simon Glass wrote:
> Hi Stephen,
>
> On 20 January 2016 at 15:15, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Add various common utility functions. These will be used by a forthcoming
>> re-written UMS test, and a brand-new DFU test.

>> diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py

>> +def md5sum_data(data):
>> +    '''Calculate the MD5 hash of some data.
>> +
>> +    Args:
>> +        data: The data to hash.
>> +
>> +    Returns:
>> +        The hash of the data, as a binary string.
>> +    '''
>> +
>> +    h = hashlib.md5()
>> +    h.update(data)
>> +    return h.digest()
>
> Or just:
>
>     return hashlib.md5().update(data).digest()

I was going to do that, but it doesn't look like update() returns the 
hash object, so I can't chain at least the .digest() call together, so I 
may as well leave it as-is.

  parent reply	other threads:[~2016-01-22 16:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 22:15 [U-Boot] [PATCH 1/8] test/py: fix timeout to be absolute Stephen Warren
2016-01-20 22:15 ` [U-Boot] [PATCH 2/8] test/py: move U-Boot respawn trigger to the test core Stephen Warren
2016-01-22  3:35   ` Simon Glass
2016-01-20 22:15 ` [U-Boot] [PATCH 3/8] test/py: drain console log at the end of any failed test Stephen Warren
2016-01-22  3:36   ` Simon Glass
2016-01-20 22:15 ` [U-Boot] [PATCH 4/8] test/py: log when tests send CTRL-C Stephen Warren
2016-01-22  3:36   ` Simon Glass
2016-01-20 22:15 ` [U-Boot] [PATCH 5/8] test/py: optionally ignore errors from shell commands Stephen Warren
2016-01-22  3:36   ` Simon Glass
2016-01-20 22:15 ` [U-Boot] [PATCH 6/8] test/py: add various utility code Stephen Warren
2016-01-22  3:36   ` Simon Glass
2016-01-22 16:45     ` Stephen Warren
2016-01-22 16:49     ` Stephen Warren [this message]
2016-01-20 22:15 ` [U-Boot] [PATCH 7/8] test/py: ums: add filesystem-based testing Stephen Warren
2016-01-21 11:26   ` Lukasz Majewski
2016-01-22  3:36     ` Simon Glass
2016-01-20 22:15 ` [U-Boot] [PATCH 8/8] test/py: add DFU test Stephen Warren
2016-01-21 10:50   ` Lukasz Majewski
2016-01-21 18:17     ` Stephen Warren
2016-01-22  3:36       ` Simon Glass
2016-01-21  9:40 ` [U-Boot] [PATCH 1/8] test/py: fix timeout to be absolute Lukasz Majewski
2016-01-22  3:35 ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A25D93.70500@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox