From patchwork Fri Feb 11 20:23:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591816 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=WPyF9Fe0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ7b5nmnz9s8q for ; Sat, 12 Feb 2022 07:24:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1806383A81; Fri, 11 Feb 2022 21:23:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="WPyF9Fe0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 66C4383BBD; Fri, 11 Feb 2022 21:23:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_FILL_THIS_FORM_SHORT,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1505083B7D for ; Fri, 11 Feb 2022 21:23:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id h7so12825581iof.3 for ; Fri, 11 Feb 2022 12:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3SaIv77ffWKyK2sAfuTz+JZdjSpDlcD31ntYBm0RigI=; b=WPyF9Fe0WcgvoQXNcfAoqAs2JLcpPjTj5CVt9BqqNFrxLAbr0jl/Aadnngf4a4RaTI uyyyPiQj+PPuA+Iyj7FshCIHfPIKy/EBgmDeSgNUNs1EKn6iJnpmvH99z9KFdxK+9mSZ YNGDyqIrnxESYGB62oyjyzaOnYIwFI+x82/AY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3SaIv77ffWKyK2sAfuTz+JZdjSpDlcD31ntYBm0RigI=; b=iX9rlq9hPQl1GXP9zE4p40nWyzodbawuCJpglFcqWdRf79EwR0ITx4agSji1XIzCJc +OELe38Hu4Ff3oWboCZFD0g2P3xSSxVNlP4zKJYVprAUVD5QMNuvND+svO5KC5T09y9X baG+mea222CWyHZcPuBw172bmwwF1gZvSWiKoOzj9Od2IGyP7/cdXFiJ6w1lkNmcbkgX OczCMy+EoeMcHgpDzqNzQ3SGjTL0ruJRPkNVe4llf+1OWgSysN9P8hmqgTIG8Q+rMi8g N488fP0FodeLZZvGC80S/C1+VW4b7zrqfn5OBUwpgjvA1Qz7YGQ70zIee+KpHpkuuKC+ Ow2A== X-Gm-Message-State: AOAM5311P0q+0IpMLTB27sQSuqjrjIAHmgtR72DfQEi+fjqV/H0Ssluj 0rutv6/qKm8s8FsQ2ABvjc0TycskzjbA6A== X-Google-Smtp-Source: ABdhPJxRBHqv7jeaXS0SpvG8n7ih8SDN7URoIjZgADwgHVrah2pMVnR33GjG0Zjv0RWjm/yyUZkizw== X-Received: by 2002:a6b:4417:: with SMTP id r23mr1713722ioa.23.1644611014498; Fri, 11 Feb 2022 12:23:34 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:34 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass Subject: [PATCH 1/9] patman: Correct pylint errors Date: Fri, 11 Feb 2022 13:23:18 -0700 Message-Id: <20220211202327.851395-2-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass --- doc/develop/python_cq.rst | 11 +++++++++++ tools/concurrencytest/__init__.py | 0 tools/patman/checkpatch.py | 4 +++- tools/patman/command.py | 8 +------- tools/patman/commit.py | 2 +- tools/patman/cros_subprocess.py | 18 ++++-------------- tools/patman/func_test.py | 10 ++++++++++ tools/patman/patchstream.py | 2 +- tools/patman/series.py | 3 +-- tools/patman/settings.py | 4 ++-- tools/patman/tools.py | 10 +++++----- 11 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 tools/concurrencytest/__init__.py diff --git a/doc/develop/python_cq.rst b/doc/develop/python_cq.rst index 3f99f1d9c0..1e209ff197 100644 --- a/doc/develop/python_cq.rst +++ b/doc/develop/python_cq.rst @@ -77,4 +77,15 @@ If the pylint version is updated in CI, this may result in needing to regenerate `scripts/pylint.base`. +Checking for errors +------------------- + +If you only want to check for pylint errors, use:: + + PYTHONPATH=/path/to/scripts/dtc/pylibfdt/ make pylint_err + +This will show only pylint errors. Note that you must set PYTHONPATH to point +to the pylibfdt directory build by U-Boot (typically the sandbox_spl board). If +you have used `make qcheck` then it sill be in `board-sandbox_spl`. + .. _`PEP 8`: https://www.python.org/dev/peps/pep-0008/ diff --git a/tools/concurrencytest/__init__.py b/tools/concurrencytest/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py index dd792efee0..70ba561c26 100644 --- a/tools/patman/checkpatch.py +++ b/tools/patman/checkpatch.py @@ -125,7 +125,7 @@ def check_patch_parse(checkpatch_output, verbose=False): Returns: namedtuple containing: ok: False=failure, True=ok - problems: List of problems, each a dict: + problems (list of problems): each a dict: 'type'; error or warning 'msg': text message 'file' : filename @@ -252,6 +252,8 @@ def check_patches(verbose, args): if (len(result.problems) != result.errors + result.warnings + result.checks): print("Internal error: some problems lost") + # Python seems to get confused by this + # pylint: disable=E1133 for item in result.problems: sys.stderr.write( get_warning_msg(col, item.get('type', ''), diff --git a/tools/patman/command.py b/tools/patman/command.py index 24358784f2..92c453b5c1 100644 --- a/tools/patman/command.py +++ b/tools/patman/command.py @@ -17,13 +17,6 @@ class CommandResult: return_code: Return code from command exception: Exception received, or None if all ok """ - def __init__(self): - self.stdout = None - self.stderr = None - self.combined = None - self.return_code = None - self.exception = None - def __init__(self, stdout='', stderr='', combined='', return_code=0, exception=None): self.stdout = stdout @@ -72,6 +65,7 @@ def run_pipe(pipe_list, infile=None, outfile=None, """ if test_result: if hasattr(test_result, '__call__'): + # pylint: disable=E1102 result = test_result(pipe_list=pipe_list) if result: return result diff --git a/tools/patman/commit.py b/tools/patman/commit.py index c331a3b122..a645b22d08 100644 --- a/tools/patman/commit.py +++ b/tools/patman/commit.py @@ -31,7 +31,7 @@ class Commit: """ def __init__(self, hash): self.hash = hash - self.subject = None + self.subject = '' self.tags = [] self.changes = {} self.cc_list = [] diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py index f1b26087cf..cd614f38a6 100644 --- a/tools/patman/cros_subprocess.py +++ b/tools/patman/cros_subprocess.py @@ -113,7 +113,7 @@ class Popen(subprocess.Popen): return b'' return data - def communicate_filter(self, output): + def communicate_filter(self, output, input_buf=''): """Interact with process: Read data from stdout and stderr. This method runs until end-of-file is reached, then waits for the @@ -166,7 +166,7 @@ class Popen(subprocess.Popen): # Flush stdio buffer. This might block, if the user has # been writing to .stdin in an uncontrolled fashion. self.stdin.flush() - if input: + if input_buf: write_set.append(self.stdin) else: self.stdin.close() @@ -195,10 +195,10 @@ class Popen(subprocess.Popen): # When select has indicated that the file is writable, # we can write up to PIPE_BUF bytes without risk # blocking. POSIX defines PIPE_BUF >= 512 - chunk = input[input_offset : input_offset + 512] + chunk = input_buf[input_offset : input_offset + 512] bytes_written = os.write(self.stdin.fileno(), chunk) input_offset += bytes_written - if input_offset >= len(input): + if input_offset >= len(input_buf): self.stdin.close() write_set.remove(self.stdin) @@ -240,16 +240,6 @@ class Popen(subprocess.Popen): stderr = self.convert_data(stderr) combined = self.convert_data(combined) - # Translate newlines, if requested. We cannot let the file - # object do the translation: It is based on stdio, which is - # impossible to combine with select (unless forcing no - # buffering). - if self.universal_newlines and hasattr(file, 'newlines'): - if stdout: - stdout = self._translate_newlines(stdout) - if stderr: - stderr = self._translate_newlines(stderr) - self.wait() return (stdout, stderr, combined) diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 59ee90c344..7b92bc67be 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -341,6 +341,8 @@ Changes in v2: tools.write_file(path, text, binary=False) index = self.repo.index index.add(fname) + # pylint doesn't seem to find this + # pylint: disable=E1101 author = pygit2.Signature('Test user', 'test@email.com') committer = author tree = index.write_tree() @@ -363,6 +365,8 @@ Changes in v2: self.repo = repo new_tree = repo.TreeBuilder().write() + # pylint doesn't seem to find this + # pylint: disable=E1101 author = pygit2.Signature('Test user', 'test@email.com') committer = author _ = repo.create_commit('HEAD', author, committer, 'Created master', @@ -414,6 +418,8 @@ better than before''') first_target = repo.revparse_single('HEAD') target = repo.revparse_single('HEAD~2') + # pylint doesn't seem to find this + # pylint: disable=E1101 repo.reset(target.oid, pygit2.GIT_CHECKOUT_FORCE) self.make_commit_with_file('video: Some video improvements', ''' Fix up the video so that @@ -459,6 +465,8 @@ complicated as possible''') """Test creating patches from a branch""" repo = self.make_git_tree() target = repo.lookup_reference('refs/heads/first') + # pylint doesn't seem to find this + # pylint: disable=E1101 self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE) control.setup() try: @@ -615,6 +623,8 @@ diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c """Test CountCommitsToBranch when there is no upstream""" repo = self.make_git_tree() target = repo.lookup_reference('refs/heads/base') + # pylint doesn't seem to find this + # pylint: disable=E1101 self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE) # Check that it can detect the current branch diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 9b32fd4790..fb6a6036f3 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -597,7 +597,7 @@ class PatchStream: if 'prefix' in self.series: parts.append(self.series['prefix']) if 'postfix' in self.series: - parts.append(self.serties['postfix']) + parts.append(self.series['postfix']) if 'version' in self.series: parts.append("v%s" % self.series['version']) diff --git a/tools/patman/series.py b/tools/patman/series.py index 891f278534..3075378ac1 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -122,8 +122,7 @@ class Series(dict): cc_list = list(self._generated_cc[commit.patch]) for email in sorted(set(cc_list) - to_set - cc_set): if email == None: - email = col.build(col.YELLOW, "" - % tag) + email = col.build(col.YELLOW, '') if email: print(' Cc: ', email) print diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 014bb376d8..7c2b5c196c 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -200,12 +200,12 @@ def CreatePatmanConfigFile(gitutil, config_fname): """ name = gitutil.get_default_user_name() if name == None: - name = raw_input("Enter name: ") + name = input("Enter name: ") email = gitutil.get_default_user_email() if email == None: - email = raw_input("Enter email: ") + email = input("Enter email: ") try: f = open(config_fname, 'w') diff --git a/tools/patman/tools.py b/tools/patman/tools.py index 5e4d4ac05c..2ac814d476 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -62,8 +62,8 @@ def prepare_output_dir(dirname, preserve=False): try: os.makedirs(outdir) except OSError as err: - raise CmdError("Cannot make output directory '%s': '%s'" % - (outdir, err.strerror)) + raise ValueError( + f"Cannot make output directory 'outdir': 'err.strerror'") tout.debug("Using output directory '%s'" % outdir) else: outdir = tempfile.mkdtemp(prefix='binman.') @@ -160,7 +160,7 @@ def get_input_filename_glob(pattern): A list of matching files in all input directories """ if not indir: - return glob.glob(fname) + return glob.glob(pattern) files = [] for dirname in indir: pathname = os.path.join(dirname, pattern) @@ -201,7 +201,7 @@ def path_has_file(path_spec, fname): return True return False -def get_host_compile_tool(name): +def get_host_compile_tool(env, name): """Get the host-specific version for a compile tool This checks the environment variables that specify which version of @@ -356,7 +356,7 @@ def run_result(name, *args, **kwargs): name, extra_args = get_target_compile_tool(name) args = tuple(extra_args) + args elif for_host: - name, extra_args = get_host_compile_tool(name) + name, extra_args = get_host_compile_tool(env, name) args = tuple(extra_args) + args name = os.path.expanduser(name) # Expand paths containing ~ all_args = (name,) + args From patchwork Fri Feb 11 20:23:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591814 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=BRy1bois; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ7F0nT4z9s8q for ; Sat, 12 Feb 2022 07:23:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4886B83BBD; Fri, 11 Feb 2022 21:23:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BRy1bois"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CC1CE83B95; Fri, 11 Feb 2022 21:23:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B11AE83B9A for ; Fri, 11 Feb 2022 21:23:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x134.google.com with SMTP id k18so1258617ils.11 for ; Fri, 11 Feb 2022 12:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tEiOG24fh4Ew4kHs3rxSFmMjp6Pz/DkWT5a77Xdnbhw=; b=BRy1boistNkk5tly6WYfjwvIYl42YrjCjQ38Em2eoAdmOEdgsl+rB5ym8LRyga9AK6 t7SVYIE7WLCzVWuzDbFp0RqDPTsCbuR1oXhNWtkVGe/rKA5NWh+bi0vc5iHhi9lFYJ++ cBfcraiZRwn8zwhMyHbInRQnoovBLV/z6+G4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tEiOG24fh4Ew4kHs3rxSFmMjp6Pz/DkWT5a77Xdnbhw=; b=OW4WQIGOIhGT/eovSWoXDfXQ1FlBH3IfGwbEPEqm0s8seaGrYPj1AuIQNc42QLHY7m SF0pAfFnwdgIaQ56kheK3zFRKm7SWmCFgrwPr/2SggRcxRJHapbyFjb72gOmtDztHqIb 0tExy4EqCMRrjEud/c9F3sXOsNjYKl/PDqqf3Wtk3Ae4ulSsh1ywnCMvgx7YaeEKJjKx Tkf+7gu2dW1MDmw/6EZeE24DNbe41tuT9YH8I0KisLaW1mIt2Eqh83nfaAYyr0X6Nt/3 sTBRlsxH1xUo7zggRFfj/XvN9ttQFM1shnSd0N/SxLC7Tg63DkTiqxJifuJGRT6pn99Z Zcyw== X-Gm-Message-State: AOAM531HAFJ48orubSqKh/RUgbDzbG6VQ+ffgisxy3xzNuCmhVrNg2DE ZgjXdsqLUlZYa4zehyuvlDLBnjaDGQ0l1A== X-Google-Smtp-Source: ABdhPJxri1snxCn2MX+4CWPqPOSUkTPETnpwaTkEhcwb+cDBoOBIC0aXvKRmw0bfkBhkMCxJhgH9aw== X-Received: by 2002:a92:d109:: with SMTP id a9mr1807995ilb.167.1644611015285; Fri, 11 Feb 2022 12:23:35 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:35 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass Subject: [PATCH 2/9] buildman: Correct pylint errors Date: Fri, 11 Feb 2022 13:23:19 -0700 Message-Id: <20220211202327.851395-3-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass --- tools/buildman/builder.py | 2 +- tools/buildman/cfgutil.py | 6 +++--- tools/buildman/func_test.py | 6 ------ tools/buildman/kconfiglib.py | 1 + tools/buildman/main.py | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 754642d4a6..ecbfa3e361 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1763,7 +1763,7 @@ class Builder: if self.num_threads: self.queue.put(job) else: - results = self._single_builder.RunJob(job) + self._single_builder.RunJob(job) if self.num_threads: term = threading.Thread(target=self.queue.join) diff --git a/tools/buildman/cfgutil.py b/tools/buildman/cfgutil.py index 4eba50868f..ab74a8ef06 100644 --- a/tools/buildman/cfgutil.py +++ b/tools/buildman/cfgutil.py @@ -123,10 +123,10 @@ def adjust_cfg_file(fname, adjust_cfg): C=val to set the value of C (val must have quotes if C is a string Kconfig) """ - lines = tools.ReadFile(fname, binary=False).splitlines() + lines = tools.read_file(fname, binary=False).splitlines() out_lines = adjust_cfg_lines(lines, adjust_cfg) out = '\n'.join(out_lines) + '\n' - tools.WriteFile(fname, out, binary=False) + tools.write_file(fname, out, binary=False) def convert_list_to_dict(adjust_cfg_list): """Convert a list of config changes into the dict used by adjust_cfg_file() @@ -219,7 +219,7 @@ def check_cfg_file(fname, adjust_cfg): Returns: str: None if OK, else an error string listing the problems """ - lines = tools.ReadFile(fname, binary=False).splitlines() + lines = tools.read_file(fname, binary=False).splitlines() bad_cfgs = check_cfg_lines(lines, adjust_cfg) if bad_cfgs: out = [f'{cfg:20} {line}' for cfg, line in bad_cfgs] diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 6fcceb0ea5..fbf6706644 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -524,12 +524,6 @@ class TestFunctional(unittest.TestCase): # Each commit has a config and make self.assertEqual(self._make_calls, len(boards) * self._commits * 2) - def testForceReconfigure(self): - """The -f flag should force a rebuild""" - self._RunControl('-b', TEST_BRANCH, '-C', '-o', self._output_dir) - # Each commit has a config and make - self.assertEqual(self._make_calls, len(boards) * self._commits * 2) - def testMrproper(self): """The -f flag should force a rebuild""" self._RunControl('-b', TEST_BRANCH, '-m', '-o', self._output_dir) diff --git a/tools/buildman/kconfiglib.py b/tools/buildman/kconfiglib.py index c67895ced6..b9f3756755 100644 --- a/tools/buildman/kconfiglib.py +++ b/tools/buildman/kconfiglib.py @@ -556,6 +556,7 @@ from os.path import dirname, exists, expandvars, islink, join, realpath VERSION = (14, 1, 0) +# pylint: disable=E1101 # File layout: # diff --git a/tools/buildman/main.py b/tools/buildman/main.py index 01271061e6..3b6af24080 100755 --- a/tools/buildman/main.py +++ b/tools/buildman/main.py @@ -30,8 +30,8 @@ from patman import terminal from patman import test_util def RunTests(skip_net_tests, verboose, args): - import func_test - import test + from buildman import func_test + from buildman import test import doctest result = unittest.TestResult() From patchwork Fri Feb 11 20:23:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591815 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=NMewDmu+; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ7Q3YcKz9s8q for ; Sat, 12 Feb 2022 07:24:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86BF883BCF; Fri, 11 Feb 2022 21:23:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NMewDmu+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3CAFC83B9A; Fri, 11 Feb 2022 21:23:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6AF4083A81 for ; Fri, 11 Feb 2022 21:23:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2d.google.com with SMTP id c188so12791580iof.6 for ; Fri, 11 Feb 2022 12:23:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HISIcp9mXoIPVvhuWsw3TxXFOf7puAeP7QZKQ9rChT8=; b=NMewDmu+ThUlv4bSnaU35gCDlnnzyhlmpedQ06+ol0emWhCVAox7qcTvOylGgDRe6j z1gFiBklGFeRwqB3PX/tgeSKeD30bC7x4isESr0e1Zt2tXcn7Cz55l7DT+2Zn3cIp1vJ /w4OIF1UHI9EW1a53TF8bUcRrc18Wh9eRuFXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HISIcp9mXoIPVvhuWsw3TxXFOf7puAeP7QZKQ9rChT8=; b=N5KlgTt3R8nTIq0P7i2qq7pbllIQvo3xHD6LhB0M1wFIfTfCkazofbF/vbRxXt4zw6 jL/6o7XMWWhrmw7TtTdaOcsvvoorvSvbeKYNRid97z5skoBZag3LrqBudw+0L7/cKsAS 82JqGaG/J++nBEDeUdeH9iEVUaE2XHTyErwk/UZJgliJKpVI9DsQhJiTbBPlm6CWQWdO vMFTtGOpl7GU4zb8ujeM+U7dG9W5pVi1Ch5nh68SznOlVHk1esDJYE79EwIMiC4XGFju eLKFX2Cn5R91jhW16MEBSBjHJ5W3XlwVfK3vk07t4UxJwVvPFUuTxodMCrnMHeG7/CFo WgMw== X-Gm-Message-State: AOAM532K+odctK3U+WlWbcuDpcPtC0mFf6MWO7oy9Y9+BuXaUWcPz4yD K2wDOE/Gnc1Svu9csU/xmnf1CxETofImFw== X-Google-Smtp-Source: ABdhPJzUgcRj52V2kPmSuCTIsDNFzMyQVxxfspA8TVyQHLw4maa3aidiNtdiom2xLLDrRNPdGbrDQA== X-Received: by 2002:a05:6638:1488:: with SMTP id j8mr1821084jak.33.1644611016112; Fri, 11 Feb 2022 12:23:36 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:35 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Walter Lozano Subject: [PATCH 3/9] dtoc: Correct pylint errors Date: Fri, 11 Feb 2022 13:23:20 -0700 Message-Id: <20220211202327.851395-4-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Fix pylint errors in this directory. Signed-off-by: Simon Glass --- tools/dtoc/test_dtoc.py | 6 +++--- tools/dtoc/test_fdt.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index ea88954923..c81bcc9c32 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -16,13 +16,13 @@ import os import struct import unittest -from dtb_platdata import Ftype -from dtb_platdata import get_value -from dtb_platdata import tab_to from dtoc import dtb_platdata from dtoc import fdt from dtoc import fdt_util from dtoc import src_scan +from dtoc.dtb_platdata import Ftype +from dtoc.dtb_platdata import get_value +from dtoc.dtb_platdata import tab_to from dtoc.src_scan import conv_name_to_c from dtoc.src_scan import get_compat_name from patman import test_util diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index c789822afa..fe6c578969 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -25,7 +25,7 @@ sys.path.insert(2, os.path.join(our_path, from dtoc import fdt from dtoc import fdt_util from dtoc.fdt_util import fdt32_to_cpu, fdt64_to_cpu -from fdt import Type, BytesToValue +from dtoc.fdt import Type, BytesToValue import libfdt from patman import command from patman import test_util @@ -119,9 +119,9 @@ class TestFdt(unittest.TestCase): """Test that packing a device tree works""" self.dtb.Pack() - def testGetFdt(self): + def testGetFdtRaw(self): """Tetst that we can access the raw device-tree data""" - self.assertTrue(isinstance(self.dtb.GetContents(), bytearray)) + self.assertTrue(isinstance(self.dtb.GetContents(), bytes)) def testGetProps(self): """Tests obtaining a list of properties""" From patchwork Fri Feb 11 20:23:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591820 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=W8UKW6W2; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ8L2GTJz9s8q for ; Sat, 12 Feb 2022 07:24:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 839E283BE4; Fri, 11 Feb 2022 21:23:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="W8UKW6W2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6C79C83BA8; Fri, 11 Feb 2022 21:23:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4445F83BA0 for ; Fri, 11 Feb 2022 21:23:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12d.google.com with SMTP id z18so7765137iln.2 for ; Fri, 11 Feb 2022 12:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bfv+e9uCqfbEgBFyyzduZ+Yx1h7RUEFyGKr6ksgDO3c=; b=W8UKW6W2FDwd1OLJPKVwxr8NjXSvngniptrCeUsaOhIxHw22jvr65ZGKaJVenWSJtR b9HvJn8yaZdwGFspmUw6o9rpMNnzUijKfX+t6eCcgy5+kCgJNKz6uq1eFEioi8JYMg0m agXjZCFZjN5MWt6t3UiMvv9DVuFuBH3KLEvuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bfv+e9uCqfbEgBFyyzduZ+Yx1h7RUEFyGKr6ksgDO3c=; b=3zX7RUNWngXP6ehfhIO1TLmvCVgtBty9cLtYwzSYU8ppG5KaquQSVuW7fX0je11K+T x7ZYjmdYQMD/cJ2qnh/wT1VstX2aYapWG6D7l5XN4Ifd9/pRuq76w76jSN0f6ZC3UdVS 6hMlRwcdywM5kCmlQ5y80M+UJ4Gl7ci9Dij1P333YTRDlZj8K+pVNnkRk+FL8AUueJpM aSQsGkOxED+wC120sd6NkhvNSidBCVcj+6jBFtn8WRTIhswxcGAjKtkLXAywEAr7C+s9 melyTs3JEe3Qz+0xCoSyo6vm9HdI/q6p3mndJ+yil4bTL6NqUhfDbiETYTnti3ParWrH amgg== X-Gm-Message-State: AOAM533tiSBkJwrQWgzQi4rS/M73m3z5GpqNrAka+T6EcUciToht5joE 6FsIDOVfI85LrogWSxuG9OX7hWINaOWtGA== X-Google-Smtp-Source: ABdhPJy/RImorfR9JiG+1hNOffgN/1aDtTT5RxfdvHKsatPdg+ha+wxdA7yCBo+hon9s0m1wkszWww== X-Received: by 2002:a05:6e02:1bcd:: with SMTP id x13mr1795093ilv.98.1644611016859; Fri, 11 Feb 2022 12:23:36 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:36 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Heiko Thiery Subject: [PATCH 4/9] binman: Correct pylint errors Date: Fri, 11 Feb 2022 13:23:21 -0700 Message-Id: <20220211202327.851395-5-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Fix pylint errors that can be fixed and mask those that seem to be incorrect. A complication with binman is that it tries to avoid importing libfdt (or anything that imports it) unless needed, so that things like help still work if it is missing. Note that two tests are duplicated in binman and two others have duplicate names, so both of these issues are fixed also. Signed-off-by: Simon Glass --- tools/binman/cmdline.py | 2 +- tools/binman/control.py | 6 ++++++ tools/binman/elf_test.py | 13 ++++++------- tools/binman/entry.py | 2 ++ tools/binman/entry_test.py | 7 ++----- tools/binman/etype/blob_dtb.py | 3 +++ tools/binman/etype/blob_phase.py | 3 +++ tools/binman/etype/cbfs.py | 3 +++ tools/binman/etype/fdtmap.py | 5 +++++ tools/binman/etype/files.py | 2 ++ tools/binman/etype/section.py | 1 + tools/binman/etype/u_boot_dtb_with_ucode.py | 3 +++ tools/binman/ftest.py | 21 ++------------------- 13 files changed, 39 insertions(+), 32 deletions(-) diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index 0626b850f4..1d1ca43993 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -7,7 +7,7 @@ import argparse from argparse import ArgumentParser -import state +from binman import state def make_extract_parser(subparsers): """make_extract_parser: Make a subparser for the 'extract' command diff --git a/tools/binman/control.py b/tools/binman/control.py index a179f78129..c9d7a08bbc 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -20,6 +20,10 @@ from binman import elf from patman import command from patman import tout +# These are imported if needed since they import libfdt +state = None +Image = None + # List of images we plan to create # Make this global so that it can be referenced from tests images = OrderedDict() @@ -41,6 +45,8 @@ def _ReadImageDesc(binman_node, use_expanded): Returns: OrderedDict of Image objects, each of which describes an image """ + # For Image() + # pylint: disable=E1102 images = OrderedDict() if 'multiple-images' in binman_node.props: for node in binman_node.subnodes: diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index 47ebfbac4a..75b6dc8d73 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -116,7 +116,7 @@ class TestElf(unittest.TestCase): entry = FakeEntry(10) section = FakeSection() with self.assertRaises(ValueError) as e: - syms = elf.LookupAndWriteSymbols('missing-file', entry, section) + elf.LookupAndWriteSymbols('missing-file', entry, section) self.assertIn("Filename 'missing-file' not found in input path", str(e.exception)) @@ -126,7 +126,7 @@ class TestElf(unittest.TestCase): section = FakeSection() elf_fname = self.ElfTestFile('u_boot_binman_syms') with self.assertRaises(ValueError) as e: - syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) + elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertIn('entry_path has offset 4 (size 8) but the contents size ' 'is a', str(e.exception)) @@ -139,8 +139,7 @@ class TestElf(unittest.TestCase): entry = FakeEntry(10) section = FakeSection() elf_fname = self.ElfTestFile('u_boot_binman_syms_bad') - self.assertEqual(elf.LookupAndWriteSymbols(elf_fname, entry, section), - None) + elf.LookupAndWriteSymbols(elf_fname, entry, section) def testBadSymbolSize(self): """Test that an attempt to use an 8-bit symbol are detected @@ -152,7 +151,7 @@ class TestElf(unittest.TestCase): section = FakeSection() elf_fname =self.ElfTestFile('u_boot_binman_syms_size') with self.assertRaises(ValueError) as e: - syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) + elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertIn('has size 1: only 4 and 8 are supported', str(e.exception)) @@ -165,7 +164,7 @@ class TestElf(unittest.TestCase): entry = FakeEntry(24) section = FakeSection(sym_value=None) elf_fname = self.ElfTestFile('u_boot_binman_syms') - syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) + elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertEqual(tools.get_bytes(255, 20) + tools.get_bytes(ord('a'), 4), entry.data) @@ -177,7 +176,7 @@ class TestElf(unittest.TestCase): section = FakeSection() elf_fname = self.ElfTestFile('u_boot_binman_syms') with test_util.capture_sys_output() as (stdout, stderr): - syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) + elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertTrue(len(stdout.getvalue()) > 0) finally: tout.init(tout.WARNING) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index dc26f8f167..9809288ffa 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -19,6 +19,8 @@ from patman import tout modules = {} +# This is imported if needed +state = None # An argument which can be passed to entries on the command line, in lieu of # device-tree properties. diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py index 7ed9b262bb..1d60076be1 100644 --- a/tools/binman/entry_test.py +++ b/tools/binman/entry_test.py @@ -5,6 +5,7 @@ # Test for the Entry class import collections +import importlib import os import sys import unittest @@ -32,11 +33,7 @@ class TestEntry(unittest.TestCase): def _ReloadEntry(self): global entry if entry: - if sys.version_info[0] >= 3: - import importlib - importlib.reload(entry) - else: - reload(entry) + importlib.reload(entry) else: from binman import entry diff --git a/tools/binman/etype/blob_dtb.py b/tools/binman/etype/blob_dtb.py index 3ce7511f6f..4159e3032a 100644 --- a/tools/binman/etype/blob_dtb.py +++ b/tools/binman/etype/blob_dtb.py @@ -8,6 +8,9 @@ from binman.entry import Entry from binman.etype.blob import Entry_blob +# This is imported if needed +state = None + class Entry_blob_dtb(Entry_blob): """A blob that holds a device tree diff --git a/tools/binman/etype/blob_phase.py b/tools/binman/etype/blob_phase.py index ed25e467a1..23e2ad69ba 100644 --- a/tools/binman/etype/blob_phase.py +++ b/tools/binman/etype/blob_phase.py @@ -7,6 +7,9 @@ from binman.etype.section import Entry_section +# This is imported if needed +state = None + class Entry_blob_phase(Entry_section): """Section that holds a phase binary diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py index cc1fbdf4b5..4a1837f26c 100644 --- a/tools/binman/etype/cbfs.py +++ b/tools/binman/etype/cbfs.py @@ -12,6 +12,9 @@ from binman.cbfs_util import CbfsWriter from binman.entry import Entry from dtoc import fdt_util +# This is imported if needed +state = None + class Entry_cbfs(Entry): """Coreboot Filesystem (CBFS) diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py index 76e8dbe818..33c9d039a9 100644 --- a/tools/binman/etype/fdtmap.py +++ b/tools/binman/etype/fdtmap.py @@ -15,6 +15,11 @@ from patman import tout FDTMAP_MAGIC = b'_FDTMAP_' FDTMAP_HDR_LEN = 16 +# These is imported if needed +Fdt = None +libfdt = None +state = None + def LocateFdtmap(data): """Search an image for an fdt map diff --git a/tools/binman/etype/files.py b/tools/binman/etype/files.py index 0650a69c55..13838ece8f 100644 --- a/tools/binman/etype/files.py +++ b/tools/binman/etype/files.py @@ -13,6 +13,8 @@ from binman.etype.section import Entry_section from dtoc import fdt_util from patman import tools +# This is imported if needed +state = None class Entry_files(Entry_section): """A set of files arranged in a section diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 25159074ba..639b12d95b 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -163,6 +163,7 @@ class Entry_section(Entry): self._sort = False self._skip_at_start = None self._end_4gb = False + self._ignore_missing = False def ReadNode(self): """Read properties from the section node""" diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py b/tools/binman/etype/u_boot_dtb_with_ucode.py index 554b3b2e00..047d310cdf 100644 --- a/tools/binman/etype/u_boot_dtb_with_ucode.py +++ b/tools/binman/etype/u_boot_dtb_with_ucode.py @@ -9,6 +9,9 @@ from binman.entry import Entry from binman.etype.blob_dtb import Entry_blob_dtb from patman import tools +# This is imported if needed +state = None + class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb): """A U-Boot device tree file, with the microcode removed diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 59b6d52fbe..eabfb2a8b7 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -989,7 +989,7 @@ class TestFunctional(unittest.TestCase): self.assertIn("Section '/binman': Size 0x7 (7) does not match " "align-size 0x8 (8)", str(e.exception)) - def testPackAlignPowerOf2(self): + def testPackAlignPowerOf2Inv(self): """Test that invalid image alignment is detected""" with self.assertRaises(ValueError) as e: self._DoTestFile('020_pack_inv_image_align_power2.dts') @@ -3712,7 +3712,7 @@ class TestFunctional(unittest.TestCase): err = stderr.getvalue() self.assertRegex(err, "Image 'main-section'.*missing.*: intel-ifwi") - def testPackOverlap(self): + def testPackOverlapZero(self): """Test that zero-size overlapping regions are ignored""" self._DoTestFile('160_pack_overlap_zero.dts') @@ -3981,13 +3981,6 @@ class TestFunctional(unittest.TestCase): self.assertIn("Generator node requires 'fit,fdt-list' property", str(e.exception)) - def testFitFdtEmptyList(self): - """Test handling of an empty 'of-list' entry arg""" - entry_args = { - 'of-list': '', - } - data = self._DoReadFileDtb('170_fit_fdt.dts', entry_args=entry_args)[0] - def testFitFdtMissing(self): """Test handling of a missing 'default-dt' entry arg""" entry_args = { @@ -4872,16 +4865,6 @@ fdt fdtmap Extract the devicetree blob from the fdtmap self.assertEqual('rot-cert', fent.fip_type) self.assertEqual(b'aa', fent.data) - def testFipOther(self): - """Basic FIP with something that isn't a external blob""" - data = self._DoReadFile('204_fip_other.dts') - hdr, fents = fip_util.decode_fip(data) - - self.assertEqual(2, len(fents)) - fent = fents[1] - self.assertEqual('rot-cert', fent.fip_type) - self.assertEqual(b'aa', fent.data) - def testFipNoType(self): """FIP with an entry of an unknown type""" with self.assertRaises(ValueError) as e: From patchwork Fri Feb 11 20:23:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591817 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=NxaBl9TW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ7n4zMnz9s8q for ; Sat, 12 Feb 2022 07:24:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 92C2C83BA2; Fri, 11 Feb 2022 21:23:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NxaBl9TW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E2A8283BCB; Fri, 11 Feb 2022 21:23:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 36A2583BB8 for ; Fri, 11 Feb 2022 21:23:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id z18so7765160iln.2 for ; Fri, 11 Feb 2022 12:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bjodoye2Fl/xHIOgRKXNUCFLhs/6nVAjvpL0qD43n98=; b=NxaBl9TWkj4BaJAnXpAHXMFTiWC/ZvpdEB1TL8Ju+Z0iXl1zY4ehOhIfne5VKLp+2I GN2kBOyeC/i90a8dXd1LsU62KnavCxtIwLyI1a/zqqhXM567scHprnpl2tzOrQVQ9HOV /plaj8bCnvNcj4d6qAbjwIG27Qw4vbIa7WZlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bjodoye2Fl/xHIOgRKXNUCFLhs/6nVAjvpL0qD43n98=; b=fojuR6AVo7nlxLiS4asbu+5+CTseo0yV5NEbwoAyz71vRQFFOo3JLCmqJwCJbL5mt3 F360EJEn8PxszkJZ1Vonz1GkW7JNklLKgD2j6Y0qsAaRZrt8q1s2tSfJK9kF4HGKefGn Hajsce03Ec66Qb5Z6MwquQO8wA0JAs/YU/6lxv1DLhmxOvFzTgmGpNdF1YMbSn51a57o nUanlxNTkybpsA/k9StEyMwQ6Lhd3xSH8fUX9BrbvObrMZEnUkRscec+pIjCIcWy1K7q UsXGWLKTCYAEVNzMP1K6rUwiaLamLGoE/5LxT/nYVBbjDd3M3FVSnKOtgheNl6nWR4hv 0Q6Q== X-Gm-Message-State: AOAM530rd3v4e7F1W7s5IYVp2vkqaPBu2hNhV80A1xoLRnApi2kPYYyR DU8GcT4XDf4+OOIOBzQcBZ22NliwEYkHEw== X-Google-Smtp-Source: ABdhPJwB3z3lDLbNQWDYHIiY9VARHUNctMrkMVUN3jxPGUKGP0PlkoXRAMQtOa/z6WjqVPC5r3oYgg== X-Received: by 2002:a92:d286:: with SMTP id p6mr1321444ilp.310.1644611017643; Fri, 11 Feb 2022 12:23:37 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:37 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Alper Nebi Yasak , Trevor Woerner Subject: [PATCH 5/9] moveconfig: Correct pylint errors Date: Fri, 11 Feb 2022 13:23:22 -0700 Message-Id: <20220211202327.851395-6-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Fix two pylint errors in this file. Note ACTION_SPL_NOT_EXIST is not defined so the dead code can be removed. Signed-off-by: Simon Glass --- tools/moveconfig.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 1bcf58caf1..d532863637 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -326,7 +326,7 @@ def read_file(fname, as_lines=True, skip_unicode=False): return inf.read() except UnicodeDecodeError as e: if not skip_unicode: - raises + raise print("Failed on file %s': %s" % (fname, e)) return None @@ -777,9 +777,6 @@ class KconfigParser: actlog = "'%s' is the same as the define in Kconfig. Do nothing." \ % value log_color = COLOR_LIGHT_PURPLE - elif action == ACTION_SPL_NOT_EXIST: - actlog = 'SPL is not enabled for this defconfig. Skip.' - log_color = COLOR_PURPLE else: sys.exit('Internal Error. This should not happen.') From patchwork Fri Feb 11 20:23:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591821 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=T26MU8E+; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ8W70J2z9s8q for ; Sat, 12 Feb 2022 07:24:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8673E83BE5; Fri, 11 Feb 2022 21:24:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="T26MU8E+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8CAFA83B8D; Fri, 11 Feb 2022 21:23:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0A07483BBC for ; Fri, 11 Feb 2022 21:23:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id n17so12807285iod.4 for ; Fri, 11 Feb 2022 12:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4ffVEttmjWLZ34VGWh6iULUHiIzS8Xl/Aj5GXGY8Jb8=; b=T26MU8E+vNYFDY0kbQ//oPs1mmODQQzJF3nr9Afr5/DuhYMSSG50qBBxBLBpbbOigY emxacLDCOgTPV8W6zYC7zdNqjjUwxoABhlovcvQfFJBJ90ulv3jL2e0j+Zhi1tX7q5hG IZzDuj/r/0n3YeSj+dDNn82LY0fLQHxgVOY5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4ffVEttmjWLZ34VGWh6iULUHiIzS8Xl/Aj5GXGY8Jb8=; b=HcHJzapR6J5VAnMilx5u7DeSTq0zgCZQixeTlXd4KPNne2sVqZJmVOxFKGkdMdkBrl V4NiCJ6pwEzEKU/Ks7rNMF/Fjo+V52Y1Q5OO1WRPLjQUTCvoJIOsfWA2dqA5n0BgIms/ wjSRxblX3hzgAgTk4oCCza2NrU3yJE+xYfQNOLNfiPoF2WwwVeWoH0rwRl/tRTYvxUs1 IenA0/JXp49+vgEMWiel0I/N4M5SBtHOaz3OebHshXj3fLsyeO7mzQiXh7UJajKYjwRl FwbiLVnAxcVDerNnsI5tDFf9F9yTjYgRCd4KRwG7kNEmyLKM9xYUb1yXMuSuOwxRId1n npPQ== X-Gm-Message-State: AOAM530to8mcLDNlBr84R4g5Ei4ri28rqxzZf7zORTFTNxkIDVIcITVN Yl8f4xY6aBju64LgGN9khjBQfbpACXgTdw== X-Google-Smtp-Source: ABdhPJxz3II3iguhFIjyYU8ymIEDa6p7EtXTbCcW3w0+3dT5sf2u/H3TrwFc4CBjMg2+KDWENFDCFQ== X-Received: by 2002:a02:cd01:: with SMTP id g1mr1738986jaq.101.1644611018575; Fri, 11 Feb 2022 12:23:38 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:38 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Arie Haenel , Bruce Monroe , Igor Opaniuk , Julien Lenoir , Patrice Chotard Subject: [PATCH 6/9] test: Correct pylint errors Date: Fri, 11 Feb 2022 13:23:23 -0700 Message-Id: <20220211202327.851395-7-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Fix pylint errors in all test. This requires adding a get_spawn() method to the ConsoleBase base, so that its subclass is happy. Signed-off-by: Simon Glass --- test/py/tests/test_android/test_avb.py | 2 +- test/py/tests/test_bind.py | 8 ++++---- test/py/tests/vboot_evil.py | 3 ++- test/py/u_boot_console_base.py | 8 ++++++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/test/py/tests/test_android/test_avb.py b/test/py/tests/test_android/test_avb.py index a04a7ff264..a3f883136b 100644 --- a/test/py/tests/test_android/test_avb.py +++ b/test/py/tests/test_android/test_avb.py @@ -66,7 +66,7 @@ def test_avb_mmc_uuid(u_boot_console): part_list[cur_partname] = guid_to_check[1] # lets check all guids with avb get_guid - for part, guid in part_list.iteritems(): + for part, guid in part_list.items(): avb_guid_resp = u_boot_console.run_command('avb get_uuid %s' % part) assert guid == avb_guid_resp.split('UUID: ')[1] diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py index 9f234fb635..8ad277da19 100644 --- a/test/py/tests/test_bind.py +++ b/test/py/tests/test_bind.py @@ -131,7 +131,7 @@ def test_bind_unbind_with_uclass(u_boot_console): child2_index = int(child2_line[0].split()[1]) #bind simple_bus as a child of bind-test-child2 - response = u_boot_console.run_command('bind {} {} simple_bus'.format(child2_uclass, child2_index, 'simple_bus')) + response = u_boot_console.run_command('bind {} {} simple_bus'.format(child2_uclass, child2_index)) #check that the child is there and its uclass/index pair is right tree = u_boot_console.run_command('dm tree') @@ -152,7 +152,7 @@ def test_bind_unbind_with_uclass(u_boot_console): assert child_of_child2_line == '' #bind simple_bus as a child of bind-test-child2 - response = u_boot_console.run_command('bind {} {} simple_bus'.format(child2_uclass, child2_index, 'simple_bus')) + response = u_boot_console.run_command('bind {} {} simple_bus'.format(child2_uclass, child2_index)) #check that the child is there and its uclass/index pair is right tree = u_boot_console.run_command('dm tree') @@ -165,7 +165,7 @@ def test_bind_unbind_with_uclass(u_boot_console): assert child_of_child2_index == child2_index + 1 #unbind the child and check it has been removed - response = u_boot_console.run_command('unbind {} {} simple_bus'.format(child2_uclass, child2_index, 'simple_bus')) + response = u_boot_console.run_command('unbind {} {} simple_bus'.format(child2_uclass, child2_index)) assert response == '' tree = u_boot_console.run_command('dm tree') @@ -176,7 +176,7 @@ def test_bind_unbind_with_uclass(u_boot_console): #unbind the child again and check it doesn't change the tree tree_old = u_boot_console.run_command('dm tree') - response = u_boot_console.run_command('unbind {} {} simple_bus'.format(child2_uclass, child2_index, 'simple_bus')) + response = u_boot_console.run_command('unbind {} {} simple_bus'.format(child2_uclass, child2_index)) tree_new = u_boot_console.run_command('dm tree') assert response == '' diff --git a/test/py/tests/vboot_evil.py b/test/py/tests/vboot_evil.py index 9825c21716..e2b0cd6546 100644 --- a/test/py/tests/vboot_evil.py +++ b/test/py/tests/vboot_evil.py @@ -482,4 +482,5 @@ if __name__ == '__main__': print('valid attack names: [fakeroot, kernel@]') sys.exit(1) - add_evil_node(sys.argv[1:]) + in_fname, out_fname, kernel_fname, attack = sys.argv[1:] + add_evil_node(in_fname, out_fname, kernel_fname, attack) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index 384fd53c65..6214e206b1 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -115,6 +115,14 @@ class ConsoleBase(object): self.at_prompt = False self.at_prompt_logevt = None + def get_spawn(self): + # This is not called, ssubclass must define this. + # Return a value to avoid: + # u_boot_console_base.py:348:12: E1128: Assigning result of a function + # call, where the function returns None (assignment-from-none) + return u_boot_spawn.Spawn([]) + + def eval_bad_patterns(self): self.bad_patterns = [pat[PAT_RE] for pat in bad_pattern_defs \ if self.disable_check_count[pat[PAT_ID]] == 0] From patchwork Fri Feb 11 20:23:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591818 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=c0VmupSS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ7z25RPz9s8q for ; Sat, 12 Feb 2022 07:24:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4871783BD5; Fri, 11 Feb 2022 21:23:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="c0VmupSS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96CC283BCD; Fri, 11 Feb 2022 21:23:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B4A3F83BA8 for ; Fri, 11 Feb 2022 21:23:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2e.google.com with SMTP id m185so12792528iof.10 for ; Fri, 11 Feb 2022 12:23:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=raVrzzeqCVQgFJdDim0TMVsreSo0SwXZF8m7ycGa1Gg=; b=c0VmupSSFx0wcb+XtDqpy6I9WlUZ/I+WN6j4CaL9E028gi+rjfyv78eMx+L+MGlQq/ gp1m5WaonR+HU62bMYJasvn+9is5JD5Sn5yVqleh/tJ4W2v/2JTDsRQlhJVOC324uF4N Iue4s1Idi0GrdRC8Sh0PPIN8rNsJxUSmnILz8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=raVrzzeqCVQgFJdDim0TMVsreSo0SwXZF8m7ycGa1Gg=; b=2SKW1WaA4CHsZUNU4dEQg5JpVHJ/V4EjwIXoeJcMVfGols6L8MQsPL7Giqcqz11srb t10MyNMTyM29LJ/t89fzFafivWJpmvTrz4MRddllFyVol9wgeo2K9GX1x+15XVl8QEBs 8X6YbO30Xt8nuF/kodsDv41/cZQVjk7e4JDJ/FyuQg8trhPVhkXGAV96VdWGj0qzrk3A NIauOPrvzH/KuXxK8R6KbmgBQ0rjNhesuN/V8l3PNof9YWFv8PLUfChgRi4kBNpc4SwM OBaGVH6UiGAbXcVrso+WIu4qZUbmJjTE58SYkt91FT0T8VbkmfFL5EvU0wtunbSA9J8h bt/w== X-Gm-Message-State: AOAM530h7mvgeL/J4zb2k/7x9xNHpeQ9sbkI8PHig4bX1rmRFejGFjOe fnL7ZM50stQfeABPJwZVwNundyGYUAQ5pg== X-Google-Smtp-Source: ABdhPJyFrDQ5ShGUHf3lka9hH4cC+skl9FwVXsHwd/f7aOleznM/7/JWMUOR1wSIabgtJgzMKTyHjw== X-Received: by 2002:a05:6638:3399:: with SMTP id h25mr1794021jav.166.1644611019338; Fri, 11 Feb 2022 12:23:39 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:39 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , =?utf-8?q?Marek_Beh=C3=BAn?= , Masahiro Yamada Subject: [PATCH 7/9] Makefile: Add a way to check for pylint errors Date: Fri, 11 Feb 2022 13:23:24 -0700 Message-Id: <20220211202327.851395-8-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Add a new 'pylint_err' target which only reports errors, not warnings. Signed-off-by: Simon Glass --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1ee7089c52..97e597ed43 100644 --- a/Makefile +++ b/Makefile @@ -521,7 +521,8 @@ env_h := include/generated/environment.h no-dot-config-targets := clean clobber mrproper distclean \ help %docs check% coccicheck \ - ubootversion backup tests check qcheck tcheck pylint + ubootversion backup tests check qcheck tcheck pylint \ + pylint_err config-targets := 0 mixed-targets := 0 @@ -2259,7 +2260,7 @@ distclean: mrproper @rm -f boards.cfg CHANGELOG # See doc/develop/python_cq.rst -PHONY += pylint +PHONY += pylint pylint_err PYLINT_BASE := scripts/pylint.base PYLINT_CUR := pylint.cur PYLINT_DIFF := pylint.diff @@ -2301,6 +2302,11 @@ pylint: echo "No pylint regressions"; \ fi +# Check for errors only +pylint_err: + $(Q)pylint -E -j 0 --ignore-imports=yes \ + $(shell find tools test -name "*.py") + backup: F=`basename $(srctree)` ; cd .. ; \ gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F From patchwork Fri Feb 11 20:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591819 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=g3fUPZB7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ886FYvz9s8q for ; Sat, 12 Feb 2022 07:24:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6F65883BE8; Fri, 11 Feb 2022 21:23:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="g3fUPZB7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05BF283BD2; Fri, 11 Feb 2022 21:23:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6BF0183B7D for ; Fri, 11 Feb 2022 21:23:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12f.google.com with SMTP id z7so7731546ilb.6 for ; Fri, 11 Feb 2022 12:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HvjSB58vXwVk1e7bN/3phtm3zgPjtWFYc6U/DLTFa5s=; b=g3fUPZB74mxVHMmi7XJ0e2jIyqBhirINmSnCAGHdRK6wnS/smLnKM0rPI0tn0VlbUr ndFoXyeDkP+2A52s6TGW9544/sik2ow7wPyNqkc6wn68XUvHFYi/F8k2q5mLQXNUixZp VpGtYu2zJ7/MZJP0Z+jDuIkF/YePZh7MY1Yqw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HvjSB58vXwVk1e7bN/3phtm3zgPjtWFYc6U/DLTFa5s=; b=SyOtvJ2CKko/YNxEbLjeOhT673/cxDLKRDHhyaUl6KwhfnD4ERjDRxzFGwuCXxpR3u GIB8TFafg9cC9+7rIkNCQbXoQQRpby/Y0psrwy4s2+1zOltHhn+CNg9Wq+L7NX3iG/8O HpJx6rkyA/sHgz1l7pq10qSMEbEIaK+d2WdidQJ23frGPSNmhdYrE/dpf/RAaqkFij0a msIFx8FWM7eEM5mFkiqSJUdG141U1n0N0cCCLVeRoEGMGHxd6HUYHKBCv7VqHFhNa0nI 5w7/NXly83A7/4YZRvDucv1Nz6FLw9nPA5sE87nuIiwgs096/hMfxMQhk8nw9Bl5fZzQ jCpQ== X-Gm-Message-State: AOAM5320m52crxJSveoDGI3PqT5hWcLeIJRZnBDfqqoFdgfAdtI30y9I GKZ7xj7wqLJunFEE05FSWBH3Qelk+IUTeQ== X-Google-Smtp-Source: ABdhPJwlO/61rs9+FkumTKuNUrFPesSQj1FICbh3XMF3zfEgONyodfBg98dZSbFo44/i6WGGAEfg2w== X-Received: by 2002:a05:6e02:1489:: with SMTP id n9mr1756933ilk.49.1644611020054; Fri, 11 Feb 2022 12:23:40 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:39 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass Subject: [PATCH 8/9] buildman: Update default config to build for sandbox Date: Fri, 11 Feb 2022 13:23:25 -0700 Message-Id: <20220211202327.851395-9-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean At present the default .buildman file written by buildman does not specify a default toolchain. Add an 'other' line so this works correctly and sandbox builds run as expected. Signed-off-by: Simon Glass --- tools/buildman/bsettings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py index 0b7208da37..e634bbb279 100644 --- a/tools/buildman/bsettings.py +++ b/tools/buildman/bsettings.py @@ -74,6 +74,7 @@ def CreateBuildmanConfigFile(config_fname): print('''[toolchain] # name = path # e.g. x86 = /opt/gcc-4.6.3-nolibc/x86_64-linux +other = / [toolchain-prefix] # name = path to prefix From patchwork Fri Feb 11 20:23:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1591822 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IfaP2K6S; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JwQ8j4CqVz9s8q for ; Sat, 12 Feb 2022 07:25:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A29AB83BFC; Fri, 11 Feb 2022 21:24:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IfaP2K6S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0572983BD2; Fri, 11 Feb 2022 21:23:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 454BC83BB3 for ; Fri, 11 Feb 2022 21:23:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id m185so12792586iof.10 for ; Fri, 11 Feb 2022 12:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l10fdTpMkR61Ux+zKBbR3i0aTPo4iV1NK7vuc6aD8GU=; b=IfaP2K6SuylvxCmb1tqA5dMUKax/KGyKxptYyEAvVWtcsV6YDsuDDeIF28qU38R6X2 s/B2QqV9QlCzHi6AE2hlZxEUKfEOSYb+EDg50xZMhoaY70THMvr9QDqrDoG58h+mA/XL 7bwhWu4jtj7KuTPGb/XNqT0vfHbyWJ6QJd0As= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l10fdTpMkR61Ux+zKBbR3i0aTPo4iV1NK7vuc6aD8GU=; b=axHeiykDexmD6jRkjpZr7PFcvdS65oIvLyw+K2vsGx90hhs2/pLBzn5gi8gVW90NLa 5tLUbwbWNx09o7bimKJMIiJZeuSQy60rjGcKyFosq740nA6SWdcN56mbNxS7PvAEzQdI lewB1raIVJepEhnejFyYmhj/BiOoRruep2VNhOE3JY9huFNgdlHHHn2l9dSkkP2P3fls qc//ACFOtepycEoNwOImAUH0TZqOh+PzHlrwX6CSRTAnaaYeQYkbBGstxgYIpU5pSHqb ZqcGgmKUkkKI5veNnXaVY232wjnhTTbFK6ysSDQ3OrFRpCSxs9f6NXo6+2rziZejEKci 9lsw== X-Gm-Message-State: AOAM533r0veu08I2K6o9WC2mgiaw6yMMbk+/ZnA2YATdaUGItV7OPJPv tmBJmJk9P2lIMcWne/DjnmVq1BxmPtEx/A== X-Google-Smtp-Source: ABdhPJyXq57HuqqkG17koHo6ZJPVamBAC7Eq8zp1IbFzpRGamCkoYdr1zcTU3ZW6vZ/g7hLv+zOFOQ== X-Received: by 2002:a05:6638:3283:: with SMTP id f3mr1728702jav.172.1644611020850; Fri, 11 Feb 2022 12:23:40 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t2sm9496071ilp.49.2022.02.11.12.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 12:23:40 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Alper Nebi Yasak , Bin Meng , Daniel Schwierzeck Subject: [PATCH 9/9] Azure/GitLab CI: Add the pylint checker Date: Fri, 11 Feb 2022 13:23:26 -0700 Message-Id: <20220211202327.851395-10-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog In-Reply-To: <20220211202327.851395-1-sjg@chromium.org> References: <20220211202327.851395-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Add a check that new Python code does not regress the pylint score for any module. Signed-off-by: Simon Glass --- .azure-pipelines.yml | 22 ++++++++++++++++++++++ .gitlab-ci.yml | 16 ++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 81ab77e134..2543c37811 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -201,6 +201,28 @@ stages: export PATH=/opt/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin:$PATH test/nokia_rx51_test.sh + - job: pylint + displayName: Check for any pylint regressions + pool: + vmImage: $(ubuntu_vm) + container: + image: $(ci_runner_image) + options: $(container_option) + steps: + - script: | + cd ${WORK_DIR} + export USER=azure + pip install -r test/py/requirements.txt + pip install asteval pylint pyopenssl + export PATH=${PATH}:~/.local/bin + echo "[MASTER]" >> .pylintrc + echo "load-plugins=pylint.extensions.docparams" >> .pylintrc + export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl + ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl + pylint --version + export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt + make pylint_err + - stage: test_py jobs: - job: test_py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85b5296634..1f4be626ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -215,6 +215,22 @@ Run tests for Nokia RX-51 (aka N900): - export PATH=/opt/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin:$PATH; test/nokia_rx51_test.sh +# Check for any pylint regressions +Run pylint: + stage: testsuites + script: + - pip install -r test/py/requirements.txt + - pip install asteval pylint pyopenssl + - export PATH=${PATH}:~/.local/bin + - echo "[MASTER]" >> .pylintrc + - echo "load-plugins=pylint.extensions.docparams" >> .pylintrc + - export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl + - ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w + --board sandbox_spl + - pylint --version + - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt" + - make pylint_err + # Test sandbox with test.py sandbox test.py: variables: