PEP8 double aggressive E401
PATCH 1/8 PEP8 double aggressive E401
From: persianpros <[email protected]>
--- meta/lib/oe/package.py | 9 +++++++-- meta/lib/oe/qa.py | 4 +++- meta/lib/oe/utils.py | 6 ++++-- meta/lib/oeqa/oetest.py | 4 +++- meta/lib/oeqa/sdk/case.py | 3 ++- meta/lib/oeqa/sdk/cases/buildlzip.py | 5 ++++- meta/lib/oeqa/sdk/cases/python.py | 3 ++- meta/lib/oeqa/sdk/testsdk.py | 3 ++- meta/lib/oeqa/selftest/cases/oelib/path.py | 3 ++- meta/lib/oeqa/selftest/cases/package.py | 7 +++++-- meta/lib/oeqa/selftest/cases/runtime_test.py | 3 ++- meta/lib/oeqa/utils/testexport.py | 6 +++++- .../texinfo-dummy-native/texinfo-dummy/template.py | 4 +++- scripts/combo-layer | 3 ++- scripts/contrib/patchreview.py | 11 ++++++++--- scripts/lnr | 3 ++- scripts/oe-pkgdata-browser | 5 ++++- .../pybootchartgui/tests/parser_test.py | 7 ++++++- scripts/send-error-report | 3 ++- scripts/verify-bashisms | 9 +++++++-- 20 files changed, 75 insertions(+), 26 deletions(-)
meta/lib/oe/package.py +7 -2
@@ -107,7 +107,10 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, d, qa_already_stripp :param qa_already_stripped: Set to True if already-stripped' in ${INSANE_SKIP} This is for proper logging and messages only. """ - import stat, errno, oe.path, oe.utils + import stat + import errno + import oe.path + import oe.utils elffiles = {} inodes = {}
@@ -187,7 +190,9 @@ def file_translate(file): return ft def filedeprunner(arg): - import re, subprocess, shlex + import re + import subprocess + import shlex (pkg, pkgfiles, rpmdeps, pkgdest) = arg provides = {}
meta/lib/oe/qa.py +3 -1
@@ -2,7 +2,9 @@ # SPDX-License-Identifier: GPL-2.0-only # -import os, struct, mmap +import os +import struct +import mmap class NotELFFileError(Exception): pass
meta/lib/oe/utils.py +4 -2
@@ -376,7 +376,8 @@ def format_pkg_list(pkg_dict, ret_format=None): # Helper function to get the host compiler version # Do not assume the compiler is gcc def get_host_compiler_version(d, taskcontextonly=False): - import re, subprocess + import re + import subprocess if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1': return
@@ -404,7 +405,8 @@ def get_host_compiler_version(d, taskcontextonly=False): def host_gcc_version(d, taskcontextonly=False): - import re, subprocess + import re + import subprocess if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1': return
meta/lib/oeqa/oetest.py +3 -1
@@ -9,7 +9,9 @@ # It also has some helper functions and it's responsible for actually starting the tests -import os, re, sys +import os +import re +import sys import unittest import inspect import subprocess
meta/lib/oeqa/sdk/case.py +2 -1
@@ -35,7 +35,8 @@ class OESDKTestCase(OETestCase): OS/architecture, or if not specified the currently configured MACHINE's OS/architecture. """ - import oe.qa, oe.elf + import oe.qa + import oe.elf if not target_os or not target_arch: output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
meta/lib/oeqa/sdk/cases/buildlzip.py +4 -1
@@ -2,7 +2,10 @@ # SPDX-License-Identifier: MIT # -import os, tempfile, subprocess, unittest +import os +import tempfile +import subprocess +import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.utils.subprocesstweak import errors_have_output errors_have_output()
meta/lib/oeqa/sdk/cases/python.py +2 -1
@@ -2,7 +2,8 @@ # SPDX-License-Identifier: MIT # -import subprocess, unittest +import subprocess +import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.utils.subprocesstweak import errors_have_output
meta/lib/oeqa/sdk/testsdk.py +2 -1
@@ -95,7 +95,8 @@ class TestSDK(TestSDKBase): processes = d.getVar("TESTIMAGE_NUMBER_THREADS") or d.getVar("BB_NUMBER_THREADS") if processes: try: - import testtools, subunit + import testtools + import subunit except ImportError: bb.warn("Failed to import testtools or subunit, the testcases will run serially") processes = None
meta/lib/oeqa/selftest/cases/oelib/path.py +2 -1
@@ -3,7 +3,8 @@ # from unittest.case import TestCase -import oe, oe.path +import oe +import oe.path import tempfile import os import errno
meta/lib/oeqa/selftest/cases/package.py +5 -2
@@ -5,7 +5,8 @@ from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import bitbake, get_bb_vars, get_bb_var, runqemu import stat -import subprocess, os +import subprocess +import os import oe.path import re
@@ -150,7 +151,9 @@ class PackageTests(OESelftestTestCase): self.fail('GDB %s failed' % binary) def test_preserve_ownership(self): - import os, stat, oe.cachedpath + import os + import stat + import oe.cachedpath features = 'IMAGE_INSTALL_append = " selftest-chown"\n' self.write_config(features) bitbake("core-image-minimal")
meta/lib/oeqa/selftest/cases/runtime_test.py +2 -1
@@ -211,7 +211,8 @@ class TestImage(OESelftestTestCase): Product: oe-core Author: Alexander Kanavin <[email protected]> """ - import subprocess, os + import subprocess + import os try: content = os.listdir("/dev/dri") if len([i for i in content if i.startswith('render')]) == 0:
meta/lib/oeqa/utils/testexport.py +5 -1
@@ -6,7 +6,11 @@ # Provides functions to help with exporting binaries obtained from built targets -import os, re, glob as g, shutil as sh,sys +import os +import re +import glob as g +import shutil as sh +import sys from time import sleep from .commands import runCmd from difflib import SequenceMatcher as SM
meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py +3 -1
@@ -28,7 +28,9 @@ # of the executable from argv[0] and emulate the corresponding program, so # multiple copies of this script will exist under different names. -import sys, os, argparse +import sys +import os +import argparse this_binary = sys.argv[0].split("/")[-1]
scripts/combo-layer +2 -1
@@ -11,7 +11,8 @@ # import fnmatch -import os, sys +import os +import sys import optparse import logging import subprocess
scripts/contrib/patchreview.py +8 -3
@@ -40,7 +40,8 @@ def blame_patch(patch): "--", patch)).decode("utf-8").splitlines() def patchreview(path, patches): - import re, os.path + import re + import os.path # General pattern: start of line, optional whitespace, tag with optional # hyphen or spaces, maybe a colon, some whitespace, then the value, all case
@@ -198,7 +199,9 @@ def histogram(results): if __name__ == "__main__": - import argparse, subprocess, os + import argparse + import subprocess + import os args = argparse.ArgumentParser(description="Patch Review Tool") args.add_argument("-b", "--blame", action="store_true", help="show blame for malformed patches")
@@ -213,7 +216,9 @@ if __name__ == "__main__": analyse(results, want_blame=args.blame, verbose=args.verbose) if args.json: - import json, os.path, collections + import json + import os.path + import collections if os.path.isfile(args.json): data = json.load(open(args.json)) else:
scripts/lnr +2 -1
@@ -6,7 +6,8 @@ # Create a *relative* symlink, just like ln --relative does but without needing # coreutils 8.16. -import sys, os +import sys +import os if len(sys.argv) != 3: print("$ lnr TARGET LINK_NAME")
scripts/oe-pkgdata-browser +4 -1
@@ -1,6 +1,9 @@ #! /usr/bin/env python3 -import os, sys, enum, ast +import os +import sys +import enum +import ast scripts_path = os.path.dirname(os.path.realpath(__file__)) lib_path = scripts_path + '/lib'
scripts/pybootchartgui/pybootchartgui/tests/parser_test.py +6 -1
@@ -1,4 +1,9 @@ -import sys, os, re, struct, operator, math +import sys +import os +import re +import struct +import operator +import math from collections import defaultdict import unittest
scripts/send-error-report +2 -1
@@ -10,7 +10,8 @@ # SPDX-License-Identifier: GPL-2.0-only # -import urllib.request, urllib.error +import urllib.request +import urllib.error import sys import json import os
scripts/verify-bashisms +7 -2
@@ -3,7 +3,11 @@ # SPDX-License-Identifier: GPL-2.0-only # -import sys, os, subprocess, re, shutil +import sys +import os +import subprocess +import re +import shutil whitelist = ( # type is supported by dash
@@ -92,7 +96,8 @@ def get_tinfoil(): return tinfoil if __name__=='__main__': - import argparse, shutil + import argparse + import shutil parser = argparse.ArgumentParser(description='Bashim detector for shell fragments in recipes.') parser.add_argument("recipes", metavar="RECIPE", nargs="*", help="recipes to check (if not specified, all will be checked)")
Signature · 1 line
2.32.0
PATCH 2/8 PEP8 double aggressive E701, E70 and E502
From: persianpros <[email protected]>
--- meta/lib/oe/buildhistory_analysis.py | 4 +- meta/lib/oe/distro_check.py | 3 +- meta/lib/oe/gpg_sign.py | 2 +- meta/lib/oe/package_manager/__init__.py | 11 +-- meta/lib/oe/package_manager/deb/__init__.py | 4 +- meta/lib/oe/package_manager/deb/rootfs.py | 4 +- meta/lib/oe/package_manager/ipk/rootfs.py | 4 +- meta/lib/oe/prservice.py | 2 +- meta/lib/oe/sdk.py | 2 +- meta/lib/oe/terminal.py | 3 +- meta/lib/oe/utils.py | 4 +- meta/lib/oeqa/core/case.py | 2 +- meta/lib/oeqa/core/context.py | 4 +- meta/lib/oeqa/core/decorator/data.py | 2 +- meta/lib/oeqa/core/decorator/depends.py | 6 +- meta/lib/oeqa/core/loader.py | 18 ++--- meta/lib/oeqa/oetest.py | 4 +- meta/lib/oeqa/runtime/context.py | 10 +-- meta/lib/oeqa/sdk/case.py | 2 +- meta/lib/oeqa/sdk/cases/buildgalculator.py | 2 +- meta/lib/oeqa/sdk/cases/gcc.py | 2 +- meta/lib/oeqa/sdk/context.py | 8 +-- meta/lib/oeqa/sdkext/case.py | 2 +- meta/lib/oeqa/sdkext/cases/devtool.py | 2 +- meta/lib/oeqa/sdkext/testsdk.py | 4 +- meta/lib/oeqa/selftest/case.py | 8 +-- meta/lib/oeqa/selftest/cases/manifest.py | 38 ++++++----- meta/lib/oeqa/selftest/cases/wic.py | 68 +++++++++---------- meta/lib/oeqa/selftest/context.py | 4 +- meta/lib/oeqa/utils/__init__.py | 8 +-- meta/lib/oeqa/utils/testexport.py | 6 +- meta/recipes-rt/rt-tests/files/rt_bmark.py | 2 +- scripts/bitbake-whatchanged | 4 +- scripts/combo-layer | 12 ++-- scripts/lib/checklayer/__init__.py | 4 +- scripts/lib/checklayer/cases/bsp.py | 4 +- scripts/lib/checklayer/cases/common.py | 4 +- scripts/lib/checklayer/cases/distro.py | 4 +- scripts/lib/devtool/sdk.py | 4 +- scripts/lib/wic/engine.py | 6 +- scripts/lib/wic/filemap.py | 2 +- scripts/lib/wic/ksparser.py | 4 +- scripts/lib/wic/misc.py | 2 +- scripts/lib/wic/plugins/imager/direct.py | 18 ++--- scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +- .../wic/plugins/source/bootimg-partition.py | 2 +- .../wic/plugins/source/isoimage-isohybrid.py | 10 +-- scripts/oe-pkgdata-browser | 2 +- .../pybootchartgui/pybootchartgui/batch.py | 2 +- scripts/pybootchartgui/pybootchartgui/draw.py | 62 ++++++++--------- .../pybootchartgui/pybootchartgui/parsing.py | 8 ++- .../pybootchartgui/pybootchartgui/samples.py | 2 +- .../pybootchartgui/tests/parser_test.py | 2 +- .../pybootchartgui/tests/process_tree_test.py | 2 +- scripts/relocate_sdk.py | 10 +-- scripts/runqemu | 4 +- scripts/tiny/dirsize.py | 2 +- scripts/tiny/ksize.py | 8 +-- scripts/tiny/ksum.py | 12 ++-- scripts/yocto-check-layer | 6 +- 60 files changed, 230 insertions(+), 219 deletions(-)
meta/lib/oe/buildhistory_analysis.py +2 -2
@@ -89,9 +89,9 @@ class ChangeRecord: def detect_renamed_dirs(aitems, bitems): adirs = set(map(os.path.dirname, aitems)) bdirs = set(map(os.path.dirname, bitems)) - files_ab = [(name, sorted(os.path.basename(item) for item in aitems if os.path.dirname(item) == name)) \ + files_ab = [(name, sorted(os.path.basename(item) for item in aitems if os.path.dirname(item) == name)) for name in adirs - bdirs] - files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) \ + files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) for name in bdirs - adirs] renamed_dirs = [] for dir1, files1 in files_ab:
meta/lib/oe/distro_check.py +2 -1
@@ -69,7 +69,8 @@ def get_source_package_list_from_url_by_letter(url, section, d): try: packages |= get_source_package_list_from_url(url + "/" + letter, section, d) except HTTPError as e: - if e.code != 404: raise + if e.code != 404: + raise return packages def get_latest_released_fedora_source_package_list(d):
meta/lib/oe/gpg_sign.py +1 -1
@@ -82,7 +82,7 @@ class LocalSigner(object): try: if passphrase_file: with open(passphrase_file) as fobj: - passphrase = fobj.readline(); + passphrase = fobj.readline() job = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE) (_, stderr) = job.communicate(passphrase.encode("utf-8"))
meta/lib/oe/package_manager/__init__.py +7 -4
@@ -97,7 +97,7 @@ Details of the failure are in %s.""" %(pkgs, log_path)) def generate_locale_archive(d, rootfs, target_arch, localedir): # Pretty sure we don't need this for locale archive generation but # keeping it to be safe... - locale_arch_options = { \ + locale_arch_options = { "arc": ["--uint32-align=4", "--little-endian"], "arceb": ["--uint32-align=4", "--big-endian"], "arm": ["--uint32-align=4", "--little-endian"],
@@ -239,7 +239,8 @@ class PackageManager(object, metaclass=ABCMeta): try: output = subprocess.check_output(script_full, stderr=subprocess.STDOUT) - if output: bb.note(output.decode("utf-8")) + if output: + bb.note(output.decode("utf-8")) except subprocess.CalledProcessError as e: bb.note("Exit code %d. Output:\n%s" % (e.returncode, e.output.decode("utf-8"))) if populate_sdk == 'host':
@@ -331,7 +332,8 @@ class PackageManager(object, metaclass=ABCMeta): bb.note('Running %s' % cmd) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() - if stderr: bb.note(stderr.decode("utf-8")) + if stderr: + bb.note(stderr.decode("utf-8")) pkgs = stdout.decode("utf-8") self.install(pkgs.split(), attempt_only=True) except subprocess.CalledProcessError as e:
@@ -390,7 +392,8 @@ class PackageManager(object, metaclass=ABCMeta): bb.note('Running %s' % cmd) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() - if stderr: bb.note(stderr.decode("utf-8")) + if stderr: + bb.note(stderr.decode("utf-8")) complementary_pkgs = stdout.decode("utf-8") complementary_pkgs = set(complementary_pkgs.split()) skip_pkgs = sorted(complementary_pkgs & provided_pkgs)
meta/lib/oe/package_manager/deb/__init__.py +2 -2
@@ -419,7 +419,7 @@ class DpkgPM(OpkgDpkgPM): os.path.join(self.deploy_dir, arch)) base_arch_list = base_archs.split() - multilib_variants = self.d.getVar("MULTILIB_VARIANTS"); + multilib_variants = self.d.getVar("MULTILIB_VARIANTS") for variant in multilib_variants.split(): localdata = bb.data.createCopy(self.d) variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False)
@@ -437,7 +437,7 @@ class DpkgPM(OpkgDpkgPM): if match_arch: for base_arch in base_arch_list: architectures += "\"%s\";" % base_arch - apt_conf.write(" Architectures {%s};\n" % architectures); + apt_conf.write(" Architectures {%s};\n" % architectures) apt_conf.write(" Architecture \"%s\";\n" % base_archs) else: line = re.sub(r"#ROOTFS#", self.target_rootfs, line)
meta/lib/oe/package_manager/deb/rootfs.py +2 -2
@@ -81,8 +81,8 @@ class DpkgOpkgRootfs(Rootfs): for edge in graph[node]: if edge not in resolved: if edge in seen: - raise RuntimeError("Packages %s and %s have " \ - "a circular dependency in postinsts scripts." \ + raise RuntimeError("Packages %s and %s have " + "a circular dependency in postinsts scripts." % (node, edge)) _dep_resolve(graph, edge, resolved, seen)
meta/lib/oe/package_manager/ipk/rootfs.py +2 -2
@@ -82,8 +82,8 @@ class DpkgOpkgRootfs(Rootfs): for edge in graph[node]: if edge not in resolved: if edge in seen: - raise RuntimeError("Packages %s and %s have " \ - "a circular dependency in postinsts scripts." \ + raise RuntimeError("Packages %s and %s have " + "a circular dependency in postinsts scripts." % (node, edge)) _dep_resolve(graph, edge, resolved, seen)
meta/lib/oe/prservice.py +1 -1
@@ -82,7 +82,7 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False): with open(df, "a") as f: if metainfo: #dump column info - f.write("#PR_core_ver = \"%s\"\n\n" % metainfo['core_ver']); + f.write("#PR_core_ver = \"%s\"\n\n" % metainfo['core_ver']) f.write("#Table: %s\n" % metainfo['tbl_name']) f.write("#Columns:\n") f.write("#name \t type \t notn \t dflt \t pk\n")
meta/lib/oe/sdk.py +1 -1
@@ -93,7 +93,7 @@ class Sdk(object, metaclass=ABCMeta): if linguas == "all": pm.install_glob("nativesdk-glibc-binary-localedata-*.utf-8", sdk=True) else: - pm.install(["nativesdk-glibc-binary-localedata-%s.utf-8" % \ + pm.install(["nativesdk-glibc-binary-localedata-%s.utf-8" % lang for lang in linguas.split()]) # Generate a locale archive of them target_arch = self.d.getVar('SDK_ARCH')
meta/lib/oe/terminal.py +2 -1
@@ -63,7 +63,8 @@ class Gnome(XTerminal): # https://bugzilla.gnome.org/show_bug.cgi?id=732127; as a workaround, # clearing the LC_ALL environment variable so it uses the locale. # Once fixed on the gnome-terminal project, this should be removed. - if os.getenv('LC_ALL'): os.putenv('LC_ALL','') + if os.getenv('LC_ALL'): + os.putenv('LC_ALL','') XTerminal.__init__(self, sh_cmd, title, env, d)
meta/lib/oe/utils.py +2 -2
@@ -391,7 +391,7 @@ def get_host_compiler_version(d, taskcontextonly=False): # datastore PATH does not contain session PATH as set by environment-setup-... # this breaks the install-buildtools use-case # env["PATH"] = d.getVar("PATH") - output = subprocess.check_output("%s --version" % compiler, \ + output = subprocess.check_output("%s --version" % compiler, shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8") except subprocess.CalledProcessError as e: bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
@@ -418,7 +418,7 @@ def host_gcc_version(d, taskcontextonly=False): try: env = os.environ.copy() env["PATH"] = d.getVar("PATH") - output = subprocess.check_output("%s --version" % compiler, \ + output = subprocess.check_output("%s --version" % compiler, shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8") except subprocess.CalledProcessError as e: bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
meta/lib/oeqa/core/case.py +1 -1
@@ -14,7 +14,7 @@ def _validate_td_vars(td, td_vars, type_msg): if td_vars: for v in td_vars: if not v in td: - raise OEQAMissingVariable("Test %s need %s variable but"\ + raise OEQAMissingVariable("Test %s need %s variable but" " isn't into td" % (type_msg, v)) class OETestCase(unittest.TestCase):
meta/lib/oeqa/core/context.py +2 -2
@@ -144,7 +144,7 @@ class OETestContextExecutor(object): if self.default_cases: self.parser.add_argument('CASES_PATHS', action='store', default=self.default_cases, nargs='*', - help="paths to directories with test cases, default: %s"\ + help="paths to directories with test cases, default: %s" % self.default_cases) else: self.parser.add_argument('CASES_PATHS', action='store',
@@ -153,7 +153,7 @@ class OETestContextExecutor(object): self.parser.set_defaults(func=self.run) def _setup_logger(self, logger, args): - formatter = logging.Formatter('%(asctime)s - ' + self.name + \ + formatter = logging.Formatter('%(asctime)s - ' + self.name + ' - %(levelname)s - %(message)s') sh = logger.handlers[0] sh.setFormatter(formatter)
meta/lib/oeqa/core/decorator/data.py +1 -1
@@ -113,7 +113,7 @@ class OETestDataDepends(OETestDecorator): try: value = self.case.td[v] except KeyError: - raise OEQAMissingVariable("Test case need %s variable but"\ + raise OEQAMissingVariable("Test case need %s variable but" " isn't into td" % v) @registerDecorator
meta/lib/oeqa/core/decorator/depends.py +3 -3
@@ -37,7 +37,7 @@ def _validate_test_case_depends(cases, depends): continue for dep in depends[case]: if not dep in cases: - raise OEQADependency("TestCase %s depends on %s and isn't available"\ + raise OEQADependency("TestCase %s depends on %s and isn't available" ", cases available %s." % (case, dep, str(cases.keys()))) def _order_test_case_by_depends(cases, depends):
@@ -46,7 +46,7 @@ def _order_test_case_by_depends(cases, depends): for edge in graph[node]: if edge not in resolved: if edge in seen: - raise OEQADependency("Test cases %s and %s have a circular" \ + raise OEQADependency("Test cases %s and %s have a circular" " dependency." % (node, edge)) _dep_resolve(graph, edge, resolved, seen) resolved.append(node)
@@ -73,7 +73,7 @@ def _skipTestDependency(case, depends): found = True break if not found: - raise SkipTest("Test case %s depends on %s but it didn't pass/run." \ + raise SkipTest("Test case %s depends on %s but it didn't pass/run." % (case.id(), dep)) @registerDecorator
meta/lib/oeqa/core/loader.py +9 -9
@@ -106,7 +106,7 @@ class OETestLoader(unittest.TestLoader): def _handle(obj): if isinstance(obj, OETestDecorator): if not obj.__class__ in decoratorClasses: - raise Exception("Decorator %s isn't registered" \ + raise Exception("Decorator %s isn't registered" " in decoratorClasses." % obj.__name__) obj.bind(self.tc._registry, case)
@@ -217,11 +217,11 @@ class OETestLoader(unittest.TestLoader): Returns a suite of all tests cases contained in testCaseClass. """ if issubclass(testCaseClass, unittest.suite.TestSuite): - raise TypeError("Test cases should not be derived from TestSuite." \ - " Maybe you meant to derive %s from TestCase?" \ + raise TypeError("Test cases should not be derived from TestSuite." + " Maybe you meant to derive %s from TestCase?" % testCaseClass.__name__) if not issubclass(testCaseClass, unittest.case.TestCase): - raise TypeError("Test %s is not derived from %s" % \ + raise TypeError("Test %s is not derived from %s" % (testCaseClass.__name__, unittest.case.TestCase.__name__)) testCaseNames = self.getTestCaseNames(testCaseClass)
@@ -262,7 +262,7 @@ class OETestLoader(unittest.TestLoader): break if not found: - raise OEQATestNotFound("Not found %s in loaded test cases" % \ + raise OEQATestNotFound("Not found %s in loaded test cases" % module) def discover(self):
@@ -300,14 +300,14 @@ class OETestLoader(unittest.TestLoader): # module list. # Underscore modules are loaded only if specified in module list. load_module = True if not module_name.startswith('_') \ - and (not self.modules \ - or module_name in self.modules \ - or module_name_small in self.modules \ + and (not self.modules + or module_name in self.modules + or module_name_small in self.modules or 'auto' in self.modules) \ else False load_underscore = True if module_name.startswith('_') \ - and (module_name in self.modules or \ + and (module_name in self.modules or module_name_small in self.modules) \ else False
meta/lib/oeqa/oetest.py +2 -2
@@ -145,8 +145,8 @@ def skipModule(reason, pos=2): if modname not in oeTest.tc.testsrequired: raise unittest.SkipTest("%s: %s" % (modname, reason)) else: - raise Exception("\nTest %s wants to be skipped.\nReason is: %s" \ - "\nTest was required in TEST_SUITES, so either the condition for skipping is wrong" \ + raise Exception("\nTest %s wants to be skipped.\nReason is: %s" + "\nTest was required in TEST_SUITES, so either the condition for skipping is wrong" "\nor the image really doesn't have the required feature/package when it should." % (modname, reason)) def skipModuleIf(cond, reason):
meta/lib/oeqa/runtime/context.py +5 -5
@@ -62,15 +62,15 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): runtime_group.add_argument('--target-type', action='store', default=self.default_target_type, choices=['simpleremote', 'qemu'], - help="Target type of device under test, default: %s" \ + help="Target type of device under test, default: %s" % self.default_target_type) runtime_group.add_argument('--target-ip', action='store', default=self.default_target_ip, - help="IP address of device under test, default: %s" \ + help="IP address of device under test, default: %s" % self.default_target_ip) runtime_group.add_argument('--server-ip', action='store', default=self.default_target_ip, - help="IP address of device under test, default: %s" \ + help="IP address of device under test, default: %s" % self.default_server_ip) runtime_group.add_argument('--host-dumper-dir', action='store',
@@ -78,12 +78,12 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): runtime_group.add_argument('--packages-manifest', action='store', default=self.default_manifest, - help="Package manifest of the image under test, default: %s" \ + help="Package manifest of the image under test, default: %s" % self.default_manifest) runtime_group.add_argument('--extract-dir', action='store', default=self.default_extract_dir, - help='Directory where extracted packages reside, default: %s' \ + help='Directory where extracted packages reside, default: %s' % self.default_extract_dir) runtime_group.add_argument('--qemu-boot', action='store',
meta/lib/oeqa/sdk/case.py +1 -1
@@ -11,7 +11,7 @@ from oeqa.core.case import OETestCase class OESDKTestCase(OETestCase): def _run(self, cmd): - return subprocess.check_output(". %s > /dev/null; %s;" % \ + return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdk_env, cmd), shell=True, executable="/bin/bash", stderr=subprocess.STDOUT, universal_newlines=True)
meta/lib/oeqa/sdk/cases/buildgalculator.py +1 -1
@@ -16,7 +16,7 @@ class GalculatorTest(OESDKTestCase): Test that autotools and GTK+ 3 compiles correctly. """ def setUp(self): - if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \ + if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or self.tc.hasTargetPackage("libgtk-3.0", multilib=True)): raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3") if not (self.tc.hasHostPackage("nativesdk-gettext-dev")):
meta/lib/oeqa/sdk/cases/gcc.py +1 -1
@@ -43,7 +43,7 @@ class GccCompileTest(OESDKTestCase): @classmethod def tearDownClass(self): - files = [os.path.join(self.tc.sdk_dir, f) \ + files = [os.path.join(self.tc.sdk_dir, f) for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testsdkmakefile']] for f in files:
meta/lib/oeqa/sdk/context.py +4 -4
@@ -120,7 +120,7 @@ class OESDKTestContextExecutor(OETestContextExecutor): return sdk_env def _display_sdk_envs(self, log, args, sdk_envs): - log("Available SDK environments at directory %s:" \ + log("Available SDK environments at directory %s:" % args.sdk_dir) log("") for env in sdk_envs:
@@ -130,12 +130,12 @@ class OESDKTestContextExecutor(OETestContextExecutor): import argparse_oe if not args.sdk_dir: - raise argparse_oe.ArgumentUsageError("No SDK directory "\ + raise argparse_oe.ArgumentUsageError("No SDK directory " "specified please do, --sdk-dir SDK_DIR", self.name) sdk_envs = OESDKTestContextExecutor._get_sdk_environs(args.sdk_dir) if not sdk_envs: - raise argparse_oe.ArgumentUsageError("No available SDK "\ + raise argparse_oe.ArgumentUsageError("No available SDK " "environments found at %s" % args.sdk_dir, self.name) if args.list_sdk_env:
@@ -144,7 +144,7 @@ class OESDKTestContextExecutor(OETestContextExecutor): if not args.sdk_env in sdk_envs: self._display_sdk_envs(logger.error, args, sdk_envs) - raise argparse_oe.ArgumentUsageError("No valid SDK "\ + raise argparse_oe.ArgumentUsageError("No valid SDK " "environment (%s) specified" % args.sdk_env, self.name) self.sdk_env = sdk_envs[args.sdk_env]
meta/lib/oeqa/sdkext/case.py +1 -1
@@ -19,6 +19,6 @@ class OESDKExtTestCase(OESDKTestCase): paths_to_avoid = ['bitbake/bin', 'poky/scripts'] env['PATH'] = avoid_paths_in_environ(paths_to_avoid) - return subprocess.check_output(". %s > /dev/null;"\ + return subprocess.check_output(". %s > /dev/null;" " %s;" % (self.tc.sdk_env, cmd), stderr=subprocess.STDOUT, shell=True, env=env, universal_newlines=True)
meta/lib/oeqa/sdkext/cases/devtool.py +1 -1
@@ -52,7 +52,7 @@ class DevtoolTest(OESDKExtTestCase): def test_devtool_location(self): output = self._run('which devtool') - self.assertEqual(output.startswith(self.tc.sdk_dir), True, \ + self.assertEqual(output.startswith(self.tc.sdk_dir), True, msg="Seems that devtool isn't the eSDK one: %s" % output) def test_devtool_add_reset(self):
meta/lib/oeqa/sdkext/testsdk.py +2 -2
@@ -30,7 +30,7 @@ class TestSDKExt(TestSDKBase): tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh") if not os.path.exists(tcname): - bb.fatal("The toolchain ext %s is not built. Build it before running the" \ + bb.fatal("The toolchain ext %s is not built. Build it before running the" " tests: 'bitbake <image> -c populate_sdk_ext' ." % tcname) tdname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.testdata.json")
@@ -73,7 +73,7 @@ class TestSDKExt(TestSDKBase): f.write('PREMIRRORS_prepend = " git://git.yoctoproject.org/.* git://%s/git2/git.yoctoproject.org.BASENAME \\n "\n' % test_data.get('DL_DIR')) # We need to do this in case we have a minimal SDK - subprocess.check_output(". %s > /dev/null; devtool sdk-install meta-extsdk-toolchain" % \ + subprocess.check_output(". %s > /dev/null; devtool sdk-install meta-extsdk-toolchain" % sdk_env, cwd=sdk_dir, shell=True, stderr=subprocess.STDOUT) tc = OESDKExtTestContext(td=test_data, logger=logger, sdk_dir=sdk_dir,
meta/lib/oeqa/selftest/case.py +4 -4
@@ -55,13 +55,13 @@ class OESelftestTestCase(OETestCase): if "#include added by oe-selftest" \ not in ftools.read_file(os.path.join(cls.builddir, "conf/local.conf")): cls.logger.info("Adding: \"include selftest.inc\" in %s" % os.path.join(cls.builddir, "conf/local.conf")) - ftools.append_file(os.path.join(cls.builddir, "conf/local.conf"), \ + ftools.append_file(os.path.join(cls.builddir, "conf/local.conf"), "\n#include added by oe-selftest\ninclude machine.inc\ninclude selftest.inc") if "#include added by oe-selftest" \ not in ftools.read_file(os.path.join(cls.builddir, "conf/bblayers.conf")): cls.logger.info("Adding: \"include bblayers.inc\" in bblayers.conf") - ftools.append_file(os.path.join(cls.builddir, "conf/bblayers.conf"), \ + ftools.append_file(os.path.join(cls.builddir, "conf/bblayers.conf"), "\n#include added by oe-selftest\ninclude bblayers.inc") @classmethod
@@ -69,13 +69,13 @@ class OESelftestTestCase(OETestCase): if "#include added by oe-selftest.py" \ in ftools.read_file(os.path.join(cls.builddir, "conf/local.conf")): cls.logger.info("Removing the include from local.conf") - ftools.remove_from_file(os.path.join(cls.builddir, "conf/local.conf"), \ + ftools.remove_from_file(os.path.join(cls.builddir, "conf/local.conf"), "\n#include added by oe-selftest.py\ninclude machine.inc\ninclude selftest.inc") if "#include added by oe-selftest.py" \ in ftools.read_file(os.path.join(cls.builddir, "conf/bblayers.conf")): cls.logger.info("Removing the include from bblayers.conf") - ftools.remove_from_file(os.path.join(cls.builddir, "conf/bblayers.conf"), \ + ftools.remove_from_file(os.path.join(cls.builddir, "conf/bblayers.conf"), "\n#include added by oe-selftest.py\ninclude bblayers.inc") @classmethod
meta/lib/oeqa/selftest/cases/manifest.py +20 -18
@@ -23,14 +23,14 @@ class VerifyManifest(OESelftestTestCase): with open(manifest, "r") as mfile: for line in mfile: manifest_entry = os.path.join(path, line.split()[0]) - self.logger.debug("{}: looking for {}"\ + self.logger.debug("{}: looking for {}" .format(self.classname, manifest_entry)) if not os.path.isfile(manifest_entry): manifest_errors.append(manifest_entry) - self.logger.debug("{}: {} not found"\ + self.logger.debug("{}: {} not found" .format(self.classname, manifest_entry)) except OSError as e: - self.logger.debug("{}: checking of {} failed"\ + self.logger.debug("{}: checking of {} failed" .format(self.classname, manifest)) raise e
@@ -40,9 +40,9 @@ class VerifyManifest(OESelftestTestCase): @classmethod def get_dir_from_bb_var(self, bb_var, target = None): target == self.buildtarget if target == None else target - directory = get_bb_var(bb_var, target); + directory = get_bb_var(bb_var, target) if not directory or not os.path.isdir(directory): - self.logger.debug("{}: {} points to {} when target = {}"\ + self.logger.debug("{}: {} points to {} when target = {}" .format(self.classname, bb_var, directory, target)) raise OSError return directory
@@ -54,12 +54,12 @@ class VerifyManifest(OESelftestTestCase): self.buildtarget = 'core-image-minimal' self.classname = 'VerifyManifest' - self.logger.info("{}: doing bitbake {} as a prerequisite of the test"\ + self.logger.info("{}: doing bitbake {} as a prerequisite of the test" .format(self.classname, self.buildtarget)) if bitbake(self.buildtarget).status: - self.logger.debug("{} Failed to setup {}"\ + self.logger.debug("{} Failed to setup {}" .format(self.classname, self.buildtarget)) - self.skipTest("{}: Cannot setup testing scenario"\ + self.skipTest("{}: Cannot setup testing scenario" .format(self.classname)) def test_SDK_manifest_entries(self):
@@ -69,12 +69,12 @@ class VerifyManifest(OESelftestTestCase): # to do an additional setup for the sdk sdktask = '-c populate_sdk' bbargs = sdktask + ' ' + self.buildtarget - self.logger.debug("{}: doing bitbake {} as a prerequisite of the test"\ + self.logger.debug("{}: doing bitbake {} as a prerequisite of the test" .format(self.classname, bbargs)) if bitbake(bbargs).status: - self.logger.debug("{} Failed to bitbake {}"\ + self.logger.debug("{} Failed to bitbake {}" .format(self.classname, bbargs)) - self.skipTest("{}: Cannot setup testing scenario"\ + self.skipTest("{}: Cannot setup testing scenario" .format(self.classname))
@@ -104,7 +104,7 @@ class VerifyManifest(OESelftestTestCase): self.classname, reverse_dir[k])) raise IOError except OSError: - raise self.skipTest("{}: Error in obtaining manifest dirs"\ + raise self.skipTest("{}: Error in obtaining manifest dirs" .format(self.classname)) except IOError: msg = "{}: Error cannot find manifests in the specified dir:\n{}"\
@@ -115,7 +115,7 @@ class VerifyManifest(OESelftestTestCase): self.logger.debug("{}: Check manifest {}".format( self.classname, m_entry[k].file)) - m_entry[k].missing = self.check_manifest_entries(\ + m_entry[k].missing = self.check_manifest_entries( m_entry[k].file,reverse_dir[k]) if m_entry[k].missing: msg = '{}: {} Error has the following missing entries'\
@@ -135,25 +135,27 @@ class VerifyManifest(OESelftestTestCase): mfilename = get_bb_var("IMAGE_LINK_NAME", self.buildtarget)\ + ".manifest" mpath = os.path.join(mdir, mfilename) - if not os.path.isfile(mpath): raise IOError + if not os.path.isfile(mpath): + raise IOError m_entry = ManifestEntry(mpath) pkgdata_dir = {} pkgdata_dir = self.get_dir_from_bb_var('PKGDATA_DIR', self.buildtarget) revdir = os.path.join(pkgdata_dir, 'runtime-reverse') - if not os.path.exists(revdir): raise IOError + if not os.path.exists(revdir): + raise IOError except OSError: - raise self.skipTest("{}: Error in obtaining manifest dirs"\ + raise self.skipTest("{}: Error in obtaining manifest dirs" .format(self.classname)) except IOError: msg = "{}: Error cannot find manifests in dir:\n{}"\ .format(self.classname, mdir) self.fail(msg) - self.logger.debug("{}: Check manifest {}"\ + self.logger.debug("{}: Check manifest {}" .format(self.classname, m_entry.file)) - m_entry.missing = self.check_manifest_entries(\ + m_entry.missing = self.check_manifest_entries( m_entry.file, revdir) if m_entry.missing: msg = '{}: {} Error has the following missing entries'\
meta/lib/oeqa/selftest/cases/wic.py +34 -34
242 lines not on this page · raw message
meta/lib/oeqa/selftest/context.py +2 -2
@@ -133,7 +133,7 @@ class OESelftestTestContext(OETestContext): self.custommachine = machine if machine == 'random': self.custommachine = choice(self.machines) - self.logger.info('Run tests with custom MACHINE set to: %s' % \ + self.logger.info('Run tests with custom MACHINE set to: %s' % self.custommachine) return super(OESelftestTestContext, self).runTests(processes, skips)
@@ -289,7 +289,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): def _add_layer_libs(): bbpath = self.tc.td['BBPATH'].split(':') - layer_libdirs = [p for p in (os.path.join(l, 'lib') \ + layer_libdirs = [p for p in (os.path.join(l, 'lib') for l in bbpath) if os.path.exists(p)] if layer_libdirs: self.tc.logger.info("Adding layer libraries:")
meta/lib/oeqa/utils/__init__.py +4 -4
@@ -69,13 +69,13 @@ def load_test_components(logger, executor): comp_name = file comp_context = os.path.join(base_dir, file, 'context.py') if os.path.exists(comp_context): - comp_plugin = importlib.import_module('oeqa.%s.%s' % \ + comp_plugin = importlib.import_module('oeqa.%s.%s' % (comp_name, 'context')) try: if not issubclass(comp_plugin._executor_class, OETestContextExecutor): - raise TypeError("Component %s in %s, _executor_class "\ - "isn't derived from OETestContextExecutor."\ + raise TypeError("Component %s in %s, _executor_class " + "isn't derived from OETestContextExecutor." % (comp_name, comp_context)) if comp_plugin._executor_class._script_executor \
@@ -84,7 +84,7 @@ def load_test_components(logger, executor): components[comp_name] = comp_plugin._executor_class() except AttributeError: - raise AttributeError("Component %s in %s don't have "\ + raise AttributeError("Component %s in %s don't have " "_executor_class defined." % (comp_name, comp_context)) return components
meta/lib/oeqa/utils/testexport.py +4 -2
@@ -86,8 +86,10 @@ def process_binaries(d, params): packaged_bin_dir = os.path.join(exportpath,"binaries", arch, "packaged_binaries") # creating necessary directory structure in case testing is done in poky env. if export_env == "0": - if not os.path.exists(extracted_bin_dir): bb.utils.mkdirhier(extracted_bin_dir) - if not os.path.exists(packaged_bin_dir): bb.utils.mkdirhier(packaged_bin_dir) + if not os.path.exists(extracted_bin_dir): + bb.utils.mkdirhier(extracted_bin_dir) + if not os.path.exists(packaged_bin_dir): + bb.utils.mkdirhier(packaged_bin_dir) if param_list[3] == "native": if export_env == "1": #this is a native package and we only need to copy it. no need for extraction
meta/recipes-rt/rt-tests/files/rt_bmark.py +1 -1
@@ -193,7 +193,7 @@ def end_stress(p): def us2hms_str(us): s = (us+500000) // 1000000 # Round microseconds to s m = s//60 - s -= 60*m; + s -= 60*m h = m//60 m -= 60*h
scripts/bitbake-whatchanged +2 -2
@@ -302,10 +302,10 @@ Note: print("\n=== Summary: (%s changed, %s unchanged)" % (total_changed, cnt_unchanged)) if args.verbose: - print("Newly added: %s\nDependencies changed: %s\n" % \ + print("Newly added: %s\nDependencies changed: %s\n" % (cnt_added, cnt_dep)) else: - print("Newly added: %s\nPV changed: %s\nPR changed: %s\nDependencies changed: %s\n" % \ + print("Newly added: %s\nPV changed: %s\nPR changed: %s\nDependencies changed: %s\n" % (cnt_added, cnt_rv.get('pv') or 0, cnt_rv.get('pr') or 0, cnt_dep)) except: print("ERROR occurred!")
scripts/combo-layer +6 -6
@@ -517,10 +517,10 @@ def drop_to_shell(workdir=None): return False shell = os.environ.get('SHELL', 'bash') - print('Dropping to shell "%s"\n' \ - 'When you are finished, run the following to continue:\n' \ - ' exit -- continue to apply the patches\n' \ - ' exit 1 -- abort\n' % shell); + print('Dropping to shell "%s"\n' + 'When you are finished, run the following to continue:\n' + ' exit -- continue to apply the patches\n' + ' exit 1 -- abort\n' % shell) ret = subprocess.call([shell], cwd=workdir) if ret != 0: print("Aborting")
@@ -725,8 +725,8 @@ def update_with_patches(conf, components, revisions, repos): # Step 5: invoke bash for user to edit patch and patch list if conf.interactive: - print('You may now edit the patch and patch list in %s\n' \ - 'For example, you can remove unwanted patch entries from patchlist-*, so that they will be not applied later' % patch_dir); + print('You may now edit the patch and patch list in %s\n' + 'For example, you can remove unwanted patch entries from patchlist-*, so that they will be not applied later' % patch_dir) if not drop_to_shell(patch_dir): sys.exit(1)
scripts/lib/checklayer/__init__.py +2 -2
@@ -158,7 +158,7 @@ def _find_layer_depends(depend, layers): def add_layer_dependencies(bblayersconf, layer, layers, logger): def recurse_dependencies(depends, layer, layers, logger, ret = []): - logger.debug('Processing dependencies %s for layer %s.' % \ + logger.debug('Processing dependencies %s for layer %s.' % (depends, layer['name'])) for depend in depends.split():
@@ -168,7 +168,7 @@ def add_layer_dependencies(bblayersconf, layer, layers, logger): layer_depend = _find_layer_depends(depend, layers) if not layer_depend: - logger.error('Layer %s depends on %s and isn\'t found.' % \ + logger.error('Layer %s depends on %s and isn\'t found.' % (layer['name'], depend)) ret = None continue
scripts/lib/checklayer/cases/bsp.py +2 -2
@@ -12,7 +12,7 @@ class BSPCheckLayer(OECheckLayerTestCase): @classmethod def setUpClass(self): if self.tc.layer['type'] != LayerType.BSP: - raise unittest.SkipTest("BSPCheckLayer: Layer %s isn't BSP one." %\ + raise unittest.SkipTest("BSPCheckLayer: Layer %s isn't BSP one." % self.tc.layer['name']) def test_bsp_defines_machines(self):
@@ -24,7 +24,7 @@ class BSPCheckLayer(OECheckLayerTestCase): machine = get_bb_var('MACHINE') self.assertEqual(self.td['bbvars']['MACHINE'], machine, - msg="Layer %s modified machine %s -> %s" % \ + msg="Layer %s modified machine %s -> %s" % (self.tc.layer['name'], self.td['bbvars']['MACHINE'], machine))
scripts/lib/checklayer/cases/common.py +2 -2
@@ -46,7 +46,7 @@ class CommonCheckLayer(OECheckLayerTestCase): def test_signatures(self): if self.tc.layer['type'] == LayerType.SOFTWARE and \ not self.tc.test_software_layer_signatures: - raise unittest.SkipTest("Not testing for signature changes in a software layer %s." \ + raise unittest.SkipTest("Not testing for signature changes in a software layer %s." % self.tc.layer['name']) curr_sigs, _ = get_signatures(self.td['builddir'], failsafe=True)
@@ -56,5 +56,5 @@ class CommonCheckLayer(OECheckLayerTestCase): def test_layerseries_compat(self): for collection_name, collection_data in self.tc.layer['collections'].items(): - self.assertTrue(collection_data['compat'], "Collection %s from layer %s does not set compatible oe-core versions via LAYERSERIES_COMPAT_collection." \ + self.assertTrue(collection_data['compat'], "Collection %s from layer %s does not set compatible oe-core versions via LAYERSERIES_COMPAT_collection." % (collection_name, self.tc.layer['name']))
scripts/lib/checklayer/cases/distro.py +2 -2
@@ -12,7 +12,7 @@ class DistroCheckLayer(OECheckLayerTestCase): @classmethod def setUpClass(self): if self.tc.layer['type'] != LayerType.DISTRO: - raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\ + raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." % self.tc.layer['name']) def test_distro_defines_distros(self):
@@ -24,5 +24,5 @@ class DistroCheckLayer(OECheckLayerTestCase): distro = get_bb_var('DISTRO') self.assertEqual(self.td['bbvars']['DISTRO'], distro, - msg="Layer %s modified distro %s -> %s" % \ + msg="Layer %s modified distro %s -> %s" % (self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro))
scripts/lib/devtool/sdk.py +2 -2
@@ -150,8 +150,8 @@ def sdk_update(args, config, basepath, workspace): if not out: ret = subprocess.call("git fetch --all; git reset --hard @{u}", shell=True, cwd=layers_dir) else: - logger.error("Failed to update metadata as there have been changes made to it. Aborting."); - logger.error("Changed files:\n%s" % out); + logger.error("Failed to update metadata as there have been changes made to it. Aborting.") + logger.error("Changed files:\n%s" % out) return -1 else: ret = -1
scripts/lib/wic/engine.py +3 -3
@@ -76,7 +76,7 @@ def find_canned_image(scripts_path, wks_file): for fname in files: if fname.endswith("~") or fname.endswith("#"): continue - if ((fname.endswith(".wks") and wks_file + ".wks" == fname) or \ + if ((fname.endswith(".wks") and wks_file + ".wks" == fname) or (fname.endswith(".wks.in") and wks_file + ".wks.in" == fname)): fullpath = os.path.join(canned_wks_dir, fname) return fullpath
@@ -519,7 +519,7 @@ class Disk: partimg = self._get_part_image(pnum) sparse_copy(partimg, partfname) exec_cmd("{} -pf {}".format(self.e2fsck, partfname)) - exec_cmd("{} {} {}s".format(\ + exec_cmd("{} {} {}s".format( self.resize2fs, partfname, part['size'])) elif fstype.startswith('fat'): logger.info("copying content of the fat partition {}".format(pnum))
@@ -561,7 +561,7 @@ def wic_ls(args, native_sysroot): if disk.partitions: print('Num Start End Size Fstype') for part in disk.partitions.values(): - print("{:2d} {:12d} {:12d} {:12d} {}".format(\ + print("{:2d} {:12d} {:12d} {:12d} {}".format( part.pnum, part.start, part.end, part.size, part.fstype)) else:
scripts/lib/wic/filemap.py +1 -1
@@ -215,7 +215,7 @@ class FilemapSeek(_FilemapBase): try: tmp_obj = tempfile.TemporaryFile("w+", dir=directory) except IOError as err: - raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" \ + raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" % (directory, err)) try:
scripts/lib/wic/ksparser.py +2 -2
@@ -217,7 +217,7 @@ class KickStart(): line_args = shlex.split(line) parsed = parser.parse_args(line_args) except ArgumentError as err: - raise KickStartError('%s:%d: %s' % \ + raise KickStartError('%s:%d: %s' % (confpath, lineno, err)) if line.startswith('part'): # SquashFS does not support filesystem UUID
@@ -286,7 +286,7 @@ class KickStart(): # Concatenate the strings set in APPEND append_var = get_bitbake_var("APPEND") if append_var: - self.bootloader.append = ' '.join(filter(None, \ + self.bootloader.append = ' '.join(filter(None, (self.bootloader.append, append_var))) else: err = "%s:%d: more than one bootloader specified" \
scripts/lib/wic/misc.py +1 -1
@@ -99,7 +99,7 @@ def _exec_cmd(cmd_and_args, as_shell=False): ret, out = runtool(args) out = out.strip() if ret != 0: - raise WicError("_exec_cmd: %s returned '%s' instead of 0\noutput: %s" % \ + raise WicError("_exec_cmd: %s returned '%s' instead of 0\noutput: %s" % (cmd_and_args, ret, out)) logger.debug("_exec_cmd: output for %s (rc = %d): %s",
scripts/lib/wic/plugins/imager/direct.py +9 -9
@@ -209,7 +209,7 @@ class DirectPlugin(ImagerPlugin): logger.debug("Generating bmap file for %s", disk_name) python = os.path.join(self.native_sysroot, 'usr/bin/python3-native/python3') bmaptool = os.path.join(self.native_sysroot, 'usr/bin/bmaptool') - exec_native_cmd("%s %s create %s -o %s.bmap" % \ + exec_native_cmd("%s %s create %s -o %s.bmap" % (python, bmaptool, full_path, full_path), self.native_sysroot) # Compress the image if self.compressor:
@@ -377,14 +377,14 @@ class PartitionedImage(): part = self.partitions[num] if self.ptable_format == 'msdos' and part.part_name: - raise WicError("setting custom partition name is not " \ + raise WicError("setting custom partition name is not " "implemented for msdos partitions") if self.ptable_format == 'msdos' and part.part_type: # The --part-type can also be implemented for MBR partitions, # in which case it would map to the 1-byte "partition type" # filed at offset 3 of the partition entry. - raise WicError("setting custom partition type is not " \ + raise WicError("setting custom partition type is not " "implemented for msdos partitions") # Get the disk where the partition is located
@@ -562,28 +562,28 @@ class PartitionedImage(): if part.part_name: logger.debug("partition %d: set name to %s", part.num, part.part_name) - exec_native_cmd("sgdisk --change-name=%d:%s %s" % \ + exec_native_cmd("sgdisk --change-name=%d:%s %s" % (part.num, part.part_name, self.path), self.native_sysroot) if part.part_type: logger.debug("partition %d: set type UID to %s", part.num, part.part_type) - exec_native_cmd("sgdisk --typecode=%d:%s %s" % \ + exec_native_cmd("sgdisk --typecode=%d:%s %s" % (part.num, part.part_type, self.path), self.native_sysroot) if part.uuid and self.ptable_format == "gpt": logger.debug("partition %d: set UUID to %s", part.num, part.uuid) - exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \ + exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % (part.num, part.uuid, self.path), self.native_sysroot) if part.label and self.ptable_format == "gpt": logger.debug("partition %d: set name to %s", part.num, part.label) - exec_native_cmd("parted -s %s name %d %s" % \ + exec_native_cmd("parted -s %s name %d %s" % (self.path, part.num, part.label), self.native_sysroot)
@@ -591,11 +591,11 @@ class PartitionedImage(): flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot" logger.debug("Set '%s' flag for partition '%s' on disk '%s'", flag_name, part.num, self.path) - exec_native_cmd("parted -s %s set %d %s on" % \ + exec_native_cmd("parted -s %s set %d %s on" % (self.path, part.num, flag_name), self.native_sysroot) if part.system_id: - exec_native_cmd("sfdisk --part-type %s %s %s" % \ + exec_native_cmd("sfdisk --part-type %s %s %s" % (self.path, part.num, part.system_id), self.native_sysroot)
scripts/lib/wic/plugins/source/bootimg-efi.py +1 -1
@@ -241,7 +241,7 @@ class BootimgEFIPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.install_task = []; + cls.install_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src:
scripts/lib/wic/plugins/source/bootimg-partition.py +1 -1
@@ -76,7 +76,7 @@ class BootimgPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.install_task = []; + cls.install_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src:
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +5 -5
@@ -170,24 +170,24 @@ class IsoImagePlugin(SourcePlugin): # Create initrd from rootfs directory initrd = "%s/initrd.cpio.gz" % cr_workdir initrd_dir = "%s/INITRD" % cr_workdir - shutil.copytree("%s" % rootfs_dir, \ + shutil.copytree("%s" % rootfs_dir, "%s" % initrd_dir, symlinks=True) if os.path.isfile("%s/init" % rootfs_dir): shutil.copy2("%s/init" % rootfs_dir, "%s/init" % initrd_dir) elif os.path.lexists("%s/init" % rootfs_dir): - os.symlink(os.readlink("%s/init" % rootfs_dir), \ + os.symlink(os.readlink("%s/init" % rootfs_dir), "%s/init" % initrd_dir) elif os.path.isfile("%s/sbin/init" % rootfs_dir): - shutil.copy2("%s/sbin/init" % rootfs_dir, \ + shutil.copy2("%s/sbin/init" % rootfs_dir, "%s" % initrd_dir) elif os.path.lexists("%s/sbin/init" % rootfs_dir): - os.symlink(os.readlink("%s/sbin/init" % rootfs_dir), \ + os.symlink(os.readlink("%s/sbin/init" % rootfs_dir), "%s/init" % initrd_dir) else: raise WicError("Couldn't find or build initrd, exiting.") - exec_cmd("cd %s && find . | cpio -o -H newc -R root:root >%s/initrd.cpio " \ + exec_cmd("cd %s && find . | cpio -o -H newc -R root:root >%s/initrd.cpio " % (initrd_dir, cr_workdir), as_shell=True) exec_cmd("gzip -f -9 %s/initrd.cpio" % cr_workdir, as_shell=True) shutil.rmtree(initrd_dir)
scripts/oe-pkgdata-browser +1 -1
@@ -31,7 +31,7 @@ def timeit(f): print ("func:%r calling" % f.__name__) result = f(*args, **kw) te = time.time() - print ('func:%r args:[%r, %r] took: %2.4f sec' % \ + print ('func:%r args:[%r, %r] took: %2.4f sec' % (f.__name__, args, kw, te-ts)) return result return timed
scripts/pybootchartgui/pybootchartgui/batch.py +1 -1
@@ -19,7 +19,7 @@ from .draw import RenderOptions def render(writer, trace, app_options, filename): handlers = { - "png": (lambda w, h: cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h), \ + "png": (lambda w, h: cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h), lambda sfc: sfc.write_to_png(filename)), "pdf": (lambda w, h: cairo.PDFSurface(filename, w, h), lambda sfc: 0), "svg": (lambda w, h: cairo.SVGSurface(filename, w, h), lambda sfc: 0)
scripts/pybootchartgui/pybootchartgui/draw.py +31 -31
146 lines not on this page · raw message
scripts/pybootchartgui/pybootchartgui/parsing.py +5 -3
@@ -297,7 +297,8 @@ def _parse_proc_ps_log(writer, file): timed_blocks = _parse_timed_blocks(file) for time, lines in timed_blocks: for line in lines: - if not line: continue + if not line: + continue tokens = line.split(' ') if len(tokens) < 21: continue
@@ -352,7 +353,8 @@ def _parse_taskstats_log(writer, file): ltime = time # continue for line in lines: - if not line: continue + if not line: + continue tokens = line.split(' ') if len(tokens) != 6: continue
@@ -380,7 +382,7 @@ def _parse_taskstats_log(writer, file): process = process.split (writer, pid, cmd, ppid, time) processMap[pid] = process else: - process.cmd = cmd; + process.cmd = cmd else: process = Process(writer, pid, cmd, ppid, time) processMap[pid] = process
scripts/pybootchartgui/pybootchartgui/samples.py +1 -1
@@ -160,7 +160,7 @@ class Process: self.parent = processMap.get (self.ppid) if self.parent == None and self.pid // 1000 > 1 and \ not (self.ppid == 2000 or self.pid == 2000): # kernel threads: ppid=2 - self.writer.warn("Missing CONFIG_PROC_EVENTS: no parent for pid '%i' ('%s') with ppid '%i'" \ + self.writer.warn("Missing CONFIG_PROC_EVENTS: no parent for pid '%i' ('%s') with ppid '%i'" % (self.pid,self.cmd,self.ppid)) def get_end_time(self):
scripts/pybootchartgui/pybootchartgui/tests/parser_test.py +1 -1
@@ -51,7 +51,7 @@ class TestBCParser(unittest.TestCase): ps_data = open(self.mk_fname('extract2.proc_ps.log')) for index, line in enumerate(ps_data): - tokens = line.split(); + tokens = line.split() process = sorted_processes[index] if debug: print(tokens[0:4])
scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py +1 -1
@@ -24,7 +24,7 @@ class TestProcessTree(unittest.TestCase): parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log')) trace.compile(writer) - self.processtree = process_tree.ProcessTree(writer, None, trace.ps_stats, \ + self.processtree = process_tree.ProcessTree(writer, None, trace.ps_stats, trace.ps_stats.sample_period, None, options.prune, None, None, False, for_testing = True) def mk_fname(self,f):
scripts/relocate_sdk.py +5 -5
@@ -95,7 +95,7 @@ def change_interpreter(elf_file_name): if p_filesz == 0: break if (len(new_dl_path) >= p_filesz): - print("ERROR: could not relocate %s, interp size = %i and %i is needed." \ + print("ERROR: could not relocate %s, interp size = %i and %i is needed." % (elf_file_name, p_memsz, len(new_dl_path) + 1)) break dl_path = new_dl_path + b("\0") * (p_filesz - len(new_dl_path))
@@ -149,7 +149,7 @@ def change_dl_sysdirs(elf_file_name): new_ldsocache_path = old_prefix.sub(new_prefix, ldsocache_path) new_ldsocache_path = new_ldsocache_path.rstrip(b("\0")) if (len(new_ldsocache_path) >= sh_size): - print("ERROR: could not relocate %s, .ldsocache section size = %i and %i is needed." \ + print("ERROR: could not relocate %s, .ldsocache section size = %i and %i is needed." % (elf_file_name, sh_size, len(new_ldsocache_path))) sys.exit(-1) # pad with zeros
@@ -164,7 +164,7 @@ def change_dl_sysdirs(elf_file_name): new_path = old_prefix.sub(new_prefix, path) new_path = new_path.rstrip(b("\0")) if (len(new_path) >= 4096): - print("ERROR: could not relocate %s, max path size = 4096 and %i is needed." \ + print("ERROR: could not relocate %s, max path size = 4096 and %i is needed." % (elf_file_name, len(new_path))) sys.exit(-1) # pad with zeros
@@ -227,8 +227,8 @@ for e in executables_list: except IOError: exctype, ioex = sys.exc_info()[:2] if ioex.errno == errno.ETXTBSY: - print("Could not open %s. File used by another process.\nPlease "\ - "make sure you exit all processes that might use any SDK "\ + print("Could not open %s. File used by another process.\nPlease " + "make sure you exit all processes that might use any SDK " "binaries." % e) else: print("Could not open %s: %s(%d)" % (e, ioex.strerror, ioex.errno))
scripts/runqemu +2 -2
@@ -521,7 +521,7 @@ class BaseConfig(object): unknown_arg = arg else: raise RunQemuError("Can't handle two unknown args: %s %s\n" - "Try 'runqemu help' on how to use it" % \ + "Try 'runqemu help' on how to use it" % (unknown_arg, arg)) # Check to make sure it is a valid machine if unknown_arg and self.get('MACHINE') != unknown_arg:
@@ -1239,7 +1239,7 @@ class BaseConfig(object): logger.info('Using ide drive') vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format) elif drive_type.startswith("/dev/vdb"): - logger.info('Using block virtio drive'); + logger.info('Using block virtio drive') vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0%s' \ % (self.rootfs, rootfs_format,qb_rootfs_extra_opt) else:
scripts/tiny/dirsize.py +1 -1
@@ -67,7 +67,7 @@ def main(): minsize = int(sys.argv[1]) rootfs = Record.create(".") total = rootfs.show(minsize) - print("Displayed %d/%d bytes (%.2f%%)" % \ + print("Displayed %d/%d bytes (%.2f%%)" % (total, rootfs.size, 100 * float(total) / rootfs.size))
scripts/tiny/ksize.py +4 -4
@@ -39,7 +39,7 @@ class Sizes: self.text = self.data = self.bss = self.total = 0 def show(self, indent=""): - print("%-32s %10d | %10d %10d %10d" % \ + print("%-32s %10d | %10d %10d %10d" % (indent+self.title, self.total, self.text, self.data, self.bss))
@@ -85,7 +85,7 @@ class Report: def show(self, indent=""): rule = str.ljust(indent, 80, '-') - print("%-32s %10s | %10s %10s %10s" % \ + print("%-32s %10s | %10s %10s %10s" % (indent+self.title, "total", "text", "data", "bss")) print(rule) self.sizes.show(indent)
@@ -94,10 +94,10 @@ class Report: if p.sizes.total > 0: p.sizes.show(indent) print(rule) - print("%-32s %10d | %10d %10d %10d" % \ + print("%-32s %10d | %10d %10d %10d" % (indent+"sum", self.totals["total"], self.totals["text"], self.totals["data"], self.totals["bss"])) - print("%-32s %10d | %10d %10d %10d" % \ + print("%-32s %10d | %10d %10d %10d" % (indent+"delta", self.deltas["total"], self.deltas["text"], self.deltas["data"], self.deltas["bss"])) print("\n")
scripts/tiny/ksum.py +6 -6
@@ -78,7 +78,7 @@ def add_ko_file(filename): if len(output) > 2: sizes = output[-1].split()[0:4] if verbose: - print(" %10d %10d %10d %10d\t" % \ + print(" %10d %10d %10d %10d\t" % (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])), end=' ') print("%s" % filename[len(os.getcwd()) + 1:]) global n_ko_files, ko_text, ko_data, ko_bss, ko_total
@@ -94,7 +94,7 @@ def get_vmlinux_totals(): if len(output) > 2: sizes = output[-1].split()[0:4] if verbose: - print(" %10d %10d %10d %10d\t" % \ + print(" %10d %10d %10d %10d\t" % (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])), end=' ') print("%s" % vmlinux_file[len(os.getcwd()) + 1:]) global vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total
@@ -132,16 +132,16 @@ def main(): print("\nTotals:") print("\nvmlinux:") print(" text\tdata\t\tbss\t\ttotal") - print(" %-10d\t%-10d\t%-10d\t%-10d" % \ + print(" %-10d\t%-10d\t%-10d\t%-10d" % (vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total)) print("\nmodules (%d):" % n_ko_files) print(" text\tdata\t\tbss\t\ttotal") - print(" %-10d\t%-10d\t%-10d\t%-10d" % \ + print(" %-10d\t%-10d\t%-10d\t%-10d" % (ko_text, ko_data, ko_bss, ko_total)) print("\nvmlinux + modules:") print(" text\tdata\t\tbss\t\ttotal") - print(" %-10d\t%-10d\t%-10d\t%-10d" % \ - (vmlinux_text + ko_text, vmlinux_data + ko_data, \ + print(" %-10d\t%-10d\t%-10d\t%-10d" % + (vmlinux_text + ko_text, vmlinux_data + ko_data, vmlinux_bss + ko_bss, vmlinux_total + ko_total)) if __name__ == "__main__":
scripts/yocto-check-layer +3 -3
@@ -107,12 +107,12 @@ def main(): logger.info("Detected layers:") for layer in layers: if layer['type'] == LayerType.ERROR_BSP_DISTRO: - logger.error("%s: Can't be DISTRO and BSP type at the same time."\ - " Both conf/distro and conf/machine folders were found."\ + logger.error("%s: Can't be DISTRO and BSP type at the same time." + " Both conf/distro and conf/machine folders were found." % layer['name']) layers.remove(layer) elif layer['type'] == LayerType.ERROR_NO_LAYER_CONF: - logger.info("%s: Doesn't have conf/layer.conf file, so ignoring"\ + logger.info("%s: Doesn't have conf/layer.conf file, so ignoring" % layer['name']) layers.remove(layer) else:
Signature · 1 line
2.32.0
PATCH 3/8 PEP8 double aggressive E251 and E252
In reply to Khem RajFrom: persianpros <[email protected]>
--- .../lib/oeqa/runtime/cases/dnf_runtime.py | 8 ++-- .../lib/oeqa/selftest/cases/external-layer.py | 2 +- meta/lib/oe/buildhistory_analysis.py | 2 +- meta/lib/oe/cachedpath.py | 2 +- meta/lib/oe/classextend.py | 6 +-- meta/lib/oe/package_manager/rpm/__init__.py | 8 ++-- meta/lib/oe/patch.py | 26 ++++++------- meta/lib/oe/path.py | 2 +- meta/lib/oe/prservice.py | 2 +- meta/lib/oe/sstatesig.py | 4 +- meta/lib/oe/terminal.py | 2 +- meta/lib/oe/types.py | 2 +- meta/lib/oe/utils.py | 2 +- meta/lib/oeqa/core/case.py | 2 +- meta/lib/oeqa/core/runner.py | 22 +++++------ meta/lib/oeqa/core/target/qemu.py | 4 +- meta/lib/oeqa/core/tests/test_decorators.py | 2 +- meta/lib/oeqa/core/utils/concurrencytest.py | 18 ++++----- meta/lib/oeqa/oetest.py | 2 +- meta/lib/oeqa/runexported.py | 2 +- meta/lib/oeqa/runtime/cases/apt.py | 2 +- meta/lib/oeqa/runtime/cases/boot.py | 2 +- meta/lib/oeqa/runtime/cases/buildcpio.py | 2 +- .../lib/oeqa/runtime/cases/buildgalculator.py | 2 +- meta/lib/oeqa/runtime/cases/buildlzip.py | 2 +- meta/lib/oeqa/runtime/cases/dnf.py | 2 +- meta/lib/oeqa/runtime/cases/logrotate.py | 18 ++++----- meta/lib/oeqa/runtime/cases/opkg.py | 2 +- meta/lib/oeqa/runtime/cases/pam.py | 8 ++-- meta/lib/oeqa/runtime/cases/parselogs.py | 2 +- meta/lib/oeqa/runtime/cases/ping.py | 2 +- meta/lib/oeqa/runtime/cases/scp.py | 2 +- meta/lib/oeqa/runtime/cases/storage.py | 20 +++++----- meta/lib/oeqa/runtime/cases/suspend.py | 6 +-- meta/lib/oeqa/runtime/cases/usb_hid.py | 4 +- meta/lib/oeqa/selftest/cases/bblayers.py | 18 ++++----- meta/lib/oeqa/selftest/cases/bbtests.py | 28 +++++++------- meta/lib/oeqa/selftest/cases/binutils.py | 2 +- meta/lib/oeqa/selftest/cases/buildoptions.py | 20 +++++----- meta/lib/oeqa/selftest/cases/devtool.py | 4 +- meta/lib/oeqa/selftest/cases/gcc.py | 6 +-- meta/lib/oeqa/selftest/cases/glibc.py | 6 +-- meta/lib/oeqa/selftest/cases/manifest.py | 6 +-- .../oeqa/selftest/cases/oelib/buildhistory.py | 12 +++--- meta/lib/oeqa/selftest/cases/oelib/path.py | 6 +-- meta/lib/oeqa/selftest/cases/pkgdata.py | 2 +- meta/lib/oeqa/selftest/cases/sstatetests.py | 6 +-- meta/lib/oeqa/targetcontrol.py | 38 +++++++++---------- meta/lib/oeqa/utils/__init__.py | 2 +- meta/lib/oeqa/utils/network.py | 2 +- meta/lib/oeqa/utils/nfs.py | 8 ++-- meta/lib/oeqa/utils/qemurunner.py | 8 ++-- meta/lib/oeqa/utils/qemutinyrunner.py | 2 +- meta/lib/oeqa/utils/sshcontrol.py | 2 +- .../glibc/glibc/check-test-wrapper | 2 +- scripts/bitbake-whatchanged | 10 ++--- scripts/buildhistory-collect-srcrevs | 10 ++--- scripts/buildhistory-diff | 2 +- scripts/combo-layer | 30 +++++++-------- scripts/contrib/list-packageconfig-flags.py | 10 ++--- scripts/contrib/verify-homepage.py | 2 +- scripts/lib/checklayer/__init__.py | 2 +- scripts/lib/scriptutils.py | 2 +- scripts/lib/wic/ksparser.py | 2 +- scripts/lib/wic/partition.py | 2 +- scripts/lib/wic/plugins/source/rootfs.py | 2 +- scripts/oe-depends-dot | 10 ++--- scripts/pybootchartgui/pybootchartgui/draw.py | 4 +- .../pybootchartgui/process_tree.py | 8 ++-- .../pybootchartgui/pybootchartgui/samples.py | 2 +- .../pybootchartgui/tests/process_tree_test.py | 2 +- 71 files changed, 238 insertions(+), 238 deletions(-)
meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py +4 -4
@@ -41,10 +41,10 @@ class DnfSelftest(DnfTest): import re # Use '-y' for non-interactive mode: automatically import the feed signing key output_makecache = self.dnf('-vy makecache') - self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg = "dnf makecache failed to synchronize repo: %s" %(output_makecache)) - self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache)) + self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg="dnf makecache failed to synchronize repo: %s" %(output_makecache)) + self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg="dnf makecache failed: %s" %(output_makecache)) output_repoinfo = self.dnf('-v repoinfo') matchobj = re.match(r".*Repo-pkgs\s*:\s*(?P<n_pkgs>[0-9]+)", output_repoinfo, re.DOTALL) - self.assertTrue(matchobj is not None, msg = "Could not find the amount of packages in dnf repoinfo output: %s" %(output_repoinfo)) - self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg = "Amount of remote packages is not more than zero: %s\n" %(output_repoinfo)) + self.assertTrue(matchobj is not None, msg="Could not find the amount of packages in dnf repoinfo output: %s" %(output_repoinfo)) + self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg="Amount of remote packages is not more than zero: %s\n" %(output_repoinfo))
meta-selftest/lib/oeqa/selftest/cases/external-layer.py +1 -1
@@ -13,4 +13,4 @@ class ImportedTests(OESelftestTestCase): Author: Mariano Lopez <[email protected] """ - self.assertEqual(True, True, msg = "Impossible to fail this test") + self.assertEqual(True, True, msg="Impossible to fail this test")
meta/lib/oe/buildhistory_analysis.py +1 -1
@@ -215,7 +215,7 @@ class FileChange: changetype_link = 'L' changetype_move = 'M' - def __init__(self, path, changetype, oldvalue = None, newvalue = None): + def __init__(self, path, changetype, oldvalue=None, newvalue=None): self.path = path self.changetype = changetype self.oldvalue = oldvalue
meta/lib/oe/cachedpath.py +1 -1
@@ -198,7 +198,7 @@ class CachedPath(object): return (file, is_dir) - def realpath(self, file, root, use_physdir = True, loop_cnt = 100, assume_dir = False): + def realpath(self, file, root, use_physdir=True, loop_cnt=100, assume_dir=False): """ Returns the canonical path of 'file' with assuming a toplevel 'root' directory. When 'use_physdir' is set, all preceding path components of 'file' will be resolved first;
meta/lib/oe/classextend.py +3 -3
@@ -40,7 +40,7 @@ class ClassExtender(object): return self.extname + "-" + name return name - def map_variable(self, varname, setvar = True): + def map_variable(self, varname, setvar=True): var = self.d.getVar(varname) if not var: return ""
@@ -53,7 +53,7 @@ class ClassExtender(object): self.d.setVar(varname, newdata) return newdata - def map_regexp_variable(self, varname, setvar = True): + def map_regexp_variable(self, varname, setvar=True): var = self.d.getVar(varname) if not var: return ""
@@ -84,7 +84,7 @@ class ClassExtender(object): return dep return self.extend_name(dep) - def map_depends_variable(self, varname, suffix = ""): + def map_depends_variable(self, varname, suffix=""): # We need to preserve EXTENDPKGV so it can be expanded correctly later if suffix: varname = varname + "_" + suffix
meta/lib/oe/package_manager/rpm/__init__.py +4 -4
@@ -181,7 +181,7 @@ class RpmPM(PackageManager): os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE') - def install(self, pkgs, attempt_only = False): + def install(self, pkgs, attempt_only=False): if len(pkgs) == 0: return self._prepare_pkg_transaction()
@@ -208,7 +208,7 @@ class RpmPM(PackageManager): if len(failed_scriptlets_pkgnames) > 0: failed_postinsts_abort(list(failed_scriptlets_pkgnames.keys()), self.d.expand("${T}/log.do_${BB_CURRENTTASK}")) - def remove(self, pkgs, with_dependencies = True): + def remove(self, pkgs, with_dependencies=True): if not pkgs: return
@@ -268,7 +268,7 @@ class RpmPM(PackageManager): def list_installed(self): output = self._invoke_dnf(["repoquery", "--installed", "--queryformat", "Package: %{name} %{arch} %{version} %{name}-%{version}-%{release}.%{arch}.rpm\nDependencies:\n%{requires}\nRecommendations:\n%{recommends}\nDependenciesEndHere:\n"], - print_output = False) + print_output=False) packages = {} current_package = None current_deps = None
@@ -300,7 +300,7 @@ class RpmPM(PackageManager): def update(self): self._invoke_dnf(["makecache", "--refresh"]) - def _invoke_dnf(self, dnf_args, fatal = True, print_output = True ): + def _invoke_dnf(self, dnf_args, fatal=True, print_output=True ): os.environ['RPM_ETCCONFIGDIR'] = self.target_rootfs dnf_cmd = bb.utils.which(os.getenv('PATH'), "dnf")
meta/lib/oe/patch.py +13 -13
@@ -23,7 +23,7 @@ class CmdError(bb.BBHandledException): (self.command, self.status, self.output) -def runcmd(args, dir = None): +def runcmd(args, dir=None): import pipes import subprocess
@@ -106,7 +106,7 @@ class PatchSet(object): def Pop(self, force): raise NotImplementedError() - def Refresh(self, remote = None, all = None): + def Refresh(self, remote=None, all=None): raise NotImplementedError() @staticmethod
@@ -199,7 +199,7 @@ class PatchTree(PatchSet): patch['strippath'] = p.split(",")[1] self._applypatch(patch, False, True) - def _removePatchFile(self, all = False): + def _removePatchFile(self, all=False): if not os.path.exists(self.seriespath): return with open(self.seriespath, 'r+') as f:
@@ -215,7 +215,7 @@ class PatchTree(PatchSet): for p in patches: f.write(p) - def Import(self, patch, force = None): + def Import(self, patch, force=None): """""" PatchSet.Import(self, patch, force)
@@ -225,7 +225,7 @@ class PatchTree(PatchSet): i = 0 self.patches.insert(i, patch) - def _applypatch(self, patch, force = False, reverse = False, run = True): + def _applypatch(self, patch, force=False, reverse=False, run=True): shellcmd = ["cat", patch['file'], "|", "patch", "--no-backup-if-mismatch", "-p", patch['strippath']] if reverse: shellcmd.append('-R')
@@ -253,7 +253,7 @@ class PatchTree(PatchSet): return output - def Push(self, force = False, all = False, run = True): + def Push(self, force=False, all=False, run=True): bb.note("self._current is %s" % self._current) bb.note("patches is %s" % self.patches) if all:
@@ -273,7 +273,7 @@ class PatchTree(PatchSet): self._current = next return ret - def Pop(self, force = None, all = None): + def Pop(self, force=None, all=None): if all: self._removePatchFile(True) self._current = None
@@ -478,10 +478,10 @@ class GitApplyTree(PatchTree): finally: shutil.rmtree(tempdir) - def _applypatch(self, patch, force = False, reverse = False, run = True): + def _applypatch(self, patch, force=False, reverse=False, run=True): import shutil - def _applypatchhelper(shellcmd, patch, force = False, reverse = False, run = True): + def _applypatchhelper(shellcmd, patch, force=False, reverse=False, run=True): if reverse: shellcmd.append('-R')
@@ -560,7 +560,7 @@ class GitApplyTree(PatchTree): class QuiltTree(PatchSet): - def _runcmd(self, args, run = True): + def _runcmd(self, args, run=True): quiltrc = self.d.getVar('QUILTRCFILE') if not run: return ["quilt"] + ["--quiltrc"] + [quiltrc] + args
@@ -616,7 +616,7 @@ class QuiltTree(PatchSet): self._current = self.patches.index(patch) self.initialized = True - def Import(self, patch, force = None): + def Import(self, patch, force=None): if not self.initialized: self.InitFromDir() PatchSet.Import(self, patch, force)
@@ -633,7 +633,7 @@ class QuiltTree(PatchSet): self.patches.insert(self._current or 0, patch) - def Push(self, force = False, all = False, run = True): + def Push(self, force=False, all=False, run=True): # quilt push [-f] args = ["push"]
@@ -651,7 +651,7 @@ class QuiltTree(PatchSet): else: self._current = 0 - def Pop(self, force = None, all = None): + def Pop(self, force=None, all=None): # quilt pop [-f] args = ["pop"] if force:
meta/lib/oe/path.py +1 -1
@@ -229,7 +229,7 @@ def __realpath(file, root, loop_cnt, assume_dir): return (file, is_dir) -def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False): +def realpath(file, root, use_physdir=True, loop_cnt=100, assume_dir=False): """ Returns the canonical path of 'file' with assuming a toplevel 'root' directory. When 'use_physdir' is set, all preceding path components of 'file' will be resolved first;
meta/lib/oe/prservice.py +1 -1
@@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -def prserv_make_conn(d, check = False): +def prserv_make_conn(d, check=False): import prserv.serv host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f]) try:
meta/lib/oe/sstatesig.py +2 -2
@@ -90,7 +90,7 @@ class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic): self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split() self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split() pass - def rundep_check(self, fn, recipename, task, dep, depname, dataCaches = None): + def rundep_check(self, fn, recipename, task, dep, depname, dataCaches=None): return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCaches) class SignatureGeneratorOEBasicHashMixIn(object):
@@ -131,7 +131,7 @@ class SignatureGeneratorOEBasicHashMixIn(object): newsafedeps.append(a1 + "->" + a2) self.saferecipedeps = newsafedeps - def rundep_check(self, fn, recipename, task, dep, depname, dataCaches = None): + def rundep_check(self, fn, recipename, task, dep, depname, dataCaches=None): return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCaches) def get_taskdata(self):
meta/lib/oe/terminal.py +1 -1
@@ -234,7 +234,7 @@ def spawn(name, sh_cmd, title=None, env=None, d=None): # until it exits. import tempfile import time - pidfile = tempfile.NamedTemporaryFile(delete = False).name + pidfile = tempfile.NamedTemporaryFile(delete=False).name try: sh_cmd = bb.utils.which(os.getenv('PATH'), "oe-gnome-terminal-phonehome") + " " + pidfile + " " + sh_cmd pipe = terminal(sh_cmd, title, env, d)
meta/lib/oe/types.py +1 -1
@@ -17,7 +17,7 @@ class OEList(list): name = "list" - def __init__(self, value, separator = None): + def __init__(self, value, separator=None): if value is not None: list.__init__(self, value.split(separator)) else:
meta/lib/oe/utils.py +1 -1
@@ -17,7 +17,7 @@ def read_file(filename): return data return None -def ifelse(condition, iftrue = True, iffalse = False): +def ifelse(condition, iftrue=True, iffalse=False): if condition: return iftrue else:
meta/lib/oeqa/core/case.py +1 -1
@@ -74,7 +74,7 @@ class OEPTestResultTestCase: self.extraresults = {"ptestresult.sections" : {}} self.extraresults["ptestresult.rawlogs"] = {"log" : self._compress_log(log)} - def ptest_section(self, section, duration = None, log = None, logfile = None, exitcode = None): + def ptest_section(self, section, duration=None, log=None, logfile=None, exitcode=None): if not hasattr(self, "extraresults"): self.extraresults = {"ptestresult.sections" : {}}
meta/lib/oeqa/core/runner.py +11 -11
@@ -130,7 +130,7 @@ class OETestResult(_TestResult): return 'UNKNOWN', None - def extractExtraResults(self, test, details = None): + def extractExtraResults(self, test, details=None): extraresults = None if details is not None and "extraresults" in details: extraresults = details.get("extraresults", {})
@@ -145,26 +145,26 @@ class OETestResult(_TestResult): else: self.extraresults[k] = v - def addError(self, test, *args, details = None): - self.extractExtraResults(test, details = details) + def addError(self, test, *args, details=None): + self.extractExtraResults(test, details=details) return super(OETestResult, self).addError(test, *args) - def addFailure(self, test, *args, details = None): - self.extractExtraResults(test, details = details) + def addFailure(self, test, *args, details=None): + self.extractExtraResults(test, details=details) return super(OETestResult, self).addFailure(test, *args) - def addSuccess(self, test, details = None): + def addSuccess(self, test, details=None): #Added so we can keep track of successes too self.successes.append((test, None)) - self.extractExtraResults(test, details = details) + self.extractExtraResults(test, details=details) return super(OETestResult, self).addSuccess(test) - def addExpectedFailure(self, test, *args, details = None): - self.extractExtraResults(test, details = details) + def addExpectedFailure(self, test, *args, details=None): + self.extractExtraResults(test, details=details) return super(OETestResult, self).addExpectedFailure(test, *args) - def addUnexpectedSuccess(self, test, details = None): - self.extractExtraResults(test, details = details) + def addUnexpectedSuccess(self, test, details=None): + self.extractExtraResults(test, details=details) return super(OETestResult, self).addUnexpectedSuccess(test) def logDetails(self, json_file_dir=None, configuration=None, result_id=None,
meta/lib/oeqa/core/target/qemu.py +2 -2
@@ -24,7 +24,7 @@ class OEQemuTarget(OESSHTarget): port=None, machine='', rootfs='', kernel='', kvm=False, slirp=False, dump_dir='', dump_host_cmds='', display='', bootlog='', tmpdir='', dir_image='', boottime=60, serial_ports=2, - boot_patterns = defaultdict(str), ovmf=False, tmpfsdir=None, **kwargs): + boot_patterns=defaultdict(str), ovmf=False, tmpfsdir=None, **kwargs): super(OEQemuTarget, self).__init__(logger, None, server_ip, timeout, user, port)
@@ -46,7 +46,7 @@ class OEQemuTarget(OESSHTarget): logfile=bootlog, boottime=boottime, use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir, dump_host_cmds=dump_host_cmds, logger=logger, - serial_ports=serial_ports, boot_patterns = boot_patterns, + serial_ports=serial_ports, boot_patterns=boot_patterns, use_ovmf=ovmf, tmpfsdir=tmpfsdir) dump_monitor_cmds = kwargs.get("testimage_dump_monitor") self.monitor_dumper = MonitorDumper(dump_monitor_cmds, dump_dir, self.runner)
meta/lib/oeqa/core/tests/test_decorators.py +1 -1
@@ -16,7 +16,7 @@ from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames, getSuiteCase class TestTagDecorator(TestBase): def _runTest(self, modules, filterfn, expect): - tc = self._testLoader(modules = modules, tags_filter = filterfn) + tc = self._testLoader(modules=modules, tags_filter=filterfn) test_loaded = set(getSuiteCasesIDs(tc.suites)) self.assertEqual(expect, test_loaded)
meta/lib/oeqa/core/utils/concurrencytest.py +9 -9
@@ -85,22 +85,22 @@ class ProxyTestResult: self.result = target self.failed_tests = 0 - def _addResult(self, method, test, *args, exception = False, **kwargs): + def _addResult(self, method, test, *args, exception=False, **kwargs): return method(test, *args, **kwargs) - def addError(self, test, err = None, **kwargs): + def addError(self, test, err=None, **kwargs): self.failed_tests += 1 - self._addResult(self.result.addError, test, err, exception = True, **kwargs) + self._addResult(self.result.addError, test, err, exception=True, **kwargs) - def addFailure(self, test, err = None, **kwargs): + def addFailure(self, test, err=None, **kwargs): self.failed_tests += 1 - self._addResult(self.result.addFailure, test, err, exception = True, **kwargs) + self._addResult(self.result.addFailure, test, err, exception=True, **kwargs) def addSuccess(self, test, **kwargs): self._addResult(self.result.addSuccess, test, **kwargs) - def addExpectedFailure(self, test, err = None, **kwargs): - self._addResult(self.result.addExpectedFailure, test, err, exception = True, **kwargs) + def addExpectedFailure(self, test, err=None, **kwargs): + self._addResult(self.result.addExpectedFailure, test, err, exception=True, **kwargs) def addUnexpectedSuccess(self, test, **kwargs): self._addResult(self.result.addUnexpectedSuccess, test, **kwargs)
@@ -112,7 +112,7 @@ class ProxyTestResult: return getattr(self.result, attr) class ExtraResultsDecoderTestResult(ProxyTestResult): - def _addResult(self, method, test, *args, exception = False, **kwargs): + def _addResult(self, method, test, *args, exception=False, **kwargs): if "details" in kwargs and "extraresults" in kwargs["details"]: if isinstance(kwargs["details"]["extraresults"], Content): kwargs = kwargs.copy()
@@ -126,7 +126,7 @@ class ExtraResultsDecoderTestResult(ProxyTestResult): return method(test, *args, **kwargs) class ExtraResultsEncoderTestResult(ProxyTestResult): - def _addResult(self, method, test, *args, exception = False, **kwargs): + def _addResult(self, method, test, *args, exception=False, **kwargs): if hasattr(test, "extraresults"): extras = lambda : [json.dumps(test.extraresults).encode()] kwargs = kwargs.copy()
meta/lib/oeqa/oetest.py +1 -1
@@ -101,7 +101,7 @@ class oeRuntimeTest(oeTest): if self.tc.sigterm: self.fail("Got SIGTERM") elif (type(self.target).__name__ == "QemuTarget"): - self.assertTrue(self.target.check(), msg = "Qemu not running?") + self.assertTrue(self.target.check(), msg="Qemu not running?") self.setUpLocal()
meta/lib/oeqa/runexported.py +1 -1
@@ -66,7 +66,7 @@ class FakeTarget(object): class MyDataDict(dict): - def getVar(self, key, unused = None): + def getVar(self, key, unused=None): return self.get(key, "") def main():
meta/lib/oeqa/runtime/cases/apt.py +1 -1
@@ -10,7 +10,7 @@ from oeqa.runtime.decorator.package import OEHasPackage class AptTest(OERuntimeTestCase): - def pkg(self, command, expected = 0): + def pkg(self, command, expected=0): command = 'apt-get %s' % command status, output = self.target.run(command, 1500) message = os.linesep.join([command, output])
meta/lib/oeqa/runtime/cases/boot.py +1 -1
@@ -30,4 +30,4 @@ class BootTest(OERuntimeTestCase): count = 0 msg = ('Expected 5 consecutive, got %d.\n' 'ping output is:\n%s' % (count,output)) - self.assertEqual(count, 5, msg = msg) + self.assertEqual(count, 5, msg=msg)
meta/lib/oeqa/runtime/cases/buildcpio.py +1 -1
@@ -15,7 +15,7 @@ class BuildCpioTest(OERuntimeTestCase): uri = 'https://downloads.yoctoproject.org/mirror/sources/cpio-2.13.tar.gz' cls.project = TargetBuildProject(cls.tc.target, uri, - dl_dir = cls.tc.td['DL_DIR']) + dl_dir=cls.tc.td['DL_DIR']) @classmethod def tearDownClass(cls):
meta/lib/oeqa/runtime/cases/buildgalculator.py +1 -1
@@ -15,7 +15,7 @@ class GalculatorTest(OERuntimeTestCase): uri = 'http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2' cls.project = TargetBuildProject(cls.tc.target, uri, - dl_dir = cls.tc.td['DL_DIR']) + dl_dir=cls.tc.td['DL_DIR']) @classmethod def tearDownClass(cls):
meta/lib/oeqa/runtime/cases/buildlzip.py +1 -1
@@ -16,7 +16,7 @@ class BuildLzipTest(OERuntimeTestCase): uri = '%s/lzip-1.19.tar.gz' % uri cls.project = TargetBuildProject(cls.tc.target, uri, - dl_dir = cls.tc.td['DL_DIR']) + dl_dir=cls.tc.td['DL_DIR']) @classmethod def tearDownClass(cls):
meta/lib/oeqa/runtime/cases/dnf.py +1 -1
@@ -14,7 +14,7 @@ from oeqa.runtime.decorator.package import OEHasPackage class DnfTest(OERuntimeTestCase): - def dnf(self, command, expected = 0): + def dnf(self, command, expected=0): command = 'dnf %s' % command status, output = self.target.run(command, 1500) message = os.linesep.join([command, output])
meta/lib/oeqa/runtime/cases/logrotate.py +9 -9
@@ -27,45 +27,45 @@ class LogrotateTest(OERuntimeTestCase): # /var/log/wtmp may not always exist initially, so use touch to ensure it is present status, output = self.target.run('touch /var/log/wtmp') msg = ('Could not create/update /var/log/wtmp with touch') - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('mkdir $HOME/logrotate_dir') msg = ('Could not create logrotate_dir. Output: %s' % output) - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('echo "create \n olddir $HOME/logrotate_dir \n include /etc/logrotate.d/wtmp" > /tmp/logrotate-test.conf') msg = ('Could not write to /tmp/logrotate-test.conf') - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) # If logrotate fails to rotate the log, view the verbose output of logrotate to see what prevented it _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test.conf') status, _ = self.target.run('find $HOME/logrotate_dir -type f | grep wtmp.1') msg = ("logrotate did not successfully rotate the wtmp log. Output from logrotate -vf: \n%s" % (logrotate_output)) - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) @OETestDepends(['logrotate.LogrotateTest.test_logrotate_wtmp']) def test_logrotate_newlog(self): status, output = self.target.run('echo "oeqa logrotate test file" > /var/log/logrotate_testfile') msg = ('Could not create logrotate test file in /var/log') - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('echo "/var/log/logrotate_testfile {\n missingok \n monthly \n rotate 1" > /etc/logrotate.d/logrotate_testfile') msg = ('Could not write to /etc/logrotate.d/logrotate_testfile') - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('echo "create \n olddir $HOME/logrotate_dir \n include /etc/logrotate.d/logrotate_testfile" > /tmp/logrotate-test2.conf') msg = ('Could not write to /tmp/logrotate_test2.conf') - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('find $HOME/logrotate_dir -type f | grep logrotate_testfile.1') msg = ('A rotated log for logrotate_testfile is already present in logrotate_dir') - self.assertEqual(status, 1, msg = msg) + self.assertEqual(status, 1, msg=msg) # If logrotate fails to rotate the log, view the verbose output of logrotate instead of just listing the files in olddir _, logrotate_output = self.target.run('logrotate -vf /tmp/logrotate-test2.conf') status, _ = self.target.run('find $HOME/logrotate_dir -type f | grep logrotate_testfile.1') msg = ('logrotate did not successfully rotate the logrotate_test log. Output from logrotate -vf: \n%s' % (logrotate_output)) - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg)
meta/lib/oeqa/runtime/cases/opkg.py +1 -1
@@ -10,7 +10,7 @@ from oeqa.runtime.decorator.package import OEHasPackage class OpkgTest(OERuntimeTestCase): - def pkg(self, command, expected = 0): + def pkg(self, command, expected=0): command = 'opkg %s' % command status, output = self.target.run(command, 1500) message = os.linesep.join([command, output])
meta/lib/oeqa/runtime/cases/pam.py +4 -4
@@ -20,19 +20,19 @@ class PamBasicTest(OERuntimeTestCase): status, output = self.target.run('login --help') msg = ('login command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 1, msg = msg) + self.assertEqual(status, 1, msg=msg) status, output = self.target.run('passwd --help') msg = ('passwd command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('su --help') msg = ('su command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg) status, output = self.target.run('useradd --help') msg = ('useradd command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 0, msg = msg) + self.assertEqual(status, 0, msg=msg)
meta/lib/oeqa/runtime/cases/parselogs.py +1 -1
@@ -328,7 +328,7 @@ class ParseLogsTest(OERuntimeTestCase): # Grep only the errors so that their context could be collected. # Default context is 10 lines before and after the error itself def parse_logs(self, errors, ignore_errors, logs, - lines_before = 10, lines_after = 10): + lines_before=10, lines_after=10): results = {} rez = [] grep_output = ''
meta/lib/oeqa/runtime/cases/ping.py +1 -1
@@ -23,4 +23,4 @@ class PingTest(OERuntimeTestCase): count = 0 msg = ('Expected 5 consecutive, got %d.\n' 'ping output is:\n%s' % (count,output)) - self.assertEqual(count, 5, msg = msg) + self.assertEqual(count, 5, msg=msg)
meta/lib/oeqa/runtime/cases/scp.py +1 -1
@@ -32,6 +32,6 @@ class ScpTest(OERuntimeTestCase): self.assertEqual(status, 0, msg=msg) (status, output) = self.target.run('ls -la %s' % dst) - self.assertEqual(status, 0, msg = 'SCP test failed') + self.assertEqual(status, 0, msg='SCP test failed') self.target.run('rm %s' % dst)
meta/lib/oeqa/runtime/cases/storage.py +10 -10
@@ -15,35 +15,35 @@ class StorageBase(OERuntimeTestCase): (status, output) = cls.target.run('mkdir -p %s' % cls.mount_point) (status, output) = cls.target.run('mount %s %s' % (cls.device, cls.mount_point)) msg = ('Mount failed: %s.' % status) - cls.assertFalse(output, msg = msg) + cls.assertFalse(output, msg=msg) time.sleep(tmo) (status, output) = cls.target.run('cat /proc/mounts') match = re.search('%s' % cls.device, output) if match: msg = ('Device %s not mounted.' % cls.device) - cls.assertTrue(match, msg = msg) + cls.assertTrue(match, msg=msg) (status, output) = cls.target.run('mkdir -p %s' % cls.test_dir) (status, output) = cls.target.run('rm -f %s/*' % cls.test_dir) msg = ('Failed to cleanup files @ %s/*' % cls.test_dir) - cls.assertFalse(output, msg = msg) + cls.assertFalse(output, msg=msg) def storage_basic(cls): # create file on device (status, output) = cls.target.run('touch %s/%s' % (cls.test_dir, cls.test_file)) msg = ('File %s not created on %s' % (cls.test_file, cls.device)) - cls.assertFalse(status, msg = msg) + cls.assertFalse(status, msg=msg) # move file (status, output) = cls.target.run('mv %s/%s %s/%s1' % (cls.test_dir, cls.test_file, cls.test_dir, cls.test_file)) msg = ('File %s not moved to %s' % (cls.test_file, cls.device)) - cls.assertFalse(status, msg = msg) + cls.assertFalse(status, msg=msg) # remove file (status, output) = cls.target.run('rm %s/%s1' % (cls.test_dir, cls.test_file)) msg = ('File %s not removed on %s' % (cls.test_file, cls.device)) - cls.assertFalse(status, msg = msg) + cls.assertFalse(status, msg=msg) def storage_read(cls): # check if message is in file
@@ -52,14 +52,14 @@ class StorageBase(OERuntimeTestCase): match = re.search('%s' % cls.test_msg, output) msg = ('Test message %s not in file %s.' % (cls.test_msg, cls.test_file)) - cls.assertEqual(status, 0, msg = msg) + cls.assertEqual(status, 0, msg=msg) def storage_write(cls): # create test message in file on device (status, output) = cls.target.run('echo "%s" > %s/%s' % (cls.test_msg, cls.test_dir, cls.test_file)) msg = ('File %s not create test message on %s' % (cls.test_file, cls.device)) - cls.assertEqual(status, 0, msg = msg) + cls.assertEqual(status, 0, msg=msg) def storage_umount(cls, tmo=1): time.sleep(tmo)
@@ -70,13 +70,13 @@ class StorageBase(OERuntimeTestCase): return else: msg = ('Device not unmount %s' % cls.mount_point) - cls.assertEqual(status, 0, msg = msg) + cls.assertEqual(status, 0, msg=msg) (status, output) = cls.target.run('cat /proc/mounts') match = re.search('%s' % cls.device, output) if match: msg = ('Device %s still mounted.' % cls.device) - cls.assertTrue(match, msg = msg) + cls.assertTrue(match, msg=msg) class UsbTest(StorageBase):
meta/lib/oeqa/runtime/cases/suspend.py +3 -3
@@ -8,7 +8,7 @@ class Suspend_Test(OERuntimeTestCase): def test_date(self): (status, output) = self.target.run('date') - self.assertEqual(status, 0, msg = 'Failed to run date command, output : %s' % output) + self.assertEqual(status, 0, msg='Failed to run date command, output : %s' % output) def test_ping(self): t_thread = threading.Thread(target=self.target.run, args=("ping 8.8.8.8",))
@@ -17,11 +17,11 @@ class Suspend_Test(OERuntimeTestCase): status, output = self.target.run('pidof ping') self.target.run('kill -9 %s' % output) - self.assertEqual(status, 0, msg = 'Not able to find process that runs ping, output : %s' % output) + self.assertEqual(status, 0, msg='Not able to find process that runs ping, output : %s' % output) def set_suspend(self): (status, output) = self.target.run('sudo rtcwake -m mem -s 10') - self.assertEqual(status, 0, msg = 'Failed to suspends your system to RAM, output : %s' % output) + self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) @skipIfQemu('qemuall', 'Test only runs on real hardware') @OETestDepends(['ssh.SSHTest.test_ssh'])
meta/lib/oeqa/runtime/cases/usb_hid.py +2 -2
@@ -7,11 +7,11 @@ class USB_HID_Test(OERuntimeTestCase): def keyboard_mouse_simulation(self): (status, output) = self.target.run('export DISPLAY=:0 && xdotool key F2 && xdotool mousemove 100 100') - return self.assertEqual(status, 0, msg = 'Failed to simulate keyboard/mouse input event, output : %s' % output) + return self.assertEqual(status, 0, msg='Failed to simulate keyboard/mouse input event, output : %s' % output) def set_suspend(self): (status, output) = self.target.run('sudo rtcwake -m mem -s 10') - return self.assertEqual(status, 0, msg = 'Failed to suspends your system to RAM, output : %s' % output) + return self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) @OEHasPackage(['xdotool']) @skipIfQemu('qemuall', 'Test only runs on real hardware')
meta/lib/oeqa/selftest/cases/bblayers.py +9 -9
@@ -15,7 +15,7 @@ class BitbakeLayers(OESelftestTestCase): def test_bitbakelayers_layerindexshowdepends(self): result = runCmd('bitbake-layers layerindex-show-depends meta-poky') find_in_contents = re.search("openembedded-core", result.output) - self.assertTrue(find_in_contents, msg = "openembedded-core should have been listed at this step. bitbake-layers layerindex-show-depends meta-poky output: %s" % result.output) + self.assertTrue(find_in_contents, msg="openembedded-core should have been listed at this step. bitbake-layers layerindex-show-depends meta-poky output: %s" % result.output) def test_bitbakelayers_showcrossdepends(self): result = runCmd('bitbake-layers show-cross-depends')
@@ -40,14 +40,14 @@ class BitbakeLayers(OESelftestTestCase): recipe_path = "recipes-graphics/xcursor-transparent-theme" recipe_file = self.get_recipe_basename(recipe) testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten') - self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time") + self.assertFalse(os.path.isdir(testoutdir), msg="test_bitbakelayers_flatten should not exist at this point in time") self.track_for_cleanup(testoutdir) result = runCmd('bitbake-layers flatten %s' % testoutdir) bb_file = os.path.join(testoutdir, recipe_path, recipe_file) - self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") + self.assertTrue(os.path.isfile(bb_file), msg="Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.") contents = ftools.read_file(bb_file) find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) - self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) + self.assertTrue(find_in_contents, msg="Flattening layers did not work. bitbake-layers flatten output: %s" % result.output) def test_bitbakelayers_add_remove(self): test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton')
@@ -55,16 +55,16 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotIn('meta-skeleton', result.output, "This test cannot run with meta-skeleton in bblayers.conf. bitbake-layers show-layers output: %s" % result.output) result = runCmd('bitbake-layers add-layer %s' % test_layer) result = runCmd('bitbake-layers show-layers') - self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output) + self.assertIn('meta-skeleton', result.output, msg="Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output) result = runCmd('bitbake-layers remove-layer %s' % test_layer) result = runCmd('bitbake-layers show-layers') - self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output) + self.assertNotIn('meta-skeleton', result.output, msg="meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output) result = runCmd('bitbake-layers add-layer %s' % test_layer) result = runCmd('bitbake-layers show-layers') - self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output) + self.assertIn('meta-skeleton', result.output, msg="Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output) result = runCmd('bitbake-layers remove-layer */meta-skeleton') result = runCmd('bitbake-layers show-layers') - self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output) + self.assertNotIn('meta-skeleton', result.output, msg="meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output) def test_bitbakelayers_showrecipes(self): result = runCmd('bitbake-layers show-recipes')
@@ -119,5 +119,5 @@ class BitbakeLayers(OESelftestTestCase): recipe_file = line break - self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe) + self.assertTrue(os.path.isfile(recipe_file), msg="Can't find recipe file for %s" % recipe) return os.path.basename(recipe_file)
meta/lib/oeqa/selftest/cases/bbtests.py +14 -14
@@ -20,21 +20,21 @@ class BitbakeTests(OESelftestTestCase): # Test bitbake can run from the <builddir>/conf directory def test_run_bitbake_from_dir_1(self): os.chdir(os.path.join(self.builddir, 'conf')) - self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir") + self.assertEqual(bitbake('-e').status, 0, msg="bitbake couldn't run from \"conf\" dir") # Test bitbake can run from the <builddir>'s parent directory def test_run_bitbake_from_dir_2(self): my_env = os.environ.copy() my_env['BBPATH'] = my_env['BUILDDIR'] os.chdir(os.path.dirname(os.environ['BUILDDIR'])) - self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir's parent directory") + self.assertEqual(bitbake('-e', env=my_env).status, 0, msg="bitbake couldn't run from builddir's parent directory") # Test bitbake can run from some other random system location (we use /tmp/) def test_run_bitbake_from_dir_3(self): my_env = os.environ.copy() my_env['BBPATH'] = my_env['BUILDDIR'] os.chdir("/tmp/") - self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from /tmp/") + self.assertEqual(bitbake('-e', env=my_env).status, 0, msg="bitbake couldn't run from /tmp/") def test_event_handler(self):
@@ -42,8 +42,8 @@ class BitbakeTests(OESelftestTestCase): result = bitbake('m4-native') find_build_started = re.search(r"NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Executing.*Tasks", result.output) find_build_completed = re.search(r"Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output) - self.assertTrue(find_build_started, msg = "Match failed in:\n%s" % result.output) - self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output) + self.assertTrue(find_build_started, msg="Match failed in:\n%s" % result.output) + self.assertTrue(find_build_completed, msg="Match failed in:\n%s" % result.output) self.assertNotIn('Test for bb.event.InvalidEvent', result.output) def test_local_sstate(self):
@@ -51,11 +51,11 @@ class BitbakeTests(OESelftestTestCase): bitbake('m4-native -cclean') result = bitbake('m4-native') find_setscene = re.search("m4-native.*do_.*_setscene", result.output) - self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output ) + self.assertTrue(find_setscene, msg="No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output ) def test_bitbake_invalid_recipe(self): result = bitbake('-b asdf', ignore_status=True) - self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output) + self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg="Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output) def test_bitbake_invalid_target(self): result = bitbake('asdf', ignore_status=True)
@@ -79,7 +79,7 @@ class BitbakeTests(OESelftestTestCase): for l in result.output.split('\n'): if l.startswith("ERROR:") and "failed" in l and "do_patch" in l: found = l - self.assertTrue(found and found.startswith("ERROR:"), msg = "Incorrectly formed patch application didn't fail. bitbake output: %s" % result.output) + self.assertTrue(found and found.startswith("ERROR:"), msg="Incorrectly formed patch application didn't fail. bitbake output: %s" % result.output) def test_force_task_1(self): # test 1 from bug 5875
@@ -123,7 +123,7 @@ class BitbakeTests(OESelftestTestCase): result = bitbake('-g %s' % recipe) for f in ['pn-buildlist', 'task-depends.dot']: self.addCleanup(os.remove, f) - self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output) + self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg="No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output) self.assertIn(recipe, ftools.read_file(os.path.join(self.builddir, 'task-depends.dot'))) def test_image_manifest(self):
@@ -150,7 +150,7 @@ INHERIT_remove = \"report-error\" self.assertEqual(result.status, 1, msg="Command succeded when it should have failed. bitbake output: %s" % result.output) self.assertIn('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:', result.output) line = self.getline(result, 'Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.') - self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \ + self.assertTrue(line and line.startswith("ERROR:"), msg="\"invalid\" file \ doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output) def test_rename_downloaded_file(self):
@@ -165,9 +165,9 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" self.write_recipeinc('aspell', data) result = bitbake('-f -c fetch aspell', ignore_status=True) self.delete_recipeinc('aspell') - self.assertEqual(result.status, 0, msg = "Couldn't fetch aspell. %s" % result.output) + self.assertEqual(result.status, 0, msg="Couldn't fetch aspell. %s" % result.output) dl_dir = get_bb_var("DL_DIR") - self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir) + self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg="File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir) self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir) def test_environment(self):
@@ -208,7 +208,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" def test_checkuri(self): result = runCmd('bitbake -c checkuri m4') - self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output) + self.assertEqual(0, result.status, msg="\"checkuri\" task was not executed. bitbake output: %s" % result.output) def test_continue(self): self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
@@ -222,7 +222,7 @@ INHERIT_remove = \"report-error\" errorpos = result.output.find('ERROR: Function failed: do_fail_task') manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output) continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) - self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) + self.assertLess(errorpos,continuepos, msg="bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) def test_non_gplv3(self): self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"')
meta/lib/oeqa/selftest/cases/binutils.py +1 -1
@@ -43,7 +43,7 @@ class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase): logpath = os.path.splitext(sumspath)[0] + ".log" ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite - self.ptest_section(ptestsuite, logfile = logpath) + self.ptest_section(ptestsuite, logfile=logpath) with open(sumspath, "r") as f: for test, result in parse_values(f): self.ptest_result(ptestsuite, test, result)
meta/lib/oeqa/selftest/cases/buildoptions.py +10 -10
@@ -26,17 +26,17 @@ class ImageOptionsTests(OESelftestTestCase): log_data_created = ftools.read_file(log_data_file) incremental_created = re.search(r"Installing\s*:\s*packagegroup-core-ssh-openssh", log_data_created) self.remove_config('IMAGE_FEATURES += "ssh-server-openssh"') - self.assertTrue(incremental_created, msg = "Match failed in:\n%s" % log_data_created) + self.assertTrue(incremental_created, msg="Match failed in:\n%s" % log_data_created) bitbake("core-image-minimal") log_data_removed = ftools.read_file(log_data_file) incremental_removed = re.search(r"Erasing\s*:\s*packagegroup-core-ssh-openssh", log_data_removed) - self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed) + self.assertTrue(incremental_removed, msg="Match failed in:\n%s" % log_data_removed) def test_ccache_tool(self): bitbake("ccache-native") bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native') p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache" - self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p) + self.assertTrue(os.path.isfile(p), msg="No ccache found (%s)" % p) self.write_config('INHERIT += "ccache"') recipe = "libgcc-initial" self.add_command_to_tearDown('bitbake -c clean %s' % recipe)
@@ -59,16 +59,16 @@ class DiskMonTest(OESelftestTestCase): def test_stoptask_behavior(self): self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') - res = bitbake("delay -c delay", ignore_status = True) - self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg = "Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output) - self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) + res = bitbake("delay -c delay", ignore_status=True) + self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg="Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output) + self.assertEqual(res.status, 1, msg="bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') - res = bitbake("delay -c delay", ignore_status = True) + res = bitbake("delay -c delay", ignore_status=True) self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output, "Tasks should have been aborted immediatelly. Disk monitor is set to ABORT: %s" % res.output) - self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) + self.assertEqual(res.status, 1, msg="bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') res = bitbake("delay -c delay") - self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output) + self.assertTrue('WARNING: The free space' in res.output, msg="A warning should have been displayed for disk monitor is set to WARN: %s" %res.output) class SanityOptionsTest(OESelftestTestCase): def getline(self, res, line):
@@ -88,7 +88,7 @@ class SanityOptionsTest(OESelftestTestCase): self.delete_recipeinc('xcursor-transparent-theme') line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.") self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) - self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) + self.assertEqual(res.status, 1, msg="bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"') self.append_config('ERROR_QA_remove = "packages-list"') self.append_config('WARN_QA_append = " packages-list"')
meta/lib/oeqa/selftest/cases/devtool.py +2 -2
@@ -249,14 +249,14 @@ class DevtoolTests(DevtoolBase): tempdir = tempfile.mkdtemp(prefix='devtoolqa') self.track_for_cleanup(tempdir) result = runCmd('devtool create-workspace %s' % tempdir) - self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output) + self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')), msg="No workspace created. devtool output: %s " % result.output) result = runCmd('bitbake-layers show-layers') self.assertIn(tempdir, result.output) # Try creating a workspace layer with the default path self.track_for_cleanup(self.workspacedir) self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') result = runCmd('devtool create-workspace') - self.assertTrue(os.path.isfile(os.path.join(self.workspacedir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output) + self.assertTrue(os.path.isfile(os.path.join(self.workspacedir, 'conf', 'layer.conf')), msg="No workspace created. devtool output: %s " % result.output) result = runCmd('bitbake-layers show-layers') self.assertNotIn(tempdir, result.output) self.assertIn(self.workspacedir, result.output)
meta/lib/oeqa/selftest/cases/gcc.py +3 -3
@@ -18,7 +18,7 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): if suite not in targets: self.skipTest("Target does not use {0}".format(suite)) - def run_check(self, *suites, ssh = None): + def run_check(self, *suites, ssh=None): targets = set() for s in suites: if s == "gcc":
@@ -54,7 +54,7 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite - self.ptest_section(ptestsuite, logfile = logpath) + self.ptest_section(ptestsuite, logfile=logpath) with open(sumspath, "r") as f: for test, result in parse_values(f): self.ptest_result(ptestsuite, test, result)
@@ -69,7 +69,7 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): bitbake("core-image-minimal") # wrap the execution with a qemu instance - with runqemu("core-image-minimal", runqemuparams = "nographic") as qemu: + with runqemu("core-image-minimal", runqemuparams="nographic") as qemu: # validate that SSH is working status, _ = qemu.run("uname") self.assertEqual(status, 0)
meta/lib/oeqa/selftest/cases/glibc.py +3 -3
@@ -15,7 +15,7 @@ def parse_values(content): break class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): - def run_check(self, ssh = None): + def run_check(self, ssh=None): # configure ssh target features = [] if ssh is not None:
@@ -61,7 +61,7 @@ class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): bitbake("core-image-minimal") # start runqemu - qemu = s.enter_context(runqemu("core-image-minimal", runqemuparams = "nographic")) + qemu = s.enter_context(runqemu("core-image-minimal", runqemuparams="nographic")) # validate that SSH is working status, _ = qemu.run("uname")
@@ -75,7 +75,7 @@ class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): if status != 0: raise Exception("Failed to setup NFS mount on target ({})".format(repr(output))) - self.run_check(ssh = qemu.ip) + self.run_check(ssh=qemu.ip) @OETestTag("toolchain-user") class GlibcSelfTest(GlibcSelfTestBase):
meta/lib/oeqa/selftest/cases/manifest.py +3 -3
@@ -38,7 +38,7 @@ class VerifyManifest(OESelftestTestCase): #this will possibly move from here @classmethod - def get_dir_from_bb_var(self, bb_var, target = None): + def get_dir_from_bb_var(self, bb_var, target=None): target == self.buildtarget if target == None else target directory = get_bb_var(bb_var, target) if not directory or not os.path.isdir(directory):
@@ -81,8 +81,8 @@ class VerifyManifest(OESelftestTestCase): pkgdata_dir = reverse_dir = {} mfilename = mpath = m_entry = {} # get manifest location based on target to query about - d_target= dict(target = self.buildtarget, - host = 'nativesdk-packagegroup-sdk-host') + d_target= dict(target=self.buildtarget, + host='nativesdk-packagegroup-sdk-host') try: mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget) for k in d_target.keys():
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +6 -6
@@ -28,7 +28,7 @@ class TestBlobParsing(OESelftestTestCase): import shutil shutil.rmtree(self.repo_path) - def commit_vars(self, to_add={}, to_remove = [], msg="A commit message"): + def commit_vars(self, to_add={}, to_remove=[], msg="A commit message"): if len(to_add) == 0 and len(to_remove) == 0: return
@@ -50,7 +50,7 @@ class TestBlobParsing(OESelftestTestCase): """ from oe.buildhistory_analysis import blob_to_dict valuesmap = { "foo" : "1", "bar" : "2" } - self.commit_vars(to_add = valuesmap) + self.commit_vars(to_add=valuesmap) blob = self.repo.head.commit.tree.blobs[0] self.assertEqual(valuesmap, blob_to_dict(blob),
@@ -64,10 +64,10 @@ class TestBlobParsing(OESelftestTestCase): changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")} - self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) + self.commit_vars(to_add={ "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) blob1 = self.repo.heads.master.commit.tree.blobs[0] - self.commit_vars(to_add = { "foo-2" : "8", "bar" : "4", "bar-2" : "5" }) + self.commit_vars(to_add={ "foo-2" : "8", "bar" : "4", "bar-2" : "5" }) blob2 = self.repo.heads.master.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
@@ -83,10 +83,10 @@ class TestBlobParsing(OESelftestTestCase): from oe.buildhistory_analysis import compare_dict_blobs defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} - self.commit_vars(to_add = { "foo" : "1" }) + self.commit_vars(to_add={ "foo" : "1" }) blob1 = self.repo.heads.master.commit.tree.blobs[0] - self.commit_vars(to_add = { "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" }) + self.commit_vars(to_add={ "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" }) blob2 = self.repo.heads.master.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
meta/lib/oeqa/selftest/cases/oelib/path.py +3 -3
@@ -44,7 +44,7 @@ class TestRealPath(TestCase): ] def setUp(self): - self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path") + self.tmpdir = tempfile.mkdtemp(prefix="oe-test_path") self.root = os.path.join(self.tmpdir, "R") os.mkdir(os.path.join(self.tmpdir, "_real"))
@@ -60,9 +60,9 @@ class TestRealPath(TestCase): def tearDown(self): shutil.rmtree(self.tmpdir) - def __realpath(self, file, use_physdir, assume_dir = True): + def __realpath(self, file, use_physdir, assume_dir=True): return oe.path.realpath(os.path.join(self.root, file), self.root, - use_physdir, assume_dir = assume_dir) + use_physdir, assume_dir=assume_dir) def test_norm(self): for l in self.LINKS:
meta/lib/oeqa/selftest/cases/pkgdata.py +1 -1
@@ -223,4 +223,4 @@ class OePkgdataUtilTests(OESelftestTestCase): result = runCmd('oe-pkgdata-util', ignore_status=True) self.assertEqual(result.status, 2, "Status different than 2. output: %s" % result.output) currpos = result.output.find('usage: oe-pkgdata-util') - self.assertTrue(currpos != -1, msg = "Test is Failed. Help is not Displayed in %s" % result.output) + self.assertTrue(currpos != -1, msg="Test is Failed. Help is not Displayed in %s" % result.output)
meta/lib/oeqa/selftest/cases/sstatetests.py +3 -3
@@ -137,7 +137,7 @@ class SStateTests(SStateBase): filtered_results.append(r) self.assertTrue(filtered_results == [], msg="Found distro non-specific sstate for: %s (%s)" % (', '.join(map(str, targets)), str(filtered_results))) file_tracker_1 = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False) - self.assertTrue(len(file_tracker_1) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) + self.assertTrue(len(file_tracker_1) >= len(targets), msg="Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) self.track_for_cleanup(self.distro_specific_sstate + "_old") shutil.copytree(self.distro_specific_sstate, self.distro_specific_sstate + "_old")
@@ -146,7 +146,7 @@ class SStateTests(SStateBase): bitbake(['-cclean'] + targets) bitbake(targets) file_tracker_2 = self.search_sstate('|'.join(map(str, [s + r'.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False) - self.assertTrue(len(file_tracker_2) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) + self.assertTrue(len(file_tracker_2) >= len(targets), msg="Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2] self.assertTrue(not_recreated == [], msg="The following sstate files ware not recreated: %s" % ', '.join(map(str, not_recreated)))
@@ -196,7 +196,7 @@ class SStateTests(SStateBase): expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build if not any(pattern in x for pattern in ignore_patterns)] self.remove_config(global_config[idx]) self.remove_recipeinc(target, target_config[idx]) - self.assertEqual(result.status, 0, msg = "build of %s failed with %s" % (target, result.output)) + self.assertEqual(result.status, 0, msg="build of %s failed with %s" % (target, result.output)) runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated --extra-archs=%s" % (self.sstate_path, ','.join(map(str, sstate_archs_list)))) actual_remaining_sstate = [x for x in self.search_sstate(target + r'.*?\.tgz$') if not any(pattern in x for pattern in ignore_patterns)]
meta/lib/oeqa/targetcontrol.py +19 -19
@@ -127,28 +127,28 @@ class QemuTarget(BaseTarget): if d.getVar("DISTRO") == "poky-tiny": self.runner = QemuTinyRunner(machine=d.getVar("MACHINE"), rootfs=self.rootfs, - tmpdir = d.getVar("TMPDIR"), - deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"), - display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), - logfile = self.qemulog, - kernel = self.kernel, - boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), - tmpfsdir = d.getVar("RUNQEMU_TMPFS_DIR"), - logger = logger) + tmpdir=d.getVar("TMPDIR"), + deploy_dir_image=d.getVar("DEPLOY_DIR_IMAGE"), + display=d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), + logfile=self.qemulog, + kernel=self.kernel, + boottime=int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), + tmpfsdir=d.getVar("RUNQEMU_TMPFS_DIR"), + logger=logger) else: self.runner = QemuRunner(machine=d.getVar("MACHINE"), rootfs=self.rootfs, - tmpdir = d.getVar("TMPDIR"), - deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"), - display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), - logfile = self.qemulog, - boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), - use_kvm = use_kvm, - dump_dir = dump_dir, - dump_host_cmds = d.getVar("testimage_dump_host"), - logger = logger, - tmpfsdir = d.getVar("RUNQEMU_TMPFS_DIR"), - serial_ports = len(d.getVar("SERIAL_CONSOLES").split())) + tmpdir=d.getVar("TMPDIR"), + deploy_dir_image=d.getVar("DEPLOY_DIR_IMAGE"), + display=d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), + logfile=self.qemulog, + boottime=int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), + use_kvm=use_kvm, + dump_dir=dump_dir, + dump_host_cmds=d.getVar("testimage_dump_host"), + logger=logger, + tmpfsdir=d.getVar("RUNQEMU_TMPFS_DIR"), + serial_ports=len(d.getVar("SERIAL_CONSOLES").split())) self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner) self.monitor_dumper = MonitorDumper(dump_monitor_cmds, dump_dir, self.runner)
meta/lib/oeqa/utils/__init__.py +1 -1
@@ -8,7 +8,7 @@ __path__ = extend_path(__path__, __name__) # Borrowed from CalledProcessError class CommandError(Exception): - def __init__(self, retcode, cmd, output = None): + def __init__(self, retcode, cmd, output=None): self.retcode = retcode self.cmd = cmd self.output = output
meta/lib/oeqa/utils/network.py +1 -1
@@ -4,7 +4,7 @@ import socket -def get_free_port(udp = False): +def get_free_port(udp=False): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM if not udp else socket.SOCK_DGRAM) s.bind(('', 0)) addr = s.getsockname()
meta/lib/oeqa/utils/nfs.py +4 -4
@@ -8,7 +8,7 @@ from oeqa.utils.commands import bitbake, get_bb_var, Command from oeqa.utils.network import get_free_port @contextlib.contextmanager -def unfs_server(directory, logger = None): +def unfs_server(directory, logger=None): unfs_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "unfs3-native") if not os.path.exists(os.path.join(unfs_sysroot, "usr", "bin", "unfsd")): # build native tool
@@ -18,16 +18,16 @@ def unfs_server(directory, logger = None): cmd = None try: # create the exports file - with tempfile.NamedTemporaryFile(delete = False) as exports: + with tempfile.NamedTemporaryFile(delete=False) as exports: exports.write("{0} (rw,no_root_squash,no_all_squash,insecure)\n".format(directory).encode()) # find some ports for the server - nfsport, mountport = get_free_port(udp = True), get_free_port(udp = True) + nfsport, mountport = get_free_port(udp=True), get_free_port(udp=True) nenv = dict(os.environ) nenv['PATH'] = "{0}/sbin:{0}/usr/sbin:{0}/usr/bin:".format(unfs_sysroot) + nenv.get('PATH', '') cmd = Command(["unfsd", "-d", "-p", "-N", "-e", exports.name, "-n", str(nfsport), "-m", str(mountport)], - bg = True, env = nenv, output_log = logger) + bg=True, env=nenv, output_log=logger) cmd.run() yield nfsport, mountport finally:
meta/lib/oeqa/utils/qemurunner.py +4 -4
@@ -34,7 +34,7 @@ re_control_char = re.compile('[%s]' % re.escape("".join(control_chars))) class QemuRunner: def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, - use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False, workdir=None, tmpfsdir=None): + use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns=defaultdict(str), use_ovmf=False, workdir=None, tmpfsdir=None): # Popen object for runqemu self.runqemu = None
@@ -134,7 +134,7 @@ class QemuRunner: self.stop() self._dump_host() - def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True): + def start(self, qemuparams=None, get_ip=True, extra_bootparams=None, runqemuparams='', launch_cmd=None, discard_writes=True): env = os.environ.copy() if self.display: env["DISPLAY"] = self.display
@@ -175,7 +175,7 @@ class QemuRunner: return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env) - def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None, env = None): + def launch(self, launch_cmd, get_ip=True, qemuparams=None, extra_bootparams=None, env=None): # use logfile to determine the recipe-sysroot-native path and # then add in the site-packages path components and add that # to the python sys.path so qmp.py can be found.
@@ -574,7 +574,7 @@ class QemuRunner: if self.thread: self.thread.allowexit() - def restart(self, qemuparams = None): + def restart(self, qemuparams=None): self.logger.warning("Restarting qemu process") if self.runqemu.poll() is None: self.stop()
meta/lib/oeqa/utils/qemutinyrunner.py +1 -1
@@ -64,7 +64,7 @@ class QemuTinyRunner(QemuRunner): with open(self.logfile, "a") as f: f.write("%s" % msg) - def start(self, qemuparams = None, ssh=True, extra_bootparams=None, runqemuparams='', discard_writes=True): + def start(self, qemuparams=None, ssh=True, extra_bootparams=None, runqemuparams='', discard_writes=True): if self.display: os.environ["DISPLAY"] = self.display
meta/lib/oeqa/utils/sshcontrol.py +1 -1
@@ -120,7 +120,7 @@ class SSHControl(object): with open(self.logfile, "a") as f: f.write("%s\n" % msg) - def _internal_run(self, command, timeout=None, ignore_status = True): + def _internal_run(self, command, timeout=None, ignore_status=True): self.log("[Running]$ %s" % " ".join(command)) proc = SSHProcess()
meta/recipes-core/glibc/glibc/check-test-wrapper +1 -1
@@ -73,7 +73,7 @@ else: sys.exit(-1) try: - r = subprocess.run(command, timeout = 1800, env = env) + r = subprocess.run(command, timeout=1800, env=env) sys.exit(r.returncode) except subprocess.TimeoutExpired: sys.exit(-1)
scripts/bitbake-whatchanged +5 -5
@@ -104,7 +104,7 @@ def split_pntask(s): return (tmp.group(1), tmp.group(2)) -def print_added(d_new = None, d_old = None): +def print_added(d_new=None, d_old=None): """ Print the newly added tasks """
@@ -137,7 +137,7 @@ def print_added(d_new = None, d_old = None): return counter -def print_vrchanged(d_new = None, d_old = None, vr = None): +def print_vrchanged(d_new=None, d_old=None, vr=None): """ Print the pv or pr changed tasks. The arg "vr" is "pv" or "pr"
@@ -165,7 +165,7 @@ def print_vrchanged(d_new = None, d_old = None, vr = None): return counter -def print_depchanged(d_new = None, d_old = None, verbose = False): +def print_depchanged(d_new=None, d_old=None, verbose=False): """ Print the dependency changes """
@@ -210,7 +210,7 @@ def main(): 3) Use bb.siggen.compare_sigfiles to diff the old and new stamps """ - parser = argparse_oe.ArgumentParser(usage = """%(prog)s [options] [package ...] + parser = argparse_oe.ArgumentParser(usage="""%(prog)s [options] [package ...] print what will be done between the current and last builds, for example: $ bitbake core-image-sato
@@ -226,7 +226,7 @@ Note: """ ) parser.add_argument("recipe", help="recipe to check") - parser.add_argument("-v", "--verbose", help = "print the verbose changes", action = "store_true") + parser.add_argument("-v", "--verbose", help="print the verbose changes", action="store_true") args = parser.parse_args() # Get the STAMPS_DIR
scripts/buildhistory-collect-srcrevs +5 -5
@@ -26,18 +26,18 @@ logger = logger_create() def main(): parser = optparse.OptionParser( - description = "Collects the recorded SRCREV values from buildhistory and reports on them.", - usage = """ + description="Collects the recorded SRCREV values from buildhistory and reports on them.", + usage=""" %prog [options]""") parser.add_option("-a", "--report-all", - help = "Report all SRCREV values, not just ones where AUTOREV has been used", + help="Report all SRCREV values, not just ones where AUTOREV has been used", action="store_true", dest="reportall") parser.add_option("-f", "--forcevariable", - help = "Use forcevariable override for all output lines", + help="Use forcevariable override for all output lines", action="store_true", dest="forcevariable") parser.add_option("-p", "--buildhistory-dir", - help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)", + help="Specify path to buildhistory directory (defaults to buildhistory/ under cwd)", action="store", dest="buildhistory_dir", default='buildhistory/') options, args = parser.parse_args(sys.argv)
scripts/buildhistory-diff +1 -1
@@ -63,7 +63,7 @@ def get_args_parser(): default="auto", help="Whether to colourise (defaults to auto)") parser.add_argument('revisions', - default = ['build-minus-1', 'HEAD'], + default=['build-minus-1', 'HEAD'], nargs='*', help=argparse.SUPPRESS) return parser
scripts/combo-layer +15 -15
@@ -746,7 +746,7 @@ def conf_commit_msg(conf, components): # expand the template with known values template = Template(conf.commit_msg_template) - msg = template.substitute(components = component_str) + msg = template.substitute(components=component_str) return msg def commit_conf_file(conf, components, commit=True):
@@ -1307,8 +1307,8 @@ actions = { def main(): parser = optparse.OptionParser( - version = "Combo Layer Repo Tool version %s" % __version__, - usage = """%prog [options] action + version="Combo Layer Repo Tool version %s" % __version__, + usage="""%prog [options] action Create and update a combination layer repository from multiple component repositories.
@@ -1318,24 +1318,24 @@ Action: pull [components] just pull component repos only splitpatch [commit] generate commit patch and split per component, default commit is HEAD""") - parser.add_option("-c", "--conf", help = "specify the config file (conf/combo-layer.conf is the default).", - action = "store", dest = "conffile", default = "conf/combo-layer.conf") + parser.add_option("-c", "--conf", help="specify the config file (conf/combo-layer.conf is the default).", + action="store", dest="conffile", default="conf/combo-layer.conf") - parser.add_option("-i", "--interactive", help = "interactive mode, user can edit the patch list and patches", - action = "store_true", dest = "interactive", default = False) + parser.add_option("-i", "--interactive", help="interactive mode, user can edit the patch list and patches", + action="store_true", dest="interactive", default=False) - parser.add_option("-D", "--debug", help = "output debug information", - action = "store_true", dest = "debug", default = False) + parser.add_option("-D", "--debug", help="output debug information", + action="store_true", dest="debug", default=False) - parser.add_option("-n", "--no-pull", help = "skip pulling component repos during update", - action = "store_true", dest = "nopull", default = False) + parser.add_option("-n", "--no-pull", help="skip pulling component repos during update", + action="store_true", dest="nopull", default=False) parser.add_option("--hard-reset", - help = "instead of pull do fetch and hard-reset in component repos", - action = "store_true", dest = "hard_reset", default = False) + help="instead of pull do fetch and hard-reset in component repos", + action="store_true", dest="hard_reset", default=False) - parser.add_option("-H", "--history", help = "import full history of components during init", - action = "store_true", default = False) + parser.add_option("-H", "--history", help="import full history of components during init", + action="store_true", default=False) options, args = parser.parse_args(sys.argv)
scripts/contrib/list-packageconfig-flags.py +5 -5
@@ -132,18 +132,18 @@ def main(): # Collect and validate input parser = optparse.OptionParser( - description = "Lists recipes and PACKAGECONFIG flags. Without -a or -f, recipes and their available PACKAGECONFIG flags are listed.", - usage = """ + description="Lists recipes and PACKAGECONFIG flags. Without -a or -f, recipes and their available PACKAGECONFIG flags are listed.", + usage=""" %prog [options]""") parser.add_option("-f", "--flags", - help = "list available PACKAGECONFIG flags and affected recipes", + help="list available PACKAGECONFIG flags and affected recipes", action="store_const", dest="listtype", const="flags", default="recipes") parser.add_option("-a", "--all", - help = "list all recipes and PACKAGECONFIG information", + help="list all recipes and PACKAGECONFIG information", action="store_const", dest="listtype", const="all") parser.add_option("-p", "--preferred-only", - help = "where multiple recipe versions are available, list only the preferred version", + help="where multiple recipe versions are available, list only the preferred version", action="store_true", dest="preferred", default=False) options, args = parser.parse_args(sys.argv)
scripts/contrib/verify-homepage.py +1 -1
@@ -27,7 +27,7 @@ import bb.tinfoil logger = scriptutils.logger_create('verify_homepage') def wgetHomepage(pn, homepage): - result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True) + result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell=True) if result: logger.warning("%s: failed to verify HOMEPAGE: %s " % (pn, homepage)) return 1
scripts/lib/checklayer/__init__.py +1 -1
@@ -157,7 +157,7 @@ def _find_layer_depends(depend, layers): return None def add_layer_dependencies(bblayersconf, layer, layers, logger): - def recurse_dependencies(depends, layer, layers, logger, ret = []): + def recurse_dependencies(depends, layer, layers, logger, ret=[]): logger.debug('Processing dependencies %s for layer %s.' % (depends, layer['name']))
scripts/lib/scriptutils.py +1 -1
@@ -37,7 +37,7 @@ class KeepAliveStreamHandler(logging.StreamHandler): self.emit(logging.LogRecord("keepalive", logging.INFO, None, None, "Keepalive message", None, None)) - self._thread = threading.Thread(target = thread, daemon = True) + self._thread = threading.Thread(target=thread, daemon=True) self._thread.start() def close(self):
scripts/lib/wic/ksparser.py +1 -1
@@ -169,7 +169,7 @@ class KickStart(): part.add_argument('--part-type') part.add_argument('--rootfs-dir') part.add_argument('--type', default='primary', - choices = ('primary', 'logical')) + choices=('primary', 'logical')) # --size and --fixed-size cannot be specified together; options # ----extra-space and --overhead-factor should also raise a parser
scripts/lib/wic/partition.py +1 -1
@@ -199,7 +199,7 @@ class Partition(): (self.mountpoint, self.size, self.fixed_size)) def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir, - native_sysroot, real_rootfs = True, pseudo_dir = None): + native_sysroot, real_rootfs=True, pseudo_dir=None): """ Prepare content for a rootfs partition i.e. create a partition and fill it from a /rootfs dir.
scripts/lib/wic/plugins/source/rootfs.py +1 -1
@@ -230,4 +230,4 @@ class RootfsPlugin(SourcePlugin): part.prepare_rootfs(cr_workdir, oe_builddir, new_rootfs or part.rootfs_dir, native_sysroot, - pseudo_dir = new_pseudo or pseudo_dir) + pseudo_dir=new_pseudo or pseudo_dir)
scripts/oe-depends-dot +5 -5
@@ -17,18 +17,18 @@ class Dot(object): description="Analyse recipe-depends.dot generated by bitbake -g", epilog="Use %(prog)s --help to get help") parser.add_argument("dotfile", - help = "Specify the dotfile", nargs = 1, action='store', default='') + help="Specify the dotfile", nargs=1, action='store', default='') parser.add_argument("-k", "--key", - help = "Specify the key, e.g., recipe name", + help="Specify the key, e.g., recipe name", action="store", default='') parser.add_argument("-d", "--depends", - help = "Print the key's dependencies", + help="Print the key's dependencies", action="store_true", default=False) parser.add_argument("-w", "--why", - help = "Print why the key is built", + help="Print why the key is built", action="store_true", default=False) parser.add_argument("-r", "--remove", - help = "Remove duplicated dependencies to reduce the size of the dot files." + help="Remove duplicated dependencies to reduce the size of the dot files." " For example, A->B, B->C, A->C, then A->C can be removed.", action="store_true", default=False)
scripts/pybootchartgui/pybootchartgui/draw.py +2 -2
@@ -395,7 +395,7 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w): proc_tree, None) # render disk throughput - max_sample = max (trace.disk_stats, key = lambda s: s.tput) + max_sample = max (trace.disk_stats, key=lambda s: s.tput) if clip_visible (clip, chart_rect): draw_chart (ctx, DISK_TPUT_COLOR, False, chart_rect, [(sample.time, sample.tput) for sample in trace.disk_stats],
@@ -782,7 +782,7 @@ class CumlSample: def merge_samples(self, proc): self.samples.extend (proc.samples) - self.samples.sort (key = lambda p: p.time) + self.samples.sort (key=lambda p: p.time) def next(self): global palette_idx
scripts/pybootchartgui/pybootchartgui/process_tree.py +4 -4
@@ -39,7 +39,7 @@ class ProcessTree: def __init__(self, writer, kernel, psstats, sample_period, monitoredApp, prune, idle, taskstats, - accurate_parentage, for_testing = False): + accurate_parentage, for_testing=False): self.writer = writer self.process_tree = [] self.taskstats = taskstats
@@ -49,7 +49,7 @@ class ProcessTree: process_list = psstats.process_map.values() else: process_list = list(kernel) + list(psstats.process_map.values()) - self.process_list = sorted(process_list, key = lambda p: p.pid) + self.process_list = sorted(process_list, key=lambda p: p.pid) self.sample_period = sample_period self.build()
@@ -94,7 +94,7 @@ class ProcessTree: def sort(self, process_subtree): """Sort process tree.""" for p in process_subtree: - p.child_list.sort(key = lambda p: p.pid) + p.child_list.sort(key=lambda p: p.pid) self.sort(p.child_list) def num_nodes(self, process_list):
@@ -284,7 +284,7 @@ class ProcessTree: def merge_processes(self, p1, p2): """Merges two process' samples.""" p1.samples.extend(p2.samples) - p1.samples.sort( key = lambda p: p.time ) + p1.samples.sort( key=lambda p: p.time ) p1time = p1.start_time p2time = p2.start_time p1.start_time = min(p1time, p2time)
scripts/pybootchartgui/pybootchartgui/samples.py +1 -1
@@ -22,7 +22,7 @@ class DiskStatSample: self.diskdata = [ a + b for a, b in zip(self.diskdata, new_diskdata) ] class CPUSample: - def __init__(self, time, user, sys, io = 0.0, swap = 0.0): + def __init__(self, time, user, sys, io=0.0, swap=0.0): self.time = time self.user = user self.sys = sys
scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py +1 -1
@@ -25,7 +25,7 @@ class TestProcessTree(unittest.TestCase): parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log')) trace.compile(writer) self.processtree = process_tree.ProcessTree(writer, None, trace.ps_stats, - trace.ps_stats.sample_period, None, options.prune, None, None, False, for_testing = True) + trace.ps_stats.sample_period, None, options.prune, None, None, False, for_testing=True) def mk_fname(self,f): return os.path.join(self.rootdir, f)
Signature · 1 line
2.32.0
PATCH 4/8 PEP8 double aggressive E20 and E211
In reply to Khem RajFrom: persianpros <[email protected]>
--- meta-selftest/lib/devtool/bbpath.py | 4 +- meta-selftest/lib/recipetool/bbpath.py | 6 +- meta/lib/buildstats.py | 6 +- meta/lib/oe/distro_check.py | 6 +- meta/lib/oe/elf.py | 134 +++++++------- meta/lib/oe/lsb.py | 2 +- meta/lib/oe/package_manager/ipk/__init__.py | 2 +- meta/lib/oe/package_manager/rpm/__init__.py | 2 +- meta/lib/oe/patch.py | 4 +- meta/lib/oe/rootfs.py | 2 +- meta/lib/oe/sstatesig.py | 4 +- meta/lib/oe/terminal.py | 2 +- meta/lib/oe/utils.py | 2 +- meta/lib/oeqa/controllers/masterimage.py | 2 +- meta/lib/oeqa/controllers/testtargetloader.py | 2 +- meta/lib/oeqa/core/case.py | 12 +- meta/lib/oeqa/core/runner.py | 2 +- meta/lib/oeqa/core/target/ssh.py | 6 +- meta/lib/oeqa/core/tests/test_data.py | 4 +- meta/lib/oeqa/core/utils/concurrencytest.py | 2 +- meta/lib/oeqa/oetest.py | 2 +- meta/lib/oeqa/runexported.py | 2 +- meta/lib/oeqa/runtime/cases/dnf.py | 2 +- meta/lib/oeqa/runtime/cases/ltp.py | 2 +- meta/lib/oeqa/runtime/cases/parselogs.py | 30 +-- meta/lib/oeqa/runtime/cases/ptest.py | 4 +- meta/lib/oeqa/sdk/cases/gcc.py | 4 +- meta/lib/oeqa/sdkext/cases/devtool.py | 4 +- meta/lib/oeqa/selftest/cases/archiver.py | 4 +- meta/lib/oeqa/selftest/cases/bbtests.py | 8 +- meta/lib/oeqa/selftest/cases/buildoptions.py | 2 +- .../lib/oeqa/selftest/cases/containerimage.py | 6 +- meta/lib/oeqa/selftest/cases/cve_check.py | 30 +-- meta/lib/oeqa/selftest/cases/fitimage.py | 4 +- meta/lib/oeqa/selftest/cases/imagefeatures.py | 2 +- .../oeqa/selftest/cases/kerneldevelopment.py | 3 +- .../oeqa/selftest/cases/oelib/buildhistory.py | 16 +- meta/lib/oeqa/selftest/cases/oelib/path.py | 46 ++--- meta/lib/oeqa/selftest/cases/package.py | 16 +- meta/lib/oeqa/selftest/cases/sstatetests.py | 4 +- meta/lib/oeqa/selftest/cases/wic.py | 3 +- meta/lib/oeqa/targetcontrol.py | 2 +- meta/lib/oeqa/utils/commands.py | 2 +- meta/lib/oeqa/utils/logparser.py | 2 +- meta/lib/oeqa/utils/sshcontrol.py | 6 +- meta/lib/oeqa/utils/testexport.py | 2 +- .../python/python3/create_manifest3.py | 4 +- .../python/python3/get_module_deps3.py | 8 +- .../perf/perf/sort-pmuevents.py | 40 ++-- meta/recipes-rt/rt-tests/files/rt_bmark.py | 4 +- scripts/buildstats-diff | 2 +- scripts/combo-layer | 2 +- scripts/lib/checklayer/cases/bsp.py | 2 +- scripts/lib/devtool/upgrade.py | 2 +- scripts/lib/resulttool/manualexecution.py | 4 +- scripts/lib/resulttool/report.py | 14 +- scripts/lib/scriptutils.py | 2 +- scripts/lib/wic/engine.py | 5 +- scripts/lib/wic/filemap.py | 2 +- scripts/lib/wic/misc.py | 6 +- .../wic/plugins/source/bootimg-biosplusefi.py | 6 +- scripts/oe-pkgdata-browser | 4 +- scripts/oe-trim-schemas | 4 +- scripts/oepydevshell-internal.py | 2 +- .../pybootchartgui/pybootchartgui/batch.py | 18 +- scripts/pybootchartgui/pybootchartgui/draw.py | 174 +++++++++--------- scripts/pybootchartgui/pybootchartgui/gui.py | 32 ++-- .../pybootchartgui/pybootchartgui/main.py.in | 4 +- .../pybootchartgui/pybootchartgui/parsing.py | 102 +++++----- .../pybootchartgui/process_tree.py | 8 +- .../pybootchartgui/pybootchartgui/samples.py | 18 +- scripts/wic | 2 +- 72 files changed, 441 insertions(+), 444 deletions(-)
meta-selftest/lib/devtool/bbpath.py +2 -2
@@ -11,10 +11,10 @@ def plugin_init(plugins): already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins) def print_name(args, config, basepath, workspace): - print (__file__) + print(__file__) def print_bbdir(args, config, basepath, workspace): - print (__file__.replace('/lib/devtool/bbpath.py','')) + print(__file__.replace('/lib/devtool/bbpath.py','')) def print_registered(args, config, basepath, workspace): global kept_context
meta-selftest/lib/recipetool/bbpath.py +3 -3
@@ -11,15 +11,15 @@ def plugin_init(plugins): already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins) def print_name(opts): - print (__file__) + print(__file__) def print_bbdir(opts): - print (__file__.replace('/lib/recipetool/bbpath.py','')) + print(__file__.replace('/lib/recipetool/bbpath.py','')) def print_registered(opts): #global kept_context #print(kept_context.loaded) - print ("1") + print("1") def multiloaded(opts): global already_loaded
meta/lib/buildstats.py +3 -3
@@ -92,10 +92,10 @@ class SystemStats: # for that point in the past. interval = time - self.diskstats_ltime if interval > 0: - sums = [ a - b for a, b in zip(diskdata, self.diskstats_data) ] + sums = [a - b for a, b in zip(diskdata, self.diskstats_data)] readTput = sums[0] / 2.0 * 100.0 / interval writeTput = sums[1] / 2.0 * 100.0 / interval - util = float( sums[2] ) / 10 / interval + util = float(sums[2]) / 10 / interval util = max(0.0, min(1.0, util)) reduced = (self.diskstats_ltime, (readTput, writeTput, util))
@@ -112,7 +112,7 @@ class SystemStats: return None # CPU times {user, nice, system, idle, io_wait, irq, softirq} from first line tokens = data.split(b'\n', 1)[0].split() - times = [ int(token) for token in tokens[1:] ] + times = [int(token) for token in tokens[1:]] reduced = None if self.stat_ltimes: user = float((times[0] + times[1]) - (self.stat_ltimes[0] + self.stat_ltimes[1]))
meta/lib/oe/distro_check.py +3 -3
@@ -183,10 +183,10 @@ def update_distro_data(distro_check_dir, datetime, d): The operations has to be protected by a lock so that only one thread performes it at a time. """ - if not os.path.isdir (distro_check_dir): + if not os.path.isdir(distro_check_dir): try: - bb.note ("Making new directory: %s" % distro_check_dir) - os.makedirs (distro_check_dir) + bb.note("Making new directory: %s" % distro_check_dir) + os.makedirs(distro_check_dir) except OSError: raise Exception('Unable to create directory %s' % (distro_check_dir))
meta/lib/oe/elf.py +67 -67
194 lines not on this page · raw message
meta/lib/oe/lsb.py +1 -1
@@ -37,7 +37,7 @@ def release_dict_lsb(): except bb.process.CmdError as exc: return {} - lsb_map = { 'Distributor ID': 'DISTRIB_ID', + lsb_map = {'Distributor ID': 'DISTRIB_ID', 'Release': 'DISTRIB_RELEASE'} lsb_keys = lsb_map.keys()
meta/lib/oe/package_manager/ipk/__init__.py +1 -1
@@ -166,7 +166,7 @@ class OpkgPM(OpkgDpkgPM): self.deploy_dir = oe.path.join(self.d.getVar('WORKDIR'), ipk_repo_workdir) self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock") self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") - self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs) + self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/'),target_rootfs) self.opkg_args += self.d.getVar("OPKG_ARGS") if prepare_index:
meta/lib/oe/package_manager/rpm/__init__.py +1 -1
@@ -300,7 +300,7 @@ class RpmPM(PackageManager): def update(self): self._invoke_dnf(["makecache", "--refresh"]) - def _invoke_dnf(self, dnf_args, fatal=True, print_output=True ): + def _invoke_dnf(self, dnf_args, fatal=True, print_output=True): os.environ['RPM_ETCCONFIGDIR'] = self.target_rootfs dnf_cmd = bb.utils.which(os.getenv('PATH'), "dnf")
meta/lib/oe/patch.py +2 -2
@@ -35,7 +35,7 @@ def runcmd(args, dir=None): # print("cwd: %s -> %s" % (olddir, dir)) try: - args = [ pipes.quote(str(arg)) for arg in args ] + args = [pipes.quote(str(arg)) for arg in args] cmd = " ".join(args) # print("cmd: %s" % cmd) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
@@ -190,7 +190,7 @@ class PatchTree(PatchSet): def _appendPatchFile(self, patch, strippath): with open(self.seriespath, 'a') as f: f.write(os.path.basename(patch) + "," + strippath + "\n") - shellcmd = ["cat", patch, ">" , self.patchdir + "/" + os.path.basename(patch)] + shellcmd = ["cat", patch, ">", self.patchdir + "/" + os.path.basename(patch)] runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) def _removePatch(self, p):
meta/lib/oe/rootfs.py +1 -1
@@ -46,7 +46,7 @@ class Rootfs(object, metaclass=ABCMeta): # Ignore any lines containing log_check to avoid recursion, and ignore # lines beginning with a + since sh -x may emit code which isn't # actually executed, but may contain error messages - excludes = [ 'log_check', r'^\+' ] + excludes = ['log_check', r'^\+'] if hasattr(self, 'log_check_expected_regexes'): excludes.extend(self.log_check_expected_regexes) # Insert custom log_check excludes
meta/lib/oe/sstatesig.py +2 -2
@@ -107,7 +107,7 @@ class SignatureGeneratorOEBasicHashMixIn(object): self.mismatch_msgs = [] self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES") or "").split() - self.unlockedrecipes = { k: "" for k in self.unlockedrecipes } + self.unlockedrecipes = {k: "" for k in self.unlockedrecipes} self.buildarch = data.getVar('BUILD_ARCH') self._internal = False pass
@@ -180,7 +180,7 @@ class SignatureGeneratorOEBasicHashMixIn(object): # If any unlocked recipe is in the direct dependencies then the # current recipe should be unlocked as well. - depnames = [ recipename_from_dep(x) for x in deps if mc == bb.runqueue.mc_from_tid(x)] + depnames = [recipename_from_dep(x) for x in deps if mc == bb.runqueue.mc_from_tid(x)] if any(x in y for y in depnames for x in self.unlockedrecipes): self.unlockedrecipes[recipename] = '' unlocked = True
meta/lib/oe/terminal.py +1 -1
@@ -42,7 +42,7 @@ class Terminal(Popen, metaclass=Registry): raise def format_command(self, sh_cmd, title): - fmt = {'title': title or 'Terminal', 'command': sh_cmd, 'cwd': os.getcwd() } + fmt = {'title': title or 'Terminal', 'command': sh_cmd, 'cwd': os.getcwd()} if isinstance(self.command, str): return shlex.split(self.command.format(**fmt)) else:
meta/lib/oe/utils.py +1 -1
@@ -8,7 +8,7 @@ import traceback def read_file(filename): try: - f = open( filename, "r" ) + f = open(filename, "r") except IOError as reason: return "" # WARNING: can't raise an error now because of the new RDEPENDS handling. This is a bit ugly. :M: else:
meta/lib/oeqa/controllers/masterimage.py +1 -1
@@ -42,7 +42,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta self.server_ip = d.getVar("TEST_SERVER_IP") if not self.server_ip: try: - self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1] + self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip]).split("\n")[0].split()[-1] except Exception as e: bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e) bb.note("Server IP: %s" % self.server_ip)
meta/lib/oeqa/controllers/testtargetloader.py +1 -1
@@ -65,7 +65,7 @@ class TestTargetLoader: obj = getattr(module, target) if obj: from oeqa.targetcontrol import BaseTarget - if( not issubclass(obj, BaseTarget)): + if(not issubclass(obj, BaseTarget)): bb.warn("Target {0} found, but subclass is not BaseTarget".format(target)) except: obj = None
meta/lib/oeqa/core/case.py +6 -6
@@ -67,16 +67,16 @@ class OEPTestResultTestCase: logdata = log.encode("utf-8") if isinstance(log, str) else log logdata = zlib.compress(logdata) logdata = base64.b64encode(logdata).decode("utf-8") - return {"compressed" : logdata} + return {"compressed": logdata} def ptest_rawlog(self, log): if not hasattr(self, "extraresults"): - self.extraresults = {"ptestresult.sections" : {}} - self.extraresults["ptestresult.rawlogs"] = {"log" : self._compress_log(log)} + self.extraresults = {"ptestresult.sections": {}} + self.extraresults["ptestresult.rawlogs"] = {"log": self._compress_log(log)} def ptest_section(self, section, duration=None, log=None, logfile=None, exitcode=None): if not hasattr(self, "extraresults"): - self.extraresults = {"ptestresult.sections" : {}} + self.extraresults = {"ptestresult.sections": {}} sections = self.extraresults.get("ptestresult.sections") if section not in sections:
@@ -95,11 +95,11 @@ class OEPTestResultTestCase: def ptest_result(self, section, test, result): if not hasattr(self, "extraresults"): - self.extraresults = {"ptestresult.sections" : {}} + self.extraresults = {"ptestresult.sections": {}} sections = self.extraresults.get("ptestresult.sections") if section not in sections: sections[section] = {} resultname = "ptestresult.{}.{}".format(section, test) - self.extraresults[resultname] = {"status" : result} + self.extraresults[resultname] = {"status": result}
meta/lib/oeqa/core/runner.py +1 -1
@@ -93,7 +93,7 @@ class OETestResult(_TestResult): def _getTestResultDetails(self, case): result_types = {'failures': 'FAILED', 'errors': 'ERROR', 'skipped': 'SKIPPED', 'expectedFailures': 'EXPECTEDFAIL', 'successes': 'PASSED', - 'unexpectedSuccesses' : 'PASSED'} + 'unexpectedSuccesses': 'PASSED'} for rtype in result_types: found = False
meta/lib/oeqa/core/target/ssh.py +3 -3
@@ -38,11 +38,11 @@ class OESSHTarget(OETarget): '-o', 'StrictHostKeyChecking=no', '-o', 'LogLevel=ERROR' ] - self.ssh = ['ssh', '-l', self.user ] + ssh_options + self.ssh = ['ssh', '-l', self.user] + ssh_options self.scp = ['scp'] + ssh_options if port: - self.ssh = self.ssh + [ '-p', port ] - self.scp = self.scp + [ '-P', port ] + self.ssh = self.ssh + ['-p', port] + self.scp = self.scp + ['-P', port] self._monitor_dumper = None def start(self, **kwargs):
meta/lib/oeqa/core/tests/test_data.py +2 -2
@@ -33,7 +33,7 @@ class TestData(TestBase): def test_data_fail_wrong_variable(self): expectedError = 'AssertionError' - d = {'IMAGE' : 'core-image-weston', 'ARCH' : 'arm'} + d = {'IMAGE': 'core-image-weston', 'ARCH': 'arm'} tc = self._testLoader(d=d, modules=self.modules) results = tc.runTests()
@@ -46,7 +46,7 @@ class TestData(TestBase): self.assertTrue(expect) def test_data_ok(self): - d = {'IMAGE' : 'core-image-minimal', 'ARCH' : 'x86', 'MACHINE' : 'qemuarm'} + d = {'IMAGE': 'core-image-minimal', 'ARCH': 'x86', 'MACHINE': 'qemuarm'} tc = self._testLoader(d=d, modules=self.modules) self.assertEqual(True, tc.runTests().wasSuccessful())
meta/lib/oeqa/core/utils/concurrencytest.py +1 -1
@@ -128,7 +128,7 @@ class ExtraResultsDecoderTestResult(ProxyTestResult): class ExtraResultsEncoderTestResult(ProxyTestResult): def _addResult(self, method, test, *args, exception=False, **kwargs): if hasattr(test, "extraresults"): - extras = lambda : [json.dumps(test.extraresults).encode()] + extras = lambda: [json.dumps(test.extraresults).encode()] kwargs = kwargs.copy() if "details" not in kwargs: kwargs["details"] = {}
meta/lib/oeqa/oetest.py +1 -1
@@ -123,7 +123,7 @@ class oeRuntimeTest(oeTest): self.tc.host_dumper.dump_host() self.target.target_dumper.dump_target( self.tc.host_dumper.dump_dir) - print ("%s dump data stored in %s" % (self._testMethodName, + print("%s dump data stored in %s" % (self._testMethodName, self.tc.host_dumper.dump_dir)) self.tearDownLocal()
meta/lib/oeqa/runexported.py +1 -1
@@ -135,7 +135,7 @@ def extract_sdk(d): tarball_path = os.path.join(export_dir, tools_dir, tarball_name) extract_path = os.path.join(export_dir, "sysroot") if os.path.isfile(tarball_path): - print ("Found SDK tarball %s. Extracting..." % tarball_path) + print("Found SDK tarball %s. Extracting..." % tarball_path) result = runCmd("%s -y -d %s" % (tarball_path, extract_path)) for f in os.listdir(extract_path): if f.startswith("environment-setup"):
meta/lib/oeqa/runtime/cases/dnf.py +1 -1
@@ -187,5 +187,5 @@ class DnfRepoTest(DnfTest): self.assertEqual(1, status, "%s was not removed, is listed as installed"%excludepkg) self.dnf_with_repo('install -y --exclude=%s --exclude=curl-staticdev curl*' % excludepkg) #check curl-dev is not installed after being excluded - status, output = self.target.run('dnf list --installed | grep %s'% excludepkg , 1500) + status, output = self.target.run('dnf list --installed | grep %s'% excludepkg, 1500) self.assertEqual(1, status, "%s was not excluded, is listed as installed"%excludepkg)
meta/lib/oeqa/runtime/cases/ltp.py +1 -1
@@ -76,7 +76,7 @@ class LtpTest(LtpTestBase): self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output # copy nice log from DUT - dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group ) + dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group) remote_src = "/opt/ltp/results/%s" % ltp_group (status, output) = self.target.copyFrom(remote_src, dst, True) msg = 'File could not be copied. Output: %s' % output
meta/lib/oeqa/runtime/cases/parselogs.py +15 -15
@@ -93,22 +93,22 @@ qemux86_common = [ ] + common_errors ignore_errors = { - 'default' : common_errors, - 'qemux86' : [ + 'default': common_errors, + 'qemux86': [ 'Failed to access perfctr msr (MSR', 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)', ] + qemux86_common, - 'qemux86-64' : qemux86_common, - 'qemumips' : [ + 'qemux86-64': qemux86_common, + 'qemumips': [ 'Failed to load module "glx"', 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)', 'cacheinfo: Failed to find cpu0 device node', ] + common_errors, - 'qemumips64' : [ + 'qemumips64': [ 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)', 'cacheinfo: Failed to find cpu0 device node', ] + common_errors, - 'qemuppc' : [ + 'qemuppc': [ 'PCI 0000:00 Cannot reserve Legacy IO [io 0x0000-0x0fff]', 'host side 80-wire cable detection failed, limiting max speed', 'mode "640x480" test failed',
@@ -116,12 +116,12 @@ ignore_errors = { 'can\'t handle BAR above 4GB', 'Cannot reserve Legacy IO', ] + common_errors, - 'qemuppc64' : [ + 'qemuppc64': [ 'vio vio: uevent: failed to send synthetic uevent', 'synth uevent: /devices/vio: failed to send uevent', 'PCI 0000:00 Cannot reserve Legacy IO [io 0x10000-0x10fff]', ] + common_errors, - 'qemuarm' : [ + 'qemuarm': [ 'mmci-pl18x: probe of fpga:05 failed with error -22', 'mmci-pl18x: probe of fpga:0b failed with error -22', 'Failed to load module "glx"',
@@ -136,14 +136,14 @@ ignore_errors = { 'Failed to initialize \'/amba/timer@101e3000\': -22', 'jitterentropy: Initialization failed with host not compliant with requirements: 2', ] + common_errors, - 'qemuarm64' : [ + 'qemuarm64': [ 'Fatal server error:', '(EE) Server terminated with error (1). Closing log file.', 'dmi: Firmware registration failed.', 'irq: type mismatch, failed to map hwirq-27 for /intc', 'logind: failed to get session seat', ] + common_errors, - 'intel-core2-32' : [ + 'intel-core2-32': [ 'ACPI: No _BQC method, cannot determine initial brightness', '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness', '(EE) Failed to load module "psb"',
@@ -155,7 +155,7 @@ ignore_errors = { 'dmi: Firmware registration failed.', 'ioremap error for 0x78', ] + x86_common, - 'intel-corei7-64' : [ + 'intel-corei7-64': [ 'can\'t set Max Payload Size to 256', 'intel_punit_ipc: can\'t request region for resource', '[drm] parse error at position 4 in video mode \'efifb\'',
@@ -170,8 +170,8 @@ ignore_errors = { 'Bluetooth: hci0: Failed to send firmware data (-38)', 'atkbd serio0: Failed to enable keyboard on isa0060/serio0', ] + x86_common, - 'genericx86' : x86_common, - 'genericx86-64' : [ + 'genericx86': x86_common, + 'genericx86-64': [ 'Direct firmware load for i915', 'Failed to load firmware i915', 'Failed to fetch GuC',
@@ -179,13 +179,13 @@ ignore_errors = { 'Failed to load DMC firmware', 'The driver is built-in, so to load the firmware you need to', ] + x86_common, - 'edgerouter' : [ + 'edgerouter': [ 'not creating \'/sys/firmware/fdt\'', 'Failed to find cpu0 device node', 'Fatal server error:', 'Server terminated with error', ] + common_errors, - 'beaglebone-yocto' : [ + 'beaglebone-yocto': [ 'Direct firmware load for regulatory.db', 'failed to load regulatory.db', 'l4_wkup_cm',
meta/lib/oeqa/runtime/cases/ptest.py +2 -2
@@ -54,7 +54,7 @@ class PtestRunnerTest(OERuntimeTestCase): ptest_runner_log = os.path.join(ptest_log_dir, 'ptest-runner.log') libdir = self.td.get('libdir', '') - ptest_dirs = [ '/usr/lib' ] + ptest_dirs = ['/usr/lib'] if not libdir in ptest_dirs: ptest_dirs.append(libdir) status, output = self.target.run('ptest-runner -d \"{}\"'.format(' '.join(ptest_dirs)), 0)
@@ -95,7 +95,7 @@ class PtestRunnerTest(OERuntimeTestCase): failed_tests[section] = sections[section]["log"] for section in results: - failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'FAILED' ] + failed_testcases = ["_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'FAILED'] if failed_testcases: failed_tests[section] = failed_testcases
meta/lib/oeqa/sdk/cases/gcc.py +2 -2
@@ -17,8 +17,8 @@ class GccCompileTest(OESDKTestCase): @classmethod def setUpClass(self): - files = {'test.c' : self.tc.files_dir, 'test.cpp' : self.tc.files_dir, - 'testsdkmakefile' : self.tc.sdk_files_dir} + files = {'test.c': self.tc.files_dir, 'test.cpp': self.tc.files_dir, + 'testsdkmakefile': self.tc.sdk_files_dir} for f in files: shutil.copyfile(os.path.join(files[f], f), os.path.join(self.tc.sdk_dir, f))
meta/lib/oeqa/sdkext/cases/devtool.py +2 -2
@@ -72,7 +72,7 @@ class DevtoolTest(OESDKExtTestCase): req = 'https://github.com/rdfa/librdfa' recipe = "librdfa" self._run('devtool sdk-install libxml2') - self._run('devtool add %s %s' % (recipe, req) ) + self._run('devtool add %s %s' % (recipe, req)) try: self._run('devtool build %s' % recipe) finally:
@@ -81,7 +81,7 @@ class DevtoolTest(OESDKExtTestCase): def test_devtool_kernelmodule(self): docfile = 'https://git.yoctoproject.org/git/kernel-module-hello-world' recipe = 'kernel-module-hello-world' - self._run('devtool add %s %s' % (recipe, docfile) ) + self._run('devtool add %s %s' % (recipe, docfile)) try: self._run('devtool build %s' % recipe) finally:
meta/lib/oeqa/selftest/cases/archiver.py +2 -2
@@ -86,8 +86,8 @@ class Archiver(OESelftestTestCase): Author: André Draszik <[email protected]> """ - target_recipes = [ 'initscripts', 'selftest-ed' ] - native_recipes = [ 'update-rc.d-native', 'selftest-ed-native' ] + target_recipes = ['initscripts', 'selftest-ed'] + native_recipes = ['update-rc.d-native', 'selftest-ed-native'] features = 'INHERIT += "archiver"\n' features += 'ARCHIVER_MODE[src] = "original"\n'
meta/lib/oeqa/selftest/cases/bbtests.py +4 -4
@@ -51,7 +51,7 @@ class BitbakeTests(OESelftestTestCase): bitbake('m4-native -cclean') result = bitbake('m4-native') find_setscene = re.search("m4-native.*do_.*_setscene", result.output) - self.assertTrue(find_setscene, msg="No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output ) + self.assertTrue(find_setscene, msg="No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output) def test_bitbake_invalid_recipe(self): result = bitbake('-b asdf', ignore_status=True)
@@ -191,7 +191,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" def test_prefile(self): preconf = os.path.join(self.builddir, 'conf/prefile.conf') self.track_for_cleanup(preconf) - ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"") + ftools.write_file(preconf,"TEST_PREFILE=\"prefile\"") result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') self.assertIn('prefile', result.output) self.write_config("TEST_PREFILE=\"localconf\"")
@@ -201,7 +201,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" def test_postfile(self): postconf = os.path.join(self.builddir, 'conf/postfile.conf') self.track_for_cleanup(postconf) - ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"") + ftools.write_file(postconf, "TEST_POSTFILE=\"postfile\"") self.write_config("TEST_POSTFILE=\"localconf\"") result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=') self.assertIn('postfile', result.output)
@@ -216,7 +216,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" INHERIT_remove = \"report-error\" """) self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) - self.write_recipeinc('man-db',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" ) + self.write_recipeinc('man-db',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n") runCmd('bitbake -c cleanall man-db xcursor-transparent-theme') result = runCmd('bitbake -c unpack -k man-db xcursor-transparent-theme', ignore_status=True) errorpos = result.output.find('ERROR: Function failed: do_fail_task')
meta/lib/oeqa/selftest/cases/buildoptions.py +1 -1
@@ -45,7 +45,7 @@ class ImageOptionsTests(OESelftestTestCase): log_compile = os.path.join(get_bb_var("WORKDIR", recipe), "temp/log.do_compile") with open(log_compile, "r") as f: loglines = "".join(f.readlines()) - self.assertIn("ccache", loglines, msg="No match for ccache in %s log.do_compile. For further details: %s" % (recipe , log_compile)) + self.assertIn("ccache", loglines, msg="No match for ccache in %s log.do_compile. For further details: %s" % (recipe, log_compile)) def test_read_only_image(self): distro_features = get_bb_var('DISTRO_FEATURES')
meta/lib/oeqa/selftest/cases/containerimage.py +3 -3
@@ -28,7 +28,7 @@ class ContainerImageTests(OESelftestTestCase): def get_each_path_part(path): if path: - part = [ '.' + path + '/' ] + part = ['.' + path + '/'] result = get_each_path_part(path.rsplit('/', 1)[0]) if result: return part + result
@@ -63,10 +63,10 @@ IMAGE_INSTALL_remove = "ssh-pregen-hostkeys" '.{localstatedir}/lib/' ] - expected_files = [ x.format(bindir=bbvars['bindir'], + expected_files = [x.format(bindir=bbvars['bindir'], sysconfdir=bbvars['sysconfdir'], localstatedir=bbvars['localstatedir']) - for x in expected_files ] + for x in expected_files] # Since tar lists all directories individually, make sure each element # from bindir, sysconfdir, etc is added
meta/lib/oeqa/selftest/cases/cve_check.py +15 -15
@@ -5,40 +5,40 @@ class CVECheck(OESelftestTestCase): def test_version_compare(self): result = Version("100") > Version("99") - self.assertTrue( result, msg="Failed to compare version '100' > '99'") + self.assertTrue(result, msg="Failed to compare version '100' > '99'") result = Version("2.3.1") > Version("2.2.3") - self.assertTrue( result, msg="Failed to compare version '2.3.1' > '2.2.3'") + self.assertTrue(result, msg="Failed to compare version '2.3.1' > '2.2.3'") result = Version("2021-01-21") > Version("2020-12-25") - self.assertTrue( result, msg="Failed to compare version '2021-01-21' > '2020-12-25'") + self.assertTrue(result, msg="Failed to compare version '2021-01-21' > '2020-12-25'") result = Version("1.2-20200910") < Version("1.2-20200920") - self.assertTrue( result, msg="Failed to compare version '1.2-20200910' < '1.2-20200920'") + self.assertTrue(result, msg="Failed to compare version '1.2-20200910' < '1.2-20200920'") result = Version("1.0") >= Version("1.0beta") - self.assertTrue( result, msg="Failed to compare version '1.0' >= '1.0beta'") + self.assertTrue(result, msg="Failed to compare version '1.0' >= '1.0beta'") result = Version("1.0-rc2") > Version("1.0-rc1") - self.assertTrue( result, msg="Failed to compare version '1.0-rc2' > '1.0-rc1'") + self.assertTrue(result, msg="Failed to compare version '1.0-rc2' > '1.0-rc1'") result = Version("1.0.alpha1") < Version("1.0") - self.assertTrue( result, msg="Failed to compare version '1.0.alpha1' < '1.0'") + self.assertTrue(result, msg="Failed to compare version '1.0.alpha1' < '1.0'") result = Version("1.0_dev") <= Version("1.0") - self.assertTrue( result, msg="Failed to compare version '1.0_dev' <= '1.0'") + self.assertTrue(result, msg="Failed to compare version '1.0_dev' <= '1.0'") # ignore "p1" and "p2", so these should be equal result = Version("1.0p2") == Version("1.0p1") - self.assertTrue( result ,msg="Failed to compare version '1.0p2' to '1.0p1'") + self.assertTrue(result,msg="Failed to compare version '1.0p2' to '1.0p1'") # ignore the "b" and "r" result = Version("1.0b") == Version("1.0r") - self.assertTrue( result ,msg="Failed to compare version '1.0b' to '1.0r'") + self.assertTrue(result,msg="Failed to compare version '1.0b' to '1.0r'") # consider the trailing alphabet as patched level when comparing result = Version("1.0b","alphabetical") < Version("1.0r","alphabetical") - self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'") + self.assertTrue(result,msg="Failed to compare version with suffix '1.0b' < '1.0r'") result = Version("1.0b","alphabetical") > Version("1.0","alphabetical") - self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'") + self.assertTrue(result,msg="Failed to compare version with suffix '1.0b' > '1.0'") # consider the trailing "p" and "patch" as patched released when comparing result = Version("1.0","patch") < Version("1.0p1","patch") - self.assertTrue( result ,msg="Failed to compare version with suffix '1.0' < '1.0p1'") + self.assertTrue(result,msg="Failed to compare version with suffix '1.0' < '1.0p1'") result = Version("1.0p2","patch") > Version("1.0p1","patch") - self.assertTrue( result ,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'") + self.assertTrue(result,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'") result = Version("1.0_patch2","patch") < Version("1.0_patch3","patch") - self.assertTrue( result ,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'") + self.assertTrue(result,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'")
meta/lib/oeqa/selftest/cases/fitimage.py +2 -2
@@ -785,7 +785,7 @@ FIT_HASH_ALG = "sha256" test_passed = False - print ("checking kernel node\n") + print("checking kernel node\n") if node_str in its_lines: node_start_idx = its_lines.index(node_str)
@@ -803,7 +803,7 @@ FIT_HASH_ALG = "sha256" line_idx = cfg_start_idx + 2 node_end = False while node_end == False: - if its_lines[line_idx] == "};" and its_lines[line_idx-1] == "};" : + if its_lines[line_idx] == "};" and its_lines[line_idx-1] == "};": node_end = True line_idx = line_idx + 1
meta/lib/oeqa/selftest/cases/imagefeatures.py +1 -1
@@ -128,7 +128,7 @@ class ImageFeatures(OESelftestTestCase): Author: Tom Rini <[email protected]> """ - img_types = [ 'vmdk', 'vdi', 'qcow2' ] + img_types = ['vmdk', 'vdi', 'qcow2'] features = "" for itype in img_types: features += 'IMAGE_FSTYPES += "wic.%s"\n' % itype
meta/lib/oeqa/selftest/cases/kerneldevelopment.py +1 -2
@@ -12,8 +12,7 @@ class KernelDev(OESelftestTestCase): cls.layername = 'meta-kerneltest' runCmd('bitbake-layers create-layer %s' % cls.layername) runCmd('mkdir -p %s/recipes-kernel/linux/linux-yocto' % cls.layername) - cls.recipes_linuxyocto_dir = os.path.join \ - (cls.builddir, cls.layername, 'recipes-kernel', 'linux', 'linux-yocto') + cls.recipes_linuxyocto_dir = os.path.join(cls.builddir, cls.layername, 'recipes-kernel', 'linux', 'linux-yocto') cls.recipeskernel_dir = os.path.dirname(cls.recipes_linuxyocto_dir) runCmd('bitbake-layers add-layer %s' % cls.layername)
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +8 -8
@@ -49,7 +49,7 @@ class TestBlobParsing(OESelftestTestCase): Test conversion of git blobs to dictionary """ from oe.buildhistory_analysis import blob_to_dict - valuesmap = { "foo" : "1", "bar" : "2" } + valuesmap = {"foo": "1", "bar": "2"} self.commit_vars(to_add=valuesmap) blob = self.repo.head.commit.tree.blobs[0]
@@ -62,18 +62,18 @@ class TestBlobParsing(OESelftestTestCase): """ from oe.buildhistory_analysis import compare_dict_blobs - changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")} + changesmap = {"foo-2": ("2", "8"), "bar": ("","4"), "bar-2": ("","5")} - self.commit_vars(to_add={ "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) + self.commit_vars(to_add={"foo": "1", "foo-2": "2", "foo-3": "3"}) blob1 = self.repo.heads.master.commit.tree.blobs[0] - self.commit_vars(to_add={ "foo-2" : "8", "bar" : "4", "bar-2" : "5" }) + self.commit_vars(to_add={"foo-2": "8", "bar": "4", "bar-2": "5"}) blob2 = self.repo.heads.master.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file), blob1, blob2, False, False) - var_changes = { x.fieldname : (x.oldvalue, x.newvalue) for x in change_records} + var_changes = {x.fieldname: (x.oldvalue, x.newvalue) for x in change_records} self.assertEqual(changesmap, var_changes, "Changes not reported correctly") def test_compare_dict_blobs_default(self):
@@ -81,12 +81,12 @@ class TestBlobParsing(OESelftestTestCase): Test default values for comparisson of git blob dictionaries """ from oe.buildhistory_analysis import compare_dict_blobs - defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} + defaultmap = {x: ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} - self.commit_vars(to_add={ "foo" : "1" }) + self.commit_vars(to_add={"foo": "1"}) blob1 = self.repo.heads.master.commit.tree.blobs[0] - self.commit_vars(to_add={ "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" }) + self.commit_vars(to_add={"PKG": "1", "PKGE": "1", "PKGV": "1", "PKGR": "1"}) blob2 = self.repo.heads.master.commit.tree.blobs[0] change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
meta/lib/oeqa/selftest/cases/oelib/path.py +23 -23
59 lines not on this page · raw message
meta/lib/oeqa/selftest/cases/package.py +8 -8
@@ -43,33 +43,33 @@ class VersionOrdering(OESelftestTestCase): def test_dpkg(self): for ver1, ver2, sort in self.tests: - op = { -1: "<<", 0: "=", 1: ">>" }[sort] + op = {-1: "<<", 0: "=", 1: ">>"}[sort] status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2)) self.assertEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2)) # Now do it again but with incorrect operations - op = { -1: ">>", 0: ">>", 1: "<<" }[sort] + op = {-1: ">>", 0: ">>", 1: "<<"}[sort] status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2)) self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2)) # Now do it again but with incorrect operations - op = { -1: "=", 0: "<<", 1: "=" }[sort] + op = {-1: "=", 0: "<<", 1: "="}[sort] status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2)) self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2)) def test_opkg(self): for ver1, ver2, sort in self.tests: - op = { -1: "<<", 0: "=", 1: ">>" }[sort] + op = {-1: "<<", 0: "=", 1: ">>"}[sort] status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2)) self.assertEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2)) # Now do it again but with incorrect operations - op = { -1: ">>", 0: ">>", 1: "<<" }[sort] + op = {-1: ">>", 0: ">>", 1: "<<"}[sort] status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2)) self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2)) # Now do it again but with incorrect operations - op = { -1: "=", 0: "<<", 1: "=" }[sort] + op = {-1: "=", 0: "<<", 1: "="}[sort] status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2)) self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
@@ -163,13 +163,13 @@ class PackageTests(OESelftestTestCase): self.logger.info("Check ownership of %s", path) status, output = qemu.run_serial(r'/bin/stat -c "%U %G" ' + path, timeout=60) output = output.split(" ") - if output[0] != uid or output[1] != gid : + if output[0] != uid or output[1] != gid: self.logger.error("Incrrect ownership %s [%s:%s]", path, output[0], output[1]) return False return True with runqemu('core-image-minimal') as qemu: - for path in [ sysconfdir + "/selftest-chown/file", + for path in [sysconfdir + "/selftest-chown/file", sysconfdir + "/selftest-chown/dir", sysconfdir + "/selftest-chown/symlink", sysconfdir + "/selftest-chown/fifotest/fifo"]:
meta/lib/oeqa/selftest/cases/sstatetests.py +2 -2
@@ -75,9 +75,9 @@ class SStateTests(SStateBase): file_tracker = results if should_pass: - self.assertTrue(file_tracker , msg="Could not find sstate files for: %s" % ', '.join(map(str, targets))) + self.assertTrue(file_tracker, msg="Could not find sstate files for: %s" % ', '.join(map(str, targets))) else: - self.assertTrue(not file_tracker , msg="Found sstate files in the wrong place for: %s (found %s)" % (', '.join(map(str, targets)), str(file_tracker))) + self.assertTrue(not file_tracker, msg="Found sstate files in the wrong place for: %s (found %s)" % (', '.join(map(str, targets)), str(file_tracker))) def test_sstate_creation_distro_specific_pass(self): self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
meta/lib/oeqa/selftest/cases/wic.py +1 -2
@@ -634,8 +634,7 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc # check each partition for permission for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')): res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part)) - self.assertTrue(files_own_by_root(res.output) - ,msg='Files permission incorrect using wks set "%s"' % test) + self.assertTrue(files_own_by_root(res.output),msg='Files permission incorrect using wks set "%s"' % test) # clean config and result directory for next cases self.remove_config(config)
meta/lib/oeqa/targetcontrol.py +1 -1
@@ -223,7 +223,7 @@ class SimpleRemoteTarget(BaseTarget): self.server_ip = d.getVar("TEST_SERVER_IP") if not self.server_ip: try: - self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1] + self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip]).split("\n")[0].split()[-1] except Exception as e: bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e) self.logger.info("Server IP: %s" % self.server_ip)
meta/lib/oeqa/utils/commands.py +1 -1
@@ -223,7 +223,7 @@ def bitbake(command, ignore_status=False, timeout=None, postconfig=None, output_ if isinstance(command, str): cmd = "bitbake " + extra_args + " " + command else: - cmd = [ "bitbake" ] + [a for a in (command + extra_args.split(" ")) if a not in [""]] + cmd = ["bitbake"] + [a for a in (command + extra_args.split(" ")) if a not in [""]] try: return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)
meta/lib/oeqa/utils/logparser.py +1 -1
@@ -29,7 +29,7 @@ class PtestParser(object): markers = ("PASS:", "FAIL:", "SKIP:", "BEGIN:", "END:", "DURATION:", "ERROR: Exit", "TIMEOUT:") def newsection(): - return { 'name': "No-section", 'log': [] } + return {'name': "No-section", 'log': []} current_section = newsection()
meta/lib/oeqa/utils/sshcontrol.py +3 -3
@@ -109,11 +109,11 @@ class SSHControl(object): '-o', 'StrictHostKeyChecking=no', '-o', 'LogLevel=ERROR' ] - self.ssh = ['ssh', '-l', self.user ] + self.ssh_options + self.ssh = ['ssh', '-l', self.user] + self.ssh_options self.scp = ['scp'] + self.ssh_options if port: - self.ssh = self.ssh + [ '-p', port ] - self.scp = self.scp + [ '-P', port ] + self.ssh = self.ssh + ['-p', port] + self.scp = self.scp + ['-P', port] def log(self, msg): if self.logfile:
meta/lib/oeqa/utils/testexport.py +1 -1
@@ -245,7 +245,7 @@ def send_bin_to_DUT(d,params): break else: bb.warn("No rpm package found for %s %s in .rpm files dir %s. Skipping deployment." % - (param_list[0], "ver. " + param_list[1] if param_list[1] else "", rpms_file_dir) ) + (param_list[0], "ver. " + param_list[1] if param_list[1] else "", rpms_file_dir)) return (status, output) = oeRuntimeTest.tc.target.copy_to(os.path.join(arch_rpms_dir, rpm_to_send), remote_path) if status != 0:
meta/recipes-devtools/python/python3/create_manifest3.py +2 -2
@@ -327,7 +327,7 @@ for pypkg in old_manifest: check_path = pymodule_dep else: check_path = os.path.dirname(pymodule_dep) - if folder in check_path : + if folder in check_path: inFolders = True # Did we find a folder? folderFound = False # Second flag to break inner for # Loop only through packages which contain folders
@@ -336,7 +336,7 @@ for pypkg in old_manifest: # print('Checking folder %s on package %s' % (pymodule_dep,pypkg_with_folder)) for folder_dep in old_manifest[pypkg_with_folder]['files'] or folder_dep in old_manifest[pypkg_with_folder]['cached']: if folder_dep == folder: - print ('%s directory found in %s' % (folder, pypkg_with_folder)) + print('%s directory found in %s' % (folder, pypkg_with_folder)) folderFound = True if pypkg_with_folder not in new_manifest[pypkg]['rdepends'] and pypkg_with_folder != pypkg: new_manifest[pypkg]['rdepends'].append(pypkg_with_folder)
meta/recipes-devtools/python/python3/get_module_deps3.py +4 -4
@@ -118,7 +118,7 @@ for item in dif: if 'sitecustomize' in dep_path: dep_path = '${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py' # Prints out result, which is what will be used by create_manifest - print (dep_path) + print(dep_path) continue dep_path = fix_path(dep_path)
@@ -130,7 +130,7 @@ for item in dif: if debug == True: log.write('Shared library found in %s\n' % dep_path) dep_path = dep_path.replace(soabi,'*') - print (dep_path) + print(dep_path) continue if "_sysconfigdata" in dep_path: dep_path = dep_path.replace(sysconfig._get_sysconfigdata_name(), "_sysconfigdata*")
@@ -138,7 +138,7 @@ for item in dif: if debug == True: log.write(dep_path+'\n') # Prints out result, which is what will be used by create_manifest - print (dep_path) + print(dep_path) cpython_tag = sys.implementation.cache_tag
@@ -168,7 +168,7 @@ for item in dif: cached = cached.replace(cpython_tag,'*') if "_sysconfigdata" in cached: cached = cached.replace(sysconfig._get_sysconfigdata_name(), "_sysconfigdata*") - print (cached) + print(cached) if debug == True: log.close()
meta/recipes-kernel/perf/perf/sort-pmuevents.py +20 -20
@@ -13,50 +13,50 @@ import re from collections import OrderedDict if len(sys.argv) < 2: - print( "[ERROR]: input and output pmu files missing" ) + print("[ERROR]: input and output pmu files missing") sys.exit(1) if len(sys.argv) < 3: - print( "[ERROR]: output pmu file missing" ) + print("[ERROR]: output pmu file missing") sys.exit(1) infile = sys.argv[1] outfile = sys.argv[2] if not os.path.exists(infile): - print( "ERROR. input file does not exist: %s" % infile ) + print("ERROR. input file does not exist: %s" % infile) sys.exit(1) if os.path.exists(outfile): - print( "WARNING. output file will be overwritten: %s" % infile ) + print("WARNING. output file will be overwritten: %s" % infile) with open(infile, 'r') as file: data = file.read() -preamble_regex = re.compile( '^(.*?)^struct', re.MULTILINE | re.DOTALL ) +preamble_regex = re.compile('^(.*?)^struct', re.MULTILINE | re.DOTALL) -preamble = re.search( preamble_regex, data ) -struct_block_regex = re.compile( '^struct.*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) -field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) -cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) -name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) +preamble = re.search(preamble_regex, data) +struct_block_regex = re.compile('^struct.*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL) +field_regex = re.compile('{.*?},', re.MULTILINE | re.DOTALL) +cpuid_regex = re.compile('\.cpuid = (.*?),', re.MULTILINE | re.DOTALL) +name_regex = re.compile('\.name = (.*?),', re.MULTILINE | re.DOTALL) # create a dictionary structure to store all the structs, their # types and then their fields. entry_dict = {} -for struct in re.findall( struct_block_regex, data ): +for struct in re.findall(struct_block_regex, data): # print( "struct: %s %s" % (struct[0],struct[1]) ) entry_dict[struct[1]] = {} entry_dict[struct[1]]['type'] = struct[0] entry_dict[struct[1]]['fields'] = {} - for entry in re.findall( field_regex, struct[2] ): + for entry in re.findall(field_regex, struct[2]): #print( " entry: %s" % entry ) - cpuid = re.search( cpuid_regex, entry ) + cpuid = re.search(cpuid_regex, entry) if cpuid: #print( " cpuid found: %s" % cpuid.group(1) ) entry_dict[struct[1]]['fields'][cpuid.group(1)] = entry - name = re.search( name_regex, entry ) + name = re.search(name_regex, entry) if name: #print( " name found: %s" % name.group(1) ) entry_dict[struct[1]]['fields'][name.group(1)] = entry
@@ -78,16 +78,16 @@ for i in sorted(entry_dict.keys()): entry_dict_sorted[i]['fields'][f] = entry_dict[i]['fields'][f] # dump the sorted elements to the outfile -outf = open( outfile, 'w' ) +outf = open(outfile, 'w') -print( preamble.group(1) ) -outf.write( preamble.group(1) ) +print(preamble.group(1)) +outf.write(preamble.group(1)) for d in entry_dict_sorted: - outf.write( "struct %s %s[] = {\n" % (entry_dict_sorted[d]['type'],d) ) + outf.write("struct %s %s[] = {\n" % (entry_dict_sorted[d]['type'],d)) for f in entry_dict_sorted[d]['fields']: - outf.write( entry_dict_sorted[d]['fields'][f] + '\n' ) + outf.write(entry_dict_sorted[d]['fields'][f] + '\n') - outf.write( "};\n" ) + outf.write("};\n") outf.close()
meta/recipes-rt/rt-tests/files/rt_bmark.py +2 -2
@@ -130,7 +130,7 @@ def log_test_header(seq_no, nr_of_tests, name): #------------------------------------------------------------------------------- def start_stress(*args): - stress_cmd = [ "stress-ng" ] + stress_cmd = ["stress-ng"] added_stress_types = [] req_stress_types = set(args) cpu_cnt = str(multiprocessing.cpu_count())
@@ -220,7 +220,7 @@ def set_hung_tmo(new_tmo): orig_tmo = int(subprocess.check_output(["cat", tmo_file]).strip()) if new_tmo != orig_tmo: - cmd = ( "echo " + str(new_tmo) + " > " + tmo_file ) + cmd = ("echo " + str(new_tmo) + " > " + tmo_file) subprocess.check_output(cmd, shell=True) log("Changed timeout for detection of hung tasks: ", orig_tmo, " -> ", new_tmo)
scripts/buildstats-diff +1 -1
@@ -202,7 +202,7 @@ def print_task_diff(bs1, bs2, val_type, min_val=0, min_absdiff=0, sort_by=('absd total1 = sum_vals(bs1) total2 = sum_vals(bs2) print("\nCumulative {}:".format(val_type)) - print (" {} {:+.1f}% {} ({}) -> {} ({})".format( + print(" {} {:+.1f}% {} ({}) -> {} ({})".format( val_to_str(total2 - total1), 100 * (total2-total1) / total1, val_to_str(total1, True), val_to_str(total1), val_to_str(total2, True), val_to_str(total2)))
scripts/combo-layer +1 -1
@@ -564,7 +564,7 @@ def get_repos(conf, repo_names): sys.exit(1) if not repos: - repos = [ repo for repo in conf.repos if conf.repos[repo].get("update", True) ] + repos = [repo for repo in conf.repos if conf.repos[repo].get("update", True)] return repos
scripts/lib/checklayer/cases/bsp.py +1 -1
@@ -125,7 +125,7 @@ class BSPCheckLayer(OECheckLayerTestCase): if color.setdefault(task, WHITE) == WHITE: visit(task) - taskname_order = dict([(task, index) for index, task in enumerate(taskname_list) ]) + taskname_order = dict([(task, index) for index, task in enumerate(taskname_list)]) def task_key(task): pn, taskname = task.rsplit(':', 1) return (pn, taskname_order.get(taskname, len(taskname_list)), taskname)
scripts/lib/devtool/upgrade.py +1 -1
@@ -605,7 +605,7 @@ def check_upgrade_status(args, config, basepath, workspace): for result in results: # pn, update_status, current, latest, maintainer, latest_commit, no_update_reason if args.all or result[1] != 'MATCH': - logger.info("{:25} {:15} {:15} {} {} {}".format( result[0], + logger.info("{:25} {:15} {:15} {} {} {}".format(result[0], result[2], result[1] if result[1] != 'UPDATE' else (result[3] if not result[3].endswith("new-commits-available") else "new commits"), result[4],
scripts/lib/resulttool/manualexecution.py +2 -2
@@ -130,7 +130,7 @@ class ManualTestRunner(object): if testcase_config_file: test_case_config = load_json_file(testcase_config_file) test_case_to_execute = test_case_config['testcases'] - for case in copy.deepcopy(cases) : + for case in copy.deepcopy(cases): if case['test']['@alias'] not in test_case_to_execute: cases.remove(case)
@@ -232,4 +232,4 @@ def register_commands(subparsers): parser_build.add_argument('-t', '--testcase-config-file', default='', help='the testcase configuration file to enable user to run a selected set of test case or make a testcase configuration file') parser_build.add_argument('-d', '--make-testcase-config-file', action='store_true', - help='make the testcase configuration file to run a set of test cases based on user selection') + help='make the testcase configuration file to run a set of test cases based on user selection')
scripts/lib/resulttool/report.py +7 -7
@@ -33,7 +33,7 @@ class ResultsTextReport(object): for suite in result['ptestresult.sections']: if suite not in self.ptests[machine]: self.ptests[machine][suite] = { - 'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', + 'passed': 0, 'failed': 0, 'skipped': 0, 'duration': '-', 'failed_testcases': [], "testcases": set(), } if 'duration' in result['ptestresult.sections'][suite]:
@@ -59,7 +59,7 @@ class ResultsTextReport(object): if suite not in self.ptests[machine]: self.ptests[machine][suite] = { - 'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', + 'passed': 0, 'failed': 0, 'skipped': 0, 'duration': '-', 'failed_testcases': [], "testcases": set(), }
@@ -82,7 +82,7 @@ class ResultsTextReport(object): # Ensure tests without any test results still show up on the report for suite in result['ltpresult.sections']: if suite not in self.ltptests[machine]: - self.ltptests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []} + self.ltptests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration': '-', 'failed_testcases': []} if 'duration' in result['ltpresult.sections'][suite]: self.ltptests[machine][suite]['duration'] = result['ltpresult.sections'][suite]['duration'] if 'timeout' in result['ltpresult.sections'][suite]:
@@ -101,7 +101,7 @@ class ResultsTextReport(object): except ValueError: pass if suite not in self.ltptests[machine]: - self.ltptests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []} + self.ltptests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration': '-', 'failed_testcases': []} for tk in self.result_types: if status in self.result_types[tk]: self.ltptests[machine][suite][tk] += 1
@@ -114,7 +114,7 @@ class ResultsTextReport(object): # Ensure tests without any test results still show up on the report for suite in result['ltpposixresult.sections']: if suite not in self.ltpposixtests[machine]: - self.ltpposixtests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []} + self.ltpposixtests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration': '-', 'failed_testcases': []} if 'duration' in result['ltpposixresult.sections'][suite]: self.ltpposixtests[machine][suite]['duration'] = result['ltpposixresult.sections'][suite]['duration'] return
@@ -131,7 +131,7 @@ class ResultsTextReport(object): except ValueError: pass if suite not in self.ltpposixtests[machine]: - self.ltpposixtests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []} + self.ltpposixtests[machine][suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration': '-', 'failed_testcases': []} for tk in self.result_types: if status in self.result_types[tk]: self.ltpposixtests[machine][suite][tk] += 1
@@ -167,7 +167,7 @@ class ResultsTextReport(object): reportvalues = [] machines = [] cols = ['passed', 'failed', 'skipped'] - maxlen = {'passed' : 0, 'failed' : 0, 'skipped' : 0, 'result_id': 0, 'testseries' : 0, 'ptest' : 0 ,'ltptest': 0, 'ltpposixtest': 0} + maxlen = {'passed': 0, 'failed': 0, 'skipped': 0, 'result_id': 0, 'testseries': 0, 'ptest': 0,'ltptest': 0, 'ltpposixtest': 0} for line in test_count_reports: total_tested = line['passed'] + line['failed'] + line['skipped'] vals = {}
scripts/lib/scriptutils.py +1 -1
@@ -80,7 +80,7 @@ def load_plugins(logger, plugins, pluginpath): def load_plugin(name): logger.debug('Loading plugin %s' % name) - spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] ) + spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath]) if spec: return spec.loader.load_module()
scripts/lib/wic/engine.py +2 -3
@@ -363,7 +363,7 @@ class Disk: cmd = "{} {} -wR 'rm \"{}\"'".format(self.debugfs, self._get_part_image(pnum), abs_path) - out = exec_cmd(cmd , as_shell=True) + out = exec_cmd(cmd, as_shell=True) for line in out.splitlines(): if line.startswith("rm:"): if "file is a directory" in line:
@@ -379,8 +379,7 @@ class Disk: rmdir_out = exec_cmd("{} {} -wR 'rmdir \"{}\"'".format(self.debugfs, self._get_part_image(pnum), - abs_path.rstrip('/')) - , as_shell=True) + abs_path.rstrip('/')), as_shell=True) for rmdir_line in rmdir_out.splitlines(): if "directory not empty" in rmdir_line:
scripts/lib/wic/filemap.py +1 -1
@@ -401,7 +401,7 @@ class FilemapFiemap(_FilemapBase): offset = _FIEMAP_SIZE + _FIEMAP_EXTENT_SIZE * index return struct.unpack(_FIEMAP_EXTENT_FORMAT, - self._buf[offset : offset + _FIEMAP_EXTENT_SIZE]) + self._buf[offset: offset + _FIEMAP_EXTENT_SIZE]) def _do_get_mapped_ranges(self, start, count): """
scripts/lib/wic/misc.py +3 -3
@@ -30,9 +30,9 @@ NATIVE_RECIPES = {"bmaptool": "bmap-tools", "grub-mkimage": "grub-efi", "isohybrid": "syslinux", "mcopy": "mtools", - "mdel" : "mtools", - "mdeltree" : "mtools", - "mdir" : "mtools", + "mdel": "mtools", + "mdeltree": "mtools", + "mdir": "mtools", "mkdosfs": "dosfstools", "mkisofs": "cdrtools", "mkfs.btrfs": "btrfs-tools",
scripts/lib/wic/plugins/source/bootimg-biosplusefi.py +3 -3
@@ -124,7 +124,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): disk image. """ - if ( (not cls.__imgEFIObj) or (not cls.__imgBiosObj) ): + if ((not cls.__imgEFIObj) or (not cls.__imgBiosObj)): cls.__instanciateSubClasses() cls.__imgEFIObj.do_install_disk(
@@ -155,7 +155,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): Called before do_prepare_partition() """ - if ( (not cls.__imgEFIObj) or (not cls.__imgBiosObj) ): + if ((not cls.__imgEFIObj) or (not cls.__imgBiosObj)): cls.__instanciateSubClasses() cls.__imgEFIObj.do_configure_partition(
@@ -187,7 +187,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): 'prepares' the partition to be incorporated into the image. """ - if ( (not cls.__imgEFIObj) or (not cls.__imgBiosObj) ): + if ((not cls.__imgEFIObj) or (not cls.__imgBiosObj)): cls.__instanciateSubClasses() cls.__imgEFIObj.do_prepare_partition(
scripts/oe-pkgdata-browser +2 -2
@@ -28,10 +28,10 @@ import time def timeit(f): def timed(*args, **kw): ts = time.time() - print ("func:%r calling" % f.__name__) + print("func:%r calling" % f.__name__) result = f(*args, **kw) te = time.time() - print ('func:%r args:[%r, %r] took: %2.4f sec' % + print('func:%r args:[%r, %r] took: %2.4f sec' % (f.__name__, args, kw, te-ts)) return result return timed
scripts/oe-trim-schemas +2 -2
@@ -9,13 +9,13 @@ try: except: import xml.etree.ElementTree as etree -def child (elem, name): +def child(elem, name): for e in elem.getchildren(): if e.tag == name: return e return None -def children (elem, name=None): +def children(elem, name=None): l = elem.getchildren() if name: l = [e for e in l if e.tag == name]
scripts/oepydevshell-internal.py +1 -1
@@ -63,7 +63,7 @@ try: writers = [] if i: writers.append(sys.stdout) - (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0) + (ready, _, _) = select.select([pty, sys.stdin], writers, [], 0) try: if pty in ready: readdata = pty.read()
scripts/pybootchartgui/pybootchartgui/batch.py +9 -9
@@ -31,16 +31,16 @@ def render(writer, trace, app_options, filename): fmt = app_options.format if not (fmt in handlers): - writer.error ("Unknown format '%s'." % fmt) + writer.error("Unknown format '%s'." % fmt) return 10 make_surface, write_surface = handlers[fmt] - options = RenderOptions (app_options) - (w, h) = draw.extents (options, 1.0, trace) - w = max (w, draw.MIN_IMG_W) - surface = make_surface (w, h) - ctx = cairo.Context (surface) - draw.render (ctx, options, 1.0, trace) - write_surface (surface) - writer.status ("bootchart written to '%s'" % filename) + options = RenderOptions(app_options) + (w, h) = draw.extents(options, 1.0, trace) + w = max(w, draw.MIN_IMG_W) + surface = make_surface(w, h) + ctx = cairo.Context(surface) + draw.render(ctx, options, 1.0, trace) + write_surface(surface) + writer.status("bootchart written to '%s'" % filename)
scripts/pybootchartgui/pybootchartgui/draw.py +87 -87
439 lines not on this page · raw message
scripts/pybootchartgui/pybootchartgui/gui.py +16 -16
@@ -26,9 +26,9 @@ from .draw import RenderOptions class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): __gsignals__ = { - 'clicked' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING, Gdk.Event)), - 'position-changed' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT, gobject.TYPE_INT)), - 'set-scroll-adjustments' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gtk.Adjustment, gtk.Adjustment)) + 'clicked': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING, Gdk.Event)), + 'position-changed': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT, gobject.TYPE_INT)), + 'set-scroll-adjustments': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gtk.Adjustment, gtk.Adjustment)) } hadjustment = GObject.property(type=Gtk.Adjustment,
@@ -101,12 +101,12 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): ZOOM_INCREMENT = 1.25 - def zoom_image (self, zoom_ratio): + def zoom_image(self, zoom_ratio): self.zoom_ratio = zoom_ratio self._set_scroll_adjustments() self.queue_draw() - def zoom_to_rect (self, rect): + def zoom_to_rect(self, rect): zoom_ratio = float(rect.width)/float(self.chart_width) self.zoom_image(zoom_ratio) self.x = 0
@@ -117,13 +117,13 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): self.xscale = xscale self.chart_width, self.chart_height = draw.extents(self.options, self.xscale, self.trace) new_x = old_mid_x - self.zoom_image (self.zoom_ratio) + self.zoom_image(self.zoom_ratio) def on_expand(self, action): - self.set_xscale (int(self.xscale * 1.5 + 0.5)) + self.set_xscale(int(self.xscale * 1.5 + 0.5)) def on_contract(self, action): - self.set_xscale (max(int(self.xscale / 1.5), 1)) + self.set_xscale(max(int(self.xscale / 1.5), 1)) def on_zoom_in(self, action): self.zoom_image(self.zoom_ratio * self.ZOOM_INCREMENT)
@@ -139,7 +139,7 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): self.set_xscale(1.0) def show_toggled(self, button): - self.options.app_options.show_all = button.get_property ('active') + self.options.app_options.show_all = button.get_property('active') self.chart_width, self.chart_height = draw.extents(self.options, self.xscale, self.trace) self._set_scroll_adjustments() self.queue_draw()
@@ -224,8 +224,8 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): adj.set_upper(upper) def _set_scroll_adjustments(self): - self._set_adj_upper (self.hadj, self.zoom_ratio * (self.chart_width - self.our_width)) - self._set_adj_upper (self.vadj, self.zoom_ratio * (self.chart_height - self.our_height)) + self._set_adj_upper(self.hadj, self.zoom_ratio * (self.chart_width - self.our_width)) + self._set_adj_upper(self.vadj, self.zoom_ratio * (self.chart_height - self.our_height)) def on_adjustments_changed(self, adj): self.x = self.hadj.get_value() / self.zoom_ratio
@@ -301,9 +301,9 @@ class PyBootchartShell(gtk.VBox): if not options.kernel_only: # Misc. options button = gtk.CheckButton("Show more") - button.connect ('toggled', self.widget2.show_toggled) + button.connect('toggled', self.widget2.show_toggled) button.set_active(options.app_options.show_all) - hbox.pack_start (button, False, True, 0) + hbox.pack_start(button, False, True, 0) self.pack_start(hbox, False, True, 0) self.pack_start(scrolled, True, True, 0)
@@ -328,15 +328,15 @@ class PyBootchartWindow(gtk.Window): full_opts = RenderOptions(app_options) full_tree = PyBootchartShell(window, trace, full_opts, 1.0) - tab_page.append_page (full_tree, gtk.Label("Full tree")) + tab_page.append_page(full_tree, gtk.Label("Full tree")) - if trace.kernel is not None and len (trace.kernel) > 2: + if trace.kernel is not None and len(trace.kernel) > 2: kernel_opts = RenderOptions(app_options) kernel_opts.cumulative = False kernel_opts.charts = False kernel_opts.kernel_only = True kernel_tree = PyBootchartShell(window, trace, kernel_opts, 5.0) - tab_page.append_page (kernel_tree, gtk.Label("Kernel boot")) + tab_page.append_page(kernel_tree, gtk.Label("Kernel boot")) full_tree.grab_focus(self) self.show()
scripts/pybootchartgui/pybootchartgui/main.py.in +2 -2
@@ -124,7 +124,7 @@ def main(argv=None): if len(args) == 0: print("No path given, trying /var/log/bootchart.tgz") - args = [ "/var/log/bootchart.tgz" ] + args = ["/var/log/bootchart.tgz"] res = parsing.Trace(writer, args, options)
@@ -142,7 +142,7 @@ def main(argv=None): print('%02d:%05.2f' % (math.floor(dur/60), dur - 60 * math.floor(dur/60))) else: if options.annotate_file: - f = open (options.annotate_file, "w") + f = open(options.annotate_file, "w") try: for time in res[4]: if time is not None:
scripts/pybootchartgui/pybootchartgui/parsing.py +51 -51
302 lines not on this page · raw message
scripts/pybootchartgui/pybootchartgui/process_tree.py +4 -4
@@ -111,7 +111,7 @@ class ProcessTree: """ if not process_subtree: return 100000000 - return min( [min(proc.start_time, self.get_start_time(proc.child_list)) for proc in process_subtree] ) + return min([min(proc.start_time, self.get_start_time(proc.child_list)) for proc in process_subtree]) def get_end_time(self, process_subtree): """Returns the end time of the process subtree. This is the end time
@@ -120,13 +120,13 @@ class ProcessTree: """ if not process_subtree: return -100000000 - return max( [max(proc.start_time + proc.duration, self.get_end_time(proc.child_list)) for proc in process_subtree] ) + return max([max(proc.start_time + proc.duration, self.get_end_time(proc.child_list)) for proc in process_subtree]) def get_max_pid(self, process_subtree): """Returns the max PID found in the process tree.""" if not process_subtree: return -100000000 - return max( [max(proc.pid, self.get_max_pid(proc.child_list)) for proc in process_subtree] ) + return max([max(proc.pid, self.get_max_pid(proc.child_list)) for proc in process_subtree]) def update_ppids_for_daemons(self, process_list): """Fedora hack: when loading the system services from rc, runuser(1)
@@ -284,7 +284,7 @@ class ProcessTree: def merge_processes(self, p1, p2): """Merges two process' samples.""" p1.samples.extend(p2.samples) - p1.samples.sort( key=lambda p: p.time ) + p1.samples.sort(key=lambda p: p.time) p1time = p1.start_time p2time = p2.start_time p1.start_time = min(p1time, p2time)
scripts/pybootchartgui/pybootchartgui/samples.py +9 -9
@@ -19,7 +19,7 @@ class DiskStatSample: self.time = time self.diskdata = [0, 0, 0] def add_diskdata(self, new_diskdata): - self.diskdata = [ a + b for a, b in zip(self.diskdata, new_diskdata) ] + self.diskdata = [a + b for a, b in zip(self.diskdata, new_diskdata)] class CPUSample: def __init__(self, time, user, sys, io=0.0, swap=0.0):
@@ -35,7 +35,7 @@ class CPUSample: def __str__(self): return str(self.time) + "\t" + str(self.user) + "\t" + \ - str(self.sys) + "\t" + str(self.io) + "\t" + str (self.swap) + str(self.sys) + "\t" + str(self.io) + "\t" + str(self.swap) class MemSample: used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
@@ -96,8 +96,8 @@ class ProcessStats: self.sample_period = sample_period self.start_time = start_time self.end_time = end_time - writer.info ("%d samples, avg. sample length %f" % (self.sample_count, self.sample_period)) - writer.info ("process list size: %d" % len (self.process_map.values())) + writer.info("%d samples, avg. sample length %f" % (self.sample_count, self.sample_period)) + writer.info("process list size: %d" % len(self.process_map.values())) class Process: def __init__(self, writer, pid, cmd, ppid, start_time):
@@ -123,7 +123,7 @@ class Process: # split this process' run - triggered by a name change def split(self, writer, pid, cmd, ppid, start_time): - split = Process (writer, pid, cmd, ppid, start_time) + split = Process(writer, pid, cmd, ppid, start_time) split.last_cpu_ns = self.last_cpu_ns split.last_blkio_delay_ns = self.last_blkio_delay_ns
@@ -132,7 +132,7 @@ class Process: return split def __str__(self): - return " ".join([str(self.pid), self.cmd, str(self.ppid), '[ ' + str(len(self.samples)) + ' samples ]' ]) + return " ".join([str(self.pid), self.cmd, str(self.ppid), '[ ' + str(len(self.samples)) + ' samples ]']) def calc_stats(self, samplePeriod): if self.samples:
@@ -141,8 +141,8 @@ class Process: self.start_time = min(firstSample.time, self.start_time) self.duration = lastSample.time - self.start_time + samplePeriod - activeCount = sum( [1 for sample in self.samples if sample.cpu_sample and sample.cpu_sample.sys + sample.cpu_sample.user + sample.cpu_sample.io > 0.0] ) - activeCount = activeCount + sum( [1 for sample in self.samples if sample.state == 'D'] ) + activeCount = sum([1 for sample in self.samples if sample.cpu_sample and sample.cpu_sample.sys + sample.cpu_sample.user + sample.cpu_sample.io > 0.0]) + activeCount = activeCount + sum([1 for sample in self.samples if sample.state == 'D']) self.active = (activeCount>2) def calc_load(self, userCpu, sysCpu, interval):
@@ -157,7 +157,7 @@ class Process: def set_parent(self, processMap): if self.ppid != None: - self.parent = processMap.get (self.ppid) + self.parent = processMap.get(self.ppid) if self.parent == None and self.pid // 1000 > 1 and \ not (self.ppid == 2000 or self.pid == 2000): # kernel threads: ppid=2 self.writer.warn("Missing CONFIG_PROC_EVENTS: no parent for pid '%i' ('%s') with ppid '%i'"
scripts/wic +1 -1
@@ -337,7 +337,7 @@ def wic_init_parser_create(subparser): dest='compressor', help="compress image with specified compressor") subparser.add_argument("-m", "--bmap", action="store_true", help="generate .bmap") - subparser.add_argument("--no-fstab-update" ,action="store_true", + subparser.add_argument("--no-fstab-update",action="store_true", help="Do not change fstab file.") subparser.add_argument("-v", "--vars", dest='vars_dir', help="directory with <image>.env files that store "
Signature · 1 line
2.32.0
PATCH 5/8 PEP8 double aggressive E22, E224, E241, E242 and E27
In reply to Khem RajFrom: persianpros <[email protected]>
--- .../lib/oeqa/runtime/cases/dnf_runtime.py | 8 +- meta-selftest/lib/oeqa/runtime/cases/virgl.py | 6 +- meta/lib/bblayers/create.py | 2 +- meta/lib/buildstats.py | 2 +- meta/lib/oe/buildhistory_analysis.py | 18 +- meta/lib/oe/classextend.py | 4 +- meta/lib/oe/copy_buildsystem.py | 2 +- meta/lib/oe/cve_check.py | 6 +- meta/lib/oe/distro_check.py | 4 +- meta/lib/oe/elf.py | 180 +++++++++--------- meta/lib/oe/gpg_sign.py | 2 +- meta/lib/oe/license.py | 2 +- meta/lib/oe/package_manager/__init__.py | 4 +- meta/lib/oe/package_manager/deb/__init__.py | 2 +- meta/lib/oe/package_manager/ipk/__init__.py | 2 +- meta/lib/oe/package_manager/rpm/__init__.py | 18 +- meta/lib/oe/patch.py | 2 +- meta/lib/oe/path.py | 2 +- meta/lib/oe/qa.py | 22 +-- meta/lib/oe/recipeutils.py | 10 +- meta/lib/oe/sdk.py | 8 +- meta/lib/oe/terminal.py | 2 +- meta/lib/oe/utils.py | 6 +- meta/lib/oeqa/core/context.py | 4 +- meta/lib/oeqa/core/runner.py | 2 +- meta/lib/oeqa/core/target/ssh.py | 2 +- meta/lib/oeqa/core/tests/test_decorators.py | 6 +- meta/lib/oeqa/core/utils/concurrencytest.py | 2 +- meta/lib/oeqa/oetest.py | 2 +- meta/lib/oeqa/runexported.py | 2 +- meta/lib/oeqa/runtime/cases/df.py | 2 +- meta/lib/oeqa/runtime/cases/dnf.py | 18 +- meta/lib/oeqa/runtime/cases/ksample.py | 2 +- meta/lib/oeqa/runtime/cases/ltp.py | 10 +- meta/lib/oeqa/runtime/cases/ltp_compliance.py | 10 +- meta/lib/oeqa/runtime/cases/ltp_stress.py | 8 +- meta/lib/oeqa/runtime/cases/oe_syslog.py | 8 +- meta/lib/oeqa/runtime/cases/parselogs.py | 10 +- meta/lib/oeqa/runtime/cases/rpm.py | 2 +- meta/lib/oeqa/runtime/cases/runlevel.py | 2 +- meta/lib/oeqa/runtime/cases/scp.py | 2 +- meta/lib/oeqa/runtime/cases/skeletoninit.py | 2 +- meta/lib/oeqa/runtime/cases/storage.py | 6 +- meta/lib/oeqa/runtime/cases/suspend.py | 4 +- meta/lib/oeqa/runtime/cases/systemd.py | 8 +- meta/lib/oeqa/runtime/cases/usb_hid.py | 4 +- meta/lib/oeqa/runtime/cases/weston.py | 4 +- meta/lib/oeqa/runtime/cases/xorg.py | 2 +- meta/lib/oeqa/sdk/context.py | 2 +- meta/lib/oeqa/sdkext/cases/devtool.py | 2 +- meta/lib/oeqa/sdkext/testsdk.py | 2 +- meta/lib/oeqa/selftest/case.py | 2 +- meta/lib/oeqa/selftest/cases/archiver.py | 4 +- meta/lib/oeqa/selftest/cases/bbtests.py | 2 +- meta/lib/oeqa/selftest/cases/buildoptions.py | 2 +- meta/lib/oeqa/selftest/cases/devtool.py | 4 +- meta/lib/oeqa/selftest/cases/eSDK.py | 4 +- meta/lib/oeqa/selftest/cases/fitimage.py | 10 +- meta/lib/oeqa/selftest/cases/gotoolchain.py | 2 +- meta/lib/oeqa/selftest/cases/image_typedep.py | 2 +- meta/lib/oeqa/selftest/cases/manifest.py | 6 +- .../oeqa/selftest/cases/oelib/buildhistory.py | 2 +- meta/lib/oeqa/selftest/cases/oelib/path.py | 38 ++-- meta/lib/oeqa/selftest/cases/oescripts.py | 2 +- meta/lib/oeqa/selftest/cases/pkgdata.py | 56 +++--- meta/lib/oeqa/selftest/cases/runqemu.py | 6 +- meta/lib/oeqa/selftest/cases/runtime_test.py | 4 +- meta/lib/oeqa/selftest/cases/sstatetests.py | 18 +- meta/lib/oeqa/selftest/cases/sysroot.py | 2 +- meta/lib/oeqa/selftest/cases/wic.py | 4 +- meta/lib/oeqa/selftest/context.py | 2 +- meta/lib/oeqa/targetcontrol.py | 6 +- meta/lib/oeqa/utils/decorators.py | 16 +- meta/lib/oeqa/utils/gitarchive.py | 2 +- meta/lib/oeqa/utils/qemurunner.py | 10 +- meta/lib/oeqa/utils/qemutinyrunner.py | 6 +- meta/lib/oeqa/utils/testexport.py | 6 +- .../glibc/glibc/check-test-wrapper | 2 +- .../python3/check_build_completeness.py | 4 +- .../python/python3/create_manifest3.py | 6 +- .../python/python3/get_module_deps3.py | 14 +- .../perf/perf/sort-pmuevents.py | 2 +- meta/recipes-rt/rt-tests/files/rt_bmark.py | 50 ++--- scripts/buildhistory-diff | 2 +- scripts/buildstats-diff | 4 +- scripts/combo-layer | 28 +-- scripts/contrib/image-manifest | 2 +- scripts/contrib/patchreview.py | 2 +- scripts/contrib/verify-homepage.py | 2 +- scripts/crosstap | 4 +- scripts/lib/build_perf/report.py | 2 +- scripts/lib/buildstats.py | 4 +- scripts/lib/devtool/deploy.py | 2 +- scripts/lib/devtool/standard.py | 14 +- scripts/lib/devtool/upgrade.py | 6 +- scripts/lib/recipetool/create.py | 2 +- scripts/lib/recipetool/create_buildsys.py | 2 +- .../lib/recipetool/create_buildsys_python.py | 2 +- scripts/lib/recipetool/create_npm.py | 2 +- scripts/lib/resulttool/manualexecution.py | 2 +- scripts/lib/resulttool/report.py | 2 +- scripts/lib/resulttool/store.py | 4 +- scripts/lib/wic/engine.py | 6 +- scripts/lib/wic/filemap.py | 2 +- scripts/lib/wic/ksparser.py | 2 +- scripts/lib/wic/misc.py | 2 +- scripts/lib/wic/plugins/imager/direct.py | 2 +- scripts/oe-depends-dot | 8 +- scripts/oe-pkgdata-browser | 2 +- scripts/oepydevshell-internal.py | 2 +- scripts/pybootchartgui/pybootchartgui/draw.py | 86 ++++----- scripts/pybootchartgui/pybootchartgui/gui.py | 14 +- .../pybootchartgui/pybootchartgui/main.py.in | 2 +- .../pybootchartgui/pybootchartgui/parsing.py | 20 +- .../pybootchartgui/process_tree.py | 6 +- .../pybootchartgui/pybootchartgui/samples.py | 2 +- .../pybootchartgui/tests/parser_test.py | 2 +- scripts/pythondeps | 4 +- scripts/relocate_sdk.py | 6 +- scripts/runqemu | 24 +-- scripts/send-error-report | 12 +- scripts/sysroot-relativelinks.py | 4 +- scripts/task-time | 14 +- scripts/tiny/ksize.py | 10 +- scripts/verify-bashisms | 2 +- scripts/wic | 30 +-- scripts/yocto-check-layer | 2 +- 127 files changed, 547 insertions(+), 547 deletions(-)
meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py +4 -4
@@ -41,10 +41,10 @@ class DnfSelftest(DnfTest): import re # Use '-y' for non-interactive mode: automatically import the feed signing key output_makecache = self.dnf('-vy makecache') - self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg="dnf makecache failed to synchronize repo: %s" %(output_makecache)) - self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg="dnf makecache failed: %s" %(output_makecache)) + self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg="dnf makecache failed to synchronize repo: %s" % (output_makecache)) + self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg="dnf makecache failed: %s" % (output_makecache)) output_repoinfo = self.dnf('-v repoinfo') matchobj = re.match(r".*Repo-pkgs\s*:\s*(?P<n_pkgs>[0-9]+)", output_repoinfo, re.DOTALL) - self.assertTrue(matchobj is not None, msg="Could not find the amount of packages in dnf repoinfo output: %s" %(output_repoinfo)) - self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg="Amount of remote packages is not more than zero: %s\n" %(output_repoinfo)) + self.assertTrue(matchobj is not None, msg="Could not find the amount of packages in dnf repoinfo output: %s" % (output_repoinfo)) + self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg="Amount of remote packages is not more than zero: %s\n" % (output_repoinfo))
meta-selftest/lib/oeqa/runtime/cases/virgl.py +3 -3
@@ -9,10 +9,10 @@ class VirglTest(OERuntimeTestCase): def test_kernel_driver(self): status, output = self.target.run('dmesg|grep virgl') self.assertEqual(status, 0, "Checking for virgl driver in dmesg returned non-zero: %d\n%s" % (status, output)) - self.assertIn("features: +virgl", output, "virgl acceleration seems to be disabled:\n%s" %(output)) + self.assertIn("features: +virgl", output, "virgl acceleration seems to be disabled:\n%s" % (output)) @OETestDepends(['virgl.VirglTest.test_kernel_driver']) def test_kmscube(self): status, output = self.target.run('kmscube') - self.assertEqual(status, 0, "kmscube exited with non-zero status %d and output:\n%s" %(status, output)) - self.assertIn('renderer: "virgl"', output, "kmscube does not seem to use virgl:\n%s" %(output)) + self.assertEqual(status, 0, "kmscube exited with non-zero status %d and output:\n%s" % (status, output)) + self.assertIn('renderer: "virgl"', output, "kmscube does not seem to use virgl:\n%s" % (output))
meta/lib/bblayers/create.py +1 -1
@@ -38,7 +38,7 @@ class CreatePlugin(LayerPlugin): layerid = args.layerid if args.layerid is not None else layername # Create the README from templates/README - readme_template = read_template('README').format(layername=layername) + readme_template = read_template('README').format(layername=layername) readme = os.path.join(layerdir, 'README') with open(readme, 'w') as fd: fd.write(readme_template)
meta/lib/buildstats.py +1 -1
@@ -121,7 +121,7 @@ class SystemStats: iowait = float(times[4] - self.stat_ltimes[4]) aSum = max(user + system + idle + iowait, 1) - reduced = (time, (user/aSum, system/aSum, iowait/aSum)) + reduced = (time, (user / aSum, system / aSum, iowait / aSum)) self.stat_ltimes = times return reduced
meta/lib/oe/buildhistory_analysis.py +9 -9
@@ -37,8 +37,8 @@ img_monitor_files = ['installed-package-names.txt', 'files-in-image.txt'] colours = { 'colour_default': '', - 'colour_add': '', - 'colour_remove': '', + 'colour_add': '', + 'colour_remove': '', } def init_colours(use_colours):
@@ -46,14 +46,14 @@ def init_colours(use_colours): if use_colours: colours = { 'colour_default': '\033[0m', - 'colour_add': '\033[1;32m', - 'colour_remove': '\033[1;31m', + 'colour_add': '\033[1;32m', + 'colour_remove': '\033[1;31m', } else: colours = { 'colour_default': '', - 'colour_add': '', - 'colour_remove': '', + 'colour_add': '', + 'colour_remove': '', } class ChangeRecord:
@@ -358,8 +358,8 @@ def compare_file_lists(alines, blines, compare_ownership=True): if commondir[i] != commondir2[i]: idx = i break - commondir = "/".join(commondir[:i+1]) - commondir2 = "/".join(commondir2[:i+1]) + commondir = "/".join(commondir[:i + 1]) + commondir2 = "/".join(commondir2[:i + 1]) # If the common parent is in one dict and not the other its likely a rename # so iterate through those files and process as such if commondir2 not in bdict and commondir not in adict:
@@ -593,7 +593,7 @@ def compare_siglists(a_blob, b_blob, taskdiff=False): elif len(tasks) == 2: desc = '%s and %s' % (tasks[0], tasks[1]) else: - desc = '%s and %d others' % (tasks[-1], len(tasks)-1) + desc = '%s and %d others' % (tasks[-1], len(tasks) - 1) out.append('%s: %s' % (desc, line)) else: for key in keys:
meta/lib/oe/classextend.py +2 -2
@@ -48,7 +48,7 @@ class ClassExtender(object): newvar = [] for v in var: newvar.append(self.extend_name(v)) - newdata = " ".join(newvar) + newdata = " ".join(newvar) if setvar: self.d.setVar(varname, newdata) return newdata
@@ -66,7 +66,7 @@ class ClassExtender(object): newvar.append("^" + self.extname + "-" + v[1:]) else: newvar.append(self.extend_name(v)) - newdata = " ".join(newvar) + newdata = " ".join(newvar) if setvar: self.d.setVar(varname, newdata) return newdata
meta/lib/oe/copy_buildsystem.py +1 -1
@@ -76,7 +76,7 @@ class BuildSystem(object): workspace_newname = '%s-%d' % (workspace_name, extranum) corebase_files = self.d.getVar('COREBASE_FILES').split() - corebase_files = [corebase + '/' +x for x in corebase_files] + corebase_files = [corebase + '/' + x for x in corebase_files] # Make sure bitbake goes in bitbake_dir = bb.__file__.rsplit('/', 3)[0] corebase_files.append(bitbake_dir)
meta/lib/oe/cve_check.py +3 -3
@@ -15,11 +15,11 @@ class Version(): suffixes = ["alphabetical", "patch"] if str(suffix) == "alphabetical": - version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<patch>[-_\.]?(?P<patch_l>[a-z]))?(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?""" + version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<patch>[-_\.]?(?P<patch_l>[a-z]))?(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?""" elif str(suffix) == "patch": - version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<patch>[-_\.]?(p|patch)(?P<patch_l>[0-9]+))?(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?""" + version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<patch>[-_\.]?(p|patch)(?P<patch_l>[0-9]+))?(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?""" else: - version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?""" + version_pattern = r"""r?v?(?:(?P<release>[0-9]+(?:[-\.][0-9]+)*)(?P<pre>[-_\.]?(?P<pre_l>(rc|alpha|beta|pre|preview|dev))[-_\.]?(?P<pre_v>[0-9]+)?)?)(.*)?""" regex = re.compile(r"^\s*" + version_pattern + r"\s*$", re.VERBOSE | re.IGNORECASE) match = regex.search(version)
meta/lib/oe/distro_check.py +2 -2
@@ -22,8 +22,8 @@ def get_links_from_url(url, d): def find_latest_numeric_release(url, d): "Find the latest listed numeric release on the given url" - max=0 - maxstr="" + max = 0 + maxstr = "" for link in get_links_from_url(url, d): try: # TODO use LooseVersion
meta/lib/oe/elf.py +90 -90
209 lines not on this page · raw message
meta/lib/oe/gpg_sign.py +1 -1
@@ -56,7 +56,7 @@ class LocalSigner(object): # Sign in chunks for i in range(0, len(files), sign_chunk): - subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i+sign_chunk])), stderr=subprocess.STDOUT) + subprocess.check_output(shlex.split(cmd + ' '.join(files[i:i + sign_chunk])), stderr=subprocess.STDOUT) def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True): """Create a detached signature of a file"""
meta/lib/oe/license.py +1 -1
@@ -45,7 +45,7 @@ class LicenseVisitor(ast.NodeVisitor): elements = list([x for x in license_operator.split(licensestr) if x.strip()]) for pos, element in enumerate(elements): if license_pattern.match(element): - if pos > 0 and license_pattern.match(elements[pos-1]): + if pos > 0 and license_pattern.match(elements[pos - 1]): new_elements.append('&') element = '"' + element + '"' elif not license_operator.match(element):
meta/lib/oe/package_manager/__init__.py +2 -2
@@ -42,7 +42,7 @@ def opkg_query(cmd_output): dep = [] prov = [] pkgarch = "" - for line in cmd_output.splitlines()+['']: + for line in cmd_output.splitlines() + ['']: line = line.rstrip() if ':' in line: if line.startswith("Package: "):
@@ -92,7 +92,7 @@ def failed_postinsts_abort(pkgs, log_path): bb.fatal("""Postinstall scriptlets of %s have failed. If the intention is to defer them to first boot, then please place them into pkg_postinst_ontarget_${PN} (). Deferring to first boot via 'exit 1' is no longer supported. -Details of the failure are in %s.""" %(pkgs, log_path)) +Details of the failure are in %s.""" % (pkgs, log_path)) def generate_locale_archive(d, rootfs, target_arch, localedir): # Pretty sure we don't need this for locale archive generation but
meta/lib/oe/package_manager/deb/__init__.py +1 -1
@@ -495,7 +495,7 @@ class DpkgPM(OpkgDpkgPM): pkg_info = self.package_info(pkg) if not pkg_info: bb.fatal("Unable to get information for package '%s' while " - "trying to extract the package." % pkg) + "trying to extract the package." % pkg) tmp_dir = super(DpkgPM, self).extract(pkg, pkg_info) bb.utils.remove(os.path.join(tmp_dir, "data.tar.xz"))
meta/lib/oe/package_manager/ipk/__init__.py +1 -1
@@ -495,7 +495,7 @@ class OpkgPM(OpkgDpkgPM): pkg_info = self.package_info(pkg) if not pkg_info: bb.fatal("Unable to get information for package '%s' while " - "trying to extract the package." % pkg) + "trying to extract the package." % pkg) tmp_dir = super(OpkgPM, self).extract(pkg, pkg_info) bb.utils.remove(os.path.join(tmp_dir, "data.tar.xz"))
meta/lib/oe/package_manager/rpm/__init__.py +9 -9
@@ -32,7 +32,7 @@ class RpmIndexer(Indexer): class RpmSubdirIndexer(RpmIndexer): def write_index(self): - bb.note("Generating package index for %s" %(self.deploy_dir)) + bb.note("Generating package index for %s" % (self.deploy_dir)) # Remove the existing repodata to ensure that we re-generate it no matter what bb.utils.remove(os.path.join(self.deploy_dir, "repodata"), recurse=True)
@@ -42,7 +42,7 @@ class RpmSubdirIndexer(RpmIndexer): for dir in entry[1]: if dir != 'repodata': dir_path = oe.path.join(self.deploy_dir, dir) - bb.note("Generating package index for %s" %(dir_path)) + bb.note("Generating package index for %s" % (dir_path)) self.do_write_index(dir_path)
@@ -94,7 +94,7 @@ class RpmPM(PackageManager): archs = archs + ["bogusarch"] # This architecture needs to be upfront so that packages using it are properly prioritized archs = ["sdk_provides_dummy_target"] + archs - confdir = "%s/%s" %(self.target_rootfs, "etc/dnf/vars/") + confdir = "%s/%s" % (self.target_rootfs, "etc/dnf/vars/") bb.utils.mkdirhier(confdir) open(confdir + "arch", 'w').write(":".join(archs)) distro_codename = self.d.getVar('DISTRO_CODENAME')
@@ -107,8 +107,8 @@ class RpmPM(PackageManager): # We need to configure rpm to use our primary package architecture as the installation architecture, # and to make it compatible with other package architectures that we use. # Otherwise it will refuse to proceed with packages installation. - platformconfdir = "%s/%s" %(self.target_rootfs, "etc/rpm/") - rpmrcconfdir = "%s/%s" %(self.target_rootfs, "etc/") + platformconfdir = "%s/%s" % (self.target_rootfs, "etc/rpm/") + rpmrcconfdir = "%s/%s" % (self.target_rootfs, "etc/") bb.utils.mkdirhier(platformconfdir) open(platformconfdir + "platform", 'w').write("%s-pc-linux" % self.primary_arch) with open(rpmrcconfdir + "rpmrc", 'w') as f:
@@ -162,7 +162,7 @@ class RpmPM(PackageManager): if feed_archs is not None: for arch in feed_archs.split(): repo_uri = uri + "/" + arch - repo_id = "oe-remote-repo" + "-".join(urlparse(repo_uri).path.split("/")) + repo_id = "oe-remote-repo" + "-".join(urlparse(repo_uri).path.split("/")) repo_name = "OE Remote Repo:" + " ".join(urlparse(repo_uri).path.split("/")) open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'a').write( "[%s]\nname=%s\nbaseurl=%s\n%s\n" % (repo_id, repo_name, repo_uri, gpg_opts))
@@ -218,7 +218,7 @@ class RpmPM(PackageManager): self._invoke_dnf(["remove"] + pkgs) else: cmd = bb.utils.which(os.getenv('PATH'), "rpm") - args = ["-e", "-v", "--nodeps", "--root=%s" %self.target_rootfs] + args = ["-e", "-v", "--nodeps", "--root=%s" % self.target_rootfs] try: bb.note("Running %s" % ' '.join([cmd] + args + pkgs))
@@ -306,7 +306,7 @@ class RpmPM(PackageManager): dnf_cmd = bb.utils.which(os.getenv('PATH'), "dnf") standard_dnf_args = ["-v", "--rpmverbosity=info", "-y", "-c", oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"), - "--setopt=reposdir=%s" %(oe.path.join(self.target_rootfs, "etc/yum.repos.d")), + "--setopt=reposdir=%s" % (oe.path.join(self.target_rootfs, "etc/yum.repos.d")), "--installroot=%s" % (self.target_rootfs), "--setopt=logdir=%s" % (self.d.getVar('T')) ]
@@ -378,7 +378,7 @@ class RpmPM(PackageManager): output = self._invoke_dnf(["repoquery", "--queryformat", "%{location}", pkg]) pkg_name = output.splitlines()[-1] if not pkg_name.endswith(".rpm"): - bb.fatal("dnf could not find package %s in repository: %s" %(pkg, output)) + bb.fatal("dnf could not find package %s in repository: %s" % (pkg, output)) pkg_path = oe.path.join(self.rpm_repo_dir, pkg_name) cpio_cmd = bb.utils.which(os.getenv("PATH"), "cpio")
meta/lib/oe/patch.py +1 -1
@@ -323,7 +323,7 @@ class GitApplyTree(PatchTree): def decodeAuthor(line): from email.header import decode_header authorval = line.split(':', 1)[1].strip().replace('"', '') - result = decode_header(authorval)[0][0] + result = decode_header(authorval)[0][0] if hasattr(result, 'decode'): result = result.decode('utf-8') return result
meta/lib/oe/path.py +1 -1
@@ -314,7 +314,7 @@ def which_wild(pathname, path=None, mode=os.F_OK, *, reverse=False, candidates=F if rel not in seen: seen.add(rel) if candidates: - files.append((found_path, [os.path.join(p, rel) for p in paths[:index+1]])) + files.append((found_path, [os.path.join(p, rel) for p in paths[:index + 1]])) else: files.append(found_path)
meta/lib/oe/qa.py +11 -11
@@ -12,26 +12,26 @@ class NotELFFileError(Exception): class ELFFile: EI_NIDENT = 16 - EI_CLASS = 4 - EI_DATA = 5 - EI_VERSION = 6 - EI_OSABI = 7 + EI_CLASS = 4 + EI_DATA = 5 + EI_VERSION = 6 + EI_OSABI = 7 EI_ABIVERSION = 8 - E_MACHINE = 0x12 + E_MACHINE = 0x12 # possible values for EI_CLASS ELFCLASSNONE = 0 - ELFCLASS32 = 1 - ELFCLASS64 = 2 + ELFCLASS32 = 1 + ELFCLASS64 = 2 # possible value for EI_VERSION - EV_CURRENT = 1 + EV_CURRENT = 1 # possible values for EI_DATA - EI_DATA_NONE = 0 - EI_DATA_LSB = 1 - EI_DATA_MSB = 2 + EI_DATA_NONE = 0 + EI_DATA_LSB = 1 + EI_DATA_MSB = 2 PT_INTERP = 3
meta/lib/oe/recipeutils.py +5 -5
@@ -133,8 +133,8 @@ def split_var_value(value, assignment=True): assigfound = True if assigfound: if '"' in item or "'" in item: - outlist = [' '.join(out[:idx+1])] - outlist.extend(out[idx+1:]) + outlist = [' '.join(out[:idx + 1])] + outlist.extend(out[idx + 1:]) break return outlist
@@ -224,7 +224,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True): # (that we'd want to ensure remain leading the next value) for i, ln in reversed(list(enumerate(lines))): if not ln.startswith('#'): - lines[i+1:i+1] = addlines + lines[i + 1:i + 1] = addlines break else: lines.extend(addlines)
@@ -1003,7 +1003,7 @@ def get_recipe_upstream_version(rd): # XXX: we suppose that the first entry points to the upstream sources src_uri = src_uris.split()[0] - uri_type, _, _, _, _, _ = decodeurl(src_uri) + uri_type, _, _, _, _, _ = decodeurl(src_uri) (pv, pfx, sfx) = get_recipe_pv_without_srcpv(rd.getVar('PV'), uri_type) ru['current_version'] = pv
@@ -1023,7 +1023,7 @@ def get_recipe_upstream_version(rd): elif uri_type == "file": # files are always up-to-date - ru['version'] = pv + ru['version'] = pv ru['type'] = 'A' ru['datetime'] = datetime.now() else:
meta/lib/oe/sdk.py +4 -4
@@ -64,17 +64,17 @@ class Sdk(object, metaclass=ABCMeta): # something goes wrong if (bb.utils.movefile(sourcefile, destdir) == None): raise OSError("moving %s to %s failed" - %(sourcefile, destdir)) + % (sourcefile, destdir)) #FIXME: using umbrella exc catching because bb.utils method raises it except Exception as e: - bb.debug(1, "printing the stack trace\n %s" %traceback.format_exc()) + bb.debug(1, "printing the stack trace\n %s" % traceback.format_exc()) bb.error("unable to place %s in final SDK location" % sourcefile) def mkdirhier(self, dirpath): try: bb.utils.mkdirhier(dirpath) except OSError as e: - bb.debug(1, "printing the stack trace\n %s" %traceback.format_exc()) + bb.debug(1, "printing the stack trace\n %s" % traceback.format_exc()) bb.fatal("cannot make dir for SDK: %s" % dirpath) def remove(self, path, recurse=False):
@@ -82,7 +82,7 @@ class Sdk(object, metaclass=ABCMeta): bb.utils.remove(path, recurse) #FIXME: using umbrella exc catching because bb.utils method raises it except Exception as e: - bb.debug(1, "printing the stack trace\n %s" %traceback.format_exc()) + bb.debug(1, "printing the stack trace\n %s" % traceback.format_exc()) bb.warn("cannot remove SDK dir: %s" % path) def install_locales(self, pm):
meta/lib/oe/terminal.py +1 -1
@@ -284,7 +284,7 @@ def check_tmux_pane_size(tmux): else: raise - return size/2 >= 19 + return size / 2 >= 19 def check_terminal_version(terminalName): import subprocess as sub
meta/lib/oe/utils.py +3 -3
@@ -117,8 +117,8 @@ def features_backfill(var,d): # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED features = (d.getVar(var) or "").split() - backfill = (d.getVar(var+"_BACKFILL") or "").split() - considered = (d.getVar(var+"_BACKFILL_CONSIDERED") or "").split() + backfill = (d.getVar(var + "_BACKFILL") or "").split() + considered = (d.getVar(var + "_BACKFILL_CONSIDERED") or "").split() addfeatures = [] for feature in backfill:
@@ -526,7 +526,7 @@ class ImageQAFailed(Exception): def __init__(self, description, name=None, logfile=None): self.description = description self.name = name - self.logfile=logfile + self.logfile = logfile def __str__(self): msg = 'Function failed: %s' % self.name
meta/lib/oeqa/core/context.py +2 -2
@@ -58,7 +58,7 @@ class OETestContext(object): if test.__class__ not in class_ids: class_ids[test.__class__] = '.'.join(test.id().split('.')[:-1]) for skip in skips: - if (test.id()+'.').startswith(skip+'.'): + if (test.id() + '.').startswith(skip + '.'): setattr(test, 'setUp', skipfuncgen('Skip by the command line argument "%s"' % skip)) for tclass in class_ids: cid = class_ids[tclass]
@@ -170,7 +170,7 @@ class OETestContextExecutor(object): self.tc_kwargs['init'] = {} self.tc_kwargs['load'] = {} self.tc_kwargs['list'] = {} - self.tc_kwargs['run'] = {} + self.tc_kwargs['run'] = {} self.tc_kwargs['init']['logger'] = self._setup_logger(logger, args) if args.test_data_file:
meta/lib/oeqa/core/runner.py +1 -1
@@ -284,7 +284,7 @@ class OETestRunner(_TestRunner): curr['module'] = case.__module__ logger.info(curr['module']) - if not 'class' in curr or curr['class'] != \ + if not 'class' in curr or curr['class'] != \ case.__class__.__name__: curr['class'] = case.__class__.__name__ logger.info(" -- %s" % curr['class'])
meta/lib/oeqa/core/target/ssh.py +1 -1
@@ -91,7 +91,7 @@ class OESSHTarget(OETarget): if timeout: processTimeout = timeout - elif timeout==0: + elif timeout == 0: processTimeout = None else: processTimeout = self.timeout
meta/lib/oeqa/core/tests/test_decorators.py +3 -3
@@ -71,7 +71,7 @@ class TestDependsDecorator(TestBase): modules = ['depends'] def test_depends_order(self): - tests = ['depends.DependsTest.testDependsFirst', + tests = ['depends.DependsTest.testDependsFirst', 'depends.DependsTest.testDependsSecond', 'depends.DependsTest.testDependsThird', 'depends.DependsTest.testDependsFourth',
@@ -88,7 +88,7 @@ class TestDependsDecorator(TestBase): def test_depends_fail_missing_dependency(self): expect = "TestCase depends.DependsTest.testDependsSecond depends on "\ "depends.DependsTest.testDependsFirst and isn't available" - tests = ['depends.DependsTest.testDependsSecond'] + tests = ['depends.DependsTest.testDependsSecond'] try: # Must throw OEQADependency because missing 'testDependsFirst' tc = self._testLoader(modules=self.modules, tests=tests)
@@ -100,7 +100,7 @@ class TestDependsDecorator(TestBase): def test_depends_fail_circular_dependency(self): expect = 'have a circular dependency' - tests = ['depends.DependsTest.testDependsCircular1', + tests = ['depends.DependsTest.testDependsCircular1', 'depends.DependsTest.testDependsCircular2', 'depends.DependsTest.testDependsCircular3'] try:
meta/lib/oeqa/core/utils/concurrencytest.py +1 -1
@@ -71,7 +71,7 @@ class BBThreadsafeForwardingResult(ThreadsafeForwardingResult): self.totalinprocess, totalprogress, self.totaltests, - "{0:.2f}".format(time.time()-self._test_start.timestamp()), + "{0:.2f}".format(time.time() - self._test_start.timestamp()), test.id()) finally: self.semaphore.release()
meta/lib/oeqa/oetest.py +1 -1
@@ -118,7 +118,7 @@ class oeRuntimeTest(oeTest): # for QemuTarget only if (type(self.target).__name__ == "QemuTarget" and (self.id() in res.getErrorList() or - self.id() in res.getFailList())): + self.id() in res.getFailList())): self.tc.host_dumper.create_dir(self._testMethodName) self.tc.host_dumper.dump_host() self.target.target_dumper.dump_target(
meta/lib/oeqa/runexported.py +1 -1
@@ -52,7 +52,7 @@ class FakeTarget(object): if os.path.lexists(sshloglink): os.remove(sshloglink) os.symlink(self.sshlog, sshloglink) - print("SSH log file: %s" % self.sshlog) + print("SSH log file: %s" % self.sshlog) self.connection = SSHControl(self.ip, logfile=self.sshlog) def run(self, cmd, timeout=None):
meta/lib/oeqa/runtime/cases/df.py +1 -1
@@ -16,4 +16,4 @@ class DfTest(OERuntimeTestCase): cmd = "df -P / | sed -n '2p' | awk '{print $4}'" (status,output) = self.target.run(cmd) msg = 'Not enough space on image. Current size is %s' % output - self.assertTrue(int(output)>5120, msg=msg) + self.assertTrue(int(output) > 5120, msg=msg)
meta/lib/oeqa/runtime/cases/dnf.py +9 -9
@@ -63,8 +63,8 @@ class DnfRepoTest(DnfTest): def dnf_with_repo(self, command): pkgarchs = os.listdir(os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')) - deploy_url = 'http://%s:%s/' %(self.target.server_ip, self.repo_server.port) - cmdlinerepoopts = ["--repofrompath=oe-testimage-repo-%s,%s%s" %(arch, deploy_url, arch) for arch in pkgarchs] + deploy_url = 'http://%s:%s/' % (self.target.server_ip, self.repo_server.port) + cmdlinerepoopts = ["--repofrompath=oe-testimage-repo-%s,%s%s" % (arch, deploy_url, arch) for arch in pkgarchs] output = self.dnf(" ".join(cmdlinerepoopts) + " --nogpgcheck " + command) return output
@@ -108,7 +108,7 @@ class DnfRepoTest(DnfTest): output = subprocess.check_output('%s %s -name run-postinsts-dev*' % (bb.utils.which(os.getenv('PATH'), "find"), os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8") rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1] - url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path) + url = 'http://%s:%s/%s' % (self.target.server_ip, self.repo_server.port, rpm_path) self.dnf_with_repo('remove -y run-postinsts-dev') self.dnf_with_repo('install -y %s' % url)
@@ -152,8 +152,8 @@ class DnfRepoTest(DnfTest): #installroot directory. self.target.run('mkdir -p %s/etc' % rootpath, 1500) self.target.run('mkdir -p %s/usr/bin %s/usr/sbin' % (rootpath, rootpath), 1500) - self.target.run('ln -sf -r %s/usr/bin %s/bin' % (rootpath, rootpath), 1500) - self.target.run('ln -sf -r %s/usr/sbin %s/sbin' % (rootpath, rootpath), 1500) + self.target.run('ln -sf -r %s/usr/bin %s/bin' % (rootpath, rootpath), 1500) + self.target.run('ln -sf -r %s/usr/sbin %s/sbin' % (rootpath, rootpath), 1500) self.target.run('mkdir -p %s/dev' % rootpath, 1500) #Handle different architectures lib dirs self.target.run('mkdir -p %s/usr/lib' % rootpath, 1500)
@@ -183,9 +183,9 @@ class DnfRepoTest(DnfTest): #Avoid remove dependencies to skip some errors on different archs and images self.dnf_with_repo('remove --setopt=clean_requirements_on_remove=0 -y curl*') #check curl-dev is not installed adter removing all curl occurrences - status, output = self.target.run('dnf list --installed | grep %s'% excludepkg, 1500) - self.assertEqual(1, status, "%s was not removed, is listed as installed"%excludepkg) + status, output = self.target.run('dnf list --installed | grep %s' % excludepkg, 1500) + self.assertEqual(1, status, "%s was not removed, is listed as installed" % excludepkg) self.dnf_with_repo('install -y --exclude=%s --exclude=curl-staticdev curl*' % excludepkg) #check curl-dev is not installed after being excluded - status, output = self.target.run('dnf list --installed | grep %s'% excludepkg, 1500) - self.assertEqual(1, status, "%s was not excluded, is listed as installed"%excludepkg) + status, output = self.target.run('dnf list --installed | grep %s' % excludepkg, 1500) + self.assertEqual(1, status, "%s was not excluded, is listed as installed" % excludepkg)
meta/lib/oeqa/runtime/cases/ksample.py +1 -1
@@ -60,7 +60,7 @@ class KSample(OERuntimeTestCase): # check result self.cmd_and_check("dmesg | grep \"test passed\" ", "test passed") # rmmod - self.cmd_and_check("rmmod %s" % module_prename) + self.cmd_and_check("rmmod %s" % module_prename) def kprobe_func(self, name=''): # check config
meta/lib/oeqa/runtime/cases/ltp.py +5 -5
@@ -45,7 +45,7 @@ class LtpTestBase(OERuntimeTestCase): @classmethod def ltp_finishup(cls): - cls.extras['ltpresult.sections'] = cls.sections + cls.extras['ltpresult.sections'] = cls.sections # update symlink to ltp_log if os.path.exists(cls.ltptest_log_dir_link):
@@ -76,7 +76,7 @@ class LtpTest(LtpTestBase): self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output # copy nice log from DUT - dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group) + dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group) remote_src = "/opt/ltp/results/%s" % ltp_group (status, output) = self.target.copyFrom(remote_src, dst, True) msg = 'File could not be copied. Output: %s' % output
@@ -84,11 +84,11 @@ class LtpTest(LtpTestBase): self.target.logger.warning(msg) parser = LtpParser() - results, sections = parser.parse(dst) + results, sections = parser.parse(dst) - runtime = int(endtime-starttime) + runtime = int(endtime - starttime) sections['duration'] = runtime - self.sections[ltp_group] = sections + self.sections[ltp_group] = sections failed_tests = {} for test in results:
meta/lib/oeqa/runtime/cases/ltp_compliance.py +5 -5
@@ -45,7 +45,7 @@ class LtpPosixBase(OERuntimeTestCase): @classmethod def ltp_finishup(cls): - cls.extras['ltpposixresult.sections'] = cls.sections + cls.extras['ltpposixresult.sections'] = cls.sections # update symlink to ltp_log if os.path.exists(cls.ltptest_log_dir_link):
@@ -57,7 +57,7 @@ class LtpPosixBase(OERuntimeTestCase): cls.fail(cls.failmsg) class LtpPosixTest(LtpPosixBase): - posix_groups = ["AIO", "MEM", "MSG", "SEM", "SIG", "THR", "TMR", "TPS"] + posix_groups = ["AIO", "MEM", "MSG", "SEM", "SIG", "THR", "TMR", "TPS"] def runltp(self, posix_group): cmd = "/opt/ltp/bin/run-posix-option-group-test.sh %s 2>@1 | tee /opt/ltp/results/%s" % (posix_group, posix_group)
@@ -71,11 +71,11 @@ class LtpPosixTest(LtpPosixBase): self.extras['ltpposixresult.rawlogs']['log'] = self.extras['ltpposixresult.rawlogs']['log'] + output parser = LtpComplianceParser() - results, sections = parser.parse(os.path.join(self.ltptest_log_dir, "%s" % posix_group)) + results, sections = parser.parse(os.path.join(self.ltptest_log_dir, "%s" % posix_group)) - runtime = int(endtime-starttime) + runtime = int(endtime - starttime) sections['duration'] = runtime - self.sections[posix_group] = sections + self.sections[posix_group] = sections failed_tests = {} for test in results:
meta/lib/oeqa/runtime/cases/ltp_stress.py +4 -4
@@ -46,7 +46,7 @@ class LtpStressBase(OERuntimeTestCase): @classmethod def ltp_finishup(cls): - cls.extras['ltpstressresult.sections'] = cls.sections + cls.extras['ltpstressresult.sections'] = cls.sections # update symlink to ltp_log if os.path.exists(cls.ltptest_log_dir_link):
@@ -70,11 +70,11 @@ class LtpStressTest(LtpStressBase): self.extras['ltpstressresult.rawlogs']['log'] = self.extras['ltpstressresult.rawlogs']['log'] + output parser = LtpParser() - results, sections = parser.parse(os.path.join(self.ltptest_log_dir, "%s" % stress_group)) + results, sections = parser.parse(os.path.join(self.ltptest_log_dir, "%s" % stress_group)) - runtime = int(endtime-starttime) + runtime = int(endtime - starttime) sections['duration'] = runtime - self.sections[stress_group] = sections + self.sections[stress_group] = sections failed_tests = {} for test in results:
meta/lib/oeqa/runtime/cases/oe_syslog.py +4 -4
@@ -24,17 +24,17 @@ class SyslogTestConfig(OERuntimeTestCase): def verif_not_running(self, pids): for pid in pids: - status, err_output = self.target.run('kill -0 %s' %pid) + status, err_output = self.target.run('kill -0 %s' % pid) if not status: - self.logger.debug("previous %s is still running" %pid) + self.logger.debug("previous %s is still running" % pid) return 1 def verify_running(self, names): pids = [] for name in names: - status, pid = self.target.run('pidof %s' %name) + status, pid = self.target.run('pidof %s' % name) if status: - self.logger.debug("%s is not running" %name) + self.logger.debug("%s is not running" % name) return 1, pids pids.append(pid) return 0, pids
meta/lib/oeqa/runtime/cases/parselogs.py +5 -5
@@ -249,7 +249,7 @@ class ParseLogsTest(OERuntimeTestCase): hwi += '*******************************\n' hwi += 'Machine name: ' + self.getMachine() + '\n' hwi += 'CPU: ' + str(cpu_name) + '\n' - hwi += 'Arch: ' + str(cpu_arch)+ '\n' + hwi += 'Arch: ' + str(cpu_arch) + '\n' hwi += 'Physical cores: ' + str(cpu_physical_cores) + '\n' hwi += 'Logical cores: ' + str(cpu_logical_cores) + '\n' hwi += '*******************************\n'
@@ -353,7 +353,7 @@ class ParseLogsTest(OERuntimeTestCase): grep_output = check_output(cmd).decode('utf-8') except: pass - results[log][xrez]=grep_output + results[log][xrez] = grep_output return results
@@ -375,8 +375,8 @@ class ParseLogsTest(OERuntimeTestCase): for error in result[log]: errcount += 1 self.msg += 'Central error: ' + str(error) + '\n' - self.msg += '***********************\n' - self.msg += result[str(log)][str(error)] + '\n' - self.msg += '***********************\n' + self.msg += '***********************\n' + self.msg += result[str(log)][str(error)] + '\n' + self.msg += '***********************\n' self.msg += '%s errors found in logs.' % errcount self.assertEqual(errcount, 0, msg=self.msg)
meta/lib/oeqa/runtime/cases/rpm.py +1 -1
@@ -121,7 +121,7 @@ class RpmInstallRemoveTest(OERuntimeTestCase): # Make sure that some database files are under /var/lib/rpm as '__db.xxx' status, output = self.target.run(db_files_cmd) - msg = 'Failed to find database files under /var/lib/rpm/ as __db.xxx' + msg = 'Failed to find database files under /var/lib/rpm/ as __db.xxx' self.assertEqual(0, status, msg=msg) self.tc.target.copyTo(self.test_file, self.dst)
meta/lib/oeqa/runtime/cases/runlevel.py +1 -1
@@ -8,7 +8,7 @@ class RunLevel_Test(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh']) def test_runlevel_3(self): (status, output) = self.target.run("init 3 && sleep 5 && runlevel") - runlevel= '5 3' + runlevel = '5 3' self.assertEqual(output, runlevel, msg='Failed to set current runlevel to runlevel 3, current runlevel : %s' % output[-1]) (status, output) = self.target.run("uname -a") self.assertEqual(status, 0, msg='Failed to run uname command, output: %s' % output)
meta/lib/oeqa/runtime/cases/scp.py +1 -1
@@ -15,7 +15,7 @@ class ScpTest(OERuntimeTestCase): def setUpClass(cls): cls.tmp_fd, cls.tmp_path = mkstemp() with os.fdopen(cls.tmp_fd, 'w') as f: - f.seek(2 ** 22 -1) + f.seek(2 ** 22 - 1) f.write(os.linesep) @classmethod
meta/lib/oeqa/runtime/cases/skeletoninit.py +1 -1
@@ -21,7 +21,7 @@ class SkeletonBasicTest(OERuntimeTestCase): msg = 'skeleton init script not found. Output:\n%s' % output self.assertEqual(status, 0, msg=msg) - status, output = self.target.run('ls /usr/sbin/skeleton-test') + status, output = self.target.run('ls /usr/sbin/skeleton-test') msg = 'skeleton-test not found. Output:\n%s' % output self.assertEqual(status, 0, msg=msg)
meta/lib/oeqa/runtime/cases/storage.py +3 -3
@@ -52,14 +52,14 @@ class StorageBase(OERuntimeTestCase): match = re.search('%s' % cls.test_msg, output) msg = ('Test message %s not in file %s.' % (cls.test_msg, cls.test_file)) - cls.assertEqual(status, 0, msg=msg) + cls.assertEqual(status, 0, msg=msg) def storage_write(cls): # create test message in file on device (status, output) = cls.target.run('echo "%s" > %s/%s' % (cls.test_msg, cls.test_dir, cls.test_file)) msg = ('File %s not create test message on %s' % (cls.test_file, cls.device)) - cls.assertEqual(status, 0, msg=msg) + cls.assertEqual(status, 0, msg=msg) def storage_umount(cls, tmo=1): time.sleep(tmo)
@@ -70,7 +70,7 @@ class StorageBase(OERuntimeTestCase): return else: msg = ('Device not unmount %s' % cls.mount_point) - cls.assertEqual(status, 0, msg=msg) + cls.assertEqual(status, 0, msg=msg) (status, output) = cls.target.run('cat /proc/mounts') match = re.search('%s' % cls.device, output)
meta/lib/oeqa/runtime/cases/suspend.py +2 -2
@@ -8,7 +8,7 @@ class Suspend_Test(OERuntimeTestCase): def test_date(self): (status, output) = self.target.run('date') - self.assertEqual(status, 0, msg='Failed to run date command, output : %s' % output) + self.assertEqual(status, 0, msg='Failed to run date command, output : %s' % output) def test_ping(self): t_thread = threading.Thread(target=self.target.run, args=("ping 8.8.8.8",))
@@ -21,7 +21,7 @@ class Suspend_Test(OERuntimeTestCase): def set_suspend(self): (status, output) = self.target.run('sudo rtcwake -m mem -s 10') - self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) + self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) @skipIfQemu('qemuall', 'Test only runs on real hardware') @OETestDepends(['ssh.SSHTest.test_ssh'])
meta/lib/oeqa/runtime/cases/systemd.py +4 -4
@@ -39,11 +39,11 @@ class SystemdTest(OERuntimeTestCase): returned no entries """ - query_units='' + query_units = '' if l_match_units: - query_units = ['_SYSTEMD_UNIT='+unit for unit in l_match_units] + query_units = ['_SYSTEMD_UNIT=' + unit for unit in l_match_units] query_units = ' '.join(query_units) - command = 'journalctl %s %s' %(args, query_units) + command = 'journalctl %s %s' % (args, query_units) status, output = self.target.run(command) if status: raise AssertionError("Command '%s' returned non-zero exit "
@@ -152,7 +152,7 @@ class SystemdJournalTests(SystemdTest): """ # The expression chain that uniquely identifies the time boot message. - expr_items=['Startup finished', 'kernel', 'userspace','\.$'] + expr_items = ['Startup finished', 'kernel', 'userspace','\.$'] try: output = self.journalctl(args='-o cat --reverse') except AssertionError:
meta/lib/oeqa/runtime/cases/usb_hid.py +2 -2
@@ -7,11 +7,11 @@ class USB_HID_Test(OERuntimeTestCase): def keyboard_mouse_simulation(self): (status, output) = self.target.run('export DISPLAY=:0 && xdotool key F2 && xdotool mousemove 100 100') - return self.assertEqual(status, 0, msg='Failed to simulate keyboard/mouse input event, output : %s' % output) + return self.assertEqual(status, 0, msg='Failed to simulate keyboard/mouse input event, output : %s' % output) def set_suspend(self): (status, output) = self.target.run('sudo rtcwake -m mem -s 10') - return self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) + return self.assertEqual(status, 0, msg='Failed to suspends your system to RAM, output : %s' % output) @OEHasPackage(['xdotool']) @skipIfQemu('qemuall', 'Test only runs on real hardware')
meta/lib/oeqa/runtime/cases/weston.py +2 -2
@@ -19,7 +19,7 @@ class WestonTest(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(['weston']) def test_weston_running(self): - cmd ='%s | grep [w]eston-desktop-shell' % self.tc.target_cmds['ps'] + cmd = '%s | grep [w]eston-desktop-shell' % self.tc.target_cmds['ps'] status, output = self.target.run(cmd) msg = ('Weston does not appear to be running %s' % self.target.run(self.tc.target_cmds['ps'])[1])
@@ -42,7 +42,7 @@ class WestonTest(OERuntimeTestCase): def get_new_wayland_processes(self, existing_wl_processes): try_cnt = 0 while try_cnt < 5: - time.sleep(5 + 5*try_cnt) + time.sleep(5 + 5 * try_cnt) try_cnt += 1 wl_processes = self.get_processes_of('weston-desktop-shell', 'existing and new') new_wl_processes = [x for x in wl_processes if x not in existing_wl_processes]
meta/lib/oeqa/runtime/cases/xorg.py +1 -1
@@ -14,7 +14,7 @@ class XorgTest(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(['xserver-nodm-init']) def test_xorg_running(self): - cmd ='%s | grep -v xinit | grep [X]org' % self.tc.target_cmds['ps'] + cmd = '%s | grep -v xinit | grep [X]org' % self.tc.target_cmds['ps'] status, output = self.target.run(cmd) msg = ('Xorg does not appear to be running %s' % self.target.run(self.tc.target_cmds['ps'])[1])
meta/lib/oeqa/sdk/context.py +1 -1
@@ -44,7 +44,7 @@ class OESDKTestContext(OETestContext): # match multilib according to sdk_env mls = self.td.get('MULTILIB_VARIANTS', '').split() for ml in mls: - if ('ml'+ml) in self.sdk_env: + if ('ml' + ml) in self.sdk_env: pkg = ml + '-' + pkg return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex)
meta/lib/oeqa/sdkext/cases/devtool.py +1 -1
@@ -93,7 +93,7 @@ class DevtoolTest(OESDKExtTestCase): try: self._run('devtool build %s ' % package_nodejs) finally: - self._run('devtool reset %s '% package_nodejs) + self._run('devtool reset %s ' % package_nodejs) class SdkUpdateTest(OESDKExtTestCase): @classmethod
meta/lib/oeqa/sdkext/testsdk.py +1 -1
@@ -100,7 +100,7 @@ class TestSDKExt(TestSDKBase): fail = True # Clean the workspace/sources to avoid `devtool add' failure because of non-empty source directory - bb.utils.remove(sdk_dir+'workspace/sources', True) + bb.utils.remove(sdk_dir + 'workspace/sources', True) if fail: bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
meta/lib/oeqa/selftest/case.py +1 -1
@@ -134,7 +134,7 @@ class OESelftestTestCase(OETestCase): failed_extra_commands = [] for command in self._extra_tear_down_commands: result = runCmd(command, ignore_status=True) - if not result.status == 0: + if not result.status == 0: failed_extra_commands.append(command) if failed_extra_commands: self.logger.warning("tearDown commands have failed: %s" % ', '.join(map(str, failed_extra_commands)))
meta/lib/oeqa/selftest/cases/archiver.py +2 -2
@@ -135,7 +135,7 @@ class Archiver(OESelftestTestCase): target = 'selftest-ed-native' features = 'INHERIT += "archiver"\n' - features += 'ARCHIVER_MODE[src] = "%s"\n' % (mode) + features += 'ARCHIVER_MODE[src] = "%s"\n' % (mode) if extra_config: features += extra_config self.write_config(features)
@@ -212,7 +212,7 @@ class Archiver(OESelftestTestCase): `ARCHIVER_MIRROR_EXCLUDE`. """ - target='selftest-ed' + target = 'selftest-ed' target_file_name = 'ed-1.14.1.tar.lz' features = 'INHERIT += "archiver"\n'
meta/lib/oeqa/selftest/cases/bbtests.py +1 -1
@@ -42,7 +42,7 @@ class BitbakeTests(OESelftestTestCase): result = bitbake('m4-native') find_build_started = re.search(r"NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Executing.*Tasks", result.output) find_build_completed = re.search(r"Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output) - self.assertTrue(find_build_started, msg="Match failed in:\n%s" % result.output) + self.assertTrue(find_build_started, msg="Match failed in:\n%s" % result.output) self.assertTrue(find_build_completed, msg="Match failed in:\n%s" % result.output) self.assertNotIn('Test for bb.event.InvalidEvent', result.output)
meta/lib/oeqa/selftest/cases/buildoptions.py +1 -1
@@ -68,7 +68,7 @@ class DiskMonTest(OESelftestTestCase): self.assertEqual(res.status, 1, msg="bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output)) self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"\nBB_HEARTBEAT_EVENT = "1"') res = bitbake("delay -c delay") - self.assertTrue('WARNING: The free space' in res.output, msg="A warning should have been displayed for disk monitor is set to WARN: %s" %res.output) + self.assertTrue('WARNING: The free space' in res.output, msg="A warning should have been displayed for disk monitor is set to WARN: %s" % res.output) class SanityOptionsTest(OESelftestTestCase): def getline(self, res, line):
meta/lib/oeqa/selftest/cases/devtool.py +2 -2
@@ -88,7 +88,7 @@ class DevtoolBase(OESelftestTestCase): bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR']) cls.original_sstate = bb_vars['SSTATE_DIR'] cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool') - cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate + cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate cls.sstate_conf += ('SSTATE_MIRRORS += "file://.* file:///%s/PATH"\n' % cls.original_sstate)
@@ -667,7 +667,7 @@ class DevtoolModifyTests(DevtoolBase): self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe) # devtool modify should fail result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True) - self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output)) + self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output)) self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe) def test_devtool_modify_native(self):
meta/lib/oeqa/selftest/cases/eSDK.py +2 -2
@@ -62,7 +62,7 @@ class oeSDKExtSelfTest(OESelftestTestCase): cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) - sstate_config=""" + sstate_config = """ SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" SSTATE_MIRRORS = "file://.* file://%s/PATH" CORE_IMAGE_EXTRA_INSTALL = "perl"
@@ -90,7 +90,7 @@ CORE_IMAGE_EXTRA_INSTALL = "perl" cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) # Configure eSDK to use sstate mirror from poky - sstate_config=""" + sstate_config = """ SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" SSTATE_MIRRORS = "file://.* file://%s/PATH" """ % bb_vars["SSTATE_DIR"]
meta/lib/oeqa/selftest/cases/fitimage.py +5 -5
@@ -80,7 +80,7 @@ FIT_DESC = "A model description" if field_index == len(its_field_check): break if its_field_check[field_index] in line: - field_index +=1 + field_index += 1 if field_index != len(its_field_check): # if its equal, the test passed self.assertTrue(field_index == len(its_field_check),
@@ -307,7 +307,7 @@ FIT_SIGN_INDIVIDUAL = "1" if field_index == len(its_field_check): break if its_field_check[field_index] in line: - field_index +=1 + field_index += 1 if field_index != len(its_field_check): # if its equal, the test passed self.assertTrue(field_index == len(its_field_check),
@@ -390,7 +390,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" if field_index == len(its_field_check): break if its_field_check[field_index] in line: - field_index +=1 + field_index += 1 if field_index != len(its_field_check): # if its equal, the test passed self.assertTrue(field_index == len(its_field_check),
@@ -776,7 +776,7 @@ FIT_HASH_ALG = "sha256" 'load = <' + kernel_load + '>;', 'entry = <' + kernel_entry + '>;', 'hash-1 {', - 'algo = "' + fit_hash_alg +'";', + 'algo = "' + fit_hash_alg + '";', '};', '};' ]
@@ -803,7 +803,7 @@ FIT_HASH_ALG = "sha256" line_idx = cfg_start_idx + 2 node_end = False while node_end == False: - if its_lines[line_idx] == "};" and its_lines[line_idx-1] == "};": + if its_lines[line_idx] == "};" and its_lines[line_idx - 1] == "};": node_end = True line_idx = line_idx + 1
meta/lib/oeqa/selftest/cases/gotoolchain.py +1 -1
@@ -61,7 +61,7 @@ class oeGoToolchainSelfTest(OESelftestTestCase): url = "https://%s/%s/archive/%s%s" % (proj, name, ver, archive) runCmd("cd %s; wget %s" % (self.tmpdir_SDKQA, url)) - runCmd("cd %s; tar -xf %s" % (self.tmpdir_SDKQA, ver+archive)) + runCmd("cd %s; tar -xf %s" % (self.tmpdir_SDKQA, ver + archive)) runCmd("mkdir -p %s/src/%s" % (self.go_path, proj)) runCmd("mv %s/direnv-2.27.0 %s/src/%s/%s" % (self.tmpdir_SDKQA, self.go_path, proj, name))
meta/lib/oeqa/selftest/cases/image_typedep.py +1 -1
@@ -44,7 +44,7 @@ inherit image bitbake('-g emptytest') taskdependsfile = os.path.join(self.builddir, 'task-depends.dot') - dep = dep + ".do_populate_sysroot" + dep = dep + ".do_populate_sysroot" depfound = False expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
meta/lib/oeqa/selftest/cases/manifest.py +3 -3
@@ -81,7 +81,7 @@ class VerifyManifest(OESelftestTestCase): pkgdata_dir = reverse_dir = {} mfilename = mpath = m_entry = {} # get manifest location based on target to query about - d_target= dict(target=self.buildtarget, + d_target = dict(target=self.buildtarget, host='nativesdk-packagegroup-sdk-host') try: mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget)
@@ -120,7 +120,7 @@ class VerifyManifest(OESelftestTestCase): if m_entry[k].missing: msg = '{}: {} Error has the following missing entries'\ .format(self.classname, m_entry[k].file) - logmsg = msg+':\n'+'\n'.join(m_entry[k].missing) + logmsg = msg + ':\n' + '\n'.join(m_entry[k].missing) self.logger.debug(logmsg) self.logger.info(msg) self.fail(logmsg)
@@ -160,7 +160,7 @@ class VerifyManifest(OESelftestTestCase): if m_entry.missing: msg = '{}: {} Error has the following missing entries'\ .format(self.classname, m_entry.file) - logmsg = msg+':\n'+'\n'.join(m_entry.missing) + logmsg = msg + ':\n' + '\n'.join(m_entry.missing) self.logger.debug(logmsg) self.logger.info(msg) self.fail(logmsg)
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +1 -1
@@ -81,7 +81,7 @@ class TestBlobParsing(OESelftestTestCase): Test default values for comparisson of git blob dictionaries """ from oe.buildhistory_analysis import compare_dict_blobs - defaultmap = {x: ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} + defaultmap = {x: ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} self.commit_vars(to_add={"foo": "1"}) blob1 = self.repo.heads.master.commit.tree.blobs[0]
meta/lib/oeqa/selftest/cases/oelib/path.py +19 -19
@@ -14,32 +14,32 @@ class TestRealPath(TestCase): DIRS = ["a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm"] FILES = ["etc/passwd", "b/file"] LINKS = [ - ("bin", "/usr/bin", "/usr/bin"), - ("binX", "usr/binX", "/usr/binX"), - ("c", "broken", "/broken"), - ("etc/passwd-1", "passwd", "/etc/passwd"), - ("etc/passwd-2", "passwd-1", "/etc/passwd"), - ("etc/passwd-3", "/etc/passwd-1", "/etc/passwd"), - ("etc/shadow-1", "/etc/shadow", "/etc/shadow"), - ("etc/shadow-2", "/etc/shadow-1", "/etc/shadow"), - ("prog-A", "bin/prog-A", "/usr/bin/prog-A"), - ("prog-B", "/bin/prog-B", "/usr/bin/prog-B"), - ("usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C"), - ("usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D"), - ("usr/binX/prog-E", "../sbin/prog-E", None), - ("usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F"), - ("loop", "a/loop", None), - ("a/loop", "../loop", None), - ("b/test", "file/foo", "/b/file/foo"), + ("bin", "/usr/bin", "/usr/bin"), + ("binX", "usr/binX", "/usr/binX"), + ("c", "broken", "/broken"), + ("etc/passwd-1", "passwd", "/etc/passwd"), + ("etc/passwd-2", "passwd-1", "/etc/passwd"), + ("etc/passwd-3", "/etc/passwd-1", "/etc/passwd"), + ("etc/shadow-1", "/etc/shadow", "/etc/shadow"), + ("etc/shadow-2", "/etc/shadow-1", "/etc/shadow"), + ("prog-A", "bin/prog-A", "/usr/bin/prog-A"), + ("prog-B", "/bin/prog-B", "/usr/bin/prog-B"), + ("usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C"), + ("usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D"), + ("usr/binX/prog-E", "../sbin/prog-E", None), + ("usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F"), + ("loop", "a/loop", None), + ("a/loop", "../loop", None), + ("b/test", "file/foo", "/b/file/foo"), ] LINKS_PHYS = [ - ("./", "/", ""), + ("./", "/", ""), ("binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E"), ] EXCEPTIONS = [ - ("loop", errno.ELOOP), + ("loop", errno.ELOOP), ("b/test", errno.ENOENT), ]
meta/lib/oeqa/selftest/cases/oescripts.py +1 -1
@@ -130,7 +130,7 @@ class OeRunNativeTest(OESelftestTestCase): class OEListPackageconfigTests(OEScriptTests): #oe-core.scripts.List_all_the_PACKAGECONFIG's_flags - def check_endlines(self, results, expected_endlines): + def check_endlines(self, results, expected_endlines): for line in results.output.splitlines(): for el in expected_endlines: if line.split() == el.split():
meta/lib/oeqa/selftest/cases/pkgdata.py +28 -28
91 lines not on this page · raw message
meta/lib/oeqa/selftest/cases/runqemu.py +3 -3
@@ -21,7 +21,7 @@ class RunqemuTests(OESelftestTestCase): def setUpLocal(self): super(RunqemuTests, self).setUpLocal() self.recipe = 'core-image-minimal' - self.machine = 'qemux86-64' + self.machine = 'qemux86-64' self.fstypes = "ext4 iso hddimg wic.vmdk wic.qcow2 wic.vdi" self.cmd_common = "runqemu nographic"
@@ -155,8 +155,8 @@ class QemuTest(OESelftestTestCase): def setUpClass(cls): super(QemuTest, cls).setUpClass() cls.recipe = 'core-image-minimal' - cls.machine = get_bb_var('MACHINE') - cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') + cls.machine = get_bb_var('MACHINE') + cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') cls.cmd_common = "runqemu nographic" cls.qemuboot_conf = "%s-%s.qemuboot.conf" % (cls.recipe, cls.machine) cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf)
meta/lib/oeqa/selftest/cases/runtime_test.py +2 -2
@@ -216,7 +216,7 @@ class TestImage(OESelftestTestCase): try: content = os.listdir("/dev/dri") if len([i for i in content if i.startswith('render')]) == 0: - self.skipTest("No render nodes found in /dev/dri: %s" %(content)) + self.skipTest("No render nodes found in /dev/dri: %s" % (content)) except FileNotFoundError: self.skipTest("/dev/dri directory does not exist; no render nodes available on this machine.") try:
@@ -345,7 +345,7 @@ class Postinst(OESelftestTestCase): self.write_config(features) bb_result = bitbake('core-image-minimal', ignore_status=True) self.assertGreaterEqual(bb_result.output.find("Postinstall scriptlets of ['postinst-rootfs-failing'] have failed."), 0, - "Warning about a failed scriptlet not found in bitbake output: %s" %(bb_result.output)) + "Warning about a failed scriptlet not found in bitbake output: %s" % (bb_result.output)) self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs-before-failure")), "rootfs-before-failure file was not created")
meta/lib/oeqa/selftest/cases/sstatetests.py +9 -9
@@ -58,7 +58,7 @@ class SStateTests(SStateBase): def run_test_sstate_creation(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True, should_pass=True): self.config_sstate(temp_sstate_location, [self.sstate_path]) - if self.temp_sstate_location: + if self.temp_sstate_location: bitbake(['-cclean'] + targets) else: bitbake(['-ccleansstate'] + targets)
@@ -80,10 +80,10 @@ class SStateTests(SStateBase): self.assertTrue(not file_tracker, msg="Found sstate files in the wrong place for: %s (found %s)" % (', '.join(map(str, targets)), str(file_tracker))) def test_sstate_creation_distro_specific_pass(self): - self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) + self.run_test_sstate_creation(['binutils-cross-' + self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True) def test_sstate_creation_distro_specific_fail(self): - self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False) + self.run_test_sstate_creation(['binutils-cross-' + self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False) def test_sstate_creation_distro_nonspecific_pass(self): self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
@@ -109,7 +109,7 @@ class SStateTests(SStateBase): self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_removed))) def test_cleansstate_task_distro_specific_nonspecific(self): - targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native'] + targets = ['binutils-cross-' + self.tune_arch, 'binutils-native'] targets.append('linux-libc-headers') self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
@@ -117,7 +117,7 @@ class SStateTests(SStateBase): self.run_test_cleansstate_task(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True) def test_cleansstate_task_distro_specific(self): - targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native'] + targets = ['binutils-cross-' + self.tune_arch, 'binutils-native'] targets.append('linux-libc-headers') self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
@@ -211,7 +211,7 @@ class SStateTests(SStateBase): target_config = [] global_config.append('') target_config.append('PR = "0"') - self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) + self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) def test_sstate_cache_management_script_using_pr_2(self): global_config = []
@@ -220,7 +220,7 @@ class SStateTests(SStateBase): target_config.append('PR = "0"') global_config.append('') target_config.append('PR = "1"') - self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) + self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) def test_sstate_cache_management_script_using_pr_3(self): global_config = []
@@ -231,7 +231,7 @@ class SStateTests(SStateBase): target_config.append('PR = "1"') global_config.append('MACHINE = "qemux86"') target_config.append('PR = "1"') - self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) + self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) def test_sstate_cache_management_script_using_machine(self): global_config = []
@@ -240,7 +240,7 @@ class SStateTests(SStateBase): target_config.append('') global_config.append('MACHINE = "qemux86"') target_config.append('') - self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) + self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) def test_sstate_32_64_same_hash(self): """
meta/lib/oeqa/selftest/cases/sysroot.py +1 -1
@@ -5,7 +5,7 @@ import uuid from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake +from oeqa.utils.commands import bitbake class SysrootTests(OESelftestTestCase): def test_sysroot_cleanup(self):
meta/lib/oeqa/selftest/cases/wic.py +2 -2
@@ -424,7 +424,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r for part in [1, 2, 3]: part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part) - partln = partlns[part-1].split(":") + partln = partlns[part - 1].split(":") self.assertEqual(7, len(partln)) start = int(partln[1].rstrip("B")) / 512 length = int(partln[3].rstrip("B")) / 512
@@ -1133,7 +1133,7 @@ class Wic2(WicTestCase): """Test sparse_copy with FIEMAP and SEEK_HOLE filemap APIs""" libpath = os.path.join(get_bb_var('COREBASE'), 'scripts', 'lib', 'wic') sys.path.insert(0, libpath) - from filemap import FilemapFiemap, FilemapSeek, sparse_copy, ErrorNotSupp + from filemap import FilemapFiemap, FilemapSeek, sparse_copy, ErrorNotSupp with NamedTemporaryFile("w", suffix=".wic-sparse") as sparse: src_name = sparse.name src_size = 1024 * 10
meta/lib/oeqa/selftest/context.py +1 -1
@@ -279,7 +279,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): meta_selftestdir = os.path.join( self.tc.td["BBLAYERS_FETCH_DIR"], 'meta-selftest') if os.path.isdir(meta_selftestdir): - runCmd("bitbake-layers add-layer %s" %meta_selftestdir) + runCmd("bitbake-layers add-layer %s" % meta_selftestdir) # reload data is needed because a meta-selftest layer was add self.tc.td = get_bb_vars() self.tc.config_paths['testlayer_path'] = get_test_layer()
meta/lib/oeqa/targetcontrol.py +3 -3
@@ -42,7 +42,7 @@ class BaseTarget(object, metaclass=ABCMeta): if os.path.islink(sshloglink): os.unlink(sshloglink) os.symlink(self.sshlog, sshloglink) - self.logger.info("SSH log file: %s" % self.sshlog) + self.logger.info("SSH log file: %s" % self.sshlog) @abstractmethod def start(self, params=None, ssh=True, extra_bootparams=None):
@@ -104,7 +104,7 @@ class QemuTarget(BaseTarget): if d.getVar('FIND_ROOTFS') == '1': self.image_fstype = image_fstype or self.get_image_fstype(d) - self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype) + self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype) self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) dump_target_cmds = d.getVar("testimage_dump_target")
@@ -161,7 +161,7 @@ class QemuTarget(BaseTarget): os.unlink(qemuloglink) os.symlink(self.qemulog, qemuloglink) - self.logger.info("rootfs file: %s" % self.rootfs) + self.logger.info("rootfs file: %s" % self.rootfs) self.logger.info("Qemu log file: %s" % self.qemulog) super(QemuTarget, self).deploy()
meta/lib/oeqa/utils/decorators.py +8 -8
@@ -125,8 +125,8 @@ def LogResults(original_class): from time import strftime, gmtime caller = os.path.basename(sys.argv[0]) timestamp = strftime('%Y%m%d%H%M%S',gmtime()) - logfile = os.path.join(os.getcwd(),'results-'+caller+'.'+timestamp+'.log') - linkfile = os.path.join(os.getcwd(),'results-'+caller+'.log') + logfile = os.path.join(os.getcwd(),'results-' + caller + '.' + timestamp + '.log') + linkfile = os.path.join(os.getcwd(),'results-' + caller + '.log') def get_class_that_defined_method(meth): if inspect.ismethod(meth):
@@ -177,20 +177,20 @@ def LogResults(original_class): tcid = self.id() for (name, msg) in result.errors: if tcid == name.id(): - local_log.results("Testcase "+str(test_case)+": ERROR") - local_log.results("Testcase "+str(test_case)+":\n"+msg) + local_log.results("Testcase " + str(test_case) + ": ERROR") + local_log.results("Testcase " + str(test_case) + ":\n" + msg) passed = False for (name, msg) in result.failures: if tcid == name.id(): - local_log.results("Testcase "+str(test_case)+": FAILED") - local_log.results("Testcase "+str(test_case)+":\n"+msg) + local_log.results("Testcase " + str(test_case) + ": FAILED") + local_log.results("Testcase " + str(test_case) + ":\n" + msg) passed = False for (name, msg) in result.skipped: if tcid == name.id(): - local_log.results("Testcase "+str(test_case)+": SKIPPED") + local_log.results("Testcase " + str(test_case) + ": SKIPPED") passed = False if passed: - local_log.results("Testcase "+str(test_case)+": PASSED") + local_log.results("Testcase " + str(test_case) + ": PASSED") # XXX: In order to avoid race condition when test if exists the linkfile # use bb.utils.lock, the best solution is to create a unique name for the
meta/lib/oeqa/utils/gitarchive.py +1 -1
@@ -123,7 +123,7 @@ def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern, keyws['tag_number'] = int(match.group('tag_number')) + 1 tag_name = format_str(name_pattern, keyws) - msg_subj= format_str(msg_subj_pattern.strip(), keyws) + msg_subj = format_str(msg_subj_pattern.strip(), keyws) msg_body = format_str(msg_body_pattern, keyws) return tag_name, msg_subj + '\n\n' + msg_body
meta/lib/oeqa/utils/qemurunner.py +5 -5
@@ -26,7 +26,7 @@ from collections import defaultdict import importlib # Get Unicode non printable control chars -control_range = list(range(0,32))+list(range(127,160)) +control_range = list(range(0,32)) + list(range(127,160)) control_chars = [chr(x) for x in control_range if chr(x) not in string.printable] re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
@@ -228,7 +228,7 @@ class QemuRunner: self.origchldhandler = signal.getsignal(signal.SIGCHLD) signal.signal(signal.SIGCHLD, self.handleSIGCHLD) - self.logger.debug('launchcmd=%s'%(launch_cmd)) + self.logger.debug('launchcmd=%s' % (launch_cmd)) # FIXME: We pass in stdin=subprocess.PIPE here to work around stty # blocking at the end of the runqemu script when using this within
@@ -402,7 +402,7 @@ class QemuRunner: except (IndexError, ValueError): # Try to get network configuration from runqemu output match = re.match(r'.*Network configuration: (?:ip=)*([0-9.]+)::([0-9.]+):([0-9.]+)$.*', - out, re.MULTILINE|re.DOTALL) + out, re.MULTILINE | re.DOTALL) if match: self.ip, self.server_ip, self.netmask = match.groups() # network configuration is required as we couldn't get it
@@ -641,13 +641,13 @@ class QemuRunner: status = 1 else: # Remove first line (command line) and last line (prompt) - data = data[data.find('$?\r\n')+4:data.rfind('\r\n')] + data = data[data.find('$?\r\n') + 4:data.rfind('\r\n')] index = data.rfind('\r\n') if index == -1: status_cmd = data data = "" else: - status_cmd = data[index+2:] + status_cmd = data[index + 2:] data = data[:index] if (status_cmd == "0"): status = 1
meta/lib/oeqa/utils/qemutinyrunner.py +3 -3
@@ -115,12 +115,12 @@ class QemuTinyRunner(QemuRunner): return self.is_alive() def run_serial(self, command, timeout=60): - self.server_socket.sendall(command+'\n') + self.server_socket.sendall(command + '\n') data = '' status = 0 stopread = False - endtime = time.time()+timeout - while time.time()<endtime and not stopread: + endtime = time.time() + timeout + while time.time() < endtime and not stopread: try: sread, _, _ = select.select([self.server_socket],[],[],1) except InterruptedError:
meta/lib/oeqa/utils/testexport.py +3 -3
@@ -104,7 +104,7 @@ def process_binaries(d, params): else: # nothing to do here; running tests under bitbake, so we asume native binaries are in sysroots dir. if param_list[1] or param_list[4]: bb.warn("Native binary %s %s%s. Running tests under bitbake environment. Version can't be checked except when the test itself does it" - " and binary can't be removed."%(param_list[0],"has assigned ver. " + param_list[1] if param_list[1] else "", + " and binary can't be removed." % (param_list[0],"has assigned ver. " + param_list[1] if param_list[1] else "", ", is marked for removal" if param_list[4] else "")) else:# the package is target aka DUT intended and it is either required to be delivered in an extracted form or in a packaged version target_rpm_file_list = [item for item in os.listdir(arch_rpm_dir) if re.search(param_list[0] + "-([0-9]+\.*)", item)]
@@ -237,7 +237,7 @@ def send_bin_to_DUT(d,params): def send_rpm(remote_path): # if it is not required to have an extracted binary, but to send an .rpm file rpm_to_send = "" for item in os.listdir(arch_rpms_dir): - if param_list[1] and re.match("%s-%s-.*rpm"%(param_list[0], param_list[1]), item): + if param_list[1] and re.match("%s-%s-.*rpm" % (param_list[0], param_list[1]), item): rpm_to_send = item break elif re.match("%s-[0-9]+\.[0-9]+-.*rpm" % param_list[0], item):
@@ -249,7 +249,7 @@ def send_bin_to_DUT(d,params): return (status, output) = oeRuntimeTest.tc.target.copy_to(os.path.join(arch_rpms_dir, rpm_to_send), remote_path) if status != 0: - bb.warn("Failed to copy %s on the remote target: %s" %(param_list[0], d.getVar("MACHINE"))) + bb.warn("Failed to copy %s on the remote target: %s" % (param_list[0], d.getVar("MACHINE"))) return if param_list[4] == "rm": cleanup_list.append(os.path.join(remote_path, rpm_to_send))
meta/recipes-core/glibc/glibc/check-test-wrapper +1 -1
@@ -50,7 +50,7 @@ if targettype == "user": # tests e.g. nptl/tst-pthread-timedlock-lockloop # Cap at 8GB since no test should need more than that # (5GB adds 7 failures for qemuarm glibc test run) - limit = 8*1024*1024*1024 + limit = 8 * 1024 * 1024 * 1024 resource.setrlimit(resource.RLIMIT_AS, (limit, limit)) elif targettype == "ssh":
meta/recipes-devtools/python/python3/check_build_completeness.py +2 -2
@@ -5,12 +5,12 @@ logfile = open(sys.argv[1]).read() necessary_bits = logfile.find("The necessary bits to build these optional modules were not found") to_find_bits = logfile.find("To find the necessary bits, look in setup.py in detect_modules() for the module's name.") if necessary_bits != -1: - print("%s" %(logfile[necessary_bits:to_find_bits])) + print("%s" % (logfile[necessary_bits:to_find_bits])) failed_to_build = logfile.find("Failed to build these modules:") if failed_to_build != -1: failed_to_build_end = logfile.find("\n\n", failed_to_build) - print("%s" %(logfile[failed_to_build:failed_to_build_end])) + print("%s" % (logfile[failed_to_build:failed_to_build_end])) if necessary_bits != -1 or failed_to_build != -1: sys.exit(1)
meta/recipes-devtools/python/python3/create_manifest3.py +3 -3
@@ -57,7 +57,7 @@ pyversion = str(sys.argv[1]) pivot = 'recipe-sysroot-native' for p in sys.path: if pivot in p: - nativelibfolder = p[:p.find(pivot)+len(pivot)] + nativelibfolder = p[:p.find(pivot) + len(pivot)] # Empty dict to hold the whole manifest new_manifest = collections.OrderedDict()
@@ -72,7 +72,7 @@ allfolders = [] def isFolder(value): value = value.replace('${PYTHON_MAJMIN}',pyversion) - if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')): + if os.path.isdir(value.replace('${libdir}',nativelibfolder + '/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder + '/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder + '/usr/lib32')): return True else: return False
@@ -98,7 +98,7 @@ def print_indent(msg, offset): # Read existing JSON manifest with open('python3-manifest.json') as manifest: # The JSON format doesn't allow comments so we hack the call to keep the comments using a marker - manifest_str = manifest.read() + manifest_str = manifest.read() json_start = manifest_str.find('# EOC') + 6 # EOC + \n manifest.seek(0) comments = manifest.read(json_start)
meta/recipes-devtools/python/python3/get_module_deps3.py +7 -7
@@ -29,7 +29,7 @@ def fix_path(dep_path): import os # We DONT want the path on our HOST system pivot = 'recipe-sysroot-native' - dep_path = dep_path[dep_path.find(pivot)+len(pivot):] + dep_path = dep_path[dep_path.find(pivot) + len(pivot):] if '/usr/bin' in dep_path: dep_path = dep_path.replace('/usr/bin''${bindir}')
@@ -44,12 +44,12 @@ def fix_path(dep_path): if '/usr/include' in dep_path: dep_path = dep_path.replace('/usr/include','${includedir}') if '__init__.' in dep_path: - dep_path = os.path.split(dep_path)[0] + dep_path = os.path.split(dep_path)[0] return dep_path # Module to import was passed as an argument -current_module = str(sys.argv[1]).rstrip() +current_module = str(sys.argv[1]).rstrip() if debug == True: log = open('temp/log_%s' % current_module.strip('.*'),'w') log.write('Module %s generated the following dependencies:\n' % current_module)
@@ -80,7 +80,7 @@ if current_module == 'python-core-package': dif = core_deps else: # We know this is not the core package, so there must be a difference. - dif = module_deps-core_deps + dif = module_deps - core_deps # Check where each dependency came from
@@ -105,7 +105,7 @@ for item in dif: # Deals with NameError: name 'dep_path' is not defined # because module is not found (wasn't compiled?), e.g. bddsm if debug == True: - log.write(item+' ') + log.write(item + ' ') log.write(str(e)) pass
@@ -136,7 +136,7 @@ for item in dif: dep_path = dep_path.replace(sysconfig._get_sysconfigdata_name(), "_sysconfigdata*") if debug == True: - log.write(dep_path+'\n') + log.write(dep_path + '\n') # Prints out result, which is what will be used by create_manifest print(dep_path)
@@ -158,7 +158,7 @@ for item in dif: except NameError as e: # Deals with NameError: name 'cached' is not defined if debug == True: - log.write(item+' ') + log.write(item + ' ') log.write(str(e)) pass if cached is not None:
meta/recipes-kernel/perf/perf/sort-pmuevents.py +1 -1
@@ -37,7 +37,7 @@ preamble_regex = re.compile('^(.*?)^struct', re.MULTILINE | re.DOTALL) preamble = re.search(preamble_regex, data) struct_block_regex = re.compile('^struct.*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL) -field_regex = re.compile('{.*?},', re.MULTILINE | re.DOTALL) +field_regex = re.compile('{.*?},', re.MULTILINE | re.DOTALL) cpuid_regex = re.compile('\.cpuid = (.*?),', re.MULTILINE | re.DOTALL) name_regex = re.compile('\.name = (.*?),', re.MULTILINE | re.DOTALL)
meta/recipes-rt/rt-tests/files/rt_bmark.py +25 -25
119 lines not on this page · raw message
scripts/buildhistory-diff +1 -1
@@ -104,7 +104,7 @@ def main(): sys.exit(1) if len(args.revisions) == 1: - if '..' in args.revisions[0]: + if '..' in args.revisions[0]: fromrev, torev = args.revisions[0].split('..') else: fromrev, torev = args.revisions[0], 'HEAD'
scripts/buildstats-diff +2 -2
@@ -203,14 +203,14 @@ def print_task_diff(bs1, bs2, val_type, min_val=0, min_absdiff=0, sort_by=('absd total2 = sum_vals(bs2) print("\nCumulative {}:".format(val_type)) print(" {} {:+.1f}% {} ({}) -> {} ({})".format( - val_to_str(total2 - total1), 100 * (total2-total1) / total1, + val_to_str(total2 - total1), 100 * (total2 - total1) / total1, val_to_str(total1, True), val_to_str(total1), val_to_str(total2, True), val_to_str(total2))) def parse_args(argv): """Parse cmdline arguments""" - description=""" + description = """ Script for comparing buildstats of two separate builds.""" parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter,
scripts/combo-layer +14 -14
@@ -142,7 +142,7 @@ class Configuration(object): self.repos[repo][option] = value def sanity_check(self, initmode=False): - required_options=["src_uri", "local_repo_dir", "dest_dir", "last_revision"] + required_options = ["src_uri", "local_repo_dir", "dest_dir", "last_revision"] if initmode: required_options.remove("last_revision") msg = ""
@@ -150,7 +150,7 @@ class Configuration(object): for name in self.repos: for option in required_options: if option not in self.repos[name]: - msg = "%s\nOption %s is not defined for component %s" %(msg, option, name) + msg = "%s\nOption %s is not defined for component %s" % (msg, option, name) missing_options.append(option) # Sanitize dest_dir so that we do not have to deal with edge cases # (unset, empty string, double slashes) in the rest of the code.
@@ -201,7 +201,7 @@ def action_init(conf, args): for name in conf.repos: ldir = conf.repos[name]['local_repo_dir'] if not os.path.exists(ldir): - logger.info("cloning %s to %s" %(conf.repos[name]['src_uri'], ldir)) + logger.info("cloning %s to %s" % (conf.repos[name]['src_uri'], ldir)) subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True) if not os.path.exists(".git"): runcmd("git init")
@@ -269,7 +269,7 @@ def action_init(conf, args): # directory and optionally tell tar to strip the path # prefix when the files were already moved. subdir_components = len(subdir.split(os.path.sep)) if subdir else 0 - strip=('--strip-components=%d' % subdir_components) if subdir else '' + strip = ('--strip-components=%d' % subdir_components) if subdir else '' # TODO: file_filter wild cards do not work (and haven't worked before either), because # a) GNU tar requires a --wildcards parameter before turning on wild card matching. # b) The semantic is not as intendend (src/*.c also matches src/foo/bar.c,
@@ -467,7 +467,7 @@ def check_repo_clean(repodir): check if the repo is clean exit if repo is dirty """ - output=runcmd("git status --porcelain", repodir) + output = runcmd("git status --porcelain", repodir) r = re.compile('\?\? patch-.*/') dirtyout = [item for item in output.splitlines() if not r.match(item)] if dirtyout:
@@ -591,15 +591,15 @@ def action_pull(conf, args): try: runcmd("git checkout %s" % branch, ldir, printerr=False) except subprocess.CalledProcessError: - output=runcmd("git fetch", ldir) + output = runcmd("git fetch", ldir) logger.info(output) runcmd("git checkout %s" % branch, ldir) runcmd("git pull --ff-only", ldir) else: - output=runcmd("git pull --ff-only", ldir) + output = runcmd("git pull --ff-only", ldir) logger.info(output) else: - output=runcmd("git fetch", ldir) + output = runcmd("git fetch", ldir) logger.info(output) runcmd("git checkout %s" % branch, ldir) runcmd("git reset --hard FETCH_HEAD", ldir)
@@ -707,20 +707,20 @@ def update_with_patches(conf, components, revisions, repos): # Step 3: Call repo specific hook to adjust patch if 'hook' in repo: # hook parameter is: ./hook patchpath revision reponame - count=len(revlist)-1 + count = len(revlist) - 1 for patch in patchlist: runcmd("%s %s %s %s" % (repo['hook'], patch, revlist[count], name)) - count=count-1 + count = count - 1 # Step 4: write patch list and revision list to file, for user to edit later patchlist_file = os.path.join(os.getcwd(), patch_dir, "patchlist-%s" % name) repo['patchlist'] = patchlist_file f = open(patchlist_file, 'w') - count=len(revlist)-1 + count = len(revlist) - 1 for patch in patchlist: f.write("%s %s\n" % (patch, revlist[count])) check_patch(os.path.join(patch_dir, patch)) - count=count-1 + count = count - 1 f.close() # Step 5: invoke bash for user to edit patch and patch list
@@ -1206,7 +1206,7 @@ def find_revs(old2new, head): num_known = len(old2new) log = runcmd("git log --grep='From .* rev: [a-fA-F0-9][a-fA-F0-9]*' --pretty=format:%H%x00%B%x00 " + head).split(chr(0)) regex = re.compile(r'From .* rev: ([a-fA-F0-9]+)') - for new_rev, body in zip(*[iter(log)]* 2): + for new_rev, body in zip(*[iter(log)] * 2): # Use the last one, in the unlikely case there are more than one. rev = regex.findall(body)[-1] if rev not in old2new:
@@ -1232,7 +1232,7 @@ def apply_commit(parent, rev, largs, wargs, dest_dir, file_filter=None): if parent: # Apply delta. changes = runcmd("git diff-tree --no-commit-id --no-renames --name-status -r --raw -z %s %s" % (parent, rev), **largs).split(chr(0)) - for status, name in zip(*[iter(changes)]*2): + for status, name in zip(*[iter(changes)] * 2): if status[0] in "ACMRT": update.append(name) elif status[0] in "D":
scripts/contrib/image-manifest +1 -1
@@ -320,7 +320,7 @@ def export_manifest_info(args): json.dump(config, sys.stdout, indent=2) print('') - tmpoutdir = tempfile.mkdtemp(prefix=os.path.basename(__file__)+'-') + tmpoutdir = tempfile.mkdtemp(prefix=os.path.basename(__file__) + '-') logger.debug('tmp dir: %s' % tmpoutdir) # export manifest
scripts/contrib/patchreview.py +1 -1
@@ -129,7 +129,7 @@ def analyse(results, want_blame=False, verbose=True): if r.malformed_upstream_status or r.unknown_upstream_status: malformed_status += 1 # Count patches with no status as pending - pending_patches +=1 + pending_patches += 1 if r.missing_cve: missing_cve += 1 if r.upstream_status == "pending":
scripts/contrib/verify-homepage.py +1 -1
@@ -55,7 +55,7 @@ def verifyHomepage(bbhandler): checked.append(realfn) return count -if __name__=='__main__': +if __name__ == '__main__': with bb.tinfoil.Tinfoil() as bbhandler: bbhandler.prepare() logger.info("Start verifying HOMEPAGE:")
scripts/crosstap +2 -2
@@ -116,7 +116,7 @@ class BitbakeEnvInvocationException(Exception): self.message = message class BitbakeEnv(object): - BITBAKE="bitbake" + BITBAKE = "bitbake" def __init__(self, package): self.package = package
@@ -292,7 +292,7 @@ with --sysroot option. def __map_systemtap_arch(self): a = self.target_arch ret = a - if re.match('(athlon|x86.64)$', a): + if re.match('(athlon|x86.64)$', a): ret = 'x86_64' elif re.match('i.86$', a): ret = 'i386'
scripts/lib/build_perf/report.py +1 -1
@@ -268,7 +268,7 @@ class TimeVal(MeasurementVal): if self != self: return "null" hh, mm, ss = self.hms() - return [hh, mm, int(ss), int(ss*1000) % 1000] + return [hh, mm, int(ss), int(ss * 1000) % 1000] class SizeVal(MeasurementVal):
scripts/lib/buildstats.py +2 -2
@@ -303,10 +303,10 @@ def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None, only_ta continue if min_absdiff and abs(val2 - val1) < min_absdiff: log.debug("Filtering out %s:%s (difference of %s)", pkg, task, - val2-val1) + val2 - val1) continue tasks_diff.append(TaskDiff(pkg, pkg_op, task, task_op, val1, val2, - val2-val1, reldiff)) + val2 - val1, reldiff)) return tasks_diff
scripts/lib/devtool/deploy.py +1 -1
@@ -188,7 +188,7 @@ def deploy(args, config, basepath, workspace): if fstat.st_ino in inodes: fsize = 0 else: - fsize = int(math.ceil(float(fstat.st_size)/1024)) + fsize = int(math.ceil(float(fstat.st_size) / 1024)) inodes.add(fstat.st_ino) ftotalsize += fsize # The path as it would appear on the target
scripts/lib/devtool/standard.py +7 -7
@@ -751,7 +751,7 @@ def _check_preserve(config, recipename): def get_staging_kver(srcdir): # Kernel version from work-shared kerver = [] - staging_kerVer="" + staging_kerVer = "" if os.path.exists(srcdir) and os.listdir(srcdir): with open(os.path.join(srcdir,"Makefile")) as f: version = [next(f) for x in range(5)][1:4]
@@ -846,7 +846,7 @@ def modify(args, config, basepath, workspace): # Ignore local files with subdir={BP} srcabspath = os.path.abspath(srcsubdir) - local_files = [fname for fname in local_files if os.path.exists(os.path.join(workdir, fname)) and (srcabspath == workdir or not os.path.join(workdir, fname).startswith(srcabspath + os.sep))] + local_files = [fname for fname in local_files if os.path.exists(os.path.join(workdir, fname)) and (srcabspath == workdir or not os.path.join(workdir, fname).startswith(srcabspath + os.sep))] if local_files: for fname in local_files: _move_file(os.path.join(workdir, fname), os.path.join(srctree, 'oe-local-files', fname))
@@ -1079,7 +1079,7 @@ def rename(args, config, basepath, workspace): if newver: newappend = '%s_%s.bbappend' % (newname, newver) - newfile = '%s_%s.bb' % (newname, newver) + newfile = '%s_%s.bb' % (newname, newver) else: newappend = '%s.bbappend' % newname newfile = '%s.bb' % newname
@@ -1555,7 +1555,7 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi key, val in list(upd_f.items()) + list(new_f.items())) removevalues = {} if update_srcuri: - removevalues = {'SRC_URI': removedentries} + removevalues = {'SRC_URI': removedentries} patchfields['SRC_URI'] = '\\\n '.join(srcuri) if dry_run_outdir: logger.info('Creating bbappend (dry-run)')
@@ -1575,7 +1575,7 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi else: _move_file(os.path.join(local_files_dir, basepath), path, dry_run_outdir=dry_run_outdir, base_outdir=recipedir) - update_srcuri= True + update_srcuri = True for basepath, path in new_f.items(): logger.info('Adding new file %s%s' % (basepath, dry_run_suffix)) _move_file(os.path.join(local_files_dir, basepath),
@@ -1960,7 +1960,7 @@ def _reset(recipes, no_clean, remove_work, config, basepath, workspace): if os.listdir(srctreebase): if remove_work: logger.info('-r argument used on %s, removing source tree.' - ' You will lose any unsaved work' %pn) + ' You will lose any unsaved work' % pn) shutil.rmtree(srctreebase) else: # We don't want to risk wiping out any work in progress
@@ -2046,7 +2046,7 @@ def finish(args, config, basepath, workspace): raise DevtoolError('Source tree is not clean:\n\n%s\nEnsure you have committed your changes or use -f/--force if you are sure there\'s nothing that needs to be committed' % dirty) no_clean = args.no_clean - remove_work=args.remove_work + remove_work = args.remove_work tinfoil = setup_tinfoil(basepath=basepath, tracking=True) try: rd = parse_recipe(config, tinfoil, args.recipename, True)
scripts/lib/devtool/upgrade.py +3 -3
@@ -242,7 +242,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee pbar.start() batchsize = 100 for i in range(0, len(filelist), batchsize): - batch = filelist[i:i+batchsize] + batch = filelist[i:i + batchsize] __run('git add -f -A %s' % ' '.join(['"%s"' % item for item in batch])) pbar.update(i) pbar.finish()
@@ -610,7 +610,7 @@ def check_upgrade_status(args, config, basepath, workspace): result[1] if result[1] != 'UPDATE' else (result[3] if not result[3].endswith("new-commits-available") else "new commits"), result[4], result[5] if result[5] != 'N/A' else "", - "cannot be updated due to: %s" %(result[6]) if result[6] else "")) + "cannot be updated due to: %s" % (result[6]) if result[6] else "")) def register_commands(subparsers, context): """Register devtool subcommands from this plugin"""
@@ -621,7 +621,7 @@ def register_commands(subparsers, context): description='Upgrades an existing recipe to a new upstream version. Puts the upgraded recipe file into the workspace along with any associated files, and extracts the source tree to a specified location (in case patches need rebasing or adding to as a result of the upgrade).', group='starting') parser_upgrade.add_argument('recipename', help='Name of recipe to upgrade (just name - no version, path or extension)') - parser_upgrade.add_argument('srctree', nargs='?', help='Path to where to extract the source tree. If not specified, a subdirectory of %s will be used.' % defsrctree) + parser_upgrade.add_argument('srctree', nargs='?', help='Path to where to extract the source tree. If not specified, a subdirectory of %s will be used.' % defsrctree) parser_upgrade.add_argument('--version', '-V', help='Version to upgrade to (PV). If omitted, latest upstream version will be determined and used, if possible.') parser_upgrade.add_argument('--srcrev', '-S', help='Source revision to upgrade to (useful when fetching from an SCM such as git)') parser_upgrade.add_argument('--srcbranch', '-B', help='Branch in source repository containing the revision to use (if fetching from an SCM such as git)')
scripts/lib/recipetool/create.py +1 -1
@@ -997,7 +997,7 @@ def handle_license_vars(srctree, lines_before, handled, extravalues, d): if pos == -1: lines_before.extend(lines) else: - lines_before[pos:pos+1] = lines + lines_before[pos:pos + 1] = lines handled.append(('license', licvalues)) return licvalues
scripts/lib/recipetool/create_buildsys.py +1 -1
@@ -446,7 +446,7 @@ class AutotoolsRecipeHandler(RecipeHandler): def process_value(value): value = value.replace('[', '').replace(']', '') if value.startswith('m4_esyscmd(') or value.startswith('m4_esyscmd_s('): - cmd = subst_defines(value[value.index('(')+1:-1]) + cmd = subst_defines(value[value.index('(') + 1:-1]) try: if '|' in cmd: cmd = 'set -o pipefail; ' + cmd
scripts/lib/recipetool/create_buildsys_python.py +1 -1
@@ -607,7 +607,7 @@ def gather_setup_info(fileobj): if key == 'ext_modules': if isinstance(value, list): for ext in value: - if (isinstance(ext, ast.Call) and + if (isinstance(ext, ast.Call) and isinstance(ext.func, ast.Name) and ext.func.id == 'Extension' and not has_non_literals(ext.args)):
scripts/lib/recipetool/create_npm.py +1 -1
@@ -217,7 +217,7 @@ class NpmRecipeHandler(RecipeHandler): extravalues["extrafiles"]["npm-shrinkwrap.json"] = shrinkwrap_copy url_local = "npmsw://%s" % shrinkwrap_file - url_recipe= "npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json" + url_recipe = "npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json" if dev: url_local += ";dev=1"
scripts/lib/resulttool/manualexecution.py +1 -1
@@ -182,7 +182,7 @@ class ManualTestRunner(object): logger.info('Configuration option file created at %s' % config_options_file) def make_testcase_config_file(self, logger, case_file, testcase_config_file): - if testcase_config_file: + if testcase_config_file: if os.path.exists(testcase_config_file): print('\nTest configuration file with name %s already exists. Please provide a unique file name' % (testcase_config_file)) return 0
scripts/lib/resulttool/report.py +1 -1
@@ -271,7 +271,7 @@ class ResultsTextReport(object): testtype = str(key).split('.')[0] if ((machine in self.ltptests and testtype == "ltpiresult" and self.ltptests[machine]) or (machine in self.ltpposixtests and testtype == "ltpposixresult" and self.ltpposixtests[machine])): - print("Already have test results for %s on %s, skipping %s" %(str(key).split('.')[0], machine, resultid)) + print("Already have test results for %s on %s, skipping %s" % (str(key).split('.')[0], machine, resultid)) skip = True break if skip:
scripts/lib/resulttool/store.py +2 -2
@@ -31,7 +31,7 @@ def store(args, logger): if resultutils.is_url(args.source) or os.path.isfile(args.source): resultutils.append_resultsdata(results, args.source, configvars=configvars) else: - for root, dirs, files in os.walk(args.source): + for root, dirs, files in os.walk(args.source): for name in files: f = os.path.join(root, name) if name == "testresults.json":
@@ -78,7 +78,7 @@ def store(args, logger): [], [], False, keywords, logger) finally: - subprocess.check_call(["rm", "-rf", tempdir]) + subprocess.check_call(["rm", "-rf", tempdir]) return 0
scripts/lib/wic/engine.py +3 -3
@@ -263,7 +263,7 @@ class Disk: splitted = out.splitlines() # skip over possible errors in exec_cmd output try: - idx =splitted.index("BYT;") + idx = splitted.index("BYT;") except ValueError: raise WicError("Error getting partition information from %s" % (self.parted)) lsector_size, psector_size, self._ptable_format = splitted[idx + 1].split(":")[3:6]
@@ -328,7 +328,7 @@ class Disk: def copy(self, src, dest): """Copy partition image into wic image.""" - pnum = dest.part if isinstance(src, str) else src.part + pnum = dest.part if isinstance(src, str) else src.part if self.partitions[pnum].fstype.startswith('ext'): if isinstance(src, str):
@@ -543,7 +543,7 @@ class Disk: label = part.get("name") label_str = "-L {}".format(label) if label else '' out = exec_cmd("{} --probe {}".format(self.blkid, self._get_part_image(pnum))) - uuid = out[out.index("UUID=\"")+6:out.index("UUID=\"")+42] + uuid = out[out.index("UUID=\"") + 6:out.index("UUID=\"") + 42] uuid_str = "-U {}".format(uuid) if uuid else '' with open(partfname, 'w') as sparse: os.ftruncate(sparse.fileno(), part['size'] * self._lsector_size)
scripts/lib/wic/filemap.py +1 -1
@@ -490,7 +490,7 @@ class FilemapNobmap(_FilemapBase): """Refer the '_FilemapBase' class for the documentation.""" self._log.debug("FilemapNobmap: get_mapped_ranges(%d, %d(%d))" % (start, count, start + count - 1)) - yield (start, start + count -1) + yield (start, start + count - 1) def filemap(image, log=None): """
scripts/lib/wic/ksparser.py +1 -1
@@ -132,7 +132,7 @@ def systemidtype(arg): class KickStart(): """Kickstart parser implementation.""" - DEFAULT_EXTRA_SPACE = 10*1024 + DEFAULT_EXTRA_SPACE = 10 * 1024 DEFAULT_OVERHEAD_FACTOR = 1.3 def __init__(self, confpath):
scripts/lib/wic/misc.py +1 -1
@@ -117,7 +117,7 @@ def exec_cmd(cmd_and_args, as_shell=False): def find_executable(cmd, paths): recipe = cmd if recipe in NATIVE_RECIPES: - recipe = NATIVE_RECIPES[recipe] + recipe = NATIVE_RECIPES[recipe] provided = get_bitbake_var("ASSUME_PROVIDED") if provided and "%s-native" % recipe in provided: return True
scripts/lib/wic/plugins/imager/direct.py +1 -1
@@ -133,7 +133,7 @@ class DirectPlugin(ImagerPlugin): device_name = "LABEL=%s" % part.label else: # mmc device partitions are named mmcblk0p1, mmcblk0p2.. - prefix = 'p' if part.disk.startswith('mmcblk') else '' + prefix = 'p' if part.disk.startswith('mmcblk') else '' device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum) opts = part.fsopts if part.fsopts else "defaults"
scripts/oe-depends-dot +4 -4
@@ -51,9 +51,9 @@ class Dot(object): if rdep in chain: continue else: - for i in range(0, len(chain)-1): - if chain[i] in alldeps[rdep] and rdep in alldeps[chain[i+1]]: - chain.insert(i+1, rdep) + for i in range(0, len(chain) - 1): + if chain[i] in alldeps[rdep] and rdep in alldeps[chain[i + 1]]: + chain.insert(i + 1, rdep) inserted_elements.append(rdep) break if chain[-1] in alldeps[rdep] and rdep not in chain:
@@ -120,7 +120,7 @@ class Dot(object): child_deps |= depends[dep] reduced_depends[k] = deps - child_deps - outfile= '%s-reduced%s' % (self.args.dotfile[0][:-4], self.args.dotfile[0][-4:]) + outfile = '%s-reduced%s' % (self.args.dotfile[0][:-4], self.args.dotfile[0][-4:]) with open(outfile, 'w') as f: print('Saving reduced dot file to %s' % outfile) f.write('digraph depends {\n')
scripts/oe-pkgdata-browser +1 -1
@@ -32,7 +32,7 @@ def timeit(f): result = f(*args, **kw) te = time.time() print('func:%r args:[%r, %r] took: %2.4f sec' % - (f.__name__, args, kw, te-ts)) + (f.__name__, args, kw, te - ts)) return result return timed
scripts/oepydevshell-internal.py +1 -1
@@ -22,7 +22,7 @@ def echonocbreak(fd): def cbreaknoecho(fd): old = termios.tcgetattr(fd) - old[3] = old[3] &~ termios.ECHO &~ termios.ICANON + old[3] = old[3] & ~ termios.ECHO & ~ termios.ICANON termios.tcsetattr(fd, termios.TCSADRAIN, old) if len(sys.argv) != 3 or sys.argv[1] in ('-h', '--help'):
scripts/pybootchartgui/pybootchartgui/draw.py +43 -43
220 lines not on this page · raw message
scripts/pybootchartgui/pybootchartgui/gui.py +7 -7
@@ -107,7 +107,7 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): self.queue_draw() def zoom_to_rect(self, rect): - zoom_ratio = float(rect.width)/float(self.chart_width) + zoom_ratio = float(rect.width) / float(self.chart_width) self.zoom_image(zoom_ratio) self.x = 0 self.position_changed()
@@ -148,13 +148,13 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): def on_key_press_event(self, widget, event): if event.keyval == Gdk.keyval_from_name("Left"): - self.x -= self.POS_INCREMENT/self.zoom_ratio + self.x -= self.POS_INCREMENT / self.zoom_ratio elif event.keyval == Gdk.keyval_from_name("Right"): - self.x += self.POS_INCREMENT/self.zoom_ratio + self.x += self.POS_INCREMENT / self.zoom_ratio elif event.keyval == Gdk.keyval_from_name("Up"): - self.y -= self.POS_INCREMENT/self.zoom_ratio + self.y -= self.POS_INCREMENT / self.zoom_ratio elif event.keyval == Gdk.keyval_from_name("Down"): - self.y += self.POS_INCREMENT/self.zoom_ratio + self.y += self.POS_INCREMENT / self.zoom_ratio else: return False self.bound_vals()
@@ -196,8 +196,8 @@ class PyBootchartWidget(gtk.DrawingArea, gtk.Scrollable): if state & Gdk.ModifierType.BUTTON2_MASK or state & Gdk.ModifierType.BUTTON1_MASK: x, y = int(event.x), int(event.y) # pan the image - self.x += (self.prevmousex - x)/self.zoom_ratio - self.y += (self.prevmousey - y)/self.zoom_ratio + self.x += (self.prevmousex - x) / self.zoom_ratio + self.y += (self.prevmousey - y) / self.zoom_ratio self.bound_vals() self.queue_draw() self.prevmousex = x
scripts/pybootchartgui/pybootchartgui/main.py.in +1 -1
@@ -139,7 +139,7 @@ def main(argv=None): else: duration = proc_tree.duration dur = duration / 100.0 - print('%02d:%05.2f' % (math.floor(dur/60), dur - 60 * math.floor(dur/60))) + print('%02d:%05.2f' % (math.floor(dur / 60), dur - 60 * math.floor(dur / 60))) else: if options.annotate_file: f = open(options.annotate_file, "w")
scripts/pybootchartgui/pybootchartgui/parsing.py +10 -10
@@ -38,7 +38,7 @@ class Trace: self.min = None self.max = None self.headers = None - self.disk_stats = [] + self.disk_stats = [] self.ps_stats = None self.taskstats = None self.cpu_stats = []
@@ -177,12 +177,12 @@ class Trace: k = j + 1 while k < len(util) and util[k][0] < start + 300: k += 1 - k = min(k, len(util)-1) + k = min(k, len(util) - 1) if util[j][1] >= 0.25: return False - avgload = sum(u[1] for u in util[j:k+1]) / (k-j+1) + avgload = sum(u[1] for u in util[j:k + 1]) / (k - j + 1) if avgload < 0.25: return True else:
@@ -304,8 +304,8 @@ def _parse_proc_ps_log(writer, file): continue offset = [index for index, token in enumerate(tokens[1:]) if token[-1] == ')'][0] - pid, cmd, state, ppid = int(tokens[0]), ' '.join(tokens[1:2+offset]), tokens[2+offset], int(tokens[3+offset]) - userCpu, sysCpu, stime = int(tokens[13+offset]), int(tokens[14+offset]), int(tokens[21+offset]) + pid, cmd, state, ppid = int(tokens[0]), ' '.join(tokens[1:2 + offset]), tokens[2 + offset], int(tokens[3 + offset]) + userCpu, sysCpu, stime = int(tokens[13 + offset]), int(tokens[14 + offset]), int(tokens[21 + offset]) # magic fixed point-ness ... pid *= 1000
@@ -330,7 +330,7 @@ def _parse_proc_ps_log(writer, file): return None startTime = timed_blocks[0][0] - avgSampleLength = (ltime - startTime)/(len(timed_blocks) - 1) + avgSampleLength = (ltime - startTime) / (len(timed_blocks) - 1) return ProcessStats(writer, processMap, len(timed_blocks), avgSampleLength, startTime, ltime)
@@ -417,7 +417,7 @@ def _parse_taskstats_log(writer, file): return None startTime = timed_blocks[0][0] - avgSampleLength = (ltime - startTime)/(len(timed_blocks)-1) + avgSampleLength = (ltime - startTime) / (len(timed_blocks) - 1) return ProcessStats(writer, processMap, len(timed_blocks), avgSampleLength, startTime, ltime)
@@ -438,7 +438,7 @@ def _parse_proc_stat_log(file): iowait = float(times[4] - ltimes[4]) aSum = max(user + system + idle + iowait, 1) - samples.append(CPUSample(time, user/aSum, system/aSum, iowait/aSum)) + samples.append(CPUSample(time, user / aSum, system / aSum, iowait / aSum)) ltimes = times # skip the rest of statistics lines
@@ -644,7 +644,7 @@ def _parse_pacct(writer, file): # read LE int32 def _read_le_int32(file): byts = file.read(4) - return (ord(byts[0])) | (ord(byts[1]) << 8) | \ + return (ord(byts[0])) | (ord(byts[1]) << 8) | \ (ord(byts[2]) << 16) | (ord(byts[3]) << 24) parent_map = {}
@@ -746,7 +746,7 @@ def _do_parse(writer, state, filename, file): elif not filename.endswith('.log'): _parse_bitbake_buildstats(writer, state, filename, file) t2 = time.process_time() - writer.info(" %s seconds" % str(t2-t1)) + writer.info(" %s seconds" % str(t2 - t1)) return state def parse_file(writer, state, filename):
scripts/pybootchartgui/pybootchartgui/process_tree.py +3 -3
@@ -246,11 +246,11 @@ class ProcessTree: """ num_removed = 0 idx = 0 - while idx < len(process_subtree)-1: + while idx < len(process_subtree) - 1: p = process_subtree[idx] - nextp = process_subtree[idx+1] + nextp = process_subtree[idx + 1] if nextp.cmd == p.cmd: - process_subtree.pop(idx+1) + process_subtree.pop(idx + 1) idx -= 1 num_removed += 1 p.child_list.extend(nextp.child_list)
scripts/pybootchartgui/pybootchartgui/samples.py +1 -1
@@ -143,7 +143,7 @@ class Process: activeCount = sum([1 for sample in self.samples if sample.cpu_sample and sample.cpu_sample.sys + sample.cpu_sample.user + sample.cpu_sample.io > 0.0]) activeCount = activeCount + sum([1 for sample in self.samples if sample.state == 'D']) - self.active = (activeCount>2) + self.active = (activeCount > 2) def calc_load(self, userCpu, sysCpu, interval): userCpuLoad = float(userCpu - self.last_user_cpu_time) / interval
scripts/pybootchartgui/pybootchartgui/tests/parser_test.py +1 -1
@@ -15,7 +15,7 @@ import pybootchartgui.main as main debug = False def floatEq(f1, f2): - return math.fabs(f1-f2) < 0.00001 + return math.fabs(f1 - f2) < 0.00001 bootchart_dir = os.path.join(os.path.dirname(sys.argv[0]), '../../examples/1/') parser = main._mk_options_parser()
scripts/pythondeps +2 -2
@@ -80,7 +80,7 @@ def get_provides(path): else: libdir = '' - package_relpath = pkg_path[len(libdir)+1:] + package_relpath = pkg_path[len(libdir) + 1:] package = '.'.join(package_relpath.split(os.sep)) if not isdir: yield package, path
@@ -89,7 +89,7 @@ def get_provides(path): yield package, path for dirpath, dirnames, filenames in os.walk(path): - relpath = dirpath[len(path)+1:] + relpath = dirpath[len(path) + 1:] if relpath: if '__init__.py' not in filenames: dirnames[:] = []
scripts/relocate_sdk.py +3 -3
@@ -31,7 +31,7 @@ old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##")) def get_arch(): f.seek(0) - e_ident =f.read(16) + e_ident = f.read(16) ei_mag0,ei_mag1_3,ei_class = struct.unpack("<B3sB11x", e_ident) if (ei_mag0 != 0x7f and ei_mag1_3 != "ELF") or ei_class == 0:
@@ -217,10 +217,10 @@ executables_list = sys.argv[3:] for e in executables_list: perms = os.stat(e)[stat.ST_MODE] - if os.access(e, os.W_OK|os.R_OK): + if os.access(e, os.W_OK | os.R_OK): perms = None else: - os.chmod(e, perms|stat.S_IRWXU) + os.chmod(e, perms | stat.S_IRWXU) try: f = open(e, "r+b")
scripts/runqemu +12 -12
@@ -217,7 +217,7 @@ class BaseConfig(object): logger.debug("Acquiring lockfile %s..." % self.taplock) try: self.taplock_descriptor = open(self.taplock, 'w') - fcntl.flock(self.taplock_descriptor, fcntl.LOCK_EX|fcntl.LOCK_NB) + fcntl.flock(self.taplock_descriptor, fcntl.LOCK_EX | fcntl.LOCK_NB) except Exception as e: msg = "Acquiring lockfile %s failed: %s" % (self.taplock, e) if error:
@@ -261,7 +261,7 @@ class BaseConfig(object): try: portlock_descriptor = open(lockfile, 'w') self.portlocks.update({lockfile: portlock_descriptor}) - fcntl.flock(self.portlocks[lockfile], fcntl.LOCK_EX|fcntl.LOCK_NB) + fcntl.flock(self.portlocks[lockfile], fcntl.LOCK_EX | fcntl.LOCK_NB) except Exception as e: msg = "Acquiring lockfile %s failed: %s" % (lockfile, e) logger.info(msg)
@@ -352,7 +352,7 @@ class BaseConfig(object): elif re.search('\.bin$', p) or re.search('bzImage', p) or \ re.search('zImage', p) or re.search('vmlinux', p) or \ re.search('fitImage', p) or re.search('uImage', p): - self.kernel = p + self.kernel = p elif os.path.exists(p) and (not os.path.isdir(p)) and '-image-' in os.path.basename(p): self.rootfs = p # Check filename against self.fstypes can hanlde <file>.cpio.gz,
@@ -365,7 +365,7 @@ class BaseConfig(object): if not fst: m = re.search('.*\.(.*)$', self.rootfs) if m: - fst = m.group(1) + fst = m.group(1) if fst: self.check_arg_fstype(fst) qb = re.sub('\.' + fst + "$", '', self.rootfs)
@@ -565,7 +565,7 @@ class BaseConfig(object): logger.error("For further help see:") raise RunQemuError(yocto_kvm_wiki) - if os.access(dev_kvm, os.W_OK|os.R_OK): + if os.access(dev_kvm, os.W_OK | os.R_OK): self.qemu_opt_script += ' -enable-kvm' if self.get('MACHINE') == "qemux86": # Workaround for broken APIC window on pre 4.15 host kernels which causes boot hangs
@@ -583,7 +583,7 @@ class BaseConfig(object): logger.error("For further help see:") raise RunQemuError(yocto_paravirt_kvm_wiki) - if not os.access(dev_vhost, os.W_OK|os.R_OK): + if not os.access(dev_vhost, os.W_OK | os.R_OK): logger.error("You have no read or write permission on /dev/vhost-net.") logger.error("Please change the ownership of this file as described at:") raise RunQemuError(yocto_paravirt_kvm_wiki)
@@ -856,7 +856,7 @@ class BaseConfig(object): self.qemuboot = "%s/%s-%s.qemuboot.conf" % (deploy_dir_image, self.rootfs, machine) else: - cmd = 'ls -t %s/*.qemuboot.conf' % deploy_dir_image + cmd = 'ls -t %s/*.qemuboot.conf' % deploy_dir_image logger.debug('Running %s...' % cmd) try: qbs = subprocess.check_output(cmd, shell=True).decode('utf-8')
@@ -958,7 +958,7 @@ class BaseConfig(object): except KeyError: fstype_flags = '' logoutput.append('FSTYPE: [%s%s]' % (self.fstype, fstype_flags)) - if self.fstype == 'nfs': + if self.fstype == 'nfs': logoutput.append('NFS_DIR: [%s]' % self.rootfs) else: logoutput.append('ROOTFS: [%s]' % self.rootfs)
@@ -998,7 +998,7 @@ class BaseConfig(object): # Use '%s' since they are integers os.putenv(k, '%s' % v) - self.unfs_opts="nfsvers=3,port=%s,tcp,mountport=%s" % (nfsd_port, mountd_port) + self.unfs_opts = "nfsvers=3,port=%s,tcp,mountport=%s" % (nfsd_port, mountd_port) # Extract .tar.bz2 or .tar.bz if no nfs dir if not (self.rootfs and os.path.isdir(self.rootfs)):
@@ -1127,7 +1127,7 @@ class BaseConfig(object): if self.acquire_taplock(error=False): tap = p logger.info("Using preconfigured tap device %s" % tap) - logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." %(lockfile, tap)) + logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." % (lockfile, tap)) break if not tap:
@@ -1354,13 +1354,13 @@ class BaseConfig(object): self.qemu_opt += 'gl=es,' self.qemu_opt += 'show-cursor=on' - self.qemu_opt += ' %s' %self.get('QB_GRAPHICS') + self.qemu_opt += ' %s' % self.get('QB_GRAPHICS') def setup_serial(self): # Setup correct kernel command line for serial if self.serialstdio == True or self.serialconsole == True or self.nographic == True or self.tcpserial_portnum: for entry in self.get('SERIAL_CONSOLES').split(' '): - self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1] + self.kernel_cmdline_script += ' console=%s' % entry.split(';')[1] if self.serialstdio == True or self.nographic == True: self.qemu_opt += " -serial mon:stdio"
scripts/send-error-report +6 -6
@@ -66,7 +66,7 @@ def edit_content(json_file_path): def prepare_data(args): # attempt to get the max_log_size from the server's settings - max_log_size = getPayloadLimit(args.protocol+args.server+"/ClientPost/JSON") + max_log_size = getPayloadLimit(args.protocol + args.server + "/ClientPost/JSON") if not os.path.isfile(args.error_file): log.error("No data file found.")
@@ -89,7 +89,7 @@ def prepare_data(args): pass if args.assume_yes == True and len(args.name) == 0: - log.error("Name needs to be provided either via "+userfile+" or as an argument (-n).") + log.error("Name needs to be provided either via " + userfile + " or as an argument (-n).") sys.exit(1) while len(args.name) <= 0 or len(args.name) > 50:
@@ -133,12 +133,12 @@ def prepare_data(args): def send_data(data, args): - headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version} + headers = {'Content-type': 'application/json', 'User-Agent': "send-error-report/" + version} if args.json: - url = args.protocol+args.server+"/ClientPost/JSON/" + url = args.protocol + args.server + "/ClientPost/JSON/" else: - url = args.protocol+args.server+"/ClientPost/" + url = args.protocol + args.server + "/ClientPost/" req = urllib.request.Request(url, data=data, headers=headers) try:
@@ -201,7 +201,7 @@ if __name__ == '__main__': args = arg_parse.parse_args() if (args.json == False): - print("Preparing to send errors to: "+args.server) + print("Preparing to send errors to: " + args.server) data = prepare_data(args) send_data(data, args)
scripts/sysroot-relativelinks.py +2 -2
@@ -23,9 +23,9 @@ def handlelink(filep, subdir): if link.startswith(topdir): return #print("Replacing %s with %s for %s" % (link, topdir+link, filep)) - print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir+link, subdir), filep)) + print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir + link, subdir), filep)) os.unlink(filep) - os.symlink(os.path.relpath(topdir+link, subdir), filep) + os.symlink(os.path.relpath(topdir + link, subdir), filep) for subdir, dirs, files in os.walk(topdir): for f in dirs + files:
scripts/task-time +7 -7
@@ -41,11 +41,11 @@ sorted in descending order from the highest value. args = arg_parser.parse_args() # Field names and regexes for parsing out their values from buildstat files -field_regexes = (("elapsed", ".*Elapsed time: ([0-9.]+)"), - ("user", "rusage ru_utime: ([0-9.]+)"), - ("sys", "rusage ru_stime: ([0-9.]+)"), +field_regexes = (("elapsed", ".*Elapsed time: ([0-9.]+)"), + ("user", "rusage ru_utime: ([0-9.]+)"), + ("sys", "rusage ru_stime: ([0-9.]+)"), ("child user", "Child rusage ru_utime: ([0-9.]+)"), - ("child sys", "Child rusage ru_stime: ([0-9.]+)")) + ("child sys", "Child rusage ru_stime: ([0-9.]+)")) # A list of (<path>, <dict>) tuples, where <path> is the path of a do_* task # buildstat file and <dict> maps fields from the file to their values
@@ -127,9 +127,9 @@ try: "user\t{}m{:.3f}s\n" "sys\t{}m{:.3f}s" .format(task_info[0], - int(real//60), real%60, - int(user//60), user%60, - int(sys//60), sys%60)) + int(real // 60), real % 60, + int(user // 60), user % 60, + int(sys // 60), sys % 60)) except BrokenPipeError: pass
scripts/tiny/ksize.py +5 -5
@@ -40,7 +40,7 @@ class Sizes: def show(self, indent=""): print("%-32s %10d | %10d %10d %10d" % - (indent+self.title, self.total, self.text, self.data, self.bss)) + (indent + self.title, self.total, self.text, self.data, self.bss)) class Report:
@@ -86,7 +86,7 @@ class Report: def show(self, indent=""): rule = str.ljust(indent, 80, '-') print("%-32s %10s | %10s %10s %10s" % - (indent+self.title, "total", "text", "data", "bss")) + (indent + self.title, "total", "text", "data", "bss")) print(rule) self.sizes.show(indent) print(rule)
@@ -95,10 +95,10 @@ class Report: p.sizes.show(indent) print(rule) print("%-32s %10d | %10d %10d %10d" % - (indent+"sum", self.totals["total"], self.totals["text"], + (indent + "sum", self.totals["total"], self.totals["text"], self.totals["data"], self.totals["bss"])) print("%-32s %10d | %10d %10d %10d" % - (indent+"delta", self.deltas["total"], self.deltas["text"], + (indent + "delta", self.deltas["total"], self.deltas["text"], self.deltas["data"], self.deltas["bss"])) print("\n")
@@ -140,7 +140,7 @@ def main(): assert False, "unhandled option" glob = "arch/*/built-in.[o,a] */built-in.[o,a]" - vmlinux = Report.create("vmlinux", "Linux Kernel", glob) + vmlinux = Report.create("vmlinux", "Linux Kernel", glob) vmlinux.show() for b in vmlinux.parts:
scripts/verify-bashisms +1 -1
@@ -95,7 +95,7 @@ def get_tinfoil(): # tinfoil.logger.setLevel(logging.WARNING) return tinfoil -if __name__=='__main__': +if __name__ == '__main__': import argparse import shutil
scripts/wic +15 -15
@@ -277,31 +277,31 @@ wic_help_topic_usage = """ """ helptopics = { - "plugins": [wic_help_topic_subcommand, + "plugins": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_plugins_help], - "overview": [wic_help_topic_subcommand, + "overview": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_overview_help], "kickstart": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_kickstart_help], - "create": [wic_help_topic_subcommand, + "create": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_create_help], - "ls": [wic_help_topic_subcommand, + "ls": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_ls_help], - "cp": [wic_help_topic_subcommand, + "cp": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_cp_help], - "rm": [wic_help_topic_subcommand, + "rm": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_rm_help], - "write": [wic_help_topic_subcommand, + "write": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_write_help], - "list": [wic_help_topic_subcommand, + "list": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_list_help] }
@@ -458,31 +458,31 @@ def wic_init_parser_help(subparser): subcommands = { - "create": [wic_create_subcommand, + "create": [wic_create_subcommand, hlp.wic_create_usage, hlp.wic_create_help, wic_init_parser_create], - "list": [wic_list_subcommand, + "list": [wic_list_subcommand, hlp.wic_list_usage, hlp.wic_list_help, wic_init_parser_list], - "ls": [wic_ls_subcommand, + "ls": [wic_ls_subcommand, hlp.wic_ls_usage, hlp.wic_ls_help, wic_init_parser_ls], - "cp": [wic_cp_subcommand, + "cp": [wic_cp_subcommand, hlp.wic_cp_usage, hlp.wic_cp_help, wic_init_parser_cp], - "rm": [wic_rm_subcommand, + "rm": [wic_rm_subcommand, hlp.wic_rm_usage, hlp.wic_rm_help, wic_init_parser_rm], - "write": [wic_write_subcommand, + "write": [wic_write_subcommand, hlp.wic_write_usage, hlp.wic_write_help, wic_init_parser_write], - "help": [wic_help_subcommand, + "help": [wic_help_subcommand, wic_help_topic_usage, hlp.wic_help_help, wic_init_parser_help]
scripts/yocto-check-layer +1 -1
@@ -219,7 +219,7 @@ def main(): if __name__ == '__main__': try: - ret = main() + ret = main() except Exception: ret = 1 import traceback
Signature · 1 line
2.32.0
PATCH 6/8 PEP8 double aggressive E225 ~ E228 and E231
In reply to Khem RajFrom: persianpros <[email protected]>
--- meta-selftest/lib/devtool/bbpath.py | 2 +- meta-selftest/lib/recipetool/bbpath.py | 2 +- meta/lib/oe/buildhistory_analysis.py | 18 +++++++------- meta/lib/oe/cve_check.py | 2 +- meta/lib/oe/data.py | 4 ++-- meta/lib/oe/distro_check.py | 4 ++-- meta/lib/oe/elf.py | 14 +++++------ meta/lib/oe/gpg_sign.py | 4 ++-- meta/lib/oe/lsb.py | 2 +- meta/lib/oe/package.py | 2 +- meta/lib/oe/package_manager/__init__.py | 4 ++-- meta/lib/oe/package_manager/ipk/__init__.py | 2 +- meta/lib/oe/package_manager/rpm/__init__.py | 10 ++++---- meta/lib/oe/patch.py | 2 +- meta/lib/oe/prservice.py | 12 +++++----- meta/lib/oe/recipeutils.py | 6 ++--- meta/lib/oe/sdk.py | 2 +- meta/lib/oe/terminal.py | 4 ++-- meta/lib/oe/utils.py | 2 +- meta/lib/oeqa/core/loader.py | 2 +- meta/lib/oeqa/core/tests/cases/data.py | 2 +- meta/lib/oeqa/oetest.py | 6 ++--- meta/lib/oeqa/runexported.py | 2 +- meta/lib/oeqa/runtime/cases/boot.py | 2 +- meta/lib/oeqa/runtime/cases/df.py | 2 +- meta/lib/oeqa/runtime/cases/dnf.py | 6 ++--- .../oeqa/runtime/cases/ethernet_ip_connman.py | 6 ++--- meta/lib/oeqa/runtime/cases/ltp.py | 2 +- meta/lib/oeqa/runtime/cases/oe_syslog.py | 2 +- meta/lib/oeqa/runtime/cases/parselogs.py | 2 +- meta/lib/oeqa/runtime/cases/ping.py | 2 +- meta/lib/oeqa/runtime/cases/rpm.py | 2 +- meta/lib/oeqa/runtime/cases/systemd.py | 6 ++--- meta/lib/oeqa/selftest/cases/bbtests.py | 6 ++--- meta/lib/oeqa/selftest/cases/cve_check.py | 24 +++++++++---------- meta/lib/oeqa/selftest/cases/devtool.py | 24 +++++++++---------- meta/lib/oeqa/selftest/cases/fitimage.py | 12 +++++----- meta/lib/oeqa/selftest/cases/imagefeatures.py | 4 ++-- meta/lib/oeqa/selftest/cases/manifest.py | 2 +- meta/lib/oeqa/selftest/cases/meta_ide.py | 2 +- .../oeqa/selftest/cases/oelib/buildhistory.py | 4 ++-- meta/lib/oeqa/selftest/cases/oescripts.py | 2 +- meta/lib/oeqa/selftest/cases/runtime_test.py | 8 +++---- meta/lib/oeqa/selftest/cases/sstatetests.py | 2 +- meta/lib/oeqa/selftest/cases/wic.py | 8 +++---- meta/lib/oeqa/utils/decorators.py | 22 ++++++++--------- meta/lib/oeqa/utils/package_manager.py | 4 ++-- meta/lib/oeqa/utils/qemurunner.py | 6 ++--- meta/lib/oeqa/utils/qemutinyrunner.py | 8 +++---- meta/lib/oeqa/utils/testexport.py | 18 +++++++------- .../python/python3/create_manifest3.py | 18 +++++++------- .../python/python3/get_module_deps3.py | 14 +++++------ .../perf/perf/sort-pmuevents.py | 2 +- meta/recipes-rt/rt-tests/files/rt_bmark.py | 2 +- scripts/combo-layer | 10 ++++---- scripts/contrib/image-manifest | 12 +++++----- scripts/contrib/list-packageconfig-flags.py | 2 +- scripts/install-buildtools | 2 +- scripts/lib/buildstats.py | 2 +- scripts/lib/devtool/export.py | 2 +- scripts/lib/devtool/menuconfig.py | 16 ++++++------- scripts/lib/devtool/standard.py | 22 ++++++++--------- scripts/lib/devtool/upgrade.py | 6 ++--- scripts/lib/recipetool/append.py | 4 ++-- scripts/lib/recipetool/create.py | 2 +- scripts/lib/recipetool/create_buildsys.py | 2 +- scripts/lib/resulttool/manualexecution.py | 8 +++---- scripts/lib/resulttool/report.py | 2 +- scripts/lib/wic/engine.py | 2 +- scripts/lib/wic/plugins/imager/direct.py | 4 ++-- scripts/oe-pkgdata-util | 2 +- scripts/opkg-query-helper.py | 8 +++---- scripts/pybootchartgui/pybootchartgui/draw.py | 2 +- .../pybootchartgui/pybootchartgui/parsing.py | 4 ++-- .../pybootchartgui/pybootchartgui/samples.py | 2 +- .../pybootchartgui/tests/parser_test.py | 2 +- .../pybootchartgui/tests/process_tree_test.py | 2 +- scripts/relocate_sdk.py | 6 ++--- scripts/runqemu | 4 ++-- scripts/tiny/ksize.py | 4 ++-- scripts/wic | 2 +- 81 files changed, 235 insertions(+), 235 deletions(-)
meta-selftest/lib/devtool/bbpath.py +1 -1
@@ -14,7 +14,7 @@ def print_name(args, config, basepath, workspace): print(__file__) def print_bbdir(args, config, basepath, workspace): - print(__file__.replace('/lib/devtool/bbpath.py','')) + print(__file__.replace('/lib/devtool/bbpath.py', '')) def print_registered(args, config, basepath, workspace): global kept_context
meta-selftest/lib/recipetool/bbpath.py +1 -1
@@ -14,7 +14,7 @@ def print_name(opts): print(__file__) def print_bbdir(opts): - print(__file__.replace('/lib/recipetool/bbpath.py','')) + print(__file__.replace('/lib/recipetool/bbpath.py', '')) def print_registered(opts): #global kept_context
meta/lib/oe/buildhistory_analysis.py +9 -9
@@ -79,9 +79,9 @@ class ChangeRecord: def pkglist_combine(depver): pkglist = [] - for k,v in depver.items(): + for k, v in depver.items(): if v: - pkglist.append("%s (%s)" % (k,v)) + pkglist.append("%s (%s)" % (k, v)) else: pkglist.append(k) return pkglist
@@ -98,9 +98,9 @@ class ChangeRecord: rename = False for dir2, files2 in files_ba: if files1 == files2 and not rename: - renamed_dirs.append((dir1,dir2)) + renamed_dirs.append((dir1, dir2)) # Make sure that we don't use this (dir, files) pair again. - files_ba.remove((dir2,files2)) + files_ba.remove((dir2, files2)) # If a dir has already been found to have a rename, stop and go no further. rename = True
@@ -261,7 +261,7 @@ def blob_to_dict(blob): alines = [line for line in blob.data_stream.read().decode('utf-8').splitlines()] adict = {} for line in alines: - splitv = [i.strip() for i in line.split('=',1)] + splitv = [i.strip() for i in line.split('=', 1)] if len(splitv) > 1: adict[splitv[0]] = splitv[1] return adict
@@ -271,7 +271,7 @@ def file_list_to_dict(lines): adict = {} for line in lines: # Leave the last few fields intact so we handle file names containing spaces - splitv = line.split(None,4) + splitv = line.split(None, 4) # Grab the path and remove the leading . path = splitv[4][1:].strip() # Handle symlinks
@@ -639,7 +639,7 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep elif filename == 'sysroot': alines = d.a_blob.data_stream.read().decode('utf-8').splitlines() blines = d.b_blob.data_stream.read().decode('utf-8').splitlines() - filechanges = compare_file_lists(alines,blines, compare_ownership=False) + filechanges = compare_file_lists(alines, blines, compare_ownership=False) if filechanges: chg = ChangeRecord(path, filename, None, None, True) chg.filechanges = filechanges
@@ -651,7 +651,7 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep if filename == 'files-in-image.txt': alines = d.a_blob.data_stream.read().decode('utf-8').splitlines() blines = d.b_blob.data_stream.read().decode('utf-8').splitlines() - filechanges = compare_file_lists(alines,blines) + filechanges = compare_file_lists(alines, blines) if filechanges: chg = ChangeRecord(path, filename, None, None, True) chg.filechanges = filechanges
@@ -659,7 +659,7 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep elif filename == 'installed-package-names.txt': alines = d.a_blob.data_stream.read().decode('utf-8').splitlines() blines = d.b_blob.data_stream.read().decode('utf-8').splitlines() - filechanges = compare_lists(alines,blines) + filechanges = compare_lists(alines, blines) if filechanges: chg = ChangeRecord(path, filename, None, None, True) chg.filechanges = filechanges
meta/lib/oe/cve_check.py +1 -1
@@ -27,7 +27,7 @@ class Version(): raise Exception("Invalid version: '{0}'".format(version)) self._version = _Version( - release=tuple(int(i) for i in match.group("release").replace("-",".").split(".")), + release=tuple(int(i) for i in match.group("release").replace("-", ".").split(".")), patch_l=match.group("patch_l") if str(suffix) in suffixes and match.group("patch_l") else "", pre_l=match.group("pre_l"), pre_v=match.group("pre_v")
meta/lib/oe/data.py +2 -2
@@ -21,7 +21,7 @@ def typed_value(key, d): except (TypeError, ValueError) as exc: bb.msg.fatal("Data", "%s: %s" % (key, str(exc))) -def export2json(d, json_file, expand=True, searchString="",replaceString=""): +def export2json(d, json_file, expand=True, searchString="", replaceString=""): data2export = {} keys2export = []
@@ -41,7 +41,7 @@ def export2json(d, json_file, expand=True, searchString="",replaceString=""): for key in keys2export: try: - data2export[key] = d.getVar(key, expand).replace(searchString,replaceString) + data2export[key] = d.getVar(key, expand).replace(searchString, replaceString) except bb.data_smart.ExpansionError: data2export[key] = '' except AttributeError:
meta/lib/oe/distro_check.py +2 -2
@@ -14,7 +14,7 @@ def get_links_from_url(url, d): from bs4 import BeautifulSoup, SoupStrainer - soup = BeautifulSoup(create_socket(url,d), "html.parser", parse_only=SoupStrainer("a")) + soup = BeautifulSoup(create_socket(url, d), "html.parser", parse_only=SoupStrainer("a")) hyperlinks = [] for line in soup.find_all('a', href=True): hyperlinks.append(line['href'].strip('/'))
@@ -246,7 +246,7 @@ def compare_in_distro_packages_list(distro_check_dir, d): bb.note("Recipe: %s" % recipe_name) - distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'}) + distro_exceptions = dict({"OE-Core": 'OE-Core', "OpenedHand": 'OpenedHand', "Intel": 'Intel', "Upstream": 'Upstream', "Windriver": 'Windriver', "OSPDT": 'OSPDT Approved', "Poky": 'poky'}) tmp = localdata.getVar('DISTRO_PN_ALIAS') or "" for str in tmp.split(): if str and str.find("=") == -1 and distro_exceptions[str]:
meta/lib/oe/elf.py +7 -7
@@ -13,7 +13,7 @@ def machine_dict(d): }, "elf": { "aarch64": (183, 0, 0, True, 64), - "aarch64_be":(183, 0, 0, False, 64), + "aarch64_be": (183, 0, 0, False, 64), "i586": (3, 0, 0, True, 32), "i686": (3, 0, 0, True, 32), "x86_64": (62, 0, 0, True, 64),
@@ -22,14 +22,14 @@ def machine_dict(d): "mips": (8, 0, 0, False, 32), "mipsel": (8, 0, 0, True, 32), "microblaze": (189, 0, 0, False, 32), - "microblazeel":(189, 0, 0, True, 32), + "microblazeel": (189, 0, 0, True, 32), "powerpc": (20, 0, 0, False, 32), "riscv32": (243, 0, 0, True, 32), "riscv64": (243, 0, 0, True, 64), }, "linux": { "aarch64": (183, 0, 0, True, 64), - "aarch64_be":(183, 0, 0, False, 64), + "aarch64_be": (183, 0, 0, False, 64), "arm": (40, 97, 0, True, 32), "armeb": (40, 97, 0, False, 32), "powerpc": (20, 0, 0, False, 32),
@@ -59,11 +59,11 @@ def machine_dict(d): "sh4": (42, 0, 0, True, 32), "sparc": (2, 0, 0, False, 32), "microblaze": (189, 0, 0, False, 32), - "microblazeel":(189, 0, 0, True, 32), + "microblazeel": (189, 0, 0, True, 32), }, "linux-musl": { "aarch64": (183, 0, 0, True, 64), - "aarch64_be":(183, 0, 0, False, 64), + "aarch64_be": (183, 0, 0, False, 64), "arm": (40, 97, 0, True, 32), "armeb": (40, 97, 0, False, 32), "powerpc": (20, 0, 0, False, 32),
@@ -79,7 +79,7 @@ def machine_dict(d): "mips64": (8, 0, 0, False, 64), "mips64el": (8, 0, 0, True, 64), "microblaze": (189, 0, 0, False, 32), - "microblazeel":(189, 0, 0, True, 32), + "microblazeel": (189, 0, 0, True, 32), "riscv32": (243, 0, 0, True, 32), "riscv64": (243, 0, 0, True, 64), "sh4": (42, 0, 0, True, 32),
@@ -118,7 +118,7 @@ def machine_dict(d): "mips64": (8, 0, 0, False, 32), "mips64el": (8, 0, 0, True, 32), "mipsisa64r6": (8, 0, 0, False, 32), - "mipsisa64r6el":(8, 0, 0, True, 32), + "mipsisa64r6el": (8, 0, 0, True, 32), }, }
meta/lib/oe/gpg_sign.py +2 -2
@@ -41,7 +41,7 @@ class LocalSigner(object): cmd = self.rpm_bin + " --addsign --define '_gpg_name %s' " % keyid gpg_args = '--no-permission-warning --batch --passphrase=%s --agent-program=%s|--auto-expand-secmem' % (passphrase, self.gpg_agent_bin) - if self.gpg_version > (2,1,): + if self.gpg_version > (2, 1,): gpg_args += ' --pinentry-mode=loopback' cmd += "--define '_gpg_sign_cmd_extra_args %s' " % gpg_args cmd += "--define '_binary_filedigest_algorithm %s' " % digest
@@ -74,7 +74,7 @@ class LocalSigner(object): #gpg > 2.1 supports password pipes only through the loopback interface #gpg < 2.1 errors out if given unknown parameters - if self.gpg_version > (2,1,): + if self.gpg_version > (2, 1,): cmd += ['--pinentry-mode', 'loopback'] cmd += [input_file]
meta/lib/oe/lsb.py +1 -1
@@ -118,4 +118,4 @@ def distro_identifier(adjust_hook=None): id_str = '{0}-{1}'.format(distro_id, release) else: id_str = distro_id - return id_str.replace(' ','-').replace('/','-') + return id_str.replace(' ', '-').replace('/', '-')
meta/lib/oe/package.py +1 -1
@@ -245,7 +245,7 @@ def filedeprunner(arg): dep = dep.split()[0] # Put parentheses around any version specifications. - dep = r.sub(r'(\g<0>)',dep) + dep = r.sub(r'(\g<0>)', dep) if file not in i: i[file] = []
meta/lib/oe/package_manager/__init__.py +2 -2
@@ -76,8 +76,8 @@ def opkg_query(cmd_output): if not filename: filename = "%s_%s_%s.ipk" % (pkg, ver, arch) if pkg: - output[pkg] = {"arch":arch, "ver":ver, - "filename":filename, "deps": dep, "pkgarch":pkgarch, "provs": prov} + output[pkg] = {"arch": arch, "ver": ver, + "filename": filename, "deps": dep, "pkgarch": pkgarch, "provs": prov} pkg = "" arch = "" ver = ""
meta/lib/oe/package_manager/ipk/__init__.py +1 -1
@@ -166,7 +166,7 @@ class OpkgPM(OpkgDpkgPM): self.deploy_dir = oe.path.join(self.d.getVar('WORKDIR'), ipk_repo_workdir) self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock") self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") - self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/'),target_rootfs) + self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/'), target_rootfs) self.opkg_args += self.d.getVar("OPKG_ARGS") if prepare_index:
meta/lib/oe/package_manager/rpm/__init__.py +5 -5
@@ -65,9 +65,9 @@ class RpmPM(PackageManager): self.target_vendor = target_vendor self.task_name = task_name if arch_var == None: - self.archs = self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_") + self.archs = self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-", "_") else: - self.archs = self.d.getVar(arch_var).replace("-","_") + self.archs = self.d.getVar(arch_var).replace("-", "_") if task_name == "host": self.primary_arch = self.d.getVar('SDK_ARCH') else:
@@ -280,7 +280,7 @@ class RpmPM(PackageManager): package_arch = package_info[1] package_version = package_info[2] package_rpm = package_info[3] - packages[current_package] = {"arch":package_arch, "ver":package_version, "filename":package_rpm} + packages[current_package] = {"arch": package_arch, "ver": package_version, "filename": package_rpm} current_deps = [] elif line.startswith("Dependencies:"): current_state = "dependencies"
@@ -315,7 +315,7 @@ class RpmPM(PackageManager): cmd = [dnf_cmd] + standard_dnf_args + dnf_args bb.note('Running %s' % ' '.join(cmd)) try: - output = subprocess.check_output(cmd,stderr=subprocess.STDOUT).decode("utf-8") + output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") if print_output: bb.debug(1, output) return output
@@ -352,7 +352,7 @@ class RpmPM(PackageManager): args = ["-q", "--root=%s" % self.target_rootfs, "--queryformat", "%{postin}", pkg] try: - output = subprocess.check_output([cmd] + args,stderr=subprocess.STDOUT).decode("utf-8") + output = subprocess.check_output([cmd] + args, stderr=subprocess.STDOUT).decode("utf-8") except subprocess.CalledProcessError as e: bb.fatal("Could not invoke rpm. Command " "'%s' returned %d:\n%s" % (' '.join([cmd] + args), e.returncode, e.output.decode("utf-8")))
meta/lib/oe/patch.py +1 -1
@@ -580,7 +580,7 @@ class QuiltTree(PatchSet): def Clean(self): try: self._runcmd(["pop", "-a", "-f"]) - oe.path.remove(os.path.join(self.dir, "patches","series")) + oe.path.remove(os.path.join(self.dir, "patches", "series")) except Exception: pass self.initialized = True
meta/lib/oe/prservice.py +6 -6
@@ -11,7 +11,7 @@ def prserv_make_conn(d, check=False): if check: if not conn.ping(): raise Exception('service not available') - d.setVar("__PRSERV_CONN",conn) + d.setVar("__PRSERV_CONN", conn) except Exception as exc: bb.fatal("Connecting to PR service %s:%s failed: %s" % (host_params[0], host_params[1], str(exc)))
@@ -63,13 +63,13 @@ def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksu try: value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum)) except BaseException as exc: - bb.debug("Not valid value of %s:%s" % (v,str(exc))) + bb.debug("Not valid value of %s:%s" % (v, str(exc))) continue - ret = conn.importone(version,pkgarch,checksum,value) + ret = conn.importone(version, pkgarch, checksum, value) if ret != value: - bb.error("importing(%s,%s,%s,%d) failed. DB may have larger value %d" % (version,pkgarch,checksum,value,ret)) + bb.error("importing(%s,%s,%s,%d) failed. DB may have larger value %d" % (version, pkgarch, checksum, value, ret)) else: - imported.append((version,pkgarch,checksum,value)) + imported.append((version, pkgarch, checksum, value)) return imported def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
@@ -112,7 +112,7 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False): (str(datainfo[i]['version']), pkgarch, str(datainfo[i]['checksum']), str(value))) if not nomax: for i in idx: - f.write("PRAUTO_%s_%s = \"%s\"\n" % (str(datainfo[idx[i]]['version']),str(datainfo[idx[i]]['pkgarch']),str(datainfo[idx[i]]['value']))) + f.write("PRAUTO_%s_%s = \"%s\"\n" % (str(datainfo[idx[i]]['version']), str(datainfo[idx[i]]['pkgarch']), str(datainfo[idx[i]]['value']))) bb.utils.unlockfile(lf) def prserv_check_avail(d):
meta/lib/oe/recipeutils.py +3 -3
@@ -353,7 +353,7 @@ def patch_recipe(d, fn, varvalues, patch=False, relpath='', redirect_output=None varfiles = get_var_files(fn, varlist, d) locs = localise_file_vars(fn, varfiles, varlist) patches = [] - for f,v in locs.items(): + for f, v in locs.items(): vals = {k: varvalues[k] for k in v} f = os.path.abspath(f) if f == fn:
@@ -489,9 +489,9 @@ def get_recipe_local_files(d, patches=False, archives=False): if os.path.isdir(localpath): for root, dirs, files in os.walk(localpath): for fname in files: - fileabspath = os.path.join(root,fname) + fileabspath = os.path.join(root, fname) srcdir = os.path.dirname(localpath) - ret[os.path.relpath(fileabspath,srcdir)] = fileabspath + ret[os.path.relpath(fileabspath, srcdir)] = fileabspath else: ret[fname] = localpath return ret
meta/lib/oe/sdk.py +1 -1
@@ -144,7 +144,7 @@ def get_extra_sdkinfo(sstate_dir): for fn in files: if fn.endswith('.tgz'): fsize = int(math.ceil(float(os.path.getsize(os.path.join(root, fn))) / 1024)) - task = fn.rsplit(':',1)[1].split('_',1)[1].split(',')[0] + task = fn.rsplit(':', 1)[1].split('_', 1)[1].split(',')[0] origtotal = extra_info['tasksizes'].get(task, 0) extra_info['tasksizes'][task] = origtotal + fsize extra_info['filesizes'][fn] = fsize
meta/lib/oe/terminal.py +2 -2
@@ -64,7 +64,7 @@ class Gnome(XTerminal): # clearing the LC_ALL environment variable so it uses the locale. # Once fixed on the gnome-terminal project, this should be removed. if os.getenv('LC_ALL'): - os.putenv('LC_ALL','') + os.putenv('LC_ALL', '') XTerminal.__init__(self, sh_cmd, title, env, d)
@@ -274,7 +274,7 @@ def check_tmux_pane_size(tmux): return False try: p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux, - shell=True,stdout=sub.PIPE,stderr=sub.PIPE) + shell=True, stdout=sub.PIPE, stderr=sub.PIPE) out, err = p.communicate() size = int(out.strip()) except OSError as exc:
meta/lib/oe/utils.py +1 -1
@@ -107,7 +107,7 @@ def inherits(d, *classes): """Return True if the metadata inherits any of the specified classes""" return any(bb.data.inherits_class(cls, d) for cls in classes) -def features_backfill(var,d): +def features_backfill(var, d): # This construct allows the addition of new features to variable specified # as var # Example for var = "DISTRO_FEATURES"
meta/lib/oeqa/core/loader.py +1 -1
@@ -316,7 +316,7 @@ class OETestLoader(unittest.TestLoader): # XXX After Python 3.5, remove backward compatibility hacks for # use_load_tests deprecation via *args and **kws. See issue 16662. - if sys.version_info >= (3,5): + if sys.version_info >= (3, 5): def loadTestsFromModule(self, module, *args, pattern=None, **kws): """ Returns a suite of all tests cases contained in module.
meta/lib/oeqa/core/tests/cases/data.py +1 -1
@@ -11,7 +11,7 @@ from oeqa.core.decorator.data import OETestDataDepends class DataTest(OETestCase): data_vars = ['IMAGE', 'ARCH'] - @OETestDataDepends(['MACHINE',]) + @OETestDataDepends(['MACHINE', ]) @OETestTag('dataTestOk') def testDataOk(self): self.assertEqual(self.td.get('IMAGE'), 'core-image-minimal')
meta/lib/oeqa/oetest.py +3 -3
@@ -81,7 +81,7 @@ class oeTest(unittest.TestCase): return False @classmethod - def hasFeature(self,feature): + def hasFeature(self, feature): if feature in oeTest.tc.imagefeatures or \ feature in oeTest.tc.distrofeatures: return True
@@ -431,7 +431,7 @@ class RuntimeTestContext(TestContext): extracted_path = self.d.getVar("TEST_EXTRACTED_DIR") packaged_path = self.d.getVar("TEST_PACKAGED_DIR") - for key,value in needed_packages.items(): + for key, value in needed_packages.items(): packages = () if isinstance(value, dict): packages = (value, )
@@ -491,7 +491,7 @@ class RuntimeTestContext(TestContext): with open(json_file) as f: test_packages = json.load(f) - for key,value in test_packages.items(): + for key, value in test_packages.items(): needed_packages[key] = value if test:
meta/lib/oeqa/runexported.py +1 -1
@@ -42,7 +42,7 @@ class FakeTarget(object): self.connection = None self.ip = None self.server_ip = None - self.datetime = time.strftime('%Y%m%d%H%M%S',time.gmtime()) + self.datetime = time.strftime('%Y%m%d%H%M%S', time.gmtime()) self.testdir = d.getVar("TEST_LOG_DIR") self.pn = d.getVar("PN")
meta/lib/oeqa/runtime/cases/boot.py +1 -1
@@ -29,5 +29,5 @@ class BootTest(OERuntimeTestCase): else: count = 0 msg = ('Expected 5 consecutive, got %d.\n' - 'ping output is:\n%s' % (count,output)) + 'ping output is:\n%s' % (count, output)) self.assertEqual(count, 5, msg=msg)
meta/lib/oeqa/runtime/cases/df.py +1 -1
@@ -14,6 +14,6 @@ class DfTest(OERuntimeTestCase): @skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs') def test_df(self): cmd = "df -P / | sed -n '2p' | awk '{print $4}'" - (status,output) = self.target.run(cmd) + (status, output) = self.target.run(cmd) msg = 'Not enough space on image. Current size is %s' % output self.assertTrue(int(output) > 5120, msg=msg)
meta/lib/oeqa/runtime/cases/dnf.py +3 -3
@@ -162,9 +162,9 @@ class DnfRepoTest(DnfTest): self.target.run('cp /lib/libtinfo.so.5 %s/usr/lib' % rootpath, 1500) self.target.run('cp /libx32/libtinfo.so.5 %s/usr/libx32' % rootpath, 1500) self.target.run('cp /lib64/libtinfo.so.5 %s/usr/lib64' % rootpath, 1500) - self.target.run('ln -sf -r %s/lib %s/usr/lib' % (rootpath,rootpath), 1500) - self.target.run('ln -sf -r %s/libx32 %s/usr/libx32' % (rootpath,rootpath), 1500) - self.target.run('ln -sf -r %s/lib64 %s/usr/lib64' % (rootpath,rootpath), 1500) + self.target.run('ln -sf -r %s/lib %s/usr/lib' % (rootpath, rootpath), 1500) + self.target.run('ln -sf -r %s/libx32 %s/usr/libx32' % (rootpath, rootpath), 1500) + self.target.run('ln -sf -r %s/lib64 %s/usr/lib64' % (rootpath, rootpath), 1500) self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500) self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) self.target.run('cp /bin/sh %s/bin' % rootpath, 1500)
meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py +3 -3
@@ -19,7 +19,7 @@ class Ethernet_Test(OERuntimeTestCase): original_ip = output virtual_ip = self.set_ip(original_ip) - (status, output) = self.target.run("ifconfig eth0:1 %s netmask 255.255.255.0 && sleep 2 && ping -c 5 %s && ifconfig eth0:1 down" % (virtual_ip,virtual_ip)) + (status, output) = self.target.run("ifconfig eth0:1 %s netmask 255.255.255.0 && sleep 2 && ping -c 5 %s && ifconfig eth0:1 down" % (virtual_ip, virtual_ip)) self.assertEqual(status, 0, msg='Failed to create virtual ip address, output: %s' % output) @OETestDepends(['ethernet_ip_connman.Ethernet_Test.test_set_virtual_ip'])
@@ -32,5 +32,5 @@ class Ethernet_Test(OERuntimeTestCase): self.assertEqual(status, 0, msg='Failed to retrieve the default gateway, output: %s' % output) default_gateway = output - (status, output) = self.target.run("connmanctl config %s --ipv4 dhcp && sleep 2 && ping -c 5 %s" % (wired_interfaces,default_gateway)) - self.assertEqual(status, 0, msg='Failed to get dynamic IP address via DHCP in connmand, output: %s' % output) + (status, output) = self.target.run("connmanctl config %s --ipv4 dhcp && sleep 2 && ping -c 5 %s" % (wired_interfaces, default_gateway)) + self.assertEqual(status, 0, msg='Failed to get dynamic IP address via DHCP in connmand, output: %s' % output)
meta/lib/oeqa/runtime/cases/ltp.py +1 -1
@@ -57,7 +57,7 @@ class LtpTestBase(OERuntimeTestCase): class LtpTest(LtpTestBase): - ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "connectors", "commands", "net.ipv6_lib", "input","fs_perms_simple"] + ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "connectors", "commands", "net.ipv6_lib", "input", "fs_perms_simple"] ltp_fs = ["fs", "fsx", "fs_bind"] # skip kernel cpuhotplug
meta/lib/oeqa/runtime/cases/oe_syslog.py +1 -1
@@ -122,7 +122,7 @@ class SyslogTestConfig(OERuntimeTestCase): self.test_syslog_restart() cmd = 'logger foobar && grep foobar /var/log/test' - status,output = self.target.run(cmd) + status, output = self.target.run(cmd) msg = 'Test log string not found. Output: %s ' % output self.assertEqual(status, 0, msg=msg)
meta/lib/oeqa/runtime/cases/parselogs.py +1 -1
@@ -195,7 +195,7 @@ ignore_errors = { ] + common_errors, } -log_locations = ["/var/log/","/var/log/dmesg", "/tmp/dmesg_output.log"] +log_locations = ["/var/log/", "/var/log/dmesg", "/tmp/dmesg_output.log"] class ParseLogsTest(OERuntimeTestCase):
meta/lib/oeqa/runtime/cases/ping.py +1 -1
@@ -22,5 +22,5 @@ class PingTest(OERuntimeTestCase): else: count = 0 msg = ('Expected 5 consecutive, got %d.\n' - 'ping output is:\n%s' % (count,output)) + 'ping output is:\n%s' % (count, output)) self.assertEqual(count, 5, msg=msg)
meta/lib/oeqa/runtime/cases/rpm.py +1 -1
@@ -102,7 +102,7 @@ class RpmInstallRemoveTest(OERuntimeTestCase): @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install']) def test_rpm_remove(self): - status,output = self.target.run('rpm -e base-passwd-doc') + status, output = self.target.run('rpm -e base-passwd-doc') msg = 'Failed to remove base-passwd-doc package: %s' % output self.assertEqual(status, 0, msg=msg)
meta/lib/oeqa/runtime/cases/systemd.py +3 -3
@@ -24,7 +24,7 @@ class SystemdTest(OERuntimeTestCase): return output #TODO: use pyjournalctl instead - def journalctl(self, args='',l_match_units=None): + def journalctl(self, args='', l_match_units=None): """ Request for the journalctl output to the current target system
@@ -110,7 +110,7 @@ class SystemdServiceTests(SystemdTest): self.systemctl('stop', 'avahi-daemon.service') self.systemctl('is-active', 'avahi-daemon.service', expected=3, verbose=True) - self.systemctl('start','avahi-daemon.service') + self.systemctl('start', 'avahi-daemon.service') self.systemctl('is-active', 'avahi-daemon.service', verbose=True) @OETestDepends(['systemd.SystemdServiceTests.test_systemd_status'])
@@ -152,7 +152,7 @@ class SystemdJournalTests(SystemdTest): """ # The expression chain that uniquely identifies the time boot message. - expr_items = ['Startup finished', 'kernel', 'userspace','\.$'] + expr_items = ['Startup finished', 'kernel', 'userspace', '\.$'] try: output = self.journalctl(args='-o cat --reverse') except AssertionError:
meta/lib/oeqa/selftest/cases/bbtests.py +3 -3
@@ -191,7 +191,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" def test_prefile(self): preconf = os.path.join(self.builddir, 'conf/prefile.conf') self.track_for_cleanup(preconf) - ftools.write_file(preconf,"TEST_PREFILE=\"prefile\"") + ftools.write_file(preconf, "TEST_PREFILE=\"prefile\"") result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=') self.assertIn('prefile', result.output) self.write_config("TEST_PREFILE=\"localconf\"")
@@ -216,13 +216,13 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" INHERIT_remove = \"report-error\" """) self.track_for_cleanup(os.path.join(self.builddir, "download-selftest")) - self.write_recipeinc('man-db',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n") + self.write_recipeinc('man-db', "\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n") runCmd('bitbake -c cleanall man-db xcursor-transparent-theme') result = runCmd('bitbake -c unpack -k man-db xcursor-transparent-theme', ignore_status=True) errorpos = result.output.find('ERROR: Function failed: do_fail_task') manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output) continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1)) - self.assertLess(errorpos,continuepos, msg="bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) + self.assertLess(errorpos, continuepos, msg="bitbake didn't pass do_fail_task. bitbake output: %s" % result.output) def test_non_gplv3(self): self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"')
meta/lib/oeqa/selftest/cases/cve_check.py +12 -12
@@ -24,21 +24,21 @@ class CVECheck(OESelftestTestCase): # ignore "p1" and "p2", so these should be equal result = Version("1.0p2") == Version("1.0p1") - self.assertTrue(result,msg="Failed to compare version '1.0p2' to '1.0p1'") + self.assertTrue(result, msg="Failed to compare version '1.0p2' to '1.0p1'") # ignore the "b" and "r" result = Version("1.0b") == Version("1.0r") - self.assertTrue(result,msg="Failed to compare version '1.0b' to '1.0r'") + self.assertTrue(result, msg="Failed to compare version '1.0b' to '1.0r'") # consider the trailing alphabet as patched level when comparing - result = Version("1.0b","alphabetical") < Version("1.0r","alphabetical") - self.assertTrue(result,msg="Failed to compare version with suffix '1.0b' < '1.0r'") - result = Version("1.0b","alphabetical") > Version("1.0","alphabetical") - self.assertTrue(result,msg="Failed to compare version with suffix '1.0b' > '1.0'") + result = Version("1.0b", "alphabetical") < Version("1.0r", "alphabetical") + self.assertTrue(result, msg="Failed to compare version with suffix '1.0b' < '1.0r'") + result = Version("1.0b", "alphabetical") > Version("1.0", "alphabetical") + self.assertTrue(result, msg="Failed to compare version with suffix '1.0b' > '1.0'") # consider the trailing "p" and "patch" as patched released when comparing - result = Version("1.0","patch") < Version("1.0p1","patch") - self.assertTrue(result,msg="Failed to compare version with suffix '1.0' < '1.0p1'") - result = Version("1.0p2","patch") > Version("1.0p1","patch") - self.assertTrue(result,msg="Failed to compare version with suffix '1.0p2' > '1.0p1'") - result = Version("1.0_patch2","patch") < Version("1.0_patch3","patch") - self.assertTrue(result,msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'") + result = Version("1.0", "patch") < Version("1.0p1", "patch") + self.assertTrue(result, msg="Failed to compare version with suffix '1.0' < '1.0p1'") + result = Version("1.0p2", "patch") > Version("1.0p1", "patch") + self.assertTrue(result, msg="Failed to compare version with suffix '1.0p2' > '1.0p1'") + result = Version("1.0_patch2", "patch") < Version("1.0_patch3", "patch") + self.assertTrue(result, msg="Failed to compare version with suffix '1.0_patch2' < '1.0_patch3'")
meta/lib/oeqa/selftest/cases/devtool.py +12 -12
@@ -1873,7 +1873,7 @@ class DevtoolUpgradeTests(DevtoolBase): #Here is just generated the config file instead of all the kernel to optimize the #time of executing this test case. bitbake('%s -c configure' % kernel_provider) - bbconfig = os.path.join(get_bb_var('B', kernel_provider),'.config') + bbconfig = os.path.join(get_bb_var('B', kernel_provider), '.config') #Step 2 runCmd('cp %s %s' % (bbconfig, tempdir_cfg)) self.assertExists(os.path.join(tempdir_cfg, '.config'), 'Could not copy .config file from kernel')
@@ -1885,34 +1885,34 @@ class DevtoolUpgradeTests(DevtoolBase): runCmd('devtool modify virtual/kernel -x %s' % tempdir) self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') #Step 4.2 - configfile = os.path.join(tempdir,'.config') + configfile = os.path.join(tempdir, '.config') diff = runCmd('diff %s %s' % (tmpconfig, configfile)) - self.assertEqual(0,diff.status,'Kernel .config file is not the same using bitbake and devtool') + self.assertEqual(0, diff.status, 'Kernel .config file is not the same using bitbake and devtool') #Step 4.3 #NOTE: virtual/kernel is mapped to kernel_provider result = runCmd('devtool build %s' % kernel_provider) - self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`') + self.assertEqual(0, result.status, 'Cannot build kernel using `devtool build`') kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', kernel_provider), 'vmlinux') self.assertExists(kernelfile, 'Kernel was not build correctly') #Modify the kernel source - modfile = os.path.join(tempdir,'arch/x86/boot/header.S') + modfile = os.path.join(tempdir, 'arch/x86/boot/header.S') modstring = "Use a boot loader. Devtool testing." modapplied = runCmd("sed -i 's/Use a boot loader./%s/' %s" % (modstring, modfile)) - self.assertEqual(0,modapplied.status,'Modification to %s on kernel source failed' % modfile) + self.assertEqual(0, modapplied.status, 'Modification to %s on kernel source failed' % modfile) #Modify the configuration - codeconfigfile = os.path.join(tempdir,'.config.new') + codeconfigfile = os.path.join(tempdir, '.config.new') modconfopt = "CONFIG_SG_POOL=n" modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, codeconfigfile)) - self.assertEqual(0,modconf.status,'Modification to %s failed' % codeconfigfile) + self.assertEqual(0, modconf.status, 'Modification to %s failed' % codeconfigfile) #Build again kernel with devtool rebuild = runCmd('devtool build %s' % kernel_provider) - self.assertEqual(0,rebuild.status,'Fail to build kernel after modification of source and config') + self.assertEqual(0, rebuild.status, 'Fail to build kernel after modification of source and config') #Step 4.4 bzimagename = 'bzImage-' + get_bb_var('KERNEL_VERSION_NAME', kernel_provider) - bzimagefile = os.path.join(get_bb_var('D', kernel_provider),'boot', bzimagename) + bzimagefile = os.path.join(get_bb_var('D', kernel_provider), 'boot', bzimagename) checkmodcode = runCmd("grep '%s' %s" % (modstring, bzimagefile)) - self.assertEqual(0,checkmodcode.status,'Modification on kernel source failed') + self.assertEqual(0, checkmodcode.status, 'Modification on kernel source failed') #Step 4.5 checkmodconfg = runCmd("grep %s %s" % (modconfopt, codeconfigfile)) - self.assertEqual(0,checkmodconfg.status,'Modification to configuration file failed') + self.assertEqual(0, checkmodconfg.status, 'Modification to configuration file failed')
meta/lib/oeqa/selftest/cases/fitimage.py +6 -6
@@ -747,7 +747,7 @@ FIT_HASH_ALG = "sha256" machine = get_bb_var('MACHINE') fitimage_its_path = os.path.join(deploy_dir_image, "fitImage-its-%s-%s-%s" % (image_type, machine, machine)) - fitimage_path = os.path.join(deploy_dir_image,"fitImage") + fitimage_path = os.path.join(deploy_dir_image, "fitImage") self.assertTrue(os.path.exists(fitimage_its_path), "%s image tree source doesn't exist" % (fitimage_its_path))
@@ -793,7 +793,7 @@ FIT_HASH_ALG = "sha256" if node == exp_node_lines: print("kernel node verified") else: - self.assertTrue(test_passed == True,"kernel node does not match expectation") + self.assertTrue(test_passed == True, "kernel node does not match expectation") rx_configs = re.compile("^conf-.*") its_configs = list(filter(rx_configs.match, its_lines))
@@ -811,23 +811,23 @@ FIT_HASH_ALG = "sha256" print("checking configuration " + cfg_str.rstrip(" {")) rx_desc_line = re.compile("^description.*1 Linux kernel.*") if len(list(filter(rx_desc_line.match, node))) != 1: - self.assertTrue(test_passed == True,"kernel keyword not found in the description line") + self.assertTrue(test_passed == True, "kernel keyword not found in the description line") break else: print("kernel keyword found in the description line") if 'kernel = "kernel-1";' not in node: - self.assertTrue(test_passed == True,"kernel line not found") + self.assertTrue(test_passed == True, "kernel line not found") break else: print("kernel line found") rx_sign_line = re.compile("^sign-images.*kernel.*") if len(list(filter(rx_sign_line.match, node))) != 1: - self.assertTrue(test_passed == True,"kernel hash not signed") + self.assertTrue(test_passed == True, "kernel hash not signed") break else: print("kernel hash signed") test_passed = True - self.assertTrue(test_passed == True,"Initramfs bundle test success") + self.assertTrue(test_passed == True, "Initramfs bundle test success")
meta/lib/oeqa/selftest/cases/imagefeatures.py +2 -2
@@ -290,5 +290,5 @@ PNBLACKLIST[busybox] = "Don't build this" res_dir = get_bb_var('DEPLOY_DIR_IMAGE') images = os.path.join(res_dir, "test-empty-image-*.manifest") result = glob.glob(images) - with open(result[1],"r") as f: - self.assertEqual(len(f.read().strip()),0) + with open(result[1], "r") as f: + self.assertEqual(len(f.read().strip()), 0)
meta/lib/oeqa/selftest/cases/manifest.py +1 -1
@@ -116,7 +116,7 @@ class VerifyManifest(OESelftestTestCase): self.classname, m_entry[k].file)) m_entry[k].missing = self.check_manifest_entries( - m_entry[k].file,reverse_dir[k]) + m_entry[k].file, reverse_dir[k]) if m_entry[k].missing: msg = '{}: {} Error has the following missing entries'\ .format(self.classname, m_entry[k].file)
meta/lib/oeqa/selftest/cases/meta_ide.py +1 -1
@@ -43,7 +43,7 @@ class MetaIDE(OESelftestTestCase): "https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz", self.tmpdir_metaideQA, self.td['DATETIME'], dl_dir=dl_dir) self.project.download_archive() - self.assertEqual(self.project.run_configure('$CONFIGURE_FLAGS --disable-maintainer-mode','sed -i -e "/char \*program_name/d" src/global.c;'), 0, + self.assertEqual(self.project.run_configure('$CONFIGURE_FLAGS --disable-maintainer-mode', 'sed -i -e "/char \*program_name/d" src/global.c;'), 0, msg="Running configure failed") self.assertEqual(self.project.run_make(), 0, msg="Running make failed")
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +2 -2
@@ -33,7 +33,7 @@ class TestBlobParsing(OESelftestTestCase): return for k in to_remove: - self.var_map.pop(x,None) + self.var_map.pop(x, None) for k in to_add: self.var_map[k] = to_add[k]
@@ -62,7 +62,7 @@ class TestBlobParsing(OESelftestTestCase): """ from oe.buildhistory_analysis import compare_dict_blobs - changesmap = {"foo-2": ("2", "8"), "bar": ("","4"), "bar-2": ("","5")} + changesmap = {"foo-2": ("2", "8"), "bar": ("", "4"), "bar-2": ("", "5")} self.commit_vars(to_add={"foo": "1", "foo-2": "2", "foo-3": "3"}) blob1 = self.repo.heads.master.commit.tree.blobs[0]
meta/lib/oeqa/selftest/cases/oescripts.py +1 -1
@@ -88,7 +88,7 @@ class OEGitproxyTests(OESelftestTestCase): # outside, use the proxy res = runCmd('%s%s/oe-git-proxy host.outside-example.com 9418' % - (prefix,self.scripts_dir)) + (prefix, self.scripts_dir)) self.assertIn('PROXY:', res.output) # match with wildcard suffix res = runCmd('%s%s/oe-git-proxy host.example.com 9418' %
meta/lib/oeqa/selftest/cases/runtime_test.py +4 -4
@@ -385,7 +385,7 @@ IMAGE_INSTALL_append = " systemtap-runtime" def test_crosstap_helloworld(self): self.write_config(self.default_config()) bitbake('systemtap-native') - systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") + systemtap_examples = os.path.join(get_bb_var("WORKDIR", "systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu:
@@ -397,7 +397,7 @@ IMAGE_INSTALL_append = " systemtap-runtime" self.write_config(self.default_config()) bitbake('systemtap-native') - systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") + systemtap_examples = os.path.join(get_bb_var("WORKDIR", "systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu:
@@ -409,7 +409,7 @@ IMAGE_INSTALL_append = " systemtap-runtime" self.write_config(self.default_config()) bitbake('systemtap-native') - systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") + systemtap_examples = os.path.join(get_bb_var("WORKDIR", "systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu:
@@ -421,7 +421,7 @@ IMAGE_INSTALL_append = " systemtap-runtime" self.write_config(self.default_config()) bitbake('systemtap-native') - systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") + systemtap_examples = os.path.join(get_bb_var("WORKDIR", "systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu:
meta/lib/oeqa/selftest/cases/sstatetests.py +1 -1
@@ -558,7 +558,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash" files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/") files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/") # Remove items that are identical in both sets - for k,v in files1.items() & files2.items(): + for k, v in files1.items() & files2.items(): del files1[k] del files2[k] if not files1 and not files2:
meta/lib/oeqa/selftest/cases/wic.py +4 -4
@@ -244,7 +244,7 @@ class Wic(WicTestCase): sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') images = glob(self.resultdir + "mkefidisk-*.direct") result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot)) - self.assertIn("kernel",result.output) + self.assertIn("kernel", result.output) def test_sdimage_bootpart(self): """Test creation of sdimage-bootpart image"""
@@ -629,12 +629,12 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file self.append_config(config) bitbake('core-image-minimal') - tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic') + tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'), 'build-wic') # check each partition for permission for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')): res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part)) - self.assertTrue(files_own_by_root(res.output),msg='Files permission incorrect using wks set "%s"' % test) + self.assertTrue(files_own_by_root(res.output), msg='Files permission incorrect using wks set "%s"' % test) # clean config and result directory for next cases self.remove_config(config)
@@ -715,7 +715,7 @@ class Wic2(WicTestCase): wicvars = set(bb_vars['WICVARS'].split()) # filter out optional variables wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES', - 'INITRD', 'INITRD_LIVE', 'ISODIR','INITRAMFS_IMAGE', + 'INITRD', 'INITRD_LIVE', 'ISODIR', 'INITRAMFS_IMAGE', 'INITRAMFS_IMAGE_BUNDLE', 'INITRAMFS_LINK_NAME', 'APPEND', 'IMAGE_EFI_BOOT_FILES')) with open(path) as envfile:
meta/lib/oeqa/utils/decorators.py +11 -11
@@ -32,7 +32,7 @@ class getResults(object): s = i[0].id() #Handle the _ErrorHolder objects from skipModule failures if "setUpModule (" in s: - ret.append(s.replace("setUpModule (", "").replace(")","")) + ret.append(s.replace("setUpModule (", "").replace(")", "")) else: ret.append(s) # Append also the test without the full path
@@ -55,10 +55,10 @@ class getResults(object): class skipIfFailure(object): - def __init__(self,testcase): + def __init__(self, testcase): self.testcase = testcase - def __call__(self,f): + def __call__(self, f): @wraps(f) def wrapped_f(*args, **kwargs): res = getResults()
@@ -70,10 +70,10 @@ class skipIfFailure(object): class skipIfSkipped(object): - def __init__(self,testcase): + def __init__(self, testcase): self.testcase = testcase - def __call__(self,f): + def __call__(self, f): @wraps(f) def wrapped_f(*args, **kwargs): res = getResults()
@@ -85,10 +85,10 @@ class skipIfSkipped(object): class skipUnlessPassed(object): - def __init__(self,testcase): + def __init__(self, testcase): self.testcase = testcase - def __call__(self,f): + def __call__(self, f): @wraps(f) def wrapped_f(*args, **kwargs): res = getResults()
@@ -124,9 +124,9 @@ def LogResults(original_class): from time import strftime, gmtime caller = os.path.basename(sys.argv[0]) - timestamp = strftime('%Y%m%d%H%M%S',gmtime()) - logfile = os.path.join(os.getcwd(),'results-' + caller + '.' + timestamp + '.log') - linkfile = os.path.join(os.getcwd(),'results-' + caller + '.log') + timestamp = strftime('%Y%m%d%H%M%S', gmtime()) + logfile = os.path.join(os.getcwd(), 'results-' + caller + '.' + timestamp + '.log') + linkfile = os.path.join(os.getcwd(), 'results-' + caller + '.log') def get_class_that_defined_method(meth): if inspect.ismethod(meth):
@@ -262,7 +262,7 @@ def gettag(obj, key, default=None): def getAllTags(obj): def __gettags(o): - r = {k[len(__tag_prefix):]:getattr(o,k) for k in dir(o) if k.startswith(__tag_prefix)} + r = {k[len(__tag_prefix):]: getattr(o, k) for k in dir(o) if k.startswith(__tag_prefix)} return r if not isinstance(obj, unittest.TestCase): return __gettags(obj)
meta/lib/oeqa/utils/package_manager.py +2 -2
@@ -80,7 +80,7 @@ def _get_needed_packages(json_file, test=None): with open(json_file) as f: test_packages = json.load(f) - for key,value in test_packages.items(): + for key, value in test_packages.items(): needed_packages[key] = value if test:
@@ -101,7 +101,7 @@ def extract_packages(d, needed_packages): extracted_path = d.getVar('TEST_EXTRACTED_DIR') - for key,value in needed_packages.items(): + for key, value in needed_packages.items(): packages = () if isinstance(value, dict): packages = (value, )
meta/lib/oeqa/utils/qemurunner.py +3 -3
@@ -26,7 +26,7 @@ from collections import defaultdict import importlib # Get Unicode non printable control chars -control_range = list(range(0,32)) + list(range(127,160)) +control_range = list(range(0, 32)) + list(range(127, 160)) control_chars = [chr(x) for x in control_range if chr(x) not in string.printable] re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
@@ -99,7 +99,7 @@ class QemuRunner: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setblocking(0) - sock.bind(("127.0.0.1",0)) + sock.bind(("127.0.0.1", 0)) sock.listen(2) port = sock.getsockname()[1] self.logger.debug("Created listening socket for qemu serial console on: 127.0.0.1:%s" % port)
@@ -621,7 +621,7 @@ class QemuRunner: data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout break try: - sread, _, _ = select.select([self.server_socket],[],[], end - now) + sread, _, _ = select.select([self.server_socket], [], [], end - now) except InterruptedError: continue if sread:
meta/lib/oeqa/utils/qemutinyrunner.py +4 -4
@@ -94,7 +94,7 @@ class QemuTinyRunner(QemuRunner): self.qemuparams = '--append "root=/dev/ram0 console=ttyS0" -nographic -serial unix:%s,server,nowait' % self.socketfile launch_cmd = 'qemu-system-i386 -kernel %s -initrd %s %s' % (self.kernel, self.rootfs, self.qemuparams) - self.runqemu = subprocess.Popen(launch_cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,preexec_fn=os.setpgrp) + self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, preexec_fn=os.setpgrp) bb.note("runqemu started, pid is %s" % self.runqemu.pid) bb.note("waiting at most %s seconds for qemu pid" % self.runqemutime)
@@ -122,7 +122,7 @@ class QemuTinyRunner(QemuRunner): endtime = time.time() + timeout while time.time() < endtime and not stopread: try: - sread, _, _ = select.select([self.server_socket],[],[],1) + sread, _, _ = select.select([self.server_socket], [], [], 1) except InterruptedError: continue for sock in sread:
@@ -138,7 +138,7 @@ class QemuTinyRunner(QemuRunner): data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout return (status, str(data)) - def find_child(self,parent_pid): + def find_child(self, parent_pid): # # Walk the process tree from the process specified looking for a qemu-system. Return its [pid'cmd] #
@@ -179,4 +179,4 @@ class QemuTinyRunner(QemuRunner): basecmd = commands[p].split()[0] basecmd = os.path.basename(basecmd) if "qemu-system" in basecmd and "-serial unix" in commands[p]: - return [int(p),commands[p]] + return [int(p), commands[p]]
meta/lib/oeqa/utils/testexport.py +9 -9
@@ -82,8 +82,8 @@ def process_binaries(d, params): rpm_deploy_dir = d.getVar("DEPLOY_DIR_RPM") arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(rpm_deploy_dir)) arch_rpm_dir = os.path.join(rpm_deploy_dir, arch) - extracted_bin_dir = os.path.join(exportpath,"binaries", arch, "extracted_binaries") - packaged_bin_dir = os.path.join(exportpath,"binaries", arch, "packaged_binaries") + extracted_bin_dir = os.path.join(exportpath, "binaries", arch, "extracted_binaries") + packaged_bin_dir = os.path.join(exportpath, "binaries", arch, "packaged_binaries") # creating necessary directory structure in case testing is done in poky env. if export_env == "0": if not os.path.exists(extracted_bin_dir):
@@ -104,7 +104,7 @@ def process_binaries(d, params): else: # nothing to do here; running tests under bitbake, so we asume native binaries are in sysroots dir. if param_list[1] or param_list[4]: bb.warn("Native binary %s %s%s. Running tests under bitbake environment. Version can't be checked except when the test itself does it" - " and binary can't be removed." % (param_list[0],"has assigned ver. " + param_list[1] if param_list[1] else "", + " and binary can't be removed." % (param_list[0], "has assigned ver. " + param_list[1] if param_list[1] else "", ", is marked for removal" if param_list[4] else "")) else:# the package is target aka DUT intended and it is either required to be delivered in an extracted form or in a packaged version target_rpm_file_list = [item for item in os.listdir(arch_rpm_dir) if re.search(param_list[0] + "-([0-9]+\.*)", item)]
@@ -121,7 +121,7 @@ def process_binaries(d, params): if param_list[1]: # the package is versioned for item in target_rpm_file_list: if re.match(".*-{}-.*\.rpm".format(param_list[1]), item): - destination = os.path.join(extracted_bin_dir,param_list[0], param_list[1]) + destination = os.path.join(extracted_bin_dir, param_list[0], param_list[1]) bb.utils.mkdirhier(destination) extract_binary(os.path.join(arch_rpm_dir, item), destination) break
@@ -130,7 +130,7 @@ def process_binaries(d, params): return "" return "extracted" else: # no version provided, just extract one binary - destination = os.path.join(extracted_bin_dir,param_list[0], + destination = os.path.join(extracted_bin_dir, param_list[0], re.search(".*-([0-9]+\.[0-9]+)-.*rpm", target_rpm_file_list[0]).group(1)) bb.utils.mkdirhier(destination) extract_binary(os.path.join(arch_rpm_dir, target_rpm_file_list[0]), destination)
@@ -168,9 +168,9 @@ def process_binaries(d, params): for item in packaged_bin_file_list: if param_list[1]: if re.match("%s-%s.*rpm" % (param_list[0], param_list[1]), item): # package with version - if not os.path.exists(os.path.join(extracted_bin_path, param_list[0],param_list[1])): + if not os.path.exists(os.path.join(extracted_bin_path, param_list[0], param_list[1])): os.makedirs(os.path.join(extracted_bin_path, param_list[0], param_list[1])) - extract_binary(os.path.join(packaged_bin_path, item), os.path.join(extracted_bin_path, param_list[0],param_list[1])) + extract_binary(os.path.join(packaged_bin_path, item), os.path.join(extracted_bin_path, param_list[0], param_list[1])) bb.plain("Using {} for {}".format(os.path.join(packaged_bin_path, item), param_list[0])) break else:
@@ -210,7 +210,7 @@ def files_to_copy(base_dir): return files_list -def send_bin_to_DUT(d,params): +def send_bin_to_DUT(d, params): from oeqa.oetest import oeRuntimeTest param_list = params cleanup_list = list()
@@ -264,7 +264,7 @@ def send_bin_to_DUT(d,params): def rm_bin(removal_list): # need to know both if the binary is sent archived and the path where it is sent if archived from oeqa.oetest import oeRuntimeTest for item in removal_list: - (status,output) = oeRuntimeTest.tc.target.run("rm " + item) + (status, output) = oeRuntimeTest.tc.target.run("rm " + item) if status != 0: bb.warn("Failed to remove: %s. Please ensure connection with the target device is up and running and " "you have the needed rights." % item)
meta/recipes-devtools/python/python3/create_manifest3.py +9 -9
@@ -71,8 +71,8 @@ hasfolders = [] allfolders = [] def isFolder(value): - value = value.replace('${PYTHON_MAJMIN}',pyversion) - if os.path.isdir(value.replace('${libdir}',nativelibfolder + '/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder + '/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder + '/usr/lib32')): + value = value.replace('${PYTHON_MAJMIN}', pyversion) + if os.path.isdir(value.replace('${libdir}', nativelibfolder + '/usr/lib')) or os.path.isdir(value.replace('${libdir}', nativelibfolder + '/usr/lib64')) or os.path.isdir(value.replace('${libdir}', nativelibfolder + '/usr/lib32')): return True else: return False
@@ -122,7 +122,7 @@ print_indent('Getting dependencies for package: core', 0) output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package', '%s' % debugFlag]).decode('utf8') for coredep in output.split(): - coredep = coredep.replace(pyversion,'${PYTHON_MAJMIN}') + coredep = coredep.replace(pyversion, '${PYTHON_MAJMIN}') if isCached(coredep): if coredep not in old_manifest['core']['cached']: old_manifest['core']['cached'].append(coredep)
@@ -173,7 +173,7 @@ for filedep in old_manifest['core']['files']: for pymodule_dep in output.split(): - pymodule_dep = pymodule_dep.replace(pyversion,'${PYTHON_MAJMIN}') + pymodule_dep = pymodule_dep.replace(pyversion, '${PYTHON_MAJMIN}') if isCached(pymodule_dep): if pymodule_dep not in old_manifest['core']['cached']:
@@ -254,7 +254,7 @@ for pypkg in old_manifest: if isFolder(filedep): new_manifest[pypkg]['files'].append(filedep) # Asyncio (and others) are both the package and the folder name, we should not skip those... - path,mod = os.path.split(filedep) + path, mod = os.path.split(filedep) if mod != pypkg: continue if '${bindir}' in filedep:
@@ -318,7 +318,7 @@ for pypkg in old_manifest: # is folder_string inside path/folder1/folder2/filename?, # Yes, it works, but we waste a couple of milliseconds. - pymodule_dep = pymodule_dep.replace(pyversion,'${PYTHON_MAJMIN}') + pymodule_dep = pymodule_dep.replace(pyversion, '${PYTHON_MAJMIN}') inFolders = False for folder in allfolders: # The module could have a directory named after it, e.g. xml, if we take out the filename from the path
@@ -427,11 +427,11 @@ for pypkg in new_manifest: new_manifest[pypkg]['rdepends'].sort() # Create the manifest from the data structure that was built -with open('python3-manifest.json.new','w') as outfile: - json.dump(new_manifest,outfile, indent=4) +with open('python3-manifest.json.new', 'w') as outfile: + json.dump(new_manifest, outfile, indent=4) outfile.write('\n') -prepend_comments(comments,'python3-manifest.json.new') +prepend_comments(comments, 'python3-manifest.json.new') if (repeated): error_msg = '\n\nERROR:\n'
meta/recipes-devtools/python/python3/get_module_deps3.py +7 -7
@@ -36,13 +36,13 @@ def fix_path(dep_path): # Handle multilib, is there a better way? if '/usr/lib32' in dep_path: - dep_path = dep_path.replace('/usr/lib32','${libdir}') + dep_path = dep_path.replace('/usr/lib32', '${libdir}') if '/usr/lib64' in dep_path: - dep_path = dep_path.replace('/usr/lib64','${libdir}') + dep_path = dep_path.replace('/usr/lib64', '${libdir}') if '/usr/lib' in dep_path: - dep_path = dep_path.replace('/usr/lib','${libdir}') + dep_path = dep_path.replace('/usr/lib', '${libdir}') if '/usr/include' in dep_path: - dep_path = dep_path.replace('/usr/include','${includedir}') + dep_path = dep_path.replace('/usr/include', '${includedir}') if '__init__.' in dep_path: dep_path = os.path.split(dep_path)[0] return dep_path
@@ -51,7 +51,7 @@ def fix_path(dep_path): # Module to import was passed as an argument current_module = str(sys.argv[1]).rstrip() if debug == True: - log = open('temp/log_%s' % current_module.strip('.*'),'w') + log = open('temp/log_%s' % current_module.strip('.*'), 'w') log.write('Module %s generated the following dependencies:\n' % current_module) try: m = importlib.import_module(current_module)
@@ -129,7 +129,7 @@ for item in dif: if soabi in dep_path: if debug == True: log.write('Shared library found in %s\n' % dep_path) - dep_path = dep_path.replace(soabi,'*') + dep_path = dep_path.replace(soabi, '*') print(dep_path) continue if "_sysconfigdata" in dep_path:
@@ -165,7 +165,7 @@ for item in dif: if debug == True: log.write(cached + '\n') cached = fix_path(cached) - cached = cached.replace(cpython_tag,'*') + cached = cached.replace(cpython_tag, '*') if "_sysconfigdata" in cached: cached = cached.replace(sysconfig._get_sysconfigdata_name(), "_sysconfigdata*") print(cached)
meta/recipes-kernel/perf/perf/sort-pmuevents.py +1 -1
@@ -83,7 +83,7 @@ outf = open(outfile, 'w') print(preamble.group(1)) outf.write(preamble.group(1)) for d in entry_dict_sorted: - outf.write("struct %s %s[] = {\n" % (entry_dict_sorted[d]['type'],d)) + outf.write("struct %s %s[] = {\n" % (entry_dict_sorted[d]['type'], d)) for f in entry_dict_sorted[d]['fields']: outf.write(entry_dict_sorted[d]['fields'][f] + '\n')
meta/recipes-rt/rt-tests/files/rt_bmark.py +1 -1
@@ -378,7 +378,7 @@ class cyclictest_runner: print() print(tc_name(name), "[Min/us,Avg/us,Max/us]:",) - print("%d,%.1f,%d" % (bm_min,bm_avg, bm_max)) + print("%d,%.1f,%d" % (bm_min, bm_avg, bm_max)) print("PASS:", tc_name(name)) print()
scripts/combo-layer +5 -5
@@ -31,7 +31,7 @@ __version__ = "0.2.1" def logger_create(): logger = logging.getLogger("") loggerhandler = logging.StreamHandler() - loggerhandler.setFormatter(logging.Formatter("[%(asctime)s] %(message)s","%H:%M:%S")) + loggerhandler.setFormatter(logging.Formatter("[%(asctime)s] %(message)s", "%H:%M:%S")) logger.addHandler(loggerhandler) logger.setLevel(logging.INFO) return logger
@@ -159,7 +159,7 @@ class Configuration(object): dest_dir = os.path.normpath(self.repos[name].get("dest_dir", ".")) self.repos[name]["dest_dir"] = "." if not dest_dir else dest_dir if msg != "": - logger.error("configuration file %s has the following error: %s" % (self.conffile,msg)) + logger.error("configuration file %s has the following error: %s" % (self.conffile, msg)) if self.localconffile and 'last_revision' in missing_options: logger.error("local configuration file %s may be missing configuration for combo branch %s" % (self.localconffile, self.combobranch)) sys.exit(1)
@@ -169,7 +169,7 @@ class Configuration(object): logger.error("ERROR: patchutils package is missing, please install it (e.g. # apt-get install patchutils)") sys.exit(1) -def runcmd(cmd,destdir=None,printerr=True,out=None,env=None): +def runcmd(cmd, destdir=None, printerr=True, out=None, env=None): """ execute command, raise CalledProcessError if fail return output if succeed
@@ -686,7 +686,7 @@ def update_with_patches(conf, components, revisions, repos): patch_cmd_range = "%s..%s" % (repo['last_revision'], top_revision) rev_cmd_range = patch_cmd_range - file_filter = repo.get('file_filter',".") + file_filter = repo.get('file_filter', ".") # Filter out unwanted files exclude = repo.get('file_exclude', '')
@@ -696,7 +696,7 @@ def update_with_patches(conf, components, revisions, repos): file_filter += " ':!%s'" % p patch_cmd = "git format-patch -N %s --output-directory %s %s -- %s" % \ - (prefix,repo_patch_dir, patch_cmd_range, file_filter) + (prefix, repo_patch_dir, patch_cmd_range, file_filter) output = runcmd(patch_cmd, ldir) logger.debug("generated patch set:\n%s" % output) patchlist = output.splitlines()
scripts/contrib/image-manifest +6 -6
@@ -79,7 +79,7 @@ def get_recipe_list(manifest, tinfoil): pkglist = get_pkg_list(manifest) recipelist = [] for pkg in pkglist: - recipe = pkg2recipe(tinfoil,pkg) + recipe = pkg2recipe(tinfoil, pkg) if recipe: if not recipe in recipelist: recipelist.append(recipe)
@@ -251,16 +251,16 @@ def pkg_dependencies(args): data = recipe_info[p] if "-native" not in data.pn: if "cross" not in data.pn: - print(" %s (%s)" % (data.pn,p)) + print(" %s (%s)" % (data.pn, p)) if args.native: print('\nThe following native packages are required to build %s' % recipe) for p in sorted(packages): data = recipe_info[p] if "-native" in data.pn: - print(" %s(%s)" % (data.pn,p)) + print(" %s(%s)" % (data.pn, p)) if "cross" in data.pn: - print(" %s(%s)" % (data.pn,p)) + print(" %s(%s)" % (data.pn, p)) def default_config(): vlist = OrderedDict()
@@ -324,7 +324,7 @@ def export_manifest_info(args): logger.debug('tmp dir: %s' % tmpoutdir) # export manifest - shutil.copy2(args.manifest,os.path.join(tmpoutdir, "manifest")) + shutil.copy2(args.manifest, os.path.join(tmpoutdir, "manifest")) with bb.tinfoil.Tinfoil(tracking=True) as tinfoil: tinfoil.logger.setLevel(logger.getEffectiveLevel())
@@ -339,7 +339,7 @@ def export_manifest_info(args): recipelist = [] for pkg in pkglist: - recipe = pkg2recipe(tinfoil,pkg) + recipe = pkg2recipe(tinfoil, pkg) if recipe: if not recipe in recipelist: recipelist.append(recipe)
scripts/contrib/list-packageconfig-flags.py +1 -1
@@ -120,7 +120,7 @@ def display_all(data_dict): packageconfig = 'None' print('PACKAGECONFIG %s' % packageconfig) - for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").items(): + for flag, flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").items(): if flag == "doc": continue print('PACKAGECONFIG[%s] %s' % (flag, flag_val))
scripts/install-buildtools +1 -1
@@ -55,7 +55,7 @@ import scriptpath PROGNAME = 'install-buildtools' logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout) -DEFAULT_INSTALL_DIR = os.path.join(os.path.split(scripts_path)[0],'buildtools') +DEFAULT_INSTALL_DIR = os.path.join(os.path.split(scripts_path)[0], 'buildtools') DEFAULT_BASE_URL = 'http://downloads.yoctoproject.org/releases/yocto' DEFAULT_RELEASE = 'yocto-3.2_M3' DEFAULT_INSTALLER_VERSION = '3.1+snapshot'
scripts/lib/buildstats.py +1 -1
@@ -8,7 +8,7 @@ import json import logging import os import re -from collections import namedtuple,OrderedDict +from collections import namedtuple, OrderedDict from statistics import mean
scripts/lib/devtool/export.py +1 -1
@@ -52,7 +52,7 @@ def export(args, config, basepath, workspace): logger.info('Workspace contains no recipes, nothing to export') return 0 else: - for param, recipes in {'include':args.include,'exclude':args.exclude}.items(): + for param, recipes in {'include': args.include, 'exclude': args.exclude}.items(): for recipe in recipes: if recipe not in workspace: logger.error('Recipe (%s) on %s argument not in the current workspace' % (recipe, param))
scripts/lib/devtool/menuconfig.py +8 -8
@@ -45,19 +45,19 @@ def menuconfig(args, config, basepath, workspace): check_workspace_recipe(workspace, args.component) pn = rd.getVar('PN', True) - if not rd.getVarFlag('do_menuconfig','task'): + if not rd.getVarFlag('do_menuconfig', 'task'): raise DevtoolError("This recipe does not support menuconfig option") - workspace_dir = os.path.join(config.workspace_path,'sources') + workspace_dir = os.path.join(config.workspace_path, 'sources') kconfigpath = rd.getVar('B') - pn_src = os.path.join(workspace_dir,pn) + pn_src = os.path.join(workspace_dir, pn) # add check to see if oe_local_files exists or not - localfilesdir = os.path.join(pn_src,'oe-local-files') + localfilesdir = os.path.join(pn_src, 'oe-local-files') if not os.path.exists(localfilesdir): bb.utils.mkdirhier(localfilesdir) # Add gitignore to ensure source tree is clean - gitignorefile = os.path.join(localfilesdir,'.gitignore') + gitignorefile = os.path.join(localfilesdir, '.gitignore') with open(gitignorefile, 'w') as f: f.write('# Ignore local files, by default. Remove this file if you want to commit the directory to Git\n') f.write('*\n')
@@ -68,12 +68,12 @@ def menuconfig(args, config, basepath, workspace): logger.info('Launching menuconfig') exec_build_env_command(config.init_path, basepath, 'bitbake -c menuconfig %s' % pn, watch=True) fragment = os.path.join(localfilesdir, 'devtool-fragment.cfg') - res = standard._create_kconfig_diff(pn_src,rd,fragment) + res = standard._create_kconfig_diff(pn_src, rd, fragment) return 0 def register_commands(subparsers, context): """register devtool subcommands from this plugin""" - parser_menuconfig = subparsers.add_parser('menuconfig',help='Alter build-time configuration for a recipe', description='Launches the make menuconfig command (for recipes where do_menuconfig is available), allowing users to make changes to the build-time configuration. Creates a config fragment corresponding to changes made.', group='advanced') + parser_menuconfig = subparsers.add_parser('menuconfig', help='Alter build-time configuration for a recipe', description='Launches the make menuconfig command (for recipes where do_menuconfig is available), allowing users to make changes to the build-time configuration. Creates a config fragment corresponding to changes made.', group='advanced') parser_menuconfig.add_argument('component', help='compenent to alter config') - parser_menuconfig.set_defaults(func=menuconfig,fixed_setup=context.fixed_setup) + parser_menuconfig.set_defaults(func=menuconfig, fixed_setup=context.fixed_setup)
scripts/lib/devtool/standard.py +11 -11
@@ -457,7 +457,7 @@ def sync(args, config, basepath, workspace): finally: tinfoil.shutdown() -def symlink_oelocal_files_srctree(rd,srctree): +def symlink_oelocal_files_srctree(rd, srctree): import oe.patch if os.path.abspath(rd.getVar('S')) == os.path.abspath(rd.getVar('WORKDIR')): # If recipe extracts to ${WORKDIR}, symlink the files into the srctree
@@ -648,9 +648,9 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works if os.path.exists(workshareddir) and (not os.listdir(workshareddir) or kernelVersion != staging_kerVer): shutil.rmtree(workshareddir) - oe.path.copyhardlinktree(srcsubdir,workshareddir) + oe.path.copyhardlinktree(srcsubdir, workshareddir) elif not os.path.exists(workshareddir): - oe.path.copyhardlinktree(srcsubdir,workshareddir) + oe.path.copyhardlinktree(srcsubdir, workshareddir) tempdir_localdir = os.path.join(tempdir, 'oe-local-files') srctree_localdir = os.path.join(srctree, 'oe-local-files')
@@ -680,7 +680,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works shutil.move(tempdir_localdir, srcsubdir) shutil.move(srcsubdir, srctree) - symlink_oelocal_files_srctree(d,srctree) + symlink_oelocal_files_srctree(d, srctree) if is_kernel_yocto: logger.info('Copying kernel config to srctree')
@@ -753,7 +753,7 @@ def get_staging_kver(srcdir): kerver = [] staging_kerVer = "" if os.path.exists(srcdir) and os.listdir(srcdir): - with open(os.path.join(srcdir,"Makefile")) as f: + with open(os.path.join(srcdir, "Makefile")) as f: version = [next(f) for x in range(5)][1:4] for word in version: kerver.append(word.split('= ')[1].split('\n')[0])
@@ -824,10 +824,10 @@ def modify(args, config, basepath, workspace): staging_kerVer = get_staging_kver(srcdir) staging_kbranch = get_staging_kbranch(srcdir) if (os.path.exists(srcdir) and os.listdir(srcdir)) and (kernelVersion in staging_kerVer and staging_kbranch == kbranch): - oe.path.copyhardlinktree(srcdir,srctree) + oe.path.copyhardlinktree(srcdir, srctree) workdir = rd.getVar('WORKDIR') srcsubdir = rd.getVar('S') - localfilesdir = os.path.join(srctree,'oe-local-files') + localfilesdir = os.path.join(srctree, 'oe-local-files') # Move local source files into separate subdir recipe_patches = [os.path.basename(patch) for patch in oe.recipeutils.get_recipe_patches(rd)] local_files = oe.recipeutils.get_recipe_local_files(rd)
@@ -853,7 +853,7 @@ def modify(args, config, basepath, workspace): with open(os.path.join(srctree, 'oe-local-files', '.gitignore'), 'w') as f: f.write('# Ignore local files, by default. Remove this file ''if you want to commit the directory to Git\n*\n') - symlink_oelocal_files_srctree(rd,srctree) + symlink_oelocal_files_srctree(rd, srctree) task = 'do_configure' res = tinfoil.build_targets(pn, task, handle_events=True)
@@ -861,7 +861,7 @@ def modify(args, config, basepath, workspace): # Copy .config to workspace kconfpath = rd.getVar('B') logger.info('Copying kernel config to workspace') - shutil.copy2(os.path.join(kconfpath, '.config'),srctree) + shutil.copy2(os.path.join(kconfpath, '.config'), srctree) # Set this to true, we still need to get initial_rev # by parsing the git repo
@@ -964,7 +964,7 @@ def modify(args, config, basepath, workspace): ' mv ${S}/.config ${S}/.config.old\n' ' fi\n' '}\n') - if rd.getVarFlag('do_menuconfig','task'): + if rd.getVarFlag('do_menuconfig', 'task'): f.write('\ndo_configure_append() {\n' ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' ' cp ${B}/.config ${S}/.config.baseline\n'
@@ -1648,7 +1648,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil logger.debug('Pre-filtering: update: %s, new: %s' % (dict(upd_p), dict(new_p))) if filter_patches: new_p = OrderedDict() - upd_p = OrderedDict((k,v) for k,v in upd_p.items() if k in filter_patches) + upd_p = OrderedDict((k, v) for k, v in upd_p.items() if k in filter_patches) remove_files = [f for f in remove_files if f in filter_patches] updatefiles = False updaterecipe = False
scripts/lib/devtool/upgrade.py +3 -3
@@ -27,7 +27,7 @@ from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_r logger = logging.getLogger('devtool') def _run(cmd, cwd=''): - logger.debug("Running command %s> %s" % (cwd,cmd)) + logger.debug("Running command %s> %s" % (cwd, cmd)) return bb.process.run('%s' % cmd, cwd=cwd) def _get_srctree(tmpdir):
@@ -47,7 +47,7 @@ def _copy_source_code(orig, dest): def _remove_patch_dirs(recipefolder): for root, dirs, files in os.walk(recipefolder): for d in dirs: - shutil.rmtree(os.path.join(root,d)) + shutil.rmtree(os.path.join(root, d)) def _recipe_contains(rd, var): rf = rd.getVar('FILE')
@@ -236,7 +236,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee # Copy in new ones _copy_source_code(tmpsrctree, srctree) - (stdout,_) = __run('git ls-files --modified --others') + (stdout, _) = __run('git ls-files --modified --others') filelist = stdout.splitlines() pbar = bb.ui.knotty.BBProgress('Adding changed files', len(filelist)) pbar.start()
scripts/lib/recipetool/append.py +2 -2
@@ -49,7 +49,7 @@ def find_target_file(targetpath, d, pkglist=None): '/etc/group': '/etc/group should be managed through the useradd and extrausers classes', '/etc/shadow': '/etc/shadow should be managed through the useradd and extrausers classes', '/etc/gshadow': '/etc/gshadow should be managed through the useradd and extrausers classes', - '${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration',} + '${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration', } for pthspec, message in invalidtargets.items(): if fnmatch.fnmatchcase(targetpath, d.expand(pthspec)):
@@ -231,7 +231,7 @@ def appendfile(args): logger.warning('This file looks like it is a binary or otherwise the output of compilation. If it is, you should consider building it properly instead of substituting a binary file directly.') if args.recipe: - recipes = {args.targetpath: [args.recipe],} + recipes = {args.targetpath: [args.recipe], } else: try: recipes = find_target_file(args.targetpath, tinfoil.config_data)
scripts/lib/recipetool/create.py +1 -1
@@ -1113,7 +1113,7 @@ def crunch_license(licfile): # Squash spaces, and replace smart quotes, double quotes # and backticks with single quotes line = oe.utils.squashspaces(line.strip()) - line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c","'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'') + line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c", "'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'') if line: lictext.append(line)
scripts/lib/recipetool/create_buildsys.py +1 -1
@@ -680,7 +680,7 @@ class AutotoolsRecipeHandler(RecipeHandler): process_macro(in_keyword, partial) if extravalues: - for k,v in list(extravalues.items()): + for k, v in list(extravalues.items()): if v: if v.startswith('$') or v.startswith('@') or v.startswith('%'): del extravalues[k]
scripts/lib/resulttool/manualexecution.py +4 -4
@@ -98,10 +98,10 @@ class ManualTestRunner(object): print('Expected output: %s' % expected_output) while True: done = input('\nPlease provide test results: (P)assed/(F)ailed/(B)locked/(S)kipped? \n').lower() - result_types = {'p':'PASSED', - 'f':'FAILED', - 'b':'BLOCKED', - 's':'SKIPPED'} + result_types = {'p': 'PASSED', + 'f': 'FAILED', + 'b': 'BLOCKED', + 's': 'SKIPPED'} if done in result_types: for r in result_types: if done == r:
scripts/lib/resulttool/report.py +1 -1
@@ -167,7 +167,7 @@ class ResultsTextReport(object): reportvalues = [] machines = [] cols = ['passed', 'failed', 'skipped'] - maxlen = {'passed': 0, 'failed': 0, 'skipped': 0, 'result_id': 0, 'testseries': 0, 'ptest': 0,'ltptest': 0, 'ltpposixtest': 0} + maxlen = {'passed': 0, 'failed': 0, 'skipped': 0, 'result_id': 0, 'testseries': 0, 'ptest': 0, 'ltptest': 0, 'ltpposixtest': 0} for line in test_count_reports: total_tested = line['passed'] + line['failed'] + line['skipped'] vals = {}
scripts/lib/wic/engine.py +1 -1
@@ -280,7 +280,7 @@ class Disk: def __getattr__(self, name): """Get path to the executable in a lazy way.""" if name in ("mdir", "mcopy", "mdel", "mdeltree", "sfdisk", "e2fsck", - "resize2fs", "mkswap", "mkdosfs", "debugfs","blkid"): + "resize2fs", "mkswap", "mkdosfs", "debugfs", "blkid"): aname = "_%s" % name if aname not in self.__dict__: setattr(self, aname, find_executable(name, self.paths))
scripts/lib/wic/plugins/imager/direct.py +2 -2
@@ -344,9 +344,9 @@ class PartitionedImage(): #make sure the fsuuid for vfat/msdos align with format 0xYYYYYYYY if part.fstype == 'vfat' or part.fstype == 'msdos': if part.fsuuid.upper().startswith("0X"): - part.fsuuid = '0x' + part.fsuuid.upper()[2:].rjust(8,"0") + part.fsuuid = '0x' + part.fsuuid.upper()[2:].rjust(8, "0") else: - part.fsuuid = '0x' + part.fsuuid.upper().rjust(8,"0") + part.fsuuid = '0x' + part.fsuuid.upper().rjust(8, "0") def prepare(self, imager): """Prepare an image. Call prepare method of all image partitions."""
scripts/oe-pkgdata-util +1 -1
@@ -497,7 +497,7 @@ def find_path(args): found = False for root, dirs, files in os.walk(os.path.join(args.pkgdata_dir, 'runtime')): for fn in files: - with open(os.path.join(root,fn)) as f: + with open(os.path.join(root, fn)) as f: for line in f: if line.startswith('FILES_INFO:'): val = line.split(':', 1)[1].strip()
scripts/opkg-query-helper.py +4 -4
@@ -43,26 +43,26 @@ for line in fileinput.input(args): if archmode: if line.startswith("Architecture:"): arch = line.split(": ")[1] - print("%s %s" % (pkg,arch)) + print("%s %s" % (pkg, arch)) elif filemode: if line.startswith("Version:"): ver = line.split(": ")[1] elif line.startswith("Architecture:"): arch = line.split(": ")[1] - print("%s %s_%s_%s.ipk %s" % (pkg,pkg,ver,arch,arch)) + print("%s %s_%s_%s.ipk %s" % (pkg, pkg, ver, arch, arch)) elif vermode: if line.startswith("Version:"): ver = line.split(": ")[1] elif line.startswith("Architecture:"): arch = line.split(": ")[1] - print("%s %s %s" % (pkg,arch,ver)) + print("%s %s %s" % (pkg, arch, ver)) else: if line.startswith("Depends:"): depval = line.split(": ")[1] deps = depval.split(", ") for dep in deps: dep = verregex.sub('', dep) - print("%s|%s" % (pkg,dep)) + print("%s|%s" % (pkg, dep)) elif line.startswith("Recommends:"): recval = line.split(": ")[1] recs = recval.split(", ")
scripts/pybootchartgui/pybootchartgui/draw.py +1 -1
@@ -454,7 +454,7 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w): [(sample.time, # Sum up used space of all volumes including the current one # so that the graphs appear as stacked on top of each other. - functools.reduce(lambda x,y: x + y, + functools.reduce(lambda x, y: x + y, [sample.records[volume] - min_used[volume] for volume in volumes[0:i] if volume in sample.records],
scripts/pybootchartgui/pybootchartgui/parsing.py +2 -2
@@ -267,7 +267,7 @@ def _parse_headers(file): value = line.strip() headers[last] += value return headers, last - return reduce(parse, file.read().split('\n'), (defaultdict(str),''))[0] + return reduce(parse, file.read().split('\n'), (defaultdict(str), ''))[0] def _parse_timed_blocks(file): """Parses (ie., splits) a file into so-called timed-blocks. A
@@ -469,7 +469,7 @@ def _parse_proc_disk_stat_log(file): for time, lines in _parse_timed_blocks(file): sample = DiskStatSample(time) - relevant_tokens = [linetokens for linetokens in map(lambda x: x.split(),lines) if is_relevant_line(linetokens)] + relevant_tokens = [linetokens for linetokens in map(lambda x: x.split(), lines) if is_relevant_line(linetokens)] for tokens in relevant_tokens: disk, rsect, wsect, use = tokens[2], int(tokens[5]), int(tokens[9]), int(tokens[12])
scripts/pybootchartgui/pybootchartgui/samples.py +1 -1
@@ -161,7 +161,7 @@ class Process: if self.parent == None and self.pid // 1000 > 1 and \ not (self.ppid == 2000 or self.pid == 2000): # kernel threads: ppid=2 self.writer.warn("Missing CONFIG_PROC_EVENTS: no parent for pid '%i' ('%s') with ppid '%i'" - % (self.pid,self.cmd,self.ppid)) + % (self.pid, self.cmd, self.ppid)) def get_end_time(self): return self.start_time + self.duration
scripts/pybootchartgui/pybootchartgui/tests/parser_test.py +1 -1
@@ -28,7 +28,7 @@ class TestBCParser(unittest.TestCase): self.name = "My first unittest" self.rootdir = bootchart_dir - def mk_fname(self,f): + def mk_fname(self, f): return os.path.join(self.rootdir, f) def testParseHeader(self):
scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py +1 -1
@@ -27,7 +27,7 @@ class TestProcessTree(unittest.TestCase): self.processtree = process_tree.ProcessTree(writer, None, trace.ps_stats, trace.ps_stats.sample_period, None, options.prune, None, None, False, for_testing=True) - def mk_fname(self,f): + def mk_fname(self, f): return os.path.join(self.rootdir, f) def flatten(self, process_tree):
scripts/relocate_sdk.py +3 -3
@@ -32,7 +32,7 @@ old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##")) def get_arch(): f.seek(0) e_ident = f.read(16) - ei_mag0,ei_mag1_3,ei_class = struct.unpack("<B3sB11x", e_ident) + ei_mag0, ei_mag1_3, ei_class = struct.unpack("<B3sB11x", e_ident) if (ei_mag0 != 0x7f and ei_mag1_3 != "ELF") or ei_class == 0: return 0
@@ -69,7 +69,7 @@ def change_interpreter(elf_file_name): ph_fmt = "<IIQQQQQQ" """ look for PT_INTERP section """ - for i in range(0,e_phnum): + for i in range(0, e_phnum): f.seek(e_phoff + i * e_phentsize) ph_hdr = f.read(e_phentsize) if arch == 32:
@@ -123,7 +123,7 @@ def change_dl_sysdirs(elf_file_name): sysdirs = sysdirs_len = "" """ change ld.so.cache path and default libs path for dynamic loader """ - for i in range(0,e_shnum): + for i in range(0, e_shnum): f.seek(e_shoff + i * e_shentsize) sh_hdr = f.read(e_shentsize)
scripts/runqemu +2 -2
@@ -795,7 +795,7 @@ class BaseConfig(object): mach = self.get('MACHINE') if not mach.startswith('qemumips'): - self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' + self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m', '').strip() + 'M' self.qemu_opt_script += ' %s' % self.get('QB_MEM')
@@ -1241,7 +1241,7 @@ class BaseConfig(object): elif drive_type.startswith("/dev/vdb"): logger.info('Using block virtio drive') vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0%s' \ - % (self.rootfs, rootfs_format,qb_rootfs_extra_opt) + % (self.rootfs, rootfs_format, qb_rootfs_extra_opt) else: # virtio might have been selected explicitly (just use it), or # is used as fallback (then warn about that).
scripts/tiny/ksize.py +2 -2
@@ -80,8 +80,8 @@ class Report: self.title = title self.sizes = Sizes(glob) self.parts = [] - self.totals = {"total":0, "text":0, "data":0, "bss":0} - self.deltas = {"total":0, "text":0, "data":0, "bss":0} + self.totals = {"total": 0, "text": 0, "data": 0, "bss": 0} + self.deltas = {"total": 0, "text": 0, "data": 0, "bss": 0} def show(self, indent=""): rule = str.ljust(indent, 80, '-')
scripts/wic +1 -1
@@ -337,7 +337,7 @@ def wic_init_parser_create(subparser): dest='compressor', help="compress image with specified compressor") subparser.add_argument("-m", "--bmap", action="store_true", help="generate .bmap") - subparser.add_argument("--no-fstab-update",action="store_true", + subparser.add_argument("--no-fstab-update", action="store_true", help="Do not change fstab file.") subparser.add_argument("-v", "--vars", dest='vars_dir', help="directory with <image>.env files that store "
Signature · 1 line
2.32.0