diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2025-01-07 16:15:14 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-11 18:35:01 +0000 |
| commit | e223f6635a0b767111c96896a154c2ee249eb243 (patch) | |
| tree | 5a205556414728f0ebf5cc7bad39c5402e9e657f /bitbake/lib/bb | |
| parent | f00e8e1233e773d495413ea31000b88f67eb61ba (diff) | |
| download | poky-e223f6635a0b767111c96896a154c2ee249eb243.tar.gz | |
bitbake: tests: utils: add test for Go mod h1 checksum
Add a basic test for the goh1_file function.
(Bitbake rev: 3dc4d28a9eed962876c148dbe69d9f521bf42287)
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/tests/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/utils.py b/bitbake/lib/bb/tests/utils.py index c363f62d7d..48e61dfcea 100644 --- a/bitbake/lib/bb/tests/utils.py +++ b/bitbake/lib/bb/tests/utils.py | |||
| @@ -130,6 +130,14 @@ class Checksum(unittest.TestCase): | |||
| 130 | checksum = bb.utils.sha256_file(f.name) | 130 | checksum = bb.utils.sha256_file(f.name) |
| 131 | self.assertEqual(checksum, "fcfbae8bf6b721dbb9d2dc6a9334a58f2031a9a9b302999243f99da4d7f12d0f") | 131 | self.assertEqual(checksum, "fcfbae8bf6b721dbb9d2dc6a9334a58f2031a9a9b302999243f99da4d7f12d0f") |
| 132 | 132 | ||
| 133 | def test_goh1(self): | ||
| 134 | import hashlib | ||
| 135 | with tempfile.NamedTemporaryFile() as f: | ||
| 136 | f.write(self.filler) | ||
| 137 | f.flush() | ||
| 138 | checksum = bb.utils.goh1_file(f.name) | ||
| 139 | self.assertEqual(checksum, "81191f04d4abf413e5badd234814e4202d9efa73e6f9437e9ddd6b8165b569ef") | ||
| 140 | |||
| 133 | class EditMetadataFile(unittest.TestCase): | 141 | class EditMetadataFile(unittest.TestCase): |
| 134 | _origfile = """ | 142 | _origfile = """ |
| 135 | # A comment | 143 | # A comment |
