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
import os
-import utils as util
+import utils
def make_fname(ubman, basename):
"""Make a temporary filename
"""
fit = make_fname(ubman, basename)
its = make_its(ubman, base_its, params)
- util.run_and_log(ubman, [mkimage, '-f', its, fit])
+ utils.run_and_log(ubman, [mkimage, '-f', its, fit])
if base_fdt:
with open(make_fname(ubman, 'u-boot.dts'), 'w') as fd:
fd.write(base_fdt)
dtb = make_fname(ubman, f'{basename}.dtb')
with open(src, 'w', encoding='utf-8') as outf:
outf.write(base_fdt)
- util.run_and_log(ubman, ['dtc', src, '-O', 'dtb', '-o', dtb])
+ utils.run_and_log(ubman, ['dtc', src, '-O', 'dtb', '-o', dtb])
return dtb
"""
import pytest
-import utils as util
# defauld mmc id
mmc_dev = 1
import os.path
import pytest
-import utils as util
+import utils
# Define the parametrized ITS data to be used for FIT images generation.
ITS_DATA = '''
"""
bin_path = make_fpath(fname)
- util.run_and_log(cons,
- ['cp', make_fpath('lib/efi_loader/helloworld.efi'),
- bin_path])
+ utils.run_and_log(cons,
+ ['cp', make_fpath('lib/efi_loader/helloworld.efi'),
+ bin_path])
if comp:
- util.run_and_log(cons, ['gzip', '-f', bin_path])
+ utils.run_and_log(cons, ['gzip', '-f', bin_path])
bin_path += '.gz'
return bin_path
# Build the test FDT.
dtb = make_fpath('test-efi-fit-%s.dtb' % fdt_type)
- util.run_and_log(cons, ['dtc', '-I', 'dts', '-O', 'dtb', '-o', dtb, dts])
+ utils.run_and_log(cons,
+ ['dtc', '-I', 'dts', '-O', 'dtb', '-o', dtb, dts])
if comp:
- util.run_and_log(cons, ['gzip', '-f', dtb])
+ utils.run_and_log(cons, ['gzip', '-f', dtb])
dtb += '.gz'
return dtb
# Build the test ITS.
fit_path = make_fpath('test-efi-fit-helloworld.fit')
- util.run_and_log(
+ utils.run_and_log(
cons, [make_fpath('tools/mkimage'), '-f', its_path, fit_path])
return fit_path
addr = fit.get('addr', None)
if not addr:
- addr = util.find_ram_base(cons)
+ addr = utils.find_ram_base(cons)
output = cons.run_command(
'host load hostfs - %x %s/%s' % (addr, fit['dn'], fit['fn']))
addr = fit.get('addr', None)
if not addr:
- addr = util.find_ram_base(cons)
+ addr = utils.find_ram_base(cons)
file_name = fit['fn']
output = cons.run_command('tftpboot %x %s' % (addr, file_name))
# Copy image to TFTP root directory.
if fit['dn'] != cons.config.build_dir:
- util.run_and_log(cons, ['mv', '-f', fit_path, '%s/' % fit['dn']])
+ utils.run_and_log(cons,
+ ['mv', '-f', fit_path, '%s/' % fit['dn']])
# Load FIT image.
addr = load_fit_from_host(fit) if is_sandbox else load_fit_from_tftp(fit)
import pytest
import re
-import utils as util
+import utils
# This is only a partial test - coverting 64-bit sandbox. It does not test
# big-endian images, nor 32-bit images
"""Test that the "help" command can be executed."""
cons = ubman
sandbox = cons.config.build_dir + '/u-boot'
- out = util.run_and_log(cons, ['scripts/event_dump.py', sandbox])
+ out = utils.run_and_log(cons, ['scripts/event_dump.py', sandbox])
expect = '''.*Event type Id Source location
-------------------- ------------------------------ ------------------------------
EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*boot/vbe_request.c:.*
import os
import pytest
import struct
-import utils as util
+import utils
import fit_util
# Define a base ITS which we can adjust using % and a dictionary
return fname
def make_compressed(filename):
- util.run_and_log(cons, ['gzip', '-f', '-k', filename])
+ utils.run_and_log(cons, ['gzip', '-f', '-k', filename])
return filename + '.gz'
def find_matching(text, match):
import os
import pytest
-import utils as util
+import utils
import binascii
from Cryptodome.Hash import SHA1
from Cryptodome.Hash import SHA256
self.confgs_nodes = set()
def __fdt_list(self, path):
- return util.run_and_log(self.cons,
+ return utils.run_and_log(self.cons,
f'fdtget -l {self.fit} {path}')
def __fdt_get_string(self, node, prop):
- return util.run_and_log(self.cons,
+ return utils.run_and_log(self.cons,
f'fdtget -ts {self.fit} {node} {prop}')
def __fdt_get_binary(self, node, prop):
- numbers = util.run_and_log(self.cons,
+ numbers = utils.run_and_log(self.cons,
f'fdtget -tbi {self.fit} {node} {prop}')
bignum = bytearray()
s_args = " -k" + tempdir + " -g" + key_name + " -o" + sign_algo
# 1 - Create auto FIT with images crc32 checksum, and verify it
- util.run_and_log(cons, mkimage + ' -fauto' + b_args + " " + fit_file)
+ utils.run_and_log(cons, mkimage + ' -fauto' + b_args + " " + fit_file)
fit = SignedFitHelper(cons, fit_file)
if fit.build_nodes_sets() == 0:
fit.check_fit_crc32_images()
# 2 - Create auto FIT with signed images, and verify it
- util.run_and_log(cons, mkimage + ' -fauto' + b_args + s_args + " " +
- fit_file)
+ utils.run_and_log(cons, mkimage + ' -fauto' + b_args + s_args + " " +
+ fit_file)
fit = SignedFitHelper(cons, fit_file)
if fit.build_nodes_sets() == 0:
fit.check_fit_signed_images(key_name, sign_algo, verifier)
# 3 - Create auto FIT with signed configs and hashed images, and verify it
- util.run_and_log(cons, mkimage + ' -fauto-conf' + b_args + s_args + " " +
- fit_file)
+ utils.run_and_log(cons, mkimage + ' -fauto-conf' + b_args + s_args + " " +
+ fit_file)
fit = SignedFitHelper(cons, fit_file)
if fit.build_nodes_sets() == 0:
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
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():
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:
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'
import os
import pytest
-import utils as util
+import utils
kernel_hashes = {
"sha512" : "f18c1486a2c29f56360301576cdfce4dfd8e8e932d0ed8e239a1f314b8ae1d77b2a58cd7fe32e4075e69448e623ce53b0b6aa6ce5626d2c189a5beae29a68d93",
self.hashable_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_get(self, node, prop):
- val = util.run_and_log(self.cons, f'fdtget {self.fit} {node} {prop}')
+ val = utils.run_and_log(self.cons, f'fdtget {self.fit} {node} {prop}')
return val.rstrip('\n')
def __fdt_get_sexadecimal(self, node, prop):
- numbers = util.run_and_log(self.cons, f'fdtget -tbx {self.fit} {node} {prop}')
+ numbers = utils.run_and_log(self.cons,
+ f'fdtget -tbx {self.fit} {node} {prop}')
sexadecimal = ''
for num in numbers.rstrip('\n').split(' '):
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'
import re
from subprocess import call, check_call, check_output, CalledProcessError
from fstest_defs import *
-import utils as util
# pylint: disable=E0611
from tests import fs_helper
import pytest
-import utils as util
+import utils
# This is needed for Azure, since the default '..' directory is not writeable
TMPDIR = '/tmp/test_kconfig'
cons = ubman
# This detects build errors in test/lib/kconfig.c
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox',
'-a', 'TEST_KCONFIG', '-o', TMPDIR], ignore_errors=True)
assert 'invalid_use_of_IF_ENABLED_INT' in out
cons = ubman
# This detects build errors in test/lib/kconfig_spl.c
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox_spl',
'-a', 'TEST_KCONFIG', '-o', TMPDIR], ignore_errors=True)
assert 'invalid_use_of_IF_ENABLED_INT' in out
import os
import pytest
-import utils as util
+import utils
# This is needed for Azure, since the default '..' directory is not writeable
TMPDIR1 = '/tmp/test_no_migrate'
dt_dir = os.path.join(build_dir, 'arch', 'sandbox', 'dts')
orig_fname = os.path.join(dt_dir, 'sandbox.dtb')
out_dts = os.path.join(dt_dir, 'sandbox_out.dts')
- util.run_and_log(cons, ['dtc', orig_fname, '-I', 'dtb', '-O', 'dts',
- '-o', out_dts])
+ utils.run_and_log(cons, ['dtc', orig_fname, '-I', 'dtb', '-O', 'dts',
+ '-o', out_dts])
# Update it to use an old tag
with open(out_dts) as inf:
with open(dts_fname, 'w') as outf:
print(data, file=outf)
dtb_fname = os.path.join(dt_dir, 'sandbox_oldtag.dtb')
- util.run_and_log(cons, ['dtc', dts_fname, '-o', dtb_fname])
+ utils.run_and_log(cons, ['dtc', dts_fname, '-o', dtb_fname])
migrate = ['-a', '~CONFIG_OF_TAG_MIGRATE'] if disable_migrate else []
env['EXT_DTB'] = dtb_fname
env['DEVICE_TREE'] = 'sandbox_new'
env['NO_LTO'] = '1' # Speed up build
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, ['./tools/buildman/buildman', '-m', '--board', board,
*migrate, '-w', '-o', tmpdir], ignore_errors=True, env=env)
return out
# It should fail to run, since the lcd device will not be bound before
# relocation. so won't get its frame-buffer memory
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, [os.path.join(TMPDIR1, 'u-boot'), '-D', '-c', 'help'],
ignore_errors=True)
assert "Video device 'lcd' cannot allocate frame buffer memory" in out
'sandbox', TMPDIR3, disable_migrate=False)
# It should show a migration message
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, [os.path.join(TMPDIR3, 'u-boot'), '-D', '-c', 'help'],
ignore_errors=True)
assert "Warning: Device tree includes old 'u-boot,dm-' tags" in out
# Copyright (c) 2016 Google, Inc
import pytest
-import utils as util
+import utils
@pytest.mark.boardspec('sandbox_spl')
@pytest.mark.buildconfigspec('spl_of_platdata')
cons = ubman
dtb = cons.config.build_dir + '/spl/u-boot-spl.dtb'
fdtgrep = cons.config.build_dir + '/tools/fdtgrep'
- output = util.run_and_log(cons, [fdtgrep, '-l', dtb])
+ output = utils.run_and_log(cons, [fdtgrep, '-l', dtb])
assert "bootph-all" not in output
assert "bootph-some-ram" not in output
"""
import pytest
-import utils as util
+import utils
@pytest.mark.buildconfigspec('cmd_optee_rpmb')
def test_optee_rpmb_read_write(ubman):
import pytest
-import utils as util
+import utils
# This is needed for Azure, since the default '..' directory is not writeable
TMPDIR = '/tmp/test_cmdline'
"""Test building sandbox without CONFIG_CMDLINE"""
cons = ubman
- out = util.run_and_log(
+ utils.run_and_log(
cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox',
'-a', '~CMDLINE', '-o', TMPDIR])
"""Test building sandbox without CONFIG_LTO"""
cons = ubman
- out = util.run_and_log(
+ utils.run_and_log(
cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox',
'-a', '~LTO', '-o', TMPDIR])
"""
import pytest
-import utils as util
+import utils
@pytest.mark.buildconfigspec('cmd_scp03')
def test_scp03(ubman):
import os
import pytest
-import utils as util
+import utils
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_echo')
mkimage = os.path.join(cons.config.build_dir, 'tools/mkimage')
its = os.path.join(cons.config.source_dir, 'test/py/tests/source.its')
fit = os.path.join(cons.config.build_dir, 'source.itb')
- util.run_and_log(cons, (mkimage, '-f', its, fit))
+ utils.run_and_log(cons, (mkimage, '-f', its, fit))
cons.run_command(f'host load hostfs - $loadaddr {fit}')
assert '2' in cons.run_command('source')
import pytest
import re
-import utils as util
+import utils
# This is needed for Azure, since the default '..' directory is not writeable
TMPDIR = '/tmp/test_trace'
map_fname (str): Filename of System.map
trace_dat (str): Filename of output file
"""
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, [proftool, '-t', fname, '-o', trace_dat, '-m', map_fname,
'dump-ftrace'])
# Check that trace-cmd can read it
- out = util.run_and_log(cons, ['trace-cmd', 'dump', trace_dat])
+ out = utils.run_and_log(cons, ['trace-cmd', 'dump', trace_dat])
# Tracing meta data in file /tmp/test_trace/trace.dat:
# [Initial format]
# Check that the trace has something useful
cmd = f"trace-cmd report -l {trace_dat} |grep -E '(initf_|initr_)'"
- out = util.run_and_log(cons, ['sh', '-c', cmd])
+ out = utils.run_and_log(cons, ['sh', '-c', cmd])
# Format:
# u-boot-1 0..... 60.805596: function: initf_malloc
"""
# Generate the funcgraph format
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, [proftool, '-t', fname, '-o', trace_dat, '-m', map_fname,
'dump-ftrace', '-f', 'funcgraph'])
# Check that the trace has what we expect
cmd = f'trace-cmd report -l {trace_dat} |head -n 70'
- out = util.run_and_log(cons, ['sh', '-c', cmd])
+ out = utils.run_and_log(cons, ['sh', '-c', cmd])
# First look for this:
# u-boot-1 0..... 282.101360: funcgraph_entry: 0.004 us | initf_malloc();
# Now look for initf_dm() and dm_timer_init() so we can check the bootstage
# time
cmd = f"trace-cmd report -l {trace_dat} |grep -E '(initf_dm|dm_timer_init)'"
- out = util.run_and_log(cons, ['sh', '-c', cmd])
+ out = utils.run_and_log(cons, ['sh', '-c', cmd])
start_timestamp = None
end_timestamp = None
"""
# Generate the flamegraph format
- out = util.run_and_log(
+ out = utils.run_and_log(
cons, [proftool, '-t', fname, '-o', trace_fg, '-m', map_fname,
'dump-flamegraph'])
assert found == 2
# Generate the timing graph
- out = util.run_and_log(
+ utils.run_and_log(
cons, [proftool, '-t', fname, '-o', trace_fg, '-m', map_fname,
'dump-flamegraph', '-f', 'timing'])
import shutil
import struct
import pytest
-import utils as util
+import utils
import vboot_forge
import vboot_evil
dtb: Resulting DTB file.
"""
dtb = dts.replace('.dts', '.dtb')
- util.run_and_log(cons, 'dtc %s %s%s -O dtb '
- '-o %s%s' % (dtc_args, datadir, dts, tmpdir, dtb))
+ utils.run_and_log(cons, 'dtc %s %s%s -O dtb '
+ '-o %s%s' % (dtc_args, datadir, dts, tmpdir, dtb))
def make_fit(its, cons, mkimage, dtc_args, datadir, fit):
"""Make a new FIT from the .its source file.
datadir: Path to data directory.
fit: Resulting FIT file.
"""
- util.run_and_log(cons, [mkimage, '-D', dtc_args, '-f',
- '%s%s' % (datadir, its), fit])
+ utils.run_and_log(cons, [mkimage, '-D', dtc_args, '-f',
+ '%s%s' % (datadir, its), fit])
# Only run the full suite on a few combinations, since it doesn't add any more
# test coverage.
options: Options provided to the compiler.
"""
dtb = dts.replace('.dts', '.dtb')
- util.run_and_log(cons, 'dtc %s %s%s -O dtb '
- '-o %s%s %s' % (dtc_args, datadir, dts, tmpdir, dtb, options))
+ utils.run_and_log(cons, 'dtc %s %s%s -O dtb -o %s%s %s' %
+ (dtc_args, datadir, dts, tmpdir, dtb, options))
def run_binman(dtb):
"""Run binman to build an image
"""
pythonpath = os.environ.get('PYTHONPATH', '')
os.environ['PYTHONPATH'] = pythonpath + ':' + '%s/../scripts/dtc/pylibfdt' % tmpdir
- util.run_and_log(cons, [binman, 'build', '-d', "%s/%s" % (tmpdir,dtb),
- '-a', "pre-load-key-path=%s" % tmpdir, '-O',
- tmpdir, '-I', tmpdir])
+ utils.run_and_log(cons, [binman, 'build', '-d', "%s/%s" % (tmpdir,dtb),
+ '-a', "pre-load-key-path=%s" % tmpdir, '-O',
+ tmpdir, '-I', tmpdir])
os.environ['PYTHONPATH'] = pythonpath
def run_bootm(sha_algo, test_type, expect_string, boots, fit=None):
if options:
args += options.split(' ')
cons.log.action('%s: Sign images' % sha_algo)
- util.run_and_log(cons, args)
+ utils.run_and_log(cons, args)
def sign_fit_dtb(sha_algo, options, dtb):
"""Sign the FIT
if options:
args += options.split(' ')
cons.log.action('%s: Sign images' % sha_algo)
- util.run_and_log(cons, args)
+ utils.run_and_log(cons, args)
def sign_fit_norequire(sha_algo, options):
"""Sign the FIT
if options:
args += options.split(' ')
cons.log.action('%s: Sign images' % sha_algo)
- util.run_and_log(cons, args)
+ utils.run_and_log(cons, args)
def replace_fit_totalsize(size):
"""Replace FIT header's totalsize with something greater.
else:
rsa_keygen_bits = 2048
- util.run_and_log(cons, 'openssl genpkey -algorithm RSA -out %s%s.key '
+ utils.run_and_log(cons, 'openssl genpkey -algorithm RSA -out %s%s.key '
'-pkeyopt rsa_keygen_bits:%d '
'-pkeyopt rsa_keygen_pubexp:%d' %
(tmpdir, name, rsa_keygen_bits, public_exponent))
# Create a certificate containing the public key
- util.run_and_log(cons, 'openssl req -batch -new -x509 -key %s%s.key '
- '-out %s%s.crt' % (tmpdir, name, tmpdir, name))
+ utils.run_and_log(cons, 'openssl req -batch -new -x509 -key %s%s.key '
+ '-out %s%s.crt' % (tmpdir, name, tmpdir, name))
def test_with_algo(sha_algo, padding, sign_options):
"""Test verified boot with the given hash algorithm.
cons.log.action('%s: Check signed config on the host' % sha_algo)
- util.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', dtb])
+ utils.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', dtb])
if full_test:
# Make sure that U-Boot checks that the config is in the list of
root, strblock = vboot_forge.manipulate(root, strblock)
with open(ffit, 'w+b') as fd:
vboot_forge.write_fdt(root, strblock, fd)
- util.run_and_log_expect_exception(
+ utils.run_and_log_expect_exception(
cons, [fit_check_sign, '-f', ffit, '-k', dtb],
1, 'Failed to verify required signature')
shutil.copyfile(fit, efit)
vboot_evil.add_evil_node(fit, efit, evil_kernel, 'fakeroot')
- util.run_and_log_expect_exception(
+ utils.run_and_log_expect_exception(
cons, [fit_check_sign, '-f', efit, '-k', dtb],
1, 'Failed to verify required signature')
run_bootm(sha_algo, 'evil fakeroot', 'Bad FIT kernel image format',
vboot_evil.add_evil_node(fit, efit, evil_kernel, 'kernel@')
msg = 'Signature checking prevents use of unit addresses (@) in nodes'
- util.run_and_log_expect_exception(
+ utils.run_and_log_expect_exception(
cons, [fit_check_sign, '-f', efit, '-k', dtb],
1, msg)
run_bootm(sha_algo, 'evil kernel@', msg, False, efit)
cons.log.action('%s: Check default FIT header totalsize' % sha_algo)
# Increment the first byte of the signature, which should cause failure
- sig = util.run_and_log(cons, 'fdtget -t bx %s %s value' %
- (fit, sig_node))
+ sig = utils.run_and_log(cons, 'fdtget -t bx %s %s value' %
+ (fit, sig_node))
byte_list = sig.split()
byte = int(byte_list[0], 16)
byte_list[0] = '%x' % (byte + 1)
sig = ' '.join(byte_list)
- util.run_and_log(cons, 'fdtput -t bx %s %s value %s' %
- (fit, sig_node, sig))
+ utils.run_and_log(cons, 'fdtput -t bx %s %s value %s' %
+ (fit, sig_node, sig))
run_bootm(sha_algo, 'Signed config with bad hash', 'Bad Data Hash',
False)
cons.log.action('%s: Check bad config on the host' % sha_algo)
- util.run_and_log_expect_exception(
+ utils.run_and_log_expect_exception(
cons, [fit_check_sign, '-f', fit, '-k', dtb],
1, 'Failed to verify required signature')
# a dev signature only (sign_fit() overwrites the FIT).
# Try to boot the FIT with dev key. This FIT should be accepted by
# U-Boot because the dev key is required and policy is "any" required key.
- util.run_and_log(cons, 'fdtput -t s %s /signature required-mode any' %
- (dtb))
+ utils.run_and_log(cons, 'fdtput -t s %s /signature required-mode any' %
+ dtb)
run_bootm(sha_algo, 'multi required key', 'dev+', True)
# Set the required-mode policy to "all".
# a dev signature only (sign_fit() overwrites the FIT).
# Try to boot the FIT with dev key. This FIT should not be accepted by
# U-Boot because the prod key is required and policy is "all" required key
- util.run_and_log(cons, 'fdtput -t s %s /signature required-mode all' %
- (dtb))
+ utils.run_and_log(cons, 'fdtput -t s %s /signature required-mode all' %
+ dtb)
run_bootm(sha_algo, 'multi required key', '', False)
def test_global_sign(sha_algo, padding, sign_options):
if options:
args += options.split(' ')
cons.log.action('%s: Sign images' % sha_algo)
- util.run_and_log(cons, args)
+ utils.run_and_log(cons, args)
def test_add_pubkey(sha_algo, padding, sign_options):
"""Test fdt_add_pubkey utility with given hash algorithm and padding.
cons.log.action('%s: Test fdt_add_pubkey with signed configuration' % sha_algo)
# Then add the dev key via the fdt_add_pubkey tool
- util.run_and_log(cons, [fdt_add_pubkey, '-a', '%s,%s' % ('sha256' if algo_arg else sha_algo, \
- 'rsa3072' if sha_algo == 'sha384' else 'rsa2048'),
- '-k', tmpdir, '-n', 'dev', '-r', 'conf', dtb])
+ utils.run_and_log(cons,
+ [fdt_add_pubkey, '-a', '%s,%s' %
+ ('sha256' if algo_arg else sha_algo,
+ 'rsa3072' if sha_algo == 'sha384' else 'rsa2048'),
+ '-k', tmpdir, '-n', 'dev', '-r', 'conf', dtb])
make_fit('sign-configs-%s%s.its' % (sha_algo, padding), cons, mkimage, dtc_args, datadir, fit)
sign_fit(sha_algo, sign_options)
# Check with fit_check_sign that FIT is signed with key
- util.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', dtb])
+ utils.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', dtb])
cons = ubman
tmpdir = os.path.join(cons.config.result_dir, name) + '/'