forked from OERV-BSP/u-boot
test/py: Drop importing utils as util
Now that we have a shorter name, we don't need this sort of thing. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android
This commit is contained in:
@@ -12,7 +12,7 @@ This test doesn't run the sandbox. It only checks the host tool 'mkimage'
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import utils as util
|
||||
import utils
|
||||
from Cryptodome.Hash import SHA256
|
||||
from Cryptodome.PublicKey import ECC
|
||||
from Cryptodome.Signature import DSS
|
||||
@@ -25,14 +25,16 @@ class SignableFitImage(object):
|
||||
self.signable_nodes = set()
|
||||
|
||||
def __fdt_list(self, path):
|
||||
return util.run_and_log(self.cons, f'fdtget -l {self.fit} {path}')
|
||||
return utils.run_and_log(self.cons, f'fdtget -l {self.fit} {path}')
|
||||
|
||||
def __fdt_set(self, node, **prop_value):
|
||||
for prop, value in prop_value.items():
|
||||
util.run_and_log(self.cons, f'fdtput -ts {self.fit} {node} {prop} {value}')
|
||||
utils.run_and_log(self.cons,
|
||||
f'fdtput -ts {self.fit} {node} {prop} {value}')
|
||||
|
||||
def __fdt_get_binary(self, node, prop):
|
||||
numbers = util.run_and_log(self.cons, f'fdtget -tbi {self.fit} {node} {prop}')
|
||||
numbers = utils.run_and_log(self.cons,
|
||||
f'fdtget -tbi {self.fit} {node} {prop}')
|
||||
|
||||
bignum = bytearray()
|
||||
for little_num in numbers.split():
|
||||
@@ -53,7 +55,7 @@ class SignableFitImage(object):
|
||||
self.__fdt_set(f'{image}/signature', algo='sha256,ecdsa256')
|
||||
|
||||
def sign(self, mkimage, key_file):
|
||||
util.run_and_log(self.cons, [mkimage, '-F', self.fit, f'-G{key_file}'])
|
||||
utils.run_and_log(self.cons, [mkimage, '-F', self.fit, f'-G{key_file}'])
|
||||
|
||||
def check_signatures(self, key):
|
||||
for image in self.signable_nodes:
|
||||
@@ -76,11 +78,11 @@ def test_fit_ecdsa(ubman):
|
||||
|
||||
def assemble_fit_image(dest_fit, its, destdir):
|
||||
dtc_args = f'-I dts -O dtb -i {destdir}'
|
||||
util.run_and_log(cons, [mkimage, '-D', dtc_args, '-f', its, dest_fit])
|
||||
utils.run_and_log(cons, [mkimage, '-D', dtc_args, '-f', its, dest_fit])
|
||||
|
||||
def dtc(dts):
|
||||
dtb = dts.replace('.dts', '.dtb')
|
||||
util.run_and_log(cons, f'dtc {datadir}/{dts} -O dtb -o {tempdir}/{dtb}')
|
||||
utils.run_and_log(cons, f'dtc {datadir}/{dts} -O dtb -o {tempdir}/{dtb}')
|
||||
|
||||
cons = ubman
|
||||
mkimage = cons.config.build_dir + '/tools/mkimage'
|
||||
|
||||
Reference in New Issue
Block a user