]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Correct the error message for a bad hash algorithm
authorSimon Glass <sjg@chromium.org>
Tue, 8 Feb 2022 17:59:44 +0000 (10:59 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Feb 2022 17:05:44 +0000 (10:05 -0700)
This shows an internal type at present, rather than the algorithm name.
Fix it and update the test to catch this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
tools/binman/ftest.py
tools/binman/state.py

index f8e73c6f9bf9f66fcce11ea6041ef412808e00e2..4616a29deb6896e9ad63054ad0d0f375773a39e0 100644 (file)
@@ -2076,7 +2076,7 @@ class TestFunctional(unittest.TestCase):
     def testHashBadAlgo(self):
         with self.assertRaises(ValueError) as e:
             self._DoReadFileDtb('092_hash_bad_algo.dts', update_dtb=True)
-        self.assertIn("Node '/binman/u-boot': Unknown hash algorithm",
+        self.assertIn("Node '/binman/u-boot': Unknown hash algorithm 'invalid'",
                       str(e.exception))
 
     def testHashSection(self):
index 8cd8a48318235bd6ded015a5360829b447ba6c44..a302e1f00ebe7c4922679c9df5d49dcedfe39a70 100644 (file)
@@ -397,7 +397,7 @@ def CheckAddHashProp(node):
         if algo.value == 'sha256':
             size = 32
         else:
-            return "Unknown hash algorithm '%s'" % algo
+            return "Unknown hash algorithm '%s'" % algo.value
         for n in GetUpdateNodes(hash_node):
             n.AddEmptyProp('value', size)